/** Cache Implementation using node-cache and ioredis */ import NodeCache from 'node-cache'; import type { Redis as RedisClient } from 'ioredis'; export interface CacheOptions { maxSize?: number; defaultTTL?: number; enableDistributed?: boolean; keyPrefix?: string; compressionEnabled?: boolean; metricsEnabled?: boolean; checkperiod?: number; } export interface CacheStats { local: { totalItems: number; hitRate: number; missRate: number; evictions: number; totalHits: number; totalMisses: number; memoryUsage: number; }; distributed: { hitRate: number; missRate: number; errors: number; totalHits: number; totalMisses: number; avgResponseTime: number; connected: boolean; }; } export declare const createLocalCache: (options?: CacheOptions) => NodeCache; export declare const createDistributedCache: (options?: CacheOptions) => Promise<{ redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }>; export declare const getFromCache: (key: string, distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, options?: CacheOptions) => Promise; export declare const setInCache: (key: string, value: T, ttl: number | undefined, distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, options?: CacheOptions) => Promise; export declare const deleteFromCache: (key: string, distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, options?: CacheOptions) => Promise; export declare const clearCache: (distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, options?: CacheOptions) => Promise; export declare const getCacheStats: (distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, stats: { hits: number; misses: number; errors: number; responseTimes: number[]; }) => CacheStats; export declare class CacheManager { private distributedCache; private initPromise; private options; private stats; constructor(options?: CacheOptions); private initializeCache; private ensureInitialized; get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; clear(): Promise; getStats(): CacheStats; shutdown(): Promise; } export declare const LocalCache: typeof NodeCache, DistributedCache: typeof CacheManager; declare const _default: { createLocalCache: (options?: CacheOptions) => NodeCache; createDistributedCache: (options?: CacheOptions) => Promise<{ redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }>; getFromCache: (key: string, distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, options?: CacheOptions) => Promise; setInCache: (key: string, value: T, ttl: number | undefined, distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, options?: CacheOptions) => Promise; deleteFromCache: (key: string, distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, options?: CacheOptions) => Promise; clearCache: (distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, options?: CacheOptions) => Promise; getCacheStats: (distributedCache: { redis: RedisClient | null; localCache: NodeCache; isConnected: boolean; }, stats: { hits: number; misses: number; errors: number; responseTimes: number[]; }) => CacheStats; CacheManager: typeof CacheManager; LocalCache: typeof NodeCache; DistributedCache: typeof CacheManager; }; export default _default; //# sourceMappingURL=cache.d.ts.map