UNPKG

@wora/cache-persist

Version:
31 lines 973 B
import { DataCache, ICache, CacheOptions, ICacheStorage } from './CacheTypes'; export declare class Cache implements ICache { private data; private rehydrated; private subscriptions; private storageProxy; private promisesRestore; private mergeState; constructor(options?: CacheOptions); getStorage(): ICacheStorage; isRehydrated(): boolean; restore(): Promise<ICache>; replace(newData: DataCache): void; purge(): void; getState(): Readonly<{ [key: string]: any; }>; has(key: string): boolean; get(key: string): any; set(key: string, value: any): void; delete(key: string): void; remove(key: string): void; flush(): Promise<void>; getAllKeys(): Array<string>; subscribe(callback: (state: any, action: any) => void): () => boolean; notify(payload?: { state?: any; action?: any; }): void; } //# sourceMappingURL=Cache.d.ts.map