UNPKG

@cute-dw/core

Version:

This TypeScript library is the main part of a more powerfull package designed for the fast WEB software development. The cornerstone of the library is the **DataStore** class, which might be useful when you need a full control of the data, but do not need

47 lines (46 loc) 2.1 kB
import { HashTable } from "./HashTable"; /** * The `Properties` class represents a persistent set of properties. Each key and its corresponding value in the property list is a _string_. */ export declare class Properties extends HashTable<string, string> { constructor(properties?: Properties); /** * Searches for the property with the specified key in this property list * @param key The key whose associated value is to be returned * @returns The value to which the specified `key` is mapped, or _undefined_ if this map contains no mapping for the `key` */ getProperty(key: string): string | undefined; /** * Returns an enumeration of all the keys in this property list * @returns Array of the property names (keys) */ propertyNames(): string[]; /** * Load key/value pairs from the global `localStorage` object * @returns _true_ if collection was changed, otherwise _false_ */ loadLocalStorage(): boolean; /** * Load key/value pairs from the global `sessionStorage` object * @returns _true_ if collection was changed, otherwise _false_ */ loadSessionStorage(): boolean; /** * Writes this property list (key and element pairs) in this {@link Properties} table to the local storage * @returns _true_ if something changes in the `localStorage` object, else _false_ */ storeToLocalStorage(): boolean; /** * Writes this property list (key and element pairs) in this {@link Properties} table to the session storage * @returns _true_ if something changes in the `sessionStorage` object, else _false_ */ storeToSessionStorage(): boolean; /** * Load key/value pairs from the string in `ini`-format * @param source The source string with key=value pairs * @param separator The separator string of key=value pairs. Default is ';'. * @returns _true_ if the dictionary was changed, else _false_ * @since 0.5.0 */ loadIniString(source: string, separator?: string): boolean; }