@nlabs/arkhamjs-storage-browser
Version:
Browser storage for ArkhamJS with enhanced performance and modern ESNext features
35 lines • 1.33 kB
TypeScript
/**
* Copyright (c) 2018-Present, Nitrogen Labs, Inc.
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
*/
import type { BrowserStorageOptions } from '../types/main.js';
export declare class BrowserStorage {
private static readonly window;
private readonly options;
private readonly storageCache;
private readonly storage;
constructor(options?: BrowserStorageOptions);
static delLocalData(key: string): boolean;
static delSessionData(key: string): boolean;
static getLocalData(key: string): any;
static getSessionData(key: string): any;
static setLocalData(key: string, value: any): boolean;
static setSessionData(key: string, value: any): boolean;
static getLocalStorage(): Storage | null;
static getSessionStorage(): Storage | null;
getStorageData(key: string): Promise<any>;
setStorageData(key: string, value: any): Promise<boolean>;
removeStorageData(key: string): Promise<boolean>;
clearStorageData(): Promise<boolean>;
getStorageStats(): {
available: number;
total: number;
used: number;
};
private getStorage;
private getPrefixedKey;
private isStorageAvailable;
private validateSize;
private cleanExpiredData;
}
//# sourceMappingURL=BrowserStorage.d.ts.map