UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

39 lines (38 loc) 1.01 kB
/** * Class representing a local storage instance. * @class */ export declare class LocalStorage { /** * Storage instance. * @type {Storage} */ db: Storage; /** * Constructs a new LocalStorage instance. * @constructor */ constructor(); /** * Sets a value in the local storage. * @param {string} id - The id/key of the value to set. * @param {any} data - The data value to set. */ set(id: string, data: unknown): void; /** * Retrieves a value from the local storage. * @param {string} id - The id/key of the value to retrieve. * @returns {string | undefined} - The retrieved value. */ get(id: string): string | undefined; /** * Removes a value from the local storage. * @param {string} id - The id/key of the value to remove. */ remove(id: string): void; } /** * Default instance of the LocalStorage class. * @type {LocalStorage} */ export declare const localStorage: LocalStorage;