/** * Query result caching for performance optimization * * Caches the results of evaluated queries to avoid redundant computations * when the same path is queried multiple times. * * SECURITY FIX (BF015): Cache keys now include document identity to prevent * cache poisoning between different documents. */ /** * Query cache with LRU eviction policy * * BUG-007 FIX: Added tracking for total lookups and misses */ export declare class QueryCache { private cache; private maxSize; private accessOrder; private totalLookups; private totalMisses; constructor(maxSize?: number); /** * Get a cached result (with document identity) * SECURITY FIX (BF015): Now includes document ID in key * BUG-007 FIX: Track lookups and misses for accurate statistics */ get(key: string, document?: object): any | undefined; /** * Set a cached result (with document identity) * SECURITY FIX (BF015): Now includes document ID in key */ set(key: string, value: any, document?: object): void; /** * Generate cache key including document identity * SECURITY FIX (BF015): Prevents cache poisoning */ private generateKey; /** * Check if a key exists in cache * BUGFIX (BUG-004): Added document parameter for consistent cache key generation */ has(key: string, document?: object): boolean; /** * Remove a specific entry * BUGFIX (BUG-004): Added document parameter for consistent cache key generation */ delete(key: string, document?: object): boolean; /** * Clear all cached entries * * BUG-007 FIX: Reset lookup and miss counters */ clear(): void; /** * Get cache statistics * * BUG-007 FIX: Return accurate lookups, hits, misses, and hit rate */ getStats(): CacheStats; /** * Update LRU access order */ private updateAccessOrder; /** * Evict least recently used entry */ private evictLRU; /** * Get size in bytes (approximate) */ getSizeInBytes(): number; } /** * Cache statistics * * BUG-007 FIX: Added totalMisses and totalLookups for accurate metrics */ export interface CacheStats { size: number; maxSize: number; totalHits: number; totalMisses: number; totalLookups: number; averageHits: number; hitRate: number; } /** * Get the global query cache */ export declare function getGlobalCache(): QueryCache; /** * Reset the global cache */ export declare function resetGlobalCache(): void; //# sourceMappingURL=cache.d.ts.map