/** * Node.js file-based cache implementation * * Provides file-based caching with TTL support and LRU memory eviction. * All Node.js built-in imports (fs, path, crypto) are isolated here. */ import { z } from 'zod'; import type { CacheProvider, CacheStats, Logger } from '../../core/services/interfaces/index.js'; /** * Zod schema for validating cache entries read from disk */ export declare const CacheEntrySchema: z.ZodObject<{ data: z.ZodUnknown; timestamp: z.ZodNumber; ttl: z.ZodNumber; }, z.core.$strip>; /** * File-based cache implementation with LRU-bounded memory cache */ export declare class FileCache implements CacheProvider { private readonly cacheDir; private readonly maxEntries; private readonly defaultTtl; private readonly log; private readonly memoryCache; private readonly lruMap; private readonly lruHead; private readonly lruTail; private dirCreated; constructor(options: { cacheDir?: string; maxEntries?: number; defaultTtl?: number; log: Logger; }); private static getCacheKey; private getCachePath; private ensureCacheDir; /** * Move a node to the front of the LRU list (most recently used) */ private lruMoveToFront; /** * Add a key to the LRU list (at front) */ private lruAdd; /** * Remove a key from the LRU list */ private lruRemove; /** * Evict the least recently used entry from memory cache */ private lruEvictLeast; /** * Get a value from cache */ get(key: string): Promise; /** * Store in memory cache, evicting LRU entry if at capacity */ private memoryCacheSet; /** * Set a value in cache */ set(key: string, value: T, ttl?: number): Promise; /** * Delete a cache entry */ delete(key: string): Promise; /** * Clear all cache entries */ clear(): Promise; /** * Get cache statistics */ stats(): Promise; /** * Prune expired entries */ prune(): Promise; } //# sourceMappingURL=cache.d.ts.map