UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

21 lines • 702 B
/** Prunes a Map in insertion order until it fits the requested maximum size. */ export declare function pruneMapToMaxSize<K, V>(map: Map<K, V>, maxSize: number): void; export declare function createStaleWhileRevalidateCache<T>(options: { maxEntries: number; maxPending?: number; ttlMs: number; cacheable?: (value: T) => boolean; errorTtlMs?: (error: unknown) => number; onBackgroundError?: (error: unknown) => void; }): { read(key: string, load: (previous: T | undefined) => Promise<T>, readOptions?: { allowStale?: boolean; refresh?: boolean; }): Promise<{ value: T; stale: boolean; }>; delete(key: string): void; deleteValue(value: T): void; clear(): void; };