import { ILogger } from './types'; /** * Options for configuring the InMemoryCache instance. */ export interface CacheOptions { /** * Logger instance for warnings. If not provided, no warnings will be logged. */ logger?: ILogger; } /** * In-memory cache with TTL expiration and automatic cleanup. * * Uses a wrapper object `{ hit: true, value: T }` pattern internally * to correctly handle falsy values (false, 0, '', null). */ export declare class InMemoryCache { private readonly store; private readonly ttlMs; private readonly logger?; private cleanupTimer; constructor(ttlMs?: number, options?: CacheOptions); /** * Get a cached value. Returns `{ hit: true, value }` if found and not expired, * or `{ hit: false }` otherwise. This avoids ambiguity with falsy values. */ get(key: string): { hit: true; value: T; } | { hit: false; }; /** * Check if a key exists AND is not expired. */ has(key: string): boolean; set(key: string, value: T): void; delete(key: string): boolean; clear(): void; getStats(): { size: number; keys: string[]; enabled: boolean; }; /** * Release the cleanup timer. Call this when the client is being disposed * to prevent memory leaks and dangling timers. * Idempotent: safe to call multiple times. */ destroy(): void; private cleanup; }