import { Cache } from 'cache-manager';
import { RedisStore } from 'cache-manager-redis-yet';
import { CacheCategory } from './enums/cache-category.enum';
/**
 * Options for cache operations
 */
export interface CacheOptions {
    category?: CacheCategory;
    ttl?: number;
    key?: string;
    /**
     * Function to validate if the value should be cached
     * Return false to skip caching (e.g., for error responses)
     */
    shouldCache?: (value: any) => boolean;
}
/**
 * Centralized cache service that wraps cache-manager with custom logic
 */
export declare class CacheService {
    private readonly cacheManager;
    private readonly redisStore;
    private readonly logger;
    constructor(cacheManager: Cache, redisStore: RedisStore | null);
    /**
     * Get a value from cache
     */
    get<T>(key: string): Promise<T | undefined>;
    /**
     * Set a value in cache with optional TTL
     */
    set<T>(key: string, value: T, options?: CacheOptions): Promise<void>;
    /**
     * Delete a specific cache key
     */
    delete(key: string): Promise<void>;
    /**
     * Delete cache keys matching a pattern (e.g., "provider:hetzner:*")
     * Note: This requires Redis store with pattern matching support
     */
    private static readonly KEY_PREFIX;
    deletePattern(pattern: string): Promise<void>;
    /**
     * Clear all cache
     */
    reset(): Promise<void>;
    /**
     * Wrap a function with caching logic
     * If skipCache is true, always fetch fresh data
     */
    wrap<T>(key: string, factory: () => Promise<T>, options?: CacheOptions & {
        skipCache?: boolean;
    }): Promise<T>;
    /**
     * Build a cache key with consistent format
     */
    buildKey(...parts: (string | number)[]): string;
    /**
     * Helper to determine if a response should be cached
     * Returns false for error responses (4xx, 5xx) or responses with errors
     *
     * @param value - The value to validate
     * @returns true if value should be cached, false otherwise
     *
     * @example
     * ```typescript
     * cacheService.wrap(key, factory, {
     *   shouldCache: CacheService.shouldCacheResponse
     * });
     * ```
     */
    static shouldCacheResponse(value: any): boolean;
    /**
     * Resolve TTL from options or category
     */
    private resolveTTL;
}
