Repository URL to install this package:
|
Version:
3.0.0 ▾
|
/**
* @todo replace oneStorage everywhere
*/
import indexdb from './adapters/indexdb';
import ls from './adapters/local-storage';
import inMemory from './adapters/in-memory';
import { Serializable } from './deps/stringify';
/**
* keys, values...
* @alias OmniStorage
*
* @todo only use the adapters (means use this.ls > ls)
* so they can be overwritten
*/
declare class OneStorage {
inMemory: typeof inMemory;
indexdb: typeof indexdb;
ls: typeof ls;
constructor();
get<Value extends Serializable = Serializable>(key: string): Value;
/**
* @todo is it faster to "graphql-client-cache" ignore if it always fills?
*/
set(key: string, value: Serializable): Promise<void> | Promise<number>;
has(key: string): boolean;
remove(key: string): Promise<any>;
clear(): Promise<any>;
readonly length: number;
}
export { OneStorage };
export default OneStorage;