@trackunit/react-core-hooks 1.7.85 → 1.7.87

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-hooks",
3
- "version": "1.7.85",
3
+ "version": "1.7.87",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,11 +9,11 @@
9
9
  "dependencies": {
10
10
  "react": "19.0.0",
11
11
  "zod": "^3.23.8",
12
- "@trackunit/iris-app-runtime-core": "1.8.81",
13
- "@trackunit/shared-utils": "1.9.73",
12
+ "@trackunit/iris-app-runtime-core": "1.8.83",
13
+ "@trackunit/shared-utils": "1.9.74",
14
14
  "fflate": "^0.8.2",
15
15
  "es-toolkit": "^1.39.10",
16
- "@trackunit/iris-app-runtime-core-api": "1.7.81"
16
+ "@trackunit/iris-app-runtime-core-api": "1.7.83"
17
17
  },
18
18
  "module": "./index.esm.js",
19
19
  "main": "./index.cjs.js",
@@ -1,7 +1,7 @@
1
- import { CurrentUserContextInterface } from "@trackunit/iris-app-runtime-core-api";
1
+ import { CurrentUserState } from "@trackunit/iris-app-runtime-core-api";
2
2
  import { ReactNode } from "react";
3
3
  interface Props {
4
- value: CurrentUserContextInterface;
4
+ value: CurrentUserState;
5
5
  children?: ReactNode;
6
6
  }
7
7
  /**
@@ -22,5 +22,5 @@ export declare const CurrentUserProvider: (props: Props) => import("react/jsx-ru
22
22
  * });
23
23
  * @see { CurrentUserContext}
24
24
  */
25
- export declare const useCurrentUser: () => CurrentUserContextInterface;
25
+ export declare const useCurrentUser: () => CurrentUserState;
26
26
  export {};
@@ -0,0 +1,8 @@
1
+ export type HasAccess = boolean | null;
2
+ /**
3
+ * Hook that checks if the current user has a given permission.
4
+ *
5
+ * @param requiredPermission - The permission to check for typesafe string.
6
+ * @returns {HasAccess} - true if the user has the permission, false if not and null if we could not determine.
7
+ */
8
+ export declare const useUserPermission: <TPermission extends string>(requiredPermission: TPermission) => HasAccess;