UNPKG

@beenotung/tslib

Version:
23 lines (22 loc) 781 B
export declare type AsyncStoreSetItemResult = Promise<void> & { hasCancel: boolean; hasDone: boolean; cancel: () => void; }; export declare class AsyncStore { private [Symbol.counter]; private [Symbol.dirpath]; private [Symbol.asyncStoreSetItemResults]; private constructor(); clear(): Promise<void>; getItem(key: string): Promise<string | null>; getObject<T>(key: string): Promise<T | null>; key(index: number): Promise<string | null>; keys(): Promise<string[]>; length(): Promise<number>; removeItem(key: string): Promise<void>; setItem(key: string, value: string): AsyncStoreSetItemResult; setObject(key: string, value: any): Promise<void>; private keyToPath; static create(dirpath: string): AsyncStore; }