import { AxiosRequestConfig } from "axios"; import { IModel } from "./APIUtils"; export interface IDBBrowserStorageUtils extends IModel { browser_storage: any; } /** * DataBaseStorage which you can storage anything. Its like the local storage for it will be saved in the DB. * This comes in handy when you want it to be saved for all devices for a specific user or when you want to save data will you are inside an iframe */ export declare namespace DBBrowserStorageUtils { /** * will only pass the given amounts * todo should add something which can expire * passCallback will be called if pass is granted */ function guard(model: IDBBrowserStorageUtils, key: string, maxAmount?: number): boolean; function setItem(model: IDBBrowserStorageUtils, key: string, data: any, axiosConfig?: AxiosRequestConfig): any; function getItem(player: IDBBrowserStorageUtils, key: string): any; } /** * class wrapper for DBBrowserStorageUtils witch can hold the model and axios config */ export declare class DBBrowserStorage { private _model; private _axiosConfig; constructor(model: IDBBrowserStorageUtils, axiosConfig?: AxiosRequestConfig); setItem(key: string, data: any): any; getItem(key: string): any; /** * will only pass the given amounts * todo should add something which can expire * passCallback will be called if pass is granted */ guard(key: string, passCallback: () => void, maxAmount?: number): boolean; }