@uxland/primary-shell 7.11.2 → 7.11.4
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/{component-Dpavkfpg.js → component-CSEGzgXw.js} +2 -2
- package/dist/{component-Dpavkfpg.js.map → component-CSEGzgXw.js.map} +1 -1
- package/dist/{index-Cv-b9XHD.js → index-U-UQuOAE.js} +6 -7
- package/dist/index-U-UQuOAE.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/api/global-state/global-state.d.ts +6 -6
- package/package.json +1 -1
- package/src/UI/components/poc-events-ecap/poc-events-ecap.ts +0 -1
- package/src/api/global-state/global-state.ts +8 -8
- package/src/api/region-manager/region-manager.ts +0 -1
- package/dist/index-Cv-b9XHD.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PrimariaBroker } from '../broker/primaria-broker';
|
|
2
2
|
export declare abstract class PrimariaGlobalStateManager {
|
|
3
|
-
abstract setData(key: string, value:
|
|
4
|
-
abstract getData(key: string):
|
|
3
|
+
abstract setData<T>(key: string, value: T): void;
|
|
4
|
+
abstract getData<T>(key: string): T | undefined;
|
|
5
5
|
abstract clearData(): void;
|
|
6
6
|
}
|
|
7
7
|
declare class PrimariaGlobalStateManagerImpl implements PrimariaGlobalStateManager {
|
|
@@ -12,17 +12,17 @@ declare class PrimariaGlobalStateManagerImpl implements PrimariaGlobalStateManag
|
|
|
12
12
|
* Sets the value of a key in the state object and publishes an event with the event bus.
|
|
13
13
|
*
|
|
14
14
|
* @param {string} key - The key to set the value for.
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {T} value - The value to set for the key.
|
|
16
16
|
* @return {void} This function does not return anything.
|
|
17
17
|
*/
|
|
18
|
-
setData(key: string, value:
|
|
18
|
+
setData<T>(key: string, value: T): void;
|
|
19
19
|
/**
|
|
20
20
|
* Retrieves the value associated with the specified key from the state object.
|
|
21
21
|
*
|
|
22
22
|
* @param {string} key - The key to retrieve the value for.
|
|
23
|
-
* @return {
|
|
23
|
+
* @return {T | undefined} The value associated with the specified key, or undefined if the key does not exist in the state object.
|
|
24
24
|
*/
|
|
25
|
-
getData(key: string):
|
|
25
|
+
getData<T>(key: string): T | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Clears all data stored in the state object.
|
|
28
28
|
*
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { PrimariaBroker } from "../broker/primaria-broker";
|
|
2
2
|
|
|
3
3
|
export abstract class PrimariaGlobalStateManager {
|
|
4
|
-
abstract setData(key: string, value:
|
|
5
|
-
abstract getData(key: string):
|
|
4
|
+
abstract setData<T>(key: string, value: T): void;
|
|
5
|
+
abstract getData<T>(key: string): T | undefined;
|
|
6
6
|
abstract clearData(): void;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
class PrimariaGlobalStateManagerImpl implements PrimariaGlobalStateManager {
|
|
10
|
-
private state: { [key: string]:
|
|
10
|
+
private state: { [key: string]: unknown } = {};
|
|
11
11
|
constructor(public broker: PrimariaBroker) {}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Sets the value of a key in the state object and publishes an event with the event bus.
|
|
15
15
|
*
|
|
16
16
|
* @param {string} key - The key to set the value for.
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {T} value - The value to set for the key.
|
|
18
18
|
* @return {void} This function does not return anything.
|
|
19
19
|
*/
|
|
20
|
-
setData(key: string, value:
|
|
20
|
+
setData<T>(key: string, value: T): void {
|
|
21
21
|
this.state[key] = value;
|
|
22
22
|
this.broker.publish("data_set", {
|
|
23
23
|
key: key,
|
|
@@ -29,10 +29,10 @@ class PrimariaGlobalStateManagerImpl implements PrimariaGlobalStateManager {
|
|
|
29
29
|
* Retrieves the value associated with the specified key from the state object.
|
|
30
30
|
*
|
|
31
31
|
* @param {string} key - The key to retrieve the value for.
|
|
32
|
-
* @return {
|
|
32
|
+
* @return {T | undefined} The value associated with the specified key, or undefined if the key does not exist in the state object.
|
|
33
33
|
*/
|
|
34
|
-
getData(key: string):
|
|
35
|
-
return this.state[key];
|
|
34
|
+
getData<T>(key: string): T | undefined {
|
|
35
|
+
return this.state[key] as T | undefined;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|