import type { DatabaseSync } from 'node:sqlite'; type SqliteWalCheckpointMode = 'PASSIVE' | 'FULL' | 'RESTART' | 'TRUNCATE'; export type SqliteWalMaintenance = { checkpoint: () => boolean; close: () => boolean; }; export type SqliteConnectionPragmaOptions = { autoCheckpointPages?: number; checkpointIntervalMs?: number; checkpointMode?: SqliteWalCheckpointMode; busyTimeoutMs?: number; foreignKeys?: boolean; synchronous?: 'NORMAL'; databasePath?: string; onCheckpointError?: (error: unknown) => void; }; export type XopcDatabase = { db: DatabaseSync; path: string; walMaintenance: SqliteWalMaintenance; }; export type OpenXopcDatabaseOptions = { path?: string; env?: NodeJS.ProcessEnv; }; export declare function openXopcDatabase(options?: OpenXopcDatabaseOptions): XopcDatabase; export declare function getXopcDatabase(): XopcDatabase; /** * Ensure the xopc SQLite database is open and return it. * Opens with default path if not already open. Use this instead of * the repetitive `if (!isXopcDatabaseOpen()) { openXopcDatabase(); }` pattern. */ export declare function requireXopcDatabase(options?: OpenXopcDatabaseOptions): XopcDatabase; export declare function isXopcDatabaseOpen(): boolean; export declare function closeXopcDatabase(): void; /** Test-only: reset singleton without touching files on disk. */ export declare function resetXopcDatabaseSingletonForTest(): void; export {};