/**
 * Cache Middleware
 *
 * Express middleware for caching GET responses and invalidating on mutations.
 * Works with RedisCacheService — automatically falls back to in-memory cache
 * when Redis is unavailable.
 *
 * @module cache.middleware
 */
import type { Request, Response, NextFunction } from 'express';
/**
 * Creates Express middleware that caches GET responses for a given cache key.
 *
 * On cache hit: sends the cached response immediately (skips controller).
 * On cache miss: intercepts `res.json()` to capture and store the response.
 *
 * @param cacheKey - Fixed cache key (from REDIS_CONSTANTS.KEYS)
 * @param ttlSeconds - Time-to-live in seconds (defaults to REDIS_CONSTANTS.TTL.DEFAULT)
 * @returns Express middleware function
 *
 * @example
 * ```typescript
 * router.get('/', cacheResponse(REDIS_CONSTANTS.KEYS.TEAMS_LIST, REDIS_CONSTANTS.TTL.TEAMS_LIST), getTeams);
 * ```
 */
export declare function cacheResponse(cacheKey: string, ttlSeconds?: number): (req: Request, res: Response, next: NextFunction) => Promise<void>;
/**
 * Creates Express middleware that invalidates one or more cache keys
 * after a mutating request (POST, PUT, PATCH, DELETE) completes successfully.
 *
 * Attaches to the `finish` event on the response so invalidation happens
 * only after the response is sent.
 *
 * @param cacheKeys - Array of cache keys to invalidate
 * @returns Express middleware function
 *
 * @example
 * ```typescript
 * router.post('/', invalidateCache([REDIS_CONSTANTS.KEYS.TEAMS_LIST]), createTeam);
 * ```
 */
export declare function invalidateCache(cacheKeys: string[]): (_req: Request, res: Response, next: NextFunction) => void;
//# sourceMappingURL=cache.middleware.d.ts.map