vue3-storage-secure
Version:
Vue3 plugin for work with local storage, session storage and websql from Vue context, inspired by tarojs, vue-ls and secure-ls.
26 lines (25 loc) • 1.48 kB
TypeScript
import { CallbackResult, ClearStorageOption, GetStorageInfoOption, GetStorageInfoSuccessCallbackOption, GetStorageOption, GetStorageSuccessCallbackResult, RemoveStorageOption, SetStorageOption, StorageInterface } from "./types";
export declare class StorageClass implements StorageInterface {
protected storage: Storage;
protected namespace: string;
protected secureKey: string;
constructor(storage: Storage);
config(namespace?: string | undefined, secureKey?: string | undefined): void;
clearStorage(option?: ClearStorageOption): Promise<CallbackResult>;
clearStorageSync(): void;
getStorage<T = any>(option: GetStorageOption<T>): Promise<GetStorageSuccessCallbackResult<T>>;
getStorageInfo(option?: GetStorageInfoSuccessCallbackOption): Promise<CallbackResult>;
getStorageInfoSync(): GetStorageInfoOption;
hasKey(key: string): boolean;
isExpire(key: string): boolean;
key(index: number): string | null;
removeStorage(option: RemoveStorageOption): Promise<CallbackResult>;
removeStorageSync(key: string): void;
setStorage(option: SetStorageOption): Promise<CallbackResult>;
setStorageSync(key: string, data: any, expire?: number): void;
setSecureStorageSync(key: string, data: any, expire?: number | undefined): void;
private getItemKey;
private getItem;
getStorageSync<T = any>(key: string): T | undefined;
getSecureStorageSync<T = any>(key: string): T | undefined;
}