UNPKG

@lomray/react-mobx-manager

Version:
66 lines (65 loc) 1.6 kB
import { IStorage } from "../types.js"; interface ICookiesStorageAttributes { expires?: number | Date | undefined; path?: string | undefined; domain?: string | undefined; secure?: boolean | undefined; sameSite?: 'strict' | 'Strict' | 'lax' | 'Lax' | 'none' | 'None' | undefined; [property: string]: any; } interface ICookieStorage { get: (key: string) => string | null | undefined; set: (key: string, value: string, options: ICookiesStorageAttributes) => any; remove: (key: string, options: ICookiesStorageAttributes) => any; } interface ICookiesStorageOptions { storage: ICookieStorage; globalKey?: string; cookieAttr?: ICookiesStorageAttributes; } /** * Cookie storage for mobx store manager */ declare class CookieStorage implements IStorage { /** * Cookie storage key */ protected globalKey: string; /** * @protected */ protected storage: ICookieStorage; /** * Cookie attributes */ protected cookieAttr: ICookiesStorageAttributes; /** * @constructor */ /** * @constructor */ constructor({ storage, cookieAttr, globalKey }: ICookiesStorageOptions); /** * @inheritDoc */ /** * @inheritDoc */ get(): Record<string, any> | Promise<Record<string, any> | undefined>; /** * @inheritDoc */ /** * @inheritDoc */ flush(): void | Promise<any>; /** * @inheritDoc */ /** * @inheritDoc */ set(value: Record<string, any> | undefined): void; } export { CookieStorage as default };