import type { DatabaseSync } from 'node:sqlite'; export declare class SqliteCommitEffectError extends Error { constructor(cause: unknown); } /** Schedule a synchronous effect after an owned transaction commits. Persist its recovery intent first. */ export declare function afterSqliteCommit(effect: () => void): void; /** * Run an operation inside a `BEGIN IMMEDIATE` transaction with nested SAVEPOINT * support and COMMIT retry on SQLITE_BUSY / SQLITE_LOCKED. * * When called inside an already-active transaction, automatically uses SAVEPOINT * so the outer transaction controls final COMMIT/ROLLBACK. When called at the * top level, owns the full transaction lifecycle with retry on contention. */ export declare function runSqliteWriteTransaction(fn: (db: DatabaseSync) => T): T; export declare function getSqliteDatabase(): DatabaseSync; /** Compose with domain-owned transactions on an explicitly supplied connection. */ export declare function runSqliteSavepoint(db: DatabaseSync, operation: () => T): T;