crypto-browser-storage
Version:
☢ A simple package for secure local storage data by encryption using Crypto.JS
34 lines (33 loc) • 1.16 kB
TypeScript
import { InjectionToken } from '@angular/core';
import * as i0 from "@angular/core";
export declare const CRYPTO_HASH_KEY: InjectionToken<string>;
export declare class CryptoBrowserStorageService {
private secureStorage;
constructor(cryptoHashKey: string);
/**
* Set data to localstorage via key
* @param {any} key:string
* @param {any} data: any
* @returns {void} void
*/
setCache(key: string, data: any): void;
/**
* Get localstorage data via key
* @param {any} key:string
* @returns {any} any: number | string | object | array
*/
getCache(key: string): any;
/**
* It will remove stored local storage data via key
* @param {any} key:string
* @returns {void} void
*/
removeCacheByKey(key: string): void;
/**
* It behave like native localstorage clear() function. It will clear all cache including pre-existing localstorage data.
* @returns {void} void
*/
clearAllCache(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<CryptoBrowserStorageService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<CryptoBrowserStorageService>;
}