UNPKG

@openim/client-sdk

Version:

JavaScript/TypeScript Client SDK for OpenIM

22 lines (21 loc) 583 B
interface CacheOptions { ttl: number; cleanupInterval: number; } type ExpiryCallback<K, V> = (key: K, value: V) => void; declare class Cache<K, V> { private store; private options; private expiryListeners; private cleanupTimer?; constructor(options: CacheOptions); onExpiry(listener: ExpiryCallback<K, V>): void; private triggerExpiry; set(key: K, value: V): void; get(key: K): V | undefined; delete(key: K): boolean; clear(): void; deleteExpired(): void; dispose(): void; } export { Cache, ExpiryCallback, CacheOptions };