/**
 * @fileoverview Runtime-agnostic SQLite handle for the mirror store. Uses the
 * built-in `bun:sqlite` driver under Bun and the `better-sqlite3` optional peer
 * dependency on Node — both exposed through one synchronous handle interface
 * (the intersection of the two driver APIs).
 *
 * The drivers are loaded via variable-specifier dynamic imports so the
 * framework typechecks and builds without `bun-types` in scope or
 * `better-sqlite3` installed; both resolve at runtime on the matching runtime.
 * @module services/mirror/sqlite/handle
 */
/** Primitive value storable in a mirror column. Buffers/bigints are out of scope for v1. */
export type SqlValue = string | number | null;
/**
 * Runtime-agnostic prepared statement — the intersection of the `bun:sqlite`
 * and `better-sqlite3` statement APIs. Bound parameters are passed positionally.
 */
export interface SqliteStatement<TRow = unknown> {
    all(...params: SqlValue[]): TRow[];
    get(...params: SqlValue[]): TRow | undefined;
    run(...params: SqlValue[]): {
        changes: number;
        lastInsertRowid: number | bigint;
    };
}
/** Runtime-agnostic database handle. Synchronous — both drivers are synchronous. */
export interface SqliteHandle {
    close(): void;
    exec(sql: string): void;
    prepare<TRow = unknown>(sql: string): SqliteStatement<TRow>;
    transaction<T>(fn: () => T): T;
}
/** Options for {@link openSqliteHandle}. */
export interface OpenHandleOptions {
    /** `PRAGMA busy_timeout` in ms — how long a writer waits on a locked DB. Default 5000. */
    busyTimeoutMs?: number;
}
/**
 * Open (or create) a SQLite database at `path`, picking the driver for the
 * current runtime. Creates the parent directory, enables WAL, and sets
 * `busy_timeout` so a refresh writer and reader processes coexist without
 * spurious `database is locked` errors.
 *
 * Throws `ConfigurationError` on Node when `better-sqlite3` is not installed,
 * and `DatabaseError` for any other open failure.
 */
export declare function openSqliteHandle(path: string, options?: OpenHandleOptions): Promise<SqliteHandle>;
//# sourceMappingURL=handle.d.ts.map