InMemoryLRUCache.d.ts 658 B

1234567891011121314151617
  1. import { TestableKeyValueCache } from './KeyValueCache';
  2. export declare class InMemoryLRUCache<V = string> implements TestableKeyValueCache<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. }
  17. //# sourceMappingURL=InMemoryLRUCache.d.ts.map