@trackunit/react-core-hooks 0.2.64 → 0.2.66
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/index.cjs +387 -387
- package/index.js +387 -387
- package/package.json +5 -5
- package/src/analytics/AnalyticsProvider.d.ts +23 -23
- package/src/assetSorting/AssetSortingProvider.d.ts +36 -36
- package/src/environment/EnvironmentContextProvider.d.ts +23 -23
- package/src/global-selection/GlobalSelectionProvider.d.ts +26 -26
- package/src/index.d.ts +16 -16
- package/src/irisOemApp/IrisOemAppContextProvider.d.ts +24 -24
- package/src/runtimes/navigation/index.d.ts +1 -1
- package/src/runtimes/navigation/useDeeplink.d.ts +4 -4
- package/src/runtimes/navigation/useNavigationRuntime.d.ts +17 -17
- package/src/runtimes/navigation/useURLSynchronization.d.ts +4 -4
- package/src/runtimes/useAssetRuntime.d.ts +22 -22
- package/src/runtimes/useCustomFieldRuntime.d.ts +9 -9
- package/src/runtimes/useCustomFieldRuntimeForEntity.d.ts +23 -23
- package/src/runtimes/useRestRuntime.d.ts +10 -10
- package/src/runtimes/useSiteRuntime.d.ts +23 -23
- package/src/subscription/UserSubscriptionProvider.d.ts +24 -24
- package/src/toast/ToastProvider.d.ts +29 -29
- package/src/token/TokenProvider.d.ts +22 -22
- package/src/user/CurrentUserProvider.d.ts +27 -27
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { IToastContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export interface ContextProviderProps {
|
|
4
|
-
value: IToastContext;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* This is a provider for the ToastContext.
|
|
9
|
-
*/
|
|
10
|
-
export declare const ToastProvider: (props: ContextProviderProps) => JSX.Element;
|
|
11
|
-
/**
|
|
12
|
-
* This is a hook to use the ToastContext.
|
|
13
|
-
*
|
|
14
|
-
* @requires ToastProvider
|
|
15
|
-
* @example
|
|
16
|
-
* import { useToast } from "@trackunit/react-core-hooks";
|
|
17
|
-
* const { addToast } = useToast();
|
|
18
|
-
* // use the toast
|
|
19
|
-
* error &&
|
|
20
|
-
* addToast({
|
|
21
|
-
* intent: "warning",
|
|
22
|
-
* title: t("assetHome.specification.failedToSave"),
|
|
23
|
-
* description: error?.message,
|
|
24
|
-
* duration: 3000,
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* @see {@link IToastContext}
|
|
28
|
-
*/
|
|
29
|
-
export declare const useToast: () => IToastContext;
|
|
1
|
+
import { IToastContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface ContextProviderProps {
|
|
4
|
+
value: IToastContext;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This is a provider for the ToastContext.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ToastProvider: (props: ContextProviderProps) => JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* This is a hook to use the ToastContext.
|
|
13
|
+
*
|
|
14
|
+
* @requires ToastProvider
|
|
15
|
+
* @example
|
|
16
|
+
* import { useToast } from "@trackunit/react-core-hooks";
|
|
17
|
+
* const { addToast } = useToast();
|
|
18
|
+
* // use the toast
|
|
19
|
+
* error &&
|
|
20
|
+
* addToast({
|
|
21
|
+
* intent: "warning",
|
|
22
|
+
* title: t("assetHome.specification.failedToSave"),
|
|
23
|
+
* description: error?.message,
|
|
24
|
+
* duration: 3000,
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* @see {@link IToastContext}
|
|
28
|
+
*/
|
|
29
|
+
export declare const useToast: () => IToastContext;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ITokenContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/**
|
|
4
|
-
* This is a hook to use the TokenContext.
|
|
5
|
-
*
|
|
6
|
-
* @requires TokenProvider
|
|
7
|
-
* @example
|
|
8
|
-
* import { useToken } from "@trackunit/react-core-hooks";
|
|
9
|
-
* const { token } = useToken();
|
|
10
|
-
*
|
|
11
|
-
* @see {@link ITokenContext}
|
|
12
|
-
*/
|
|
13
|
-
export declare const useToken: () => ITokenContext;
|
|
14
|
-
interface IProps {
|
|
15
|
-
value: ITokenContext;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* This is a provider for the TokenContext.
|
|
20
|
-
*/
|
|
21
|
-
export declare const TokenProvider: (props: IProps) => JSX.Element;
|
|
22
|
-
export {};
|
|
1
|
+
import { ITokenContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* This is a hook to use the TokenContext.
|
|
5
|
+
*
|
|
6
|
+
* @requires TokenProvider
|
|
7
|
+
* @example
|
|
8
|
+
* import { useToken } from "@trackunit/react-core-hooks";
|
|
9
|
+
* const { token } = useToken();
|
|
10
|
+
*
|
|
11
|
+
* @see {@link ITokenContext}
|
|
12
|
+
*/
|
|
13
|
+
export declare const useToken: () => ITokenContext;
|
|
14
|
+
interface IProps {
|
|
15
|
+
value: ITokenContext;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* This is a provider for the TokenContext.
|
|
20
|
+
*/
|
|
21
|
+
export declare const TokenProvider: (props: IProps) => JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { ICurrentUserContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
interface Props {
|
|
4
|
-
value: ICurrentUserContext;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* This is a provider for the CurrentUserContext.
|
|
9
|
-
*/
|
|
10
|
-
export declare const CurrentUserProvider: (props: Props) => JSX.Element;
|
|
11
|
-
/**
|
|
12
|
-
* This is a hook providing the CurrentUserContext.
|
|
13
|
-
*
|
|
14
|
-
* @requires CurrentUserProvider
|
|
15
|
-
* @example
|
|
16
|
-
* import { useCurrentUser } from "@trackunit/react-core-hooks";
|
|
17
|
-
* const { assumedUser, accountId } = useCurrentUser();
|
|
18
|
-
*
|
|
19
|
-
* //use it for something
|
|
20
|
-
* const { data, loading } = useGetAccountByIdQuery({
|
|
21
|
-
* variables: { accountId: assumedUser?.accountId || accountId || "" },
|
|
22
|
-
* });
|
|
23
|
-
*
|
|
24
|
-
* @see {@link ICurrentUserContext}
|
|
25
|
-
*/
|
|
26
|
-
export declare const useCurrentUser: () => ICurrentUserContext;
|
|
27
|
-
export {};
|
|
1
|
+
import { ICurrentUserContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface Props {
|
|
4
|
+
value: ICurrentUserContext;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This is a provider for the CurrentUserContext.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CurrentUserProvider: (props: Props) => JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* This is a hook providing the CurrentUserContext.
|
|
13
|
+
*
|
|
14
|
+
* @requires CurrentUserProvider
|
|
15
|
+
* @example
|
|
16
|
+
* import { useCurrentUser } from "@trackunit/react-core-hooks";
|
|
17
|
+
* const { assumedUser, accountId } = useCurrentUser();
|
|
18
|
+
*
|
|
19
|
+
* //use it for something
|
|
20
|
+
* const { data, loading } = useGetAccountByIdQuery({
|
|
21
|
+
* variables: { accountId: assumedUser?.accountId || accountId || "" },
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* @see {@link ICurrentUserContext}
|
|
25
|
+
*/
|
|
26
|
+
export declare const useCurrentUser: () => ICurrentUserContext;
|
|
27
|
+
export {};
|