import { ResponseCacheConfig } from '../../types/service-response-store';
/**
 * ServiceResponseStore manages keyed storage of service responses with flexible retention policies.
 *
 * Responses are stored by `{method}:{path}` key (e.g., 'GET:/api/ingredients')
 * and can be configured with different retention policies to control caching behavior.
 *
 * @example
 * const store = new ServiceResponseStore();
 *
 * // Store with TTL (replaces on each request)
 * store.set('GET:/api/status', statusData, {
 *   retention: ResponseRetention.TTL,
 *   ttl: 5 * 60 * 1000
 * });
 *
 * // Store with TTL extension (keeps existing data, extends TTL)
 * const stored = store.set('GET:/api/expensive', expensiveData, {
 *   retention: ResponseRetention.TTL,
 *   ttl: 5 * 60 * 1000,
 *   extendOnRefresh: true
 * });
 * // stored === false if cache was extended, true if new data stored
 *
 * // Retrieve
 * const status = store.get('GET:/api/status');
 */
export declare class ServiceResponseStore {
    private responses;
    private retentionPolicies;
    private cleanupTimers;
    /**
     * Store a response with retention policy
     *
     * @param key - Storage key (typically `{method}:{path}`)
     * @param response - Response data to cache
     * @param config - Caching configuration (defaults to SINGLE retention)
     * @param requestedAt - When the request was sent (for temporal tracking)
     * @param receivedAt - When the response was received (for temporal tracking)
     * @returns true if response was stored, false if refresh extended existing TTL
     */
    set<T>(key: string, response: T, config?: ResponseCacheConfig, requestedAt?: number, receivedAt?: number): boolean;
    /**
     * Get response if not expired
     *
     * @param key - Storage key
     * @returns Response data or undefined if not found/expired
     */
    get<T = any>(key: string): T | undefined;
    /**
     * Get response by path and method
     *
     * @param path - API path
     * @param method - HTTP method (defaults to 'get')
     * @returns Response data or undefined if not found/expired
     */
    getByPath<T = any>(path: string, method?: string): T | undefined;
    /**
     * Check if response exists and is not expired
     *
     * @param key - Storage key
     * @returns true if valid response exists
     */
    has(key: string): boolean;
    /**
     * Manually delete a response
     *
     * @param key - Storage key
     */
    delete(key: string): void;
    /**
     * Clear all responses for a path (all methods)
     *
     * @param path - API path to clear
     */
    clearPath(path: string): void;
    /**
     * Clear all responses
     */
    clear(): void;
    /**
     * Get count of cached responses
     */
    get size(): number;
    /**
     * Check if a response should be cleaned up after handler completes
     *
     * @param key - Storage key
     * @returns true if response has IMMEDIATE retention policy
     */
    shouldCleanupAfterHandler(key: string): boolean;
    /**
     * Zone 2: Evaluates if TTL should be extended instead of replacing data
     */
    private shouldExtendTTL;
    /**
     * Extend TTL for existing cached response
     */
    private extendExistingTTL;
    /**
     * Zone 3: Reset cleanup timer for a cached response
     */
    private resetCleanupTimer;
    /**
     * Clear cleanup timer if it exists
     */
    private clearTimerIfExists;
    /**
     * Create cached response object with metadata
     */
    private createCachedResponse;
    /**
     * Calculate expiration timestamp based on config
     */
    private calculateExpiresAt;
    /**
     * Store response with retention policy
     */
    private storeResponse;
    /**
     * Zone 2: Configures retention policy for a stored response
     */
    private applyRetentionPolicy;
    /**
     * Make storage key from path and method
     */
    private makeKey;
    /**
     * Extract path from storage key
     */
    private extractPath;
    /**
     * Extract method from storage key
     */
    private extractMethod;
    /**
     * Get temporal metadata for a cached response
     * Used for baseline-delta race condition handling
     *
     * @param key - Storage key
     * @returns Temporal metadata or undefined if not found
     */
    getTemporalMetadata(key: string): {
        requestedAt: number;
        receivedAt: number;
    } | undefined;
    /**
     * Get temporal metadata by path and method
     *
     * @param path - API path
     * @param method - HTTP method (defaults to 'get')
     * @returns Temporal metadata or undefined if not found
     */
    getTemporalMetadataByPath(path: string, method?: string): {
        requestedAt: number;
        receivedAt: number;
    } | undefined;
    /**
     * Cleanup expired responses (called periodically if needed)
     */
    cleanup(): void;
}
//# sourceMappingURL=service-response-store.d.ts.map