UNPKG

flash-store

Version:

FlashStore is a Key-Value persistent storage with easy to use ES6 Map-like API(both Async and Sync support), powered by LevelDB and TypeScript.

44 lines (43 loc) 1.27 kB
export declare class FlashStoreSync<K = any, V = any> implements Map<K, V> { workdir?: string | undefined; static VERSION: string; private cacheMap; private flashStore; private asyncBusyState; private asyncBusyDict; constructor(workdir?: string | undefined); private loadStoreToCache; private asyncBusyAdd; version(): string; /** * * Async methods: * */ close(): Promise<void>; destroy(): Promise<void>; ready(): Promise<void>; /******************************************************* * * * The following methods is all for ES6 Map Interface * * *******************************************************/ get size(): number; get [Symbol.toStringTag](): "Map"; [Symbol.iterator](): IterableIterator<[K, V]>; entries(): IterableIterator<[K, V]>; keys(): IterableIterator<K>; values(): IterableIterator<V>; clear(): void; delete(key: K): boolean; /** * Do not mutate the key/value in the forEach loop! */ forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void; get(key: K): V | undefined; has(key: K): boolean; set(key: K, value: V): this; } export default FlashStoreSync;