/** * Persistent Cache: Disk-based cache storage * Features: * - Save/load cache entries to/from disk * - Atomic writes to prevent corruption * - Auto-create cache directory * - Operation serialization to prevent race conditions * - Batched writes to reduce disk I/O */ import type { LRUCacheEntry } from './cache-types.js'; export declare class PersistentCache { private filePath; private writeQueue; private isProcessing; private pendingWrites; private batchTimer; private readonly BATCH_DELAY_MS; constructor(filePath: string); /** * Ensure cache directory exists */ private ensureDirectory; /** * Load all cache entries from disk */ loadAll(): LRUCacheEntry[]; /** * Save all cache entries to disk synchronously (atomic write) * Internal use only */ private saveAllSync; /** * Save all cache entries to disk (queued) */ saveAll(entries: LRUCacheEntry[]): Promise; /** * Flush all pending writes immediately * Call this before process exit to ensure all writes are persisted */ flush(): Promise; /** * Queue a write operation */ private queueWrite; /** * Process the write queue serially */ private processQueue; /** * Execute a single write operation */ private executeOperation; /** * Schedule a batched write operation */ private scheduleBatchWrite; /** * Flush all pending writes to disk */ private flushPendingWrites; /** * Save a single entry (batched and queued) */ save(key: string, entry: LRUCacheEntry): Promise; /** * Delete a single entry (queued) */ delete(key: string): Promise; /** * Clear all cache entries (queued) */ clear(): Promise; /** * Get cache file size in bytes */ getFileSize(): number; /** * Check if cache file exists */ exists(): boolean; } //# sourceMappingURL=persistent-cache.d.ts.map