/**
* SQLite Database Abstraction Types
*
* Unified interface for Node.js (node:sqlite) and Bun (bun:sqlite)
*/
/**
* Query execution result
*/
interface RunResult {
	/** Number of rows changed */
	changes: number;
	/** Last inserted row ID */
	lastInsertRowid: number | bigint;
}
/**
* Prepared statement
*/
interface Statement {
	/** Execute statement with parameters, return result */
	run(...params: unknown[]): RunResult;
	/** Get single row */
	get(...params: unknown[]): unknown;
	/** Get all rows */
	all(...params: unknown[]): unknown[];
}
/**
* Database connection
*/
interface Database {
	/** Execute raw SQL (no return value) */
	exec(sql: string): void;
	/** Prepare a statement for execution */
	prepare(sql: string): Statement;
	/** Close the database connection */
	close(): void;
}
/**
* Open a SQLite database
*
* Automatically detects runtime:
* - Bun → uses bun:sqlite
* - Node.js 22+ → uses node:sqlite
*
* @param path - Database file path (use ":memory:" for in-memory)
* @returns Database instance
*
* @example
* ```typescript
* import { openDatabase } from "@agentxjs/common";
*
* const db = openDatabase("./data/app.db");
* db.exec("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)");
*
* const stmt = db.prepare("INSERT INTO users (name) VALUES (?)");
* stmt.run("Alice");
*
* const users = db.prepare("SELECT * FROM users").all();
* console.log(users);
*
* db.close();
* ```
*/
declare function openDatabase(path: string): Database;
export { openDatabase, Statement, RunResult, Database };
