@aws/mynah-ui 1.1.4 → 1.1.6
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.
- package/dist/helper/store.d.ts +13 -1
- package/dist/main.d.ts +6 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +4 -27
- package/package.json +1 -1
package/dist/helper/store.d.ts
CHANGED
|
@@ -5,14 +5,20 @@
|
|
|
5
5
|
import { MynahUIDataModel } from '../static';
|
|
6
6
|
export declare class EmptyMynahUIDataModel {
|
|
7
7
|
data: Required<MynahUIDataModel>;
|
|
8
|
-
constructor();
|
|
8
|
+
constructor(defaults?: MynahUIDataModel | null);
|
|
9
9
|
}
|
|
10
10
|
export declare class MynahUIDataStore {
|
|
11
11
|
private static instance;
|
|
12
12
|
private readonly subsciptions;
|
|
13
13
|
private store;
|
|
14
|
+
private defaults;
|
|
14
15
|
private constructor();
|
|
15
16
|
static getInstance: (initialData?: MynahUIDataModel | undefined) => MynahUIDataStore;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the defaults to use while clearing the store
|
|
19
|
+
* @param defaults partial set of MynahUIDataModel for defaults
|
|
20
|
+
*/
|
|
21
|
+
setDefaults: (defaults: MynahUIDataModel | null) => void;
|
|
16
22
|
/**
|
|
17
23
|
* Subscribe to value changes of a specific item in data store
|
|
18
24
|
* @param storeKey One of the keys in MynahUIDataModel
|
|
@@ -32,6 +38,12 @@ export declare class MynahUIDataStore {
|
|
|
32
38
|
* @returns value of the given key in data store
|
|
33
39
|
*/
|
|
34
40
|
getValue: (storeKey: keyof MynahUIDataModel) => any;
|
|
41
|
+
/**
|
|
42
|
+
* Returns current value of an item in data store
|
|
43
|
+
* @param storeKey One of the keys in MynahUIDataModel
|
|
44
|
+
* @returns value of the given key in data store
|
|
45
|
+
*/
|
|
46
|
+
getDefaultValue: (storeKey: keyof MynahUIDataModel) => any;
|
|
35
47
|
/**
|
|
36
48
|
* Updates the store and informs the subscribers.
|
|
37
49
|
* @param data A full or partial set of store data model with values.
|
package/dist/main.d.ts
CHANGED
|
@@ -44,6 +44,12 @@ export declare class MynahUI {
|
|
|
44
44
|
* @param data A full or partial set of data with values.
|
|
45
45
|
*/
|
|
46
46
|
updateStore: (data: MynahUIDataModel) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Sets store defaults to use while clearing the store
|
|
49
|
+
* To clear the defaults, send `null`
|
|
50
|
+
* @param defaults partial set of MynahUIDataModel for defaults
|
|
51
|
+
*/
|
|
52
|
+
setStoreDefaults: (defaults: MynahUIDataModel | null) => void;
|
|
47
53
|
/**
|
|
48
54
|
* Simply creates and shows a notification
|
|
49
55
|
* @param props NotificationProps
|