clear-react-router 1.0.3 → 1.0.5
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/components/Link.d.ts +1 -1
- package/dist/components/Router.d.ts +1 -1
- package/dist/context/RouterContext.d.ts +5 -5
- package/dist/hooks/useBlocker.d.ts +1 -1
- package/dist/hooks/useHandleNavigation.d.ts +1 -1
- package/dist/hooks/useLatest.d.ts +1 -1
- package/dist/hooks/useLoader.d.ts +3 -3
- package/dist/hooks/useLocation.d.ts +1 -1
- package/dist/hooks/useNavigate.d.ts +1 -1
- package/dist/hooks/useServiceContext.d.ts +3 -3
- package/dist/index.d.ts +1 -2
- package/dist/index.js +437 -515
- package/dist/provider/RouterProvider.d.ts +2 -2
- package/dist/types/global.d.ts +1 -1
- package/dist/utils/createLazyComponent.d.ts +1 -1
- package/dist/utils/renderElement.d.ts +1 -1
- package/dist/utils/utils.d.ts +1 -1
- package/package.json +25 -26
- package/README.md +0 -169
- package/dist/vite.config.d.ts +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockerState, Location, UpdateBlockedRouteProps } from '../types/global
|
|
1
|
+
import type { BlockerState, Location, UpdateBlockedRouteProps } from '../types/global';
|
|
2
2
|
export type NavigationContextValue = {
|
|
3
3
|
location: Location;
|
|
4
4
|
params: Record<string, string>;
|
|
@@ -11,9 +11,9 @@ export type ActionsContextValue = {
|
|
|
11
11
|
setContext(arg: object): void;
|
|
12
12
|
};
|
|
13
13
|
export type DataContextValue = {
|
|
14
|
-
loaderCache:
|
|
14
|
+
loaderCache: unknown;
|
|
15
15
|
context: Record<string, unknown>;
|
|
16
16
|
};
|
|
17
|
-
export declare const ActionsContext: import(
|
|
18
|
-
export declare const DataContext: import(
|
|
19
|
-
export declare const NavigationContext: import(
|
|
17
|
+
export declare const ActionsContext: import("react").Context<ActionsContextValue>;
|
|
18
|
+
export declare const DataContext: import("react").Context<DataContextValue>;
|
|
19
|
+
export declare const NavigationContext: import("react").Context<NavigationContextValue>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockerState, Location, RouteItem, UpdateBlockedRouteProps } from '../types/global.ts';
|
|
1
|
+
import type { BlockerState, Location, RouteItem, UpdateBlockedRouteProps } from '../types/global.ts';
|
|
2
2
|
type UseHandleNavigation = {
|
|
3
3
|
routeList: RouteItem[];
|
|
4
4
|
setLocation: (arg: Location) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useLatest: <T>(value: T) => import(
|
|
1
|
+
export declare const useLatest: <T>(value: T) => import("react").RefObject<T>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RouteItem } from '../types/global.ts';
|
|
1
|
+
import type { RouteItem } from '../types/global.ts';
|
|
2
2
|
export declare const useLoader: (routeList: RouteItem[]) => {
|
|
3
|
-
loaderCache:
|
|
3
|
+
loaderCache: unknown;
|
|
4
4
|
loaderError: boolean;
|
|
5
5
|
prefetchLoader: (pathname: string) => Promise<void>;
|
|
6
6
|
revalidateCache: (routeItem?: RouteItem) => Promise<void>;
|
|
7
|
-
|
|
7
|
+
isLoading: boolean;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useLocation: () => import(
|
|
1
|
+
export declare const useLocation: () => import("../types/global").Location;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Location } from '../types/global.ts';
|
|
1
|
+
import type { Location } from '../types/global.ts';
|
|
2
2
|
export declare const useNavigate: () => (arg: Location | -1) => Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const useNavigationState: () => import(
|
|
2
|
-
export declare const useRouterActions: () => import(
|
|
3
|
-
export declare const useRouterData: () => import(
|
|
1
|
+
export declare const useNavigationState: () => import("../context/RouterContext").NavigationContextValue;
|
|
2
|
+
export declare const useRouterActions: () => import("../context/RouterContext").ActionsContextValue;
|
|
3
|
+
export declare const useRouterData: () => import("../context/RouterContext").DataContextValue;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,5 @@ export { useLoaderState } from './hooks/useLoaderState';
|
|
|
7
7
|
export { useBlocker } from './hooks/useBlocker';
|
|
8
8
|
export { useBeforeUnload } from './hooks/useBeforeUnload';
|
|
9
9
|
export { useRouterContext } from './hooks/useRouterContext';
|
|
10
|
-
export { createRouter
|
|
10
|
+
export { createRouter } from './utils/utils';
|
|
11
11
|
export { redirect } from './utils/redirect';
|
|
12
|
-
export type { ClientRouteItem, RouteItem, Location, BlockerState } from './types/global';
|