import type { Request, RequestHandler, Response } from 'express'; export interface CacheConfig { redis?: { host?: string; port?: number; password?: string; db?: number; keyPrefix?: string; enableOfflineQueue?: boolean; retryStrategy?: (times: number) => number | null; }; defaultTTL?: number; keyGenerator?: (req: Request) => string; shouldCache?: (req: Request, res: Response) => boolean; errorHandler?: (error: Error) => void; compress?: boolean; namespace?: string; maxSize?: number; monitoring?: { enabled?: boolean; onHit?: (key: string, latency: number) => void; onMiss?: (key: string, latency: number) => void; onSet?: (key: string, size: number, latency: number) => void; onError?: (error: Error, operation: string) => void; }; } export declare class CacheMiddleware { private redis; private config; private stats; constructor(config?: CacheConfig); private initializeRedis; middleware(options?: { ttl?: number; key?: string | ((req: Request) => string); condition?: (req: Request, res: Response) => boolean; tags?: string[]; vary?: string[]; }): RequestHandler; invalidateAsync(pattern: string): Promise; invalidateByTagsAsync(tags: string[]): Promise; clearAsync(): Promise; getStats(): typeof this.stats & { hitRate: number; }; warmCacheAsync(entries: Array<{ key: string; generator: () => Promise; ttl?: number; }>): Promise; closeAsync(): Promise; private defaultKeyGenerator; private defaultShouldCache; private generateKey; private getFromCacheAsync; private setCacheAsync; private handleConditionalRequest; } export declare function createCacheMiddleware(config?: CacheConfig): CacheMiddleware; //# sourceMappingURL=cache-middleware.d.ts.map