/** * Cache interfaces and types */ export interface CacheEntry { value: T; expiresAt: number; createdAt: number; accessCount: number; lastAccessed: number; } export interface CacheOptions { ttlMs: number; maxSize: number; cleanupIntervalMs: number; enableStats: boolean; } export interface CacheStats { hits: number; misses: number; sets: number; deletes: number; evictions: number; size: number; maxSize: number; hitRate: number; memoryUsage: number; } export interface ICache { get(key: string): T | undefined; set(key: string, value: T, ttlMs?: number): void; has(key: string): boolean; delete(key: string): boolean; clear(): void; size(): number; keys(): string[]; getStats(): CacheStats; } /** * In-memory LRU cache with TTL support */ export declare class MemoryCache implements ICache { private options; private cache; private accessOrder; private stats; private cleanupInterval?; constructor(options: CacheOptions); get(key: string): T | undefined; set(key: string, value: T, ttlMs?: number): void; has(key: string): boolean; delete(key: string): boolean; clear(): void; size(): number; keys(): string[]; getStats(): CacheStats; destroy(): void; private evictIfNecessary; private updateAccessOrder; private removeFromAccessOrder; private updateStats; private estimateMemoryUsage; private startCleanupInterval; private cleanupExpiredEntries; } /** * Multi-level cache with different storage tiers */ export declare class TieredCache implements ICache { private l1Options; private l2Options?; private l1Cache; private l2Cache?; constructor(l1Options: CacheOptions, l2Options?: CacheOptions | undefined); get(key: string): T | undefined; set(key: string, value: T, ttlMs?: number): void; has(key: string): boolean; delete(key: string): boolean; clear(): void; size(): number; keys(): string[]; getStats(): CacheStats; destroy(): void; } /** * Cache manager for managing multiple named caches */ export declare class CacheManager { private caches; private defaultOptions; getCache(name: string, options?: Partial): ICache; createTieredCache(name: string, l1Options?: Partial, l2Options?: Partial): ICache; getAllStats(): Record; clearAll(): void; destroy(): void; } export declare const cacheManager: CacheManager; //# sourceMappingURL=cache.d.ts.map