/**
 * Simple in-memory cache with TTL and stale support
 *
 * Supports:
 * - Fresh entries: Within TTL, returned immediately
 * - Stale entries: Past TTL but within staleTtl, returned as fallback
 * - Automatic eviction: Stale entries evicted first, then oldest fresh
 */
/**
 * Result from getStale() with age information
 */
export interface StaleResult<T> {
    value: T;
    /** Seconds since the entry's TTL expired (0 if still fresh) */
    staleAgeSec: number;
}
/**
 * Options for cache.set()
 */
export interface CacheSetOptions {
    /** Time-to-live in milliseconds (overrides default) */
    ttl?: number;
    /** Additional time after TTL during which stale data can be served (overrides default) */
    staleTtl?: number;
}
export declare class SimpleCache<T> {
    private cache;
    private maxSize;
    private ttl;
    private staleTtl;
    constructor(options?: {
        maxSize?: number;
        ttl?: number;
        staleTtl?: number;
    });
    /**
     * Get a fresh value (within TTL)
     * @returns The value if fresh, null otherwise
     */
    getFresh(key: string): T | null;
    /**
     * Get a value that may be stale (past TTL but within staleTtl)
     * @returns Object with value and stale age, or null if expired
     */
    getStale(key: string): StaleResult<T> | null;
    /**
     * Store a value with TTL and stale window
     */
    set(key: string, value: T, options?: CacheSetOptions): void;
    /**
     * Evict one entry to make room for a new one
     * Priority: oldest stale entry, then oldest fresh entry
     */
    private evictOne;
    /**
     * Remove all fully expired entries (past staleUntil)
     */
    prune(): void;
    /**
     * Clear all entries
     */
    clear(): void;
    /**
     * Check if a key exists and is not fully expired
     */
    has(key: string): boolean;
}
