@matir-js/react 0.2.0 → 0.2.1
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/index.d.mts +5 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MatirCore, matir, matir as matir$1 } from "@matir-js/core";
|
|
1
|
+
import { InferPermissions, MatirCore, matir, matir as matir$1 } from "@matir-js/core";
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/matir-context.d.ts
|
|
@@ -16,6 +16,9 @@ type CurrentRole = {
|
|
|
16
16
|
value: string | null;
|
|
17
17
|
description: string | null;
|
|
18
18
|
} | null;
|
|
19
|
+
type CurrentPermissions = MatirRegister extends {
|
|
20
|
+
schema: infer S;
|
|
21
|
+
} ? S extends Schema ? InferPermissions<S> : Record<string, string[]> : Record<string, string[]>;
|
|
19
22
|
declare function MatirProvider({
|
|
20
23
|
children,
|
|
21
24
|
schema,
|
|
@@ -27,7 +30,7 @@ declare function MatirProvider({
|
|
|
27
30
|
}): react_jsx_runtime0.JSX.Element;
|
|
28
31
|
declare function useCurrent(): {
|
|
29
32
|
role: CurrentRole;
|
|
30
|
-
permissions:
|
|
33
|
+
permissions: CurrentPermissions | null;
|
|
31
34
|
setRole: (role: string) => void;
|
|
32
35
|
setPermissions: (permissions: Record<string, string[]>) => void;
|
|
33
36
|
clearAll: () => void;
|