import { TOKEN_KEY, USER_INFO_KEY, ROLES_KEY, LOCK_INFO_KEY, PROJ_CFG_KEY, MULTIPLE_TABS_KEY, ADMINTOKEN_KEY } from '@dq-next/types/enums/cacheEnum'; import { RouteLocationNormalized } from 'vue-router'; import { ProjectConfig } from '@dq-next/types/config'; import { LockInfo, UserInfo } from '@dq-next/types/store'; import { EncryptionParams, AesEncryption } from './cipher'; export declare const DEFAULT_CACHE_TIME: number; export declare const cacheCipher: { key: string; iv: string; }; export declare function getCommonStoragePrefix(): string; export interface CreateStorageParams extends EncryptionParams { prefixKey: string; storage: Storage | NodeMockStorage; hasEncrypt: boolean; timeout?: number; } declare class WebStorage { private storage; private encryption; private hasEncrypt; private prefixKey; private timeout; constructor(storage: Storage, encryption: AesEncryption, hasEncrypt: boolean, prefixKey: string | undefined, timeout: number); private getKey; set(key: string, value: any, expire?: number | null): void; get(key: string, def?: any): any; remove(key: string): void; clear(): void; } export declare const createStorage: ({ prefixKey, storage, key, iv, timeout, hasEncrypt, }?: Partial) => WebStorage; type Options = Partial; export declare const createSessionStorage: (options?: Options) => WebStorage; export declare const createLocalStorage: (options?: Options) => WebStorage; interface BasicStore { [TOKEN_KEY]: string | number | null | undefined; [ADMINTOKEN_KEY]: string | number | null | undefined; [USER_INFO_KEY]: UserInfo; [ROLES_KEY]: string[]; [LOCK_INFO_KEY]: LockInfo; [PROJ_CFG_KEY]: ProjectConfig; [MULTIPLE_TABS_KEY]: RouteLocationNormalized[]; } export type BasicKeys = keyof BasicStore; declare class NodeMockStorage { private storage; constructor(); getItem(key: string): any; setItem(key: string, value: any): void; removeItem(key: string): void; clear(): void; get length(): number; key(index: number): string; } export declare const webStorage: { ls: WebStorage; ss: WebStorage; clearAll: () => void; }; export {};