/** * Generic on-disk TTL cache helpers shared by model-limits, model-catalog-cache, * and model-benchmarks. * * Each cache file has the same envelope shape: * { version: 1, fetchedAt: number, ttlMs: number, } * * Only the envelope fields and the single payload key/kind differ between caches; * those differences are captured by the arguments to validateTtlCacheEnvelope. */ /** 24-hour TTL in milliseconds. */ export declare const TTL_24H_MS = 86400000; /** Base envelope fields shared by all on-disk TTL caches. */ export interface TtlCacheEnvelope { version: number; fetchedAt: number; ttlMs: number; } /** * Returns true when the cache has exceeded its declared TTL. */ export declare function isTtlCacheStale(cache: Pick): boolean; /** * Validate the shared TTL cache envelope and one payload field. * * @param value Raw parsed JSON value. * @param payloadKey Name of the payload field (e.g. `'models'`, `'entries'`). * @param payloadKind Whether the payload should be an `'object'` or `'array'`. * @returns `{ cache: T }` on success, or `{ cache: null, reason }` on failure. */ export declare function validateTtlCacheEnvelope(value: unknown, payloadKey: string, payloadKind: 'object' | 'array', expectedVersion?: number): { cache: T | null; reason?: string; }; //# sourceMappingURL=json-ttl-cache.d.ts.map