/**
 * Redis Cache Service
 *
 * Provides a caching layer backed by Redis with automatic graceful fallback
 * to an in-memory LRU-style Map when Redis is unavailable. This ensures the
 * application continues to function even without a Redis instance.
 *
 * Features:
 * - Singleton pattern for shared cache across the application
 * - Configurable TTL per cache entry
 * - Pattern-based cache invalidation
 * - Graceful degradation to in-memory cache
 * - Connection health monitoring
 *
 * @module redis-cache.service
 */
/**
 * Redis-backed cache service with in-memory fallback.
 *
 * Usage:
 * ```typescript
 * const cache = RedisCacheService.getInstance();
 * await cache.set('key', data, 60);   // store for 60s
 * const hit = await cache.get<MyType>('key');
 * await cache.invalidate('key');
 * await cache.invalidateByPattern('api:teams*');
 * ```
 */
export declare class RedisCacheService {
    private static instance;
    private client;
    private connected;
    private memoryCache;
    private readonly keyPrefix;
    private readonly maxMemoryCacheSize;
    private constructor();
    /**
     * Returns the singleton RedisCacheService instance.
     * Creates one on first call.
     *
     * @returns The shared RedisCacheService instance
     */
    static getInstance(): RedisCacheService;
    /**
     * Resets the singleton instance. Used only in tests.
     */
    static resetInstance(): void;
    /**
     * Connects to Redis. If connection fails, the service gracefully
     * falls back to in-memory caching without throwing.
     *
     * @returns true if Redis connection succeeded, false if using fallback
     */
    connect(): Promise<boolean>;
    /**
     * Disconnects from Redis and clears the in-memory cache.
     */
    disconnect(): void;
    /**
     * Whether the service is currently connected to Redis.
     *
     * @returns true if Redis is connected
     */
    isConnected(): boolean;
    /**
     * Retrieves a cached value by key.
     *
     * @typeParam T - Expected type of the cached value
     * @param key - Cache key (without prefix)
     * @returns The cached value or null on miss/error
     */
    get<T>(key: string): Promise<T | null>;
    /**
     * Stores a value in the cache with a given TTL.
     *
     * @param key - Cache key (without prefix)
     * @param value - Value to cache (must be JSON-serialisable)
     * @param ttlSeconds - Time-to-live in seconds (defaults to REDIS_CONSTANTS.TTL.DEFAULT)
     */
    set(key: string, value: unknown, ttlSeconds?: number): Promise<void>;
    /**
     * Removes a specific key from the cache.
     *
     * @param key - Cache key (without prefix)
     */
    invalidate(key: string): Promise<void>;
    /**
     * Removes all keys matching a glob-style pattern.
     * In Redis, uses SCAN for safe iteration. In memory, does a prefix match.
     *
     * @param pattern - Glob pattern (e.g. "api:teams*")
     */
    invalidateByPattern(pattern: string): Promise<void>;
    /**
     * Returns basic cache statistics for monitoring.
     *
     * @returns Object with backend type, connected flag, and memory cache size
     */
    getStats(): {
        backend: 'redis' | 'memory';
        connected: boolean;
        memoryCacheSize: number;
    };
    /**
     * Retrieves a value from the in-memory fallback cache.
     * Automatically evicts expired entries.
     */
    private memoryGet;
    /**
     * Stores a value in the in-memory fallback cache.
     * Evicts the oldest entry when the maximum size is reached.
     */
    private memorySet;
}
//# sourceMappingURL=redis-cache.service.d.ts.map