@hyeonqyu/typed-router-react 1.4.1 → 1.5.0
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 +7 -1
- package/dist/index.d.ts +7 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -6,6 +6,9 @@ type Paths<TObject, TSplitter extends string, TPrev extends string = '', TMaxDep
|
|
|
6
6
|
[K in keyof TObject & string]: TObject[K] extends object ? `${TSplitter}${TPrev extends '' ? K : `${TPrev}${TSplitter}${K}`}` | Paths<TObject[K], TSplitter, TPrev extends '' ? K : `${TPrev}${TSplitter}${K}`, TMaxDepth, [...TDepth, 1]> : `${TSplitter}${TPrev extends '' ? K : `${TPrev}${TSplitter}${K}`}`;
|
|
7
7
|
}[keyof TObject & string];
|
|
8
8
|
|
|
9
|
+
type SearchParamsValue = string | number | boolean | readonly (string | number | boolean)[];
|
|
10
|
+
type SearchParams = Record<string, SearchParamsValue>;
|
|
11
|
+
|
|
9
12
|
type BaseMetadata = NonNullable<unknown>;
|
|
10
13
|
type AnyZodSchema = {
|
|
11
14
|
_input: any;
|
|
@@ -45,11 +48,14 @@ declare const createAppRoutes: <TMetadata extends {
|
|
|
45
48
|
children: ReactNode;
|
|
46
49
|
}) => react_jsx_runtime.JSX.Element;
|
|
47
50
|
useAppRoutes: () => ResolvedRouteTree<TMetadata, TContext, TRouteTree>;
|
|
48
|
-
useCurrentRouteNode: <TPath extends RoutePathname<TMetadata, TContext, TRouteTree>>(pathname: TPath) =>
|
|
51
|
+
useCurrentRouteNode: <TPath extends RoutePathname<TMetadata, TContext, TRouteTree>>(pathname: TPath) => RouteNode<TMetadata, TContext>;
|
|
52
|
+
getPathnameFromNode: (targetNode: RouteNode<TMetadata, TContext>, params?: SearchParams) => string | undefined;
|
|
53
|
+
freezeAppRoutes: () => ResolvedRouteTree<TMetadata, TContext, TRouteTree>;
|
|
49
54
|
_types: {
|
|
50
55
|
AppRoutesMetadata: TMetadata;
|
|
51
56
|
AppRoutesContext: TContext;
|
|
52
57
|
AppRoutesPathname: RoutePathname<TMetadata, TContext, TRouteTree>;
|
|
58
|
+
AppRouteNode: RouteNode<TMetadata, TContext>;
|
|
53
59
|
};
|
|
54
60
|
};
|
|
55
61
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ type Paths<TObject, TSplitter extends string, TPrev extends string = '', TMaxDep
|
|
|
6
6
|
[K in keyof TObject & string]: TObject[K] extends object ? `${TSplitter}${TPrev extends '' ? K : `${TPrev}${TSplitter}${K}`}` | Paths<TObject[K], TSplitter, TPrev extends '' ? K : `${TPrev}${TSplitter}${K}`, TMaxDepth, [...TDepth, 1]> : `${TSplitter}${TPrev extends '' ? K : `${TPrev}${TSplitter}${K}`}`;
|
|
7
7
|
}[keyof TObject & string];
|
|
8
8
|
|
|
9
|
+
type SearchParamsValue = string | number | boolean | readonly (string | number | boolean)[];
|
|
10
|
+
type SearchParams = Record<string, SearchParamsValue>;
|
|
11
|
+
|
|
9
12
|
type BaseMetadata = NonNullable<unknown>;
|
|
10
13
|
type AnyZodSchema = {
|
|
11
14
|
_input: any;
|
|
@@ -45,11 +48,14 @@ declare const createAppRoutes: <TMetadata extends {
|
|
|
45
48
|
children: ReactNode;
|
|
46
49
|
}) => react_jsx_runtime.JSX.Element;
|
|
47
50
|
useAppRoutes: () => ResolvedRouteTree<TMetadata, TContext, TRouteTree>;
|
|
48
|
-
useCurrentRouteNode: <TPath extends RoutePathname<TMetadata, TContext, TRouteTree>>(pathname: TPath) =>
|
|
51
|
+
useCurrentRouteNode: <TPath extends RoutePathname<TMetadata, TContext, TRouteTree>>(pathname: TPath) => RouteNode<TMetadata, TContext>;
|
|
52
|
+
getPathnameFromNode: (targetNode: RouteNode<TMetadata, TContext>, params?: SearchParams) => string | undefined;
|
|
53
|
+
freezeAppRoutes: () => ResolvedRouteTree<TMetadata, TContext, TRouteTree>;
|
|
49
54
|
_types: {
|
|
50
55
|
AppRoutesMetadata: TMetadata;
|
|
51
56
|
AppRoutesContext: TContext;
|
|
52
57
|
AppRoutesPathname: RoutePathname<TMetadata, TContext, TRouteTree>;
|
|
58
|
+
AppRouteNode: RouteNode<TMetadata, TContext>;
|
|
53
59
|
};
|
|
54
60
|
};
|
|
55
61
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyeonqyu/typed-router-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Type-safe IA-first routing for React Router",
|
|
5
5
|
"author": "hyeonQyu <dhk0561@naver.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-router-dom": "^6.0.0 || ^7.0.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@hyeonqyu/typed-router-core": "^1.
|
|
53
|
+
"@hyeonqyu/typed-router-core": "^1.5.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.5",
|