neouter 0.1.1 → 0.1.2
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 +14 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, ComponentType } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
3
|
|
|
3
4
|
//#region src/types.d.ts
|
|
4
5
|
type Path$1 = string;
|
|
@@ -29,7 +30,7 @@ declare const BaseLink: ({
|
|
|
29
30
|
...props
|
|
30
31
|
}: ComponentProps<"a"> & {
|
|
31
32
|
href: Path$1;
|
|
32
|
-
}) =>
|
|
33
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
33
34
|
//#endregion
|
|
34
35
|
//#region src/hooks/useCreateRoutes.d.ts
|
|
35
36
|
declare const useCreateRoutes: ({
|
|
@@ -38,7 +39,15 @@ declare const useCreateRoutes: ({
|
|
|
38
39
|
}: {
|
|
39
40
|
routes: Routes;
|
|
40
41
|
notFoundComponent?: React.ComponentType;
|
|
41
|
-
}) =>
|
|
42
|
+
}) => {
|
|
43
|
+
paths: string[];
|
|
44
|
+
RouterProvider: ({
|
|
45
|
+
children
|
|
46
|
+
}: {
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
49
|
+
Router: () => react_jsx_runtime0.JSX.Element;
|
|
50
|
+
};
|
|
42
51
|
//#endregion
|
|
43
52
|
//#region src/hooks/usePathParams.d.ts
|
|
44
53
|
declare const usePathParams: <Path extends string>() => ParamsObject<Path> | null;
|
|
@@ -47,10 +56,10 @@ declare const usePathParams: <Path extends string>() => ParamsObject<Path> | nul
|
|
|
47
56
|
type Options = {
|
|
48
57
|
noThrowError?: boolean;
|
|
49
58
|
};
|
|
50
|
-
declare const useQueryParams: <T extends Record<string, QueryParamsValueType>>(expectedTypes: T, options?: Options) =>
|
|
59
|
+
declare const useQueryParams: <T extends Record<string, QueryParamsValueType>>(expectedTypes: T, options?: Options) => Partial<{ [K in keyof T]: T[K] extends "number" ? number : string }>;
|
|
51
60
|
//#endregion
|
|
52
61
|
//#region src/hooks/useRouter.d.ts
|
|
53
|
-
declare const useRouter: () => readonly [
|
|
62
|
+
declare const useRouter: () => readonly [string, (path: string) => void];
|
|
54
63
|
//#endregion
|
|
55
64
|
//#region src/libs/extractParams.d.ts
|
|
56
65
|
declare const extractParams: <Path extends string, Params extends string = ExtractParams<Path>>(pathPattern: Path, actualPath: string) => Record<Params, string>;
|
|
@@ -62,6 +71,6 @@ declare const getMatchedPath: (routes: Routes, path: string) => Path$1 | null;
|
|
|
62
71
|
declare function lazyImport<U extends string, T$1 extends { [P in U]: ComponentType }>(factory: () => Promise<T$1>, name: U): T$1;
|
|
63
72
|
//#endregion
|
|
64
73
|
//#region src/libs/redirect.d.ts
|
|
65
|
-
declare const redirect: <T extends Path$1>(path: T) => () =>
|
|
74
|
+
declare const redirect: <T extends Path$1>(path: T) => () => react_jsx_runtime0.JSX.Element;
|
|
66
75
|
//#endregion
|
|
67
76
|
export { type AssertPathType, BaseLink, type ExtractParams, type ParamsObject, type Path$1 as Path, type QueryParamsValueType, type Routes, type WithQueryAndHash, extractParams, getMatchedPath, lazyImport, redirect, useCreateRoutes, usePathParams, useQueryParams, useRouter };
|