/** * Smart in-memory cache with LRU eviction and adaptive TTL */ interface CacheOptions { maxSize?: number; defaultTTL?: number; cleanupInterval?: number; } export declare class CacheManager { private cache; private sizeUsed; private readonly maxSize; private readonly defaultTTL; private cleanupTimer; private readonly ttlByPattern; constructor(options?: CacheOptions); /** * Get item from cache */ get(key: string): T | null; /** * Set item in cache with automatic size management */ set(key: string, data: T, customTTL?: number): void; /** * Check if key exists in cache and is not expired */ has(key: string): boolean; /** * Delete item from cache */ delete(key: string): boolean; /** * Clear all cache */ clear(): void; /** * Get cache statistics */ getStats(): { entries: number; sizeUsed: number; maxSize: number; sizeUsedMB: string; maxSizeMB: string; hitRate: string | number; oldestEntry: string | null; mostUsed: string[]; }; /** * Generate cache key with sanitization * Ensures cache keys are unique and properly formatted */ static createKey(...parts: (string | number | boolean | undefined)[]): string; /** * Private: Estimate size of data in bytes */ private estimateSize; /** * Private: Evict least recently used entry */ private evictLRU; /** * Private: Cleanup expired entries */ private cleanup; /** * Private: Start cleanup timer * Uses unref() to prevent the timer from keeping the process alive */ private startCleanup; /** * Private: Stop cleanup timer */ private stopCleanup; /** * Private: Get oldest cache entry */ private getOldestEntry; /** * Private: Get most used keys */ private getMostUsedKeys; /** * Cleanup on destroy */ destroy(): void; } export {}; //# sourceMappingURL=cache.d.ts.map