/** * Database Connection Module * * Manages SQLite connection singleton, path management, and database lifecycle. */ import Database from 'better-sqlite3'; /** * Get the path to the SQLite database file. */ export declare function getDbPath(): string; /** * Get the cache directory path. */ export declare function getCacheDir(): string; /** * Initialize and return the database connection singleton. * Creates the database file and schema if they don't exist. */ export declare function initDb(): Database.Database; /** * Get the database connection, initializing if necessary. * This is the primary way other modules should access the database. */ export declare function getDb(): Database.Database; /** * Clear all detections from the database. */ export declare function clearDb(): void; /** * Force recreation of the database. * Useful when schema changes require a fresh start. * Handles Windows file locking (EBUSY) with retry logic. */ export declare function recreateDb(): void; /** * Check if the database file exists. */ export declare function dbExists(): boolean; /** * Close the database connection. */ export declare function closeDb(): void;