@trackunit/react-core-contexts-api 1.4.77 → 1.4.79

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-contexts-api",
3
- "version": "1.4.77",
3
+ "version": "1.4.79",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "jest-fetch-mock": "^3.0.3",
11
- "@trackunit/shared-utils": "1.5.75",
12
- "@trackunit/geo-json-utils": "1.3.76"
11
+ "@trackunit/shared-utils": "1.5.76",
12
+ "@trackunit/geo-json-utils": "1.3.77"
13
13
  },
14
14
  "module": "./index.esm.js",
15
15
  "main": "./index.cjs.js",
package/src/index.d.ts CHANGED
@@ -13,3 +13,4 @@ export * from "./timeRangeContext";
13
13
  export * from "./toastContext";
14
14
  export * from "./tokenContext";
15
15
  export * from "./userSubscriptionContext";
16
+ export * from "./widgetConfigContext";
@@ -0,0 +1,37 @@
1
+ export interface WidgetConfigContext {
2
+ /**
3
+ * Gets the title of the widget.
4
+ *
5
+ * @returns the title of the widget
6
+ */
7
+ getTitle: () => Promise<string>;
8
+ /**
9
+ * Sets the title of the widget.
10
+ *
11
+ * @param title - The title to set.
12
+ */
13
+ setTitle: (title: string) => Promise<void>;
14
+ /**
15
+ * Gets the data of the widget.
16
+ *
17
+ * @returns the data of the widget
18
+ */
19
+ getData: () => Promise<Record<string, unknown>>;
20
+ /**
21
+ * Gets the data version of the widget.
22
+ * Dataversion is used to make it easy for you to see what dataVersion is saved in the widget.
23
+ * Use it to upgrade the widget data to a new version when loading the widget.
24
+ *
25
+ * @returns the data version of the widget
26
+ */
27
+ getDataVersion: () => Promise<number>;
28
+ /**
29
+ * Sets the data of the widget.
30
+ * Dataversion is used to make it easy for you to see what dataVersion is saved in the widget.
31
+ * Use it to upgrade the widget data to a new version when loading the widget.
32
+ *
33
+ * @param data - The data to set.
34
+ * @param dataVersion - The data version to set.
35
+ */
36
+ setData: (data: Record<string, unknown>, dataVersion: number) => Promise<void>;
37
+ }