UNPKG

@neo-one/node-storage-cache-esnext-esm

Version:

NEO•ONE node storage cache.

20 lines (19 loc) 1.07 kB
import { ReadAllStorage, ReadGetAllStorage, ReadStorage } from '@neo-one/node-core-esnext-esm'; import LRUCache from 'lru-cache'; declare type SerializeKeyString<Key> = (key: Key) => string; export declare function createReadStorage<Key, Value>({ cache, storage, serializeKeyString, }: { readonly cache: LRUCache<string, Value>; readonly storage: ReadStorage<Key, Value>; readonly serializeKeyString: SerializeKeyString<Key>; }): ReadStorage<Key, Value>; export declare function createReadAllStorage<Key, Value>({ cache, storage, serializeKeyString, }: { readonly cache: LRUCache<string, Value>; readonly storage: ReadAllStorage<Key, Value>; readonly serializeKeyString: SerializeKeyString<Key>; }): ReadAllStorage<Key, Value>; export declare function createReadGetAllStorage<Key, Keys, Value>({ cache, storage, serializeKeyString, }: { readonly cache: LRUCache<string, Value>; readonly storage: ReadGetAllStorage<Key, Keys, Value>; readonly serializeKeyString: SerializeKeyString<Key>; }): ReadGetAllStorage<Key, Keys, Value>; export {};