UNPKG

@ceramicnetwork/core

Version:

Typescript implementation of the Ceramic protocol

18 lines 688 B
import { LRUCache } from 'least-recent'; export declare class StateCache<T> implements Iterable<[string, T]> { private readonly onEvicted?; readonly volatile: LRUCache<string, T>; readonly durable: Map<string, T>; constructor(limit: number, onEvicted?: (item: T) => void); get(key: string): T | undefined; set(key: string, value: T): void; delete(key: string): void; clear(): void; endure(key: string, value: T): void; free(key: string): void; entries(): Generator<[string, T]>; keys(): Generator<string>; values(): Generator<T>; [Symbol.iterator](): Generator<[string, T], any, unknown>; } //# sourceMappingURL=state-cache.d.ts.map