UNPKG

2.09 kBTypeScriptView Raw
1/**
2 * Checks whether such a key exists.
3 * @param key The key to check for.
4 */
5export function hasKey(key: string): boolean;
6
7/**
8 * Gets a value (if existing) for a key as a Boolean Object. A default value can be provided in case there is no existing value.
9 * @param key The key to check for.
10 * @param defaultValue An optional value to be returned in case there is no existing value.
11 */
12export function getBoolean(key: string, defaultValue?: boolean): boolean;
13
14/**
15 * Gets a value (if existing) for a key as a String Object. A default value can be provided in case there is no existing value.
16 * @param key The key to check for.
17 * @param defaultValue An optional value to be returned in case there is no existing value.
18 */
19export function getString(key: string, defaultValue?: string): string;
20
21/**
22 * Gets a value (if existing) for a key as a Number Object. A default value can be provided in case there is no existing value.
23 * @param key The key to check for.
24 * @param defaultValue An optional value to be returned in case there is no existing value.
25 */
26export function getNumber(key: string, defaultValue?: number): number;
27
28/**
29 * Sets a Boolean Object for a key.
30 * @param key The key.
31 * @param value The value.
32 */
33export function setBoolean(key: string, value: boolean): void;
34
35/**
36 * Sets a String Object for a key.
37 * @param key The key.
38 * @param value The value.
39 */
40export function setString(key: string, value: string): void;
41
42/**
43 * Sets a Number Object for a key.
44 * @param key The key.
45 * @param value The value.
46 */
47export function setNumber(key: string, value: number): void;
48
49/**
50 * Removes a value (if existing) for a key.
51 * @param key The key to check for.
52 */
53export function remove(key: string): void;
54
55/**
56 * Removes all values.
57 */
58export function clear(): void;
59
60/**
61 * Flush all changes to disk synchronously.
62 * @return boolean flag indicating if changes were saved successfully to disk.
63 */
64export function flush(): boolean;
65
66/**
67 * Get all stored keys
68 * @return Array containing all stored keys
69 */
70export function getAllKeys(): Array<string>;