/** * SQLite-backed PersistentStore (CX-007) * * A drop-in replacement for PersistentStore that uses SQLite instead of JSON files. * Provides the same API for gradual migration of existing components. * * Usage: * // Before (JSON-based): * const store = new PersistentStore('./data.json'); * * // After (SQLite-based): * const store = new SqlitePersistentStore('./data.json', 'mydata'); * * The SqlitePersistentStore will: * - Automatically migrate existing JSON data to SQLite on first use * - Store data in the shared EmbeddedStore database * - Provide the same save/load/flush API as PersistentStore */ import type { PersistentStoreStats } from './persistent-store.js'; /** * Configuration for SqlitePersistentStore */ export interface SqlitePersistentStoreConfig { /** Namespace in the SQLite store (defaults to filename without extension) */ namespace?: string; /** Key to use for the data (defaults to '_data' for single-object stores) */ key?: string; /** Component name for logging */ componentName?: string; /** Path to the shared SQLite database (defaults to ./llm-browser.db) */ dbPath?: string; /** Whether to auto-migrate from JSON file (defaults to true) */ autoMigrate?: boolean; } /** * SqlitePersistentStore - SQLite-backed replacement for PersistentStore * * Provides the same API as PersistentStore but stores data in SQLite. * Automatically migrates from existing JSON files. */ export declare class SqlitePersistentStore { private jsonFilePath; private namespace; private key; private componentName; private dbPath; private autoMigrate; private store; private initialized; private stats; constructor(jsonFilePath: string, config?: SqlitePersistentStoreConfig); /** * Get the original JSON file path (for compatibility) */ getFilePath(): string; /** * Get store statistics */ getStats(): PersistentStoreStats; /** * Initialize the store and migrate if needed */ private ensureInitialized; /** * Migrate data from the original JSON file */ private migrateFromJson; /** * Save data to the store * * Unlike PersistentStore, writes are synchronous in SQLite mode. * The Promise is returned for API compatibility. */ save(data: T): Promise; /** * Save data immediately (same as save() for SQLite) */ saveImmediate(data: T): Promise; /** * Flush any pending writes (no-op for SQLite, writes are synchronous) */ flush(): Promise; /** * Load data from the store */ load(): Promise; /** * Check if data exists */ exists(): Promise; /** * Delete the data */ delete(): Promise; /** * Cancel any pending writes (no-op for SQLite) */ cancel(): void; /** * Check if there's a pending write (always false for SQLite) */ hasPendingWrite(): boolean; } /** * Create a SqlitePersistentStore instance with convenience defaults */ export declare function createSqlitePersistentStore(jsonFilePath: string, componentName: string, config?: Partial): SqlitePersistentStore; //# sourceMappingURL=sqlite-persistent-store.d.ts.map