UNPKG

702 BTypeScriptView Raw
1import type { KeyValueCache } from './KeyValueCache';
2export declare class InMemoryLRUCache<V = string> implements KeyValueCache<V> {
3 private store;
4 constructor({ maxSize, sizeCalculator, onDispose, }?: {
5 maxSize?: number;
6 sizeCalculator?: (value: V, key: string) => number;
7 onDispose?: (key: string, value: V) => void;
8 });
9 get(key: string): Promise<V | undefined>;
10 set(key: string, value: V, options?: {
11 ttl?: number;
12 }): Promise<void>;
13 delete(key: string): Promise<void>;
14 flush(): Promise<void>;
15 getTotalSize(): Promise<number>;
16 static jsonBytesSizeCalculator<T>(obj: T): number;
17}
18//# sourceMappingURL=InMemoryLRUCache.d.ts.map
\No newline at end of file