angular-persistence
Version:
A library to handle persistence for Angular 2 applications.
62 lines (61 loc) • 1.33 kB
TypeScript
import { IStorage } from './storage.interface';
/**
* A storage type which stored values in memory. They are assumed to be mutable, but
* any object will work in this storage type.
*
* @export
* @class MemoryStorage
* @implements {IStorage}
*
* @author Scott O'Bryan
* @since 1.0
*/
export declare class MemoryStorage implements IStorage {
private _data;
/**
* Always returns true
*
* @returns {boolean}
*/
available(): boolean;
/**
* Sets a value in this object for the specified key
*
* @param {string} key
* @param {*} value
* @returns {boolean}
*/
set(key: string, value: any): boolean;
/**
* Returns the value of the specified key
*
* @param {string} key
* @returns
*/
get(key: string): any;
/**
* Returns false if the value for the key is undefined.
*
* @param {*} key
* @returns {boolean}
*/
exists(key: any): boolean;
/**
* Removes a value from this object
*
* @param {*} key
*/
remove(key: any): void;
/**
* Removes all values in this storage type.
*
* @returns {string[]}
*/
removeAll(): string[];
/**
* Returns a list of all keys that are stored
*
* @returns {string[]}
*/
keys(): string[];
}