@plasmohq/storage
Version:
Safely and securely store data and share them across your extension and websites
43 lines (39 loc) • 1.5 kB
text/typescript
import { BaseStorage } from './index.cjs';
/**
* Resources:
*
* https://www.youtube.com/watch?v=lbt2_M1hZeg
*
*/
declare const DEFAULT_NS_SEPARATOR = "|:|";
/**
* ALPHA API: This API is still in development and may change at any time.
*/
declare class SecureStorage extends BaseStorage {
#private;
private get passwordKey();
setPassword: (password: string, { iterations, saltSize, ivSize, namespace, nsSize, nsSeparator }?: {
iterations?: number | undefined;
saltSize?: number | undefined;
ivSize?: number | undefined;
namespace?: string | undefined;
nsSize?: number | undefined;
nsSeparator?: string | undefined;
}) => Promise<void>;
migrate: (newInstance: SecureStorage) => Promise<SecureStorage>;
/**
*
* @param boxBase64 A box contains salt, iv and encrypted data
* @returns decrypted data
*/
decrypt: (boxBase64: string) => Promise<string>;
encrypt: (rawData: string) => Promise<string>;
get: <T = string>(key: string) => Promise<T | undefined>;
getMany: <T = any>(keys: string[]) => Promise<Record<string, T | undefined>>;
set: (key: string, rawValue: any) => Promise<null>;
setMany: (items: Record<string, any>) => Promise<null>;
remove: (key: string) => Promise<void>;
removeMany: (keys: string[]) => Promise<void>;
protected parseValue: <T>(boxBase64: string | null | undefined) => Promise<T | undefined>;
}
export { DEFAULT_NS_SEPARATOR, SecureStorage };