/** * SMI-585: L2 SQLite Persistent Cache * Persistent cache layer with configurable TTL */ import type { SearchResult, SearchCacheEntry, CacheStats } from './lru.js'; export interface L2CacheOptions { dbPath: string; ttlSeconds?: number; } interface L2CacheInternalOptions { ttlSeconds?: number; } export declare class L2Cache { private db; private readonly ttlSeconds; private hits; private misses; private stmts; /** * @deprecated Use L2Cache.create(options) — async factory with WASM fallback. * The dbPath passed to this constructor throws to prevent silent data loss. */ constructor(options: L2CacheOptions | L2CacheInternalOptions); /** * Async factory — supports both native and WASM SQLite. * * @param options - Cache options including dbPath * @returns Fully initialised L2Cache instance */ static create(options: L2CacheOptions): Promise; private initTable; private prepareStatements; /** * Get cached search results */ get(key: string): SearchCacheEntry | undefined; /** * Store search results in cache */ set(key: string, results: SearchResult[], totalCount: number): void; /** * Check if key exists and is not expired */ has(key: string): boolean; /** * Delete specific cache entry */ delete(key: string): boolean; /** * Clear all cache entries */ clear(): void; /** * Invalidate all entries (called when index updates) */ invalidateAll(): void; /** * Remove expired entries */ prune(): number; /** * Get cache statistics */ getStats(): CacheStats & { expiredCount: number; }; /** * Close database connection */ close(): void; } export default L2Cache; //# sourceMappingURL=sqlite.d.ts.map