UNPKG

@beenotung/tslib

Version:
26 lines (25 loc) 940 B
export declare const counterSymbol: unique symbol; export declare const dirpathSymbol: unique symbol; export declare const asyncStoreSetItemResultsSymbol: unique symbol; export type AsyncStoreSetItemResult = Promise<void> & { hasCancel: boolean; hasDone: boolean; cancel: () => void; }; export declare class AsyncStore { private [counterSymbol]; private [dirpathSymbol]; private [asyncStoreSetItemResultsSymbol]; 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; }