browser-storage-utilities
Version:
A front-end library that provides utility methods to facilitate CRUD operations to data stored in the browser, and more.
28 lines (27 loc) • 1.4 kB
TypeScript
import { IStorageSettings } from '../interfaces/storage-settings';
import { StorageBaseOperations } from './storage-base-operations';
import { StorageTypes } from '../enums/storage-types';
import { Observable } from 'rxjs';
import { IStorageNotifier } from '../interfaces/storage-typings';
export declare abstract class StorageBase<T> extends StorageBaseOperations<T> {
private _settings;
private _stateSubject;
constructor(settings: IStorageSettings);
protected setSettings(settings: IStorageSettings): void;
protected get(key: string, type?: StorageTypes, isUpdateProp?: boolean): T;
protected add(key: string, value: T, expiry?: number, type?: StorageTypes, isUpdateProp?: boolean): void;
protected remove(key: string, type?: StorageTypes): void;
protected removeAll(keys: string[], type?: StorageTypes): void;
protected updateProp(key: string, propName: string, newValue: any, type?: StorageTypes): T;
protected removeProp(key: string, propName: string, type?: StorageTypes): T;
protected getStorage(type?: StorageTypes): Storage;
protected clear(type?: StorageTypes): void;
protected getNotifierObservable(): Observable<IStorageNotifier<T>>;
private _setStorageState;
private _deserializer;
private _serializer;
private _setWithExpiry;
private _getWithExpiry;
private _validateStorageType;
private _validateSettings;
}