sprintify-ui 0.8.66 → 0.8.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
type
|
|
1
|
+
type StorageValue = Record<string, any> | string[] | number[] | number | string | boolean | null | undefined;
|
|
2
|
+
type SettingsStorageGetFunction = (key: string) => Promise<StorageValue>;
|
|
2
3
|
type SettingsStorageSetFunction = (key: string, value: string) => Promise<void>;
|
|
3
4
|
declare class SettingsStorage {
|
|
4
5
|
private getFunction;
|
|
5
6
|
private setFunction;
|
|
6
7
|
constructor(getFunction?: SettingsStorageGetFunction, setFunction?: SettingsStorageSetFunction);
|
|
7
|
-
get(key: string): Promise<
|
|
8
|
+
get(key: string): Promise<StorageValue>;
|
|
8
9
|
set(key: string, value: string): Promise<void>;
|
|
9
10
|
}
|
|
10
11
|
export { SettingsStorage };
|
package/package.json
CHANGED
package/src/utils/storage.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const storageKeyPrefix = 'sui.';
|
|
2
2
|
|
|
3
|
-
type
|
|
3
|
+
type StorageValue = Record<string, any> | string[] | number[] | number | string | boolean | null | undefined;
|
|
4
|
+
type SettingsStorageGetFunction = (key: string) => Promise<StorageValue>;
|
|
4
5
|
type SettingsStorageSetFunction = (key: string, value: string) => Promise<void>;
|
|
5
6
|
|
|
6
7
|
class SettingsStorage {
|
|
@@ -24,7 +25,7 @@ class SettingsStorage {
|
|
|
24
25
|
this.setFunction = setFunction ? setFunction : localStorageSet;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
get(key: string): Promise<
|
|
28
|
+
get(key: string): Promise<StorageValue> {
|
|
28
29
|
return this.getFunction(key);
|
|
29
30
|
}
|
|
30
31
|
|