/** * A cache that stores its values depending on block height (eg.: contract's state cache). * See {@link BsonFileBlockHeightSwCache} or {@link MemBlockHeightSwCache} * * @typeParam V - type of value stored in cache, defaults to `any`. */ export interface BlockHeightSwCache { /** * returns cached value for the highest available in cache block that is not higher than `blockHeight`. */ getLessOrEqual(key: string, blockHeight: number): Promise | null>; /** * returns latest value stored for given key */ getLast(key: string): Promise | null>; /** * returns value for the key and exact blockHeight */ get(key: string, blockHeight: number, returnDeepCopy?: boolean): Promise | null>; /** * puts new value in cache under given {@link BlockHeightKey.key} and {@link BlockHeightKey.blockHeight}. */ put(blockHeightKey: BlockHeightKey, value: V): Promise; /** * checks whether cache has any value stored for given cache key */ contains(key: string): Promise; /** * flushes cache to underneath storage (if available) */ flush(): Promise; } export declare class BlockHeightKey { readonly cacheKey: string; readonly blockHeight: number; constructor(cacheKey: string, blockHeight: number); } export declare class BlockHeightCacheResult { readonly cachedHeight: number; readonly cachedValue: V; constructor(cachedHeight: number, cachedValue: V); } //# sourceMappingURL=BlockHeightSwCache.d.ts.map