/** * Cache Service Abstraction * * Provides interface for caching implementations. * Allows swapping cache backends without changing tool code. */ import NodeCache from 'node-cache'; /** * Cache statistics interface */ export interface CacheStats { hits: number; misses: number; keys: number; ksize: number; vsize: number; } /** * Cache service interface * Abstracts away concrete caching implementation */ export interface CacheService { /** * Get cached value * @returns Cached value or undefined if not found or expired */ get(key: string): T | undefined; /** * Set cache value with TTL * @param key Cache key * @param value Value to cache * @param ttl Time-to-live in seconds */ set(key: string, value: T, ttl: number): void; /** * Check if key exists in cache */ has(key: string): boolean; /** * Delete cache entry */ del(key: string): void; /** * Clear all cache entries */ flush(): void; /** * Get cache statistics */ getStats(): CacheStats; } /** * NodeCache adapter implementing CacheService interface */ export declare class NodeCacheAdapter implements CacheService { private cache; constructor(cache: NodeCache); get(key: string): T | undefined; set(key: string, value: T, ttl: number): void; has(key: string): boolean; del(key: string): void; flush(): void; getStats(): CacheStats; } /** * Create NodeCache adapter with configuration */ export declare function createNodeCacheAdapter(options: { stdTTL: number; checkperiod: number; maxKeys: number; }): CacheService; //# sourceMappingURL=cache-adapter.d.ts.map