@trackunit/react-core-contexts-api 1.8.9 → 1.8.10

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.8.9",
3
+ "version": "1.8.10",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,9 +8,9 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "jest-fetch-mock": "^3.0.3",
11
- "@trackunit/shared-utils": "1.9.7",
12
- "@trackunit/geo-json-utils": "1.7.7",
13
- "@trackunit/react-test-setup": "1.4.7"
11
+ "@trackunit/shared-utils": "1.9.8",
12
+ "@trackunit/geo-json-utils": "1.7.8",
13
+ "@trackunit/react-test-setup": "1.4.8"
14
14
  },
15
15
  "module": "./index.esm.js",
16
16
  "main": "./index.cjs.js",
@@ -1,3 +1,7 @@
1
+ export type LoadingState = {
2
+ hasData: boolean;
3
+ isLoading: boolean;
4
+ };
1
5
  export interface WidgetConfigContext {
2
6
  /**
3
7
  * Gets the title of the widget.
@@ -34,4 +38,24 @@ export interface WidgetConfigContext {
34
38
  * @param dataVersion - The data version to set.
35
39
  */
36
40
  setData: (data: Record<string, unknown>, dataVersion: number) => Promise<void>;
41
+ /**
42
+ * Sets the loading state of the widget.
43
+ *
44
+ * @param loadingState - The loading state to set.
45
+ */
46
+ setLoadingState: (loadingState: LoadingState) => Promise<void>;
47
+ /**
48
+ * Opens the edit mode of the widget.
49
+ */
50
+ openEditMode: () => Promise<void>;
51
+ /**
52
+ * Closes the edit mode of the widget.
53
+ */
54
+ closeEditMode: () => Promise<void>;
55
+ /**
56
+ * The poll interval of the widget.
57
+ *
58
+ * @returns the poll interval of the widget
59
+ */
60
+ pollInterval?: number;
37
61
  }