UNPKG

@lomray/react-mobx-manager

Version:
53 lines (52 loc) 1.09 kB
import { IStorage } from "../types.js"; interface IAsyncStorage { getItem: (key: string) => Promise<string | null>; setItem: (key: string, value: string) => Promise<void>; removeItem: (key: string) => Promise<void>; } interface IAsyncStorageOptions { storage: IAsyncStorage; globalKey?: string; } /** * Async storage for mobx store manager */ declare class AsyncStorage implements IStorage { /** * Cookie storage key */ protected globalKey: string; /** * @protected */ protected storage: IAsyncStorage; /** * @constructor */ /** * @constructor */ constructor({ storage, globalKey }: IAsyncStorageOptions); /** * @inheritDoc */ /** * @inheritDoc */ get(): Promise<Record<string, any> | undefined>; /** * @inheritDoc */ /** * @inheritDoc */ flush(): Promise<any>; /** * @inheritDoc */ /** * @inheritDoc */ set(value: Record<string, any> | undefined): Promise<void>; } export { AsyncStorage as default };