@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.
@@ -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: any): void;
4
- abstract getData(key: string): any;
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 {any} value - The value to set for the key.
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: any): void;
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 {any} The value associated with the specified key, or undefined if the key does not exist in the state object.
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): any;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.11.2",
3
+ "version": "7.11.4",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -47,7 +47,6 @@ export class PocEventsEcap extends LitElement {
47
47
 
48
48
  getPDFS() {
49
49
  const pdfs = shellApi.pdfViewerManager.getPdfs();
50
- console.log(pdfs);
51
50
  return pdfs;
52
51
  }
53
52
 
@@ -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: any): void;
5
- abstract getData(key: string): any;
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]: any } = {};
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 {any} value - The value to set for the key.
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: any): void {
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 {any} The value associated with the specified key, or undefined if the key does not exist in the state object.
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): any {
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
  /**
@@ -130,7 +130,6 @@ class RegionManagerProxy implements PrimariaRegionManager {
130
130
  }
131
131
 
132
132
  _notifyMainViewChanged(viewId: string) {
133
- console.log(viewId);
134
133
  this.broker.publish(shellEvents.mainViewChanged, { viewId });
135
134
  }
136
135