1 | /**
|
2 | * Checks whether such a key exists.
|
3 | * @param key The key to check for.
|
4 | */
|
5 | export 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 | */
|
12 | export 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 | */
|
19 | export 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 | */
|
26 | export 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 | */
|
33 | export 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 | */
|
40 | export 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 | */
|
47 | export 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 | */
|
53 | export function remove(key: string): void;
|
54 |
|
55 | /**
|
56 | * Removes all values.
|
57 | */
|
58 | export 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 | */
|
64 | export function flush(): boolean;
|
65 |
|
66 | /**
|
67 | * Get all stored keys
|
68 | * @return Array containing all stored keys
|
69 | */
|
70 | export function getAllKeys(): Array<string>;
|