/** * Simple in-memory cache with TTL support. * * @module cache */ /** * A generic in-memory cache with configurable TTL. */ export declare class MemoryCache { private store; private readonly defaultTtlMs; /** * @param defaultTtlMs Default time-to-live in milliseconds. */ constructor(defaultTtlMs?: number); /** * Get a cached value by key. * Returns undefined if not found or expired. */ get(key: string): T | undefined; /** * Set a value in the cache. * @param key Cache key * @param value Value to cache * @param ttlMs Optional TTL override in milliseconds */ set(key: string, value: T, ttlMs?: number): void; /** * Check if a key exists and is not expired. */ has(key: string): boolean; /** * Delete a specific key. */ delete(key: string): boolean; /** * Clear all cached entries. */ clear(): void; /** * Remove all expired entries. */ cleanup(): void; /** * Get the number of active (non-expired) entries. */ get size(): number; } /** Global request cache (5-minute TTL). */ export declare const requestCache: MemoryCache; /** * Generate a cache key from URL and options. */ export declare function cacheKey(url: string, opts?: Record): string; //# sourceMappingURL=cache.d.ts.map