@tanstack/react-router 1.43.12 → 1.43.13
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/cjs/Matches.d.cts +1 -1
- package/dist/cjs/ScriptOnce.d.cts +0 -1
- package/dist/cjs/fileRoute.d.cts +24 -24
- package/dist/cjs/route.d.cts +3 -3
- package/dist/cjs/router.d.cts +2 -2
- package/dist/esm/Matches.d.ts +1 -1
- package/dist/esm/ScriptOnce.d.ts +0 -1
- package/dist/esm/fileRoute.d.ts +24 -24
- package/dist/esm/route.d.ts +3 -3
- package/dist/esm/router.d.ts +2 -2
- package/package.json +2 -2
package/dist/cjs/Matches.d.cts
CHANGED
|
@@ -46,7 +46,7 @@ export interface MatchRouteOptions {
|
|
|
46
46
|
fuzzy?: boolean;
|
|
47
47
|
}
|
|
48
48
|
export type UseMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> = RoutePaths<TRouter['routeTree']>, TTo extends string = '', TMaskFrom extends RoutePaths<TRouter['routeTree']> = TFrom, TMaskTo extends string = '', TOptions extends ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> = ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>, TRelaxedOptions = Omit<TOptions, 'search' | 'params'> & DeepPartial<Pick<TOptions, 'search' | 'params'>>> = TRelaxedOptions & MatchRouteOptions;
|
|
49
|
-
export declare function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>(): <TFrom extends
|
|
49
|
+
export declare function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>(): <TFrom extends RoutePaths<TRouter["routeTree"]> | string = string, TTo extends string = "", TMaskFrom extends RoutePaths<TRouter["routeTree"]> | string = TFrom, TMaskTo extends string = "", TResolved extends string = ResolveRelativePath<TFrom, NoInfer<TTo>>>(opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => false | RouteByPath<TRouter["routeTree"], TResolved>["types"]["allParams"];
|
|
50
50
|
export type MakeMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> = RoutePaths<TRouter['routeTree']>, TTo extends string = '', TMaskFrom extends RoutePaths<TRouter['routeTree']> = TFrom, TMaskTo extends string = ''> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
|
|
51
51
|
children?: ((params?: RouteByPath<TRouter['routeTree'], ResolveRelativePath<TFrom, NoInfer<TTo>>>['types']['allParams']) => ReactNode) | React.ReactNode;
|
|
52
52
|
};
|
package/dist/cjs/fileRoute.d.cts
CHANGED
|
@@ -13,26 +13,26 @@ export declare function createFileRoute<TFilePath extends keyof FileRoutesByPath
|
|
|
13
13
|
parse: (input: TSearchSchemaInput) => TSearchSchema;
|
|
14
14
|
} | undefined;
|
|
15
15
|
shouldReload?: boolean | ((match: import('./route').LoaderFnContext<TAllParams, TFullSearchSchema, TAllContext>) => any) | undefined;
|
|
16
|
-
beforeLoad?: ((ctx: import('./route').BeforeLoadContext<TFullSearchSchema, TAllParams, InferAllContext<TParentRoute>>) =>
|
|
16
|
+
beforeLoad?: ((ctx: import('./route').BeforeLoadContext<TFullSearchSchema, TAllParams, InferAllContext<TParentRoute>>) => Promise<TRouteContextReturn> | TRouteContextReturn | void) | undefined;
|
|
17
17
|
loaderDeps?: ((opts: import('./route').FullSearchSchemaOption<TFullSearchSchema>) => TLoaderDeps) | undefined;
|
|
18
18
|
loader?: ((ctx: import('./route').LoaderFnContext<TAllParams, TLoaderDeps, TAllContext>) => TLoaderDataReturn | Promise<TLoaderDataReturn>) | undefined;
|
|
19
19
|
} & import('./route').ParamsOptions<TPath, TParams> & {
|
|
20
|
-
caseSensitive?: boolean
|
|
21
|
-
wrapInSuspense?: boolean
|
|
22
|
-
component?: import('./route').RouteComponent
|
|
23
|
-
errorComponent?: false | import('./route').ErrorRouteComponent
|
|
24
|
-
notFoundComponent?: import('./route').NotFoundRouteComponent
|
|
25
|
-
pendingComponent?: import('./route').RouteComponent
|
|
26
|
-
pendingMs?: number
|
|
27
|
-
pendingMinMs?: number
|
|
28
|
-
staleTime?: number
|
|
29
|
-
gcTime?: number
|
|
30
|
-
preloadStaleTime?: number
|
|
31
|
-
preloadGcTime?: number
|
|
20
|
+
caseSensitive?: boolean;
|
|
21
|
+
wrapInSuspense?: boolean;
|
|
22
|
+
component?: import('./route').RouteComponent;
|
|
23
|
+
errorComponent?: false | null | import('./route').ErrorRouteComponent;
|
|
24
|
+
notFoundComponent?: import('./route').NotFoundRouteComponent;
|
|
25
|
+
pendingComponent?: import('./route').RouteComponent;
|
|
26
|
+
pendingMs?: number;
|
|
27
|
+
pendingMinMs?: number;
|
|
28
|
+
staleTime?: number;
|
|
29
|
+
gcTime?: number;
|
|
30
|
+
preloadStaleTime?: number;
|
|
31
|
+
preloadGcTime?: number;
|
|
32
32
|
preSearchFilters?: import('./route').SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
33
33
|
postSearchFilters?: import('./route').SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
34
|
-
onCatch?: (
|
|
35
|
-
onError?: (
|
|
34
|
+
onCatch?: (error: Error, errorInfo: import('react').ErrorInfo) => void;
|
|
35
|
+
onError?: (err: any) => void;
|
|
36
36
|
onEnter?: ((match: import('./Matches').RouteMatch<TId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>) => void) | undefined;
|
|
37
37
|
onStay?: ((match: import('./Matches').RouteMatch<TId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>) => void) | undefined;
|
|
38
38
|
onLeave?: ((match: import('./Matches').RouteMatch<TId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>) => void) | undefined;
|
|
@@ -40,14 +40,14 @@ export declare function createFileRoute<TFilePath extends keyof FileRoutesByPath
|
|
|
40
40
|
matches: import('./Matches').RouteMatch<TId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>[];
|
|
41
41
|
params: TAllParams;
|
|
42
42
|
loaderData: TLoaderData;
|
|
43
|
-
}) =>
|
|
44
|
-
links?: (
|
|
45
|
-
scripts?: (
|
|
43
|
+
}) => Array<import("react").JSX.IntrinsicElements["meta"]>) | undefined;
|
|
44
|
+
links?: () => Array<import("react").JSX.IntrinsicElements["link"]>;
|
|
45
|
+
scripts?: () => Array<import("react").JSX.IntrinsicElements["script"]>;
|
|
46
46
|
headers?: ((ctx: {
|
|
47
47
|
loaderData: TLoaderData;
|
|
48
48
|
}) => Record<string, string>) | undefined;
|
|
49
49
|
} & {
|
|
50
|
-
staticData?: import('./route').StaticDataRouteOption
|
|
50
|
+
staticData?: import('./route').StaticDataRouteOption;
|
|
51
51
|
}) | undefined) => Route<TParentRoute, TPath, TFullPath, TFilePath, TId, TSearchSchemaInput, TSearchSchema, TSearchSchemaUsed, TFullSearchSchemaInput, TFullSearchSchema, TParams, TAllParams, TRouteContextReturn, TRouteContext, TAllContext, TLoaderDeps, TLoaderDataReturn, TLoaderData, TChildren>;
|
|
52
52
|
/**
|
|
53
53
|
@deprecated It's no longer recommended to use the `FileRoute` class directly.
|
|
@@ -79,19 +79,19 @@ export declare class LazyRoute<TRoute extends AnyRoute> {
|
|
|
79
79
|
select?: (match: TRouteMatch) => TSelected;
|
|
80
80
|
}) => TSelected;
|
|
81
81
|
useRouteContext: <TSelected = TRoute["types"]["allContext"]>(opts?: {
|
|
82
|
-
select?: (s: TRoute[
|
|
82
|
+
select?: (s: TRoute["types"]["allContext"]) => TSelected;
|
|
83
83
|
}) => TSelected;
|
|
84
84
|
useSearch: <TSelected = TRoute["types"]["fullSearchSchema"]>(opts?: {
|
|
85
|
-
select?: (s: TRoute[
|
|
85
|
+
select?: (s: TRoute["types"]["fullSearchSchema"]) => TSelected;
|
|
86
86
|
}) => TSelected;
|
|
87
87
|
useParams: <TSelected = TRoute["types"]["allParams"]>(opts?: {
|
|
88
|
-
select?: (s: TRoute[
|
|
88
|
+
select?: (s: TRoute["types"]["allParams"]) => TSelected;
|
|
89
89
|
}) => TSelected;
|
|
90
90
|
useLoaderDeps: <TSelected = TRoute["types"]["loaderDeps"]>(opts?: {
|
|
91
|
-
select?: (s: TRoute[
|
|
91
|
+
select?: (s: TRoute["types"]["loaderDeps"]) => TSelected;
|
|
92
92
|
}) => TSelected;
|
|
93
93
|
useLoaderData: <TSelected = TRoute["types"]["loaderData"]>(opts?: {
|
|
94
|
-
select?: (s: TRoute[
|
|
94
|
+
select?: (s: TRoute["types"]["loaderData"]) => TSelected;
|
|
95
95
|
}) => TSelected;
|
|
96
96
|
useNavigate: () => import('./useNavigate').UseNavigateResult<string>;
|
|
97
97
|
}
|
package/dist/cjs/route.d.cts
CHANGED
|
@@ -245,7 +245,7 @@ export declare class RouteApi<TId extends RouteIds<RegisteredRouter['routeTree']
|
|
|
245
245
|
useLoaderData: <TSelected = TLoaderData>(opts?: {
|
|
246
246
|
select?: (s: TLoaderData) => TSelected;
|
|
247
247
|
}) => TSelected;
|
|
248
|
-
useNavigate: () => UseNavigateResult<TRoute[
|
|
248
|
+
useNavigate: () => UseNavigateResult<TRoute["fullPath"]>;
|
|
249
249
|
notFound: (opts?: NotFoundError) => NotFoundError;
|
|
250
250
|
}
|
|
251
251
|
export declare class Route<in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, in out TPath extends RouteConstraints['TPath'] = '/', in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, in out TCustomId extends RouteConstraints['TCustomId'] = string, in out TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, in out TSearchSchemaInput = Record<string, unknown>, in out TSearchSchema = {}, in out TSearchSchemaUsed = ResolveSearchSchemaUsed<TSearchSchemaInput, TSearchSchema>, in out TFullSearchSchemaInput = ResolveFullSearchSchemaInput<TParentRoute, TSearchSchemaUsed>, in out TFullSearchSchema = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, in out TParams = Record<ParsePathParams<TPath>, string>, in out TAllParams = ResolveAllParamsFromParent<TParentRoute, TParams>, TRouteContextReturn = RouteContext, in out TRouteContext = ResolveRouteContext<TRouteContextReturn>, in out TAllContext = ResolveAllContext<TParentRoute, TRouteContext>, in out TLoaderDeps extends Record<string, any> = {}, TLoaderDataReturn = {}, in out TLoaderData = ResolveLoaderData<TLoaderDataReturn>, in out TChildren = unknown> {
|
|
@@ -288,10 +288,10 @@ export declare class Route<in out TParentRoute extends RouteConstraints['TParent
|
|
|
288
288
|
init: (opts: {
|
|
289
289
|
originalIndex: number;
|
|
290
290
|
}) => void;
|
|
291
|
-
addChildren: <const TNewChildren extends Record<string, AnyRoute> |
|
|
291
|
+
addChildren: <const TNewChildren extends Record<string, AnyRoute> | ReadonlyArray<AnyRoute>>(children: TNewChildren) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchSchemaInput, TSearchSchema, TSearchSchemaUsed, TFullSearchSchemaInput, TFullSearchSchema, TParams, TAllParams, TRouteContextReturn, TRouteContext, TAllContext, TLoaderDeps, TLoaderDataReturn, TLoaderData, TNewChildren>;
|
|
292
292
|
updateLoader: <TNewLoaderData = unknown>(options: {
|
|
293
293
|
loader: RouteLoaderFn<TAllParams, TLoaderDeps, TAllContext, TNewLoaderData>;
|
|
294
|
-
}) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchSchemaInput, TSearchSchema, TSearchSchemaUsed, TFullSearchSchemaInput, TFullSearchSchema, TParams, TAllParams, TRouteContextReturn, TRouteContext, TAllContext, TLoaderDeps, TNewLoaderData, TChildren
|
|
294
|
+
}) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchSchemaInput, TSearchSchema, TSearchSchemaUsed, TFullSearchSchemaInput, TFullSearchSchema, TParams, TAllParams, TRouteContextReturn, TRouteContext, TAllContext, TLoaderDeps, TNewLoaderData, TChildren>;
|
|
295
295
|
update: (options: UpdatableRouteOptions<TCustomId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>) => this;
|
|
296
296
|
lazy: (lazyFn: () => Promise<LazyRoute<any>>) => this;
|
|
297
297
|
useMatch: <TRouter extends AnyRouter = AnyRouter, TRouteTree extends AnyRoute = TRouter["routeTree"], TRouteMatch = MakeRouteMatch<TRouteTree, TId>, TSelected = TRouteMatch>(opts?: {
|
package/dist/cjs/router.d.cts
CHANGED
|
@@ -407,8 +407,8 @@ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailing
|
|
|
407
407
|
invalidate: () => Promise<void>;
|
|
408
408
|
resolveRedirect: (err: AnyRedirect) => ResolvedRedirect;
|
|
409
409
|
cleanCache: () => void;
|
|
410
|
-
preloadRoute: <TFrom extends
|
|
411
|
-
matchRoute: <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string = "", TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>>(location: ToOptions<Router<TRouteTree, TTrailingSlashOption, TDehydrated, TSerializedError>, TFrom, TTo>, opts?: MatchRouteOptions) => false | RouteById<TRouteTree, TResolved>[
|
|
410
|
+
preloadRoute: <TFrom extends RoutePaths<TRouteTree> | string = string, TTo extends string = "", TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom, TMaskTo extends string = "">(opts: NavigateOptions<Router<TRouteTree, TTrailingSlashOption, TDehydrated, TSerializedError>, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<Array<AnyRouteMatch> | undefined>;
|
|
411
|
+
matchRoute: <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string = "", TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>>(location: ToOptions<Router<TRouteTree, TTrailingSlashOption, TDehydrated, TSerializedError>, TFrom, TTo>, opts?: MatchRouteOptions) => false | RouteById<TRouteTree, TResolved>["types"]["allParams"];
|
|
412
412
|
dehydrate: () => DehydratedRouter;
|
|
413
413
|
hydrate: () => Promise<void>;
|
|
414
414
|
injectedHtml: Array<() => string>;
|
package/dist/esm/Matches.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export interface MatchRouteOptions {
|
|
|
46
46
|
fuzzy?: boolean;
|
|
47
47
|
}
|
|
48
48
|
export type UseMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> = RoutePaths<TRouter['routeTree']>, TTo extends string = '', TMaskFrom extends RoutePaths<TRouter['routeTree']> = TFrom, TMaskTo extends string = '', TOptions extends ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> = ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>, TRelaxedOptions = Omit<TOptions, 'search' | 'params'> & DeepPartial<Pick<TOptions, 'search' | 'params'>>> = TRelaxedOptions & MatchRouteOptions;
|
|
49
|
-
export declare function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>(): <TFrom extends
|
|
49
|
+
export declare function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>(): <TFrom extends RoutePaths<TRouter["routeTree"]> | string = string, TTo extends string = "", TMaskFrom extends RoutePaths<TRouter["routeTree"]> | string = TFrom, TMaskTo extends string = "", TResolved extends string = ResolveRelativePath<TFrom, NoInfer<TTo>>>(opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => false | RouteByPath<TRouter["routeTree"], TResolved>["types"]["allParams"];
|
|
50
50
|
export type MakeMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> = RoutePaths<TRouter['routeTree']>, TTo extends string = '', TMaskFrom extends RoutePaths<TRouter['routeTree']> = TFrom, TMaskTo extends string = ''> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
|
|
51
51
|
children?: ((params?: RouteByPath<TRouter['routeTree'], ResolveRelativePath<TFrom, NoInfer<TTo>>>['types']['allParams']) => ReactNode) | React.ReactNode;
|
|
52
52
|
};
|
package/dist/esm/ScriptOnce.d.ts
CHANGED
package/dist/esm/fileRoute.d.ts
CHANGED
|
@@ -13,26 +13,26 @@ export declare function createFileRoute<TFilePath extends keyof FileRoutesByPath
|
|
|
13
13
|
parse: (input: TSearchSchemaInput) => TSearchSchema;
|
|
14
14
|
} | undefined;
|
|
15
15
|
shouldReload?: boolean | ((match: import('./route').LoaderFnContext<TAllParams, TFullSearchSchema, TAllContext>) => any) | undefined;
|
|
16
|
-
beforeLoad?: ((ctx: import('./route').BeforeLoadContext<TFullSearchSchema, TAllParams, InferAllContext<TParentRoute>>) =>
|
|
16
|
+
beforeLoad?: ((ctx: import('./route').BeforeLoadContext<TFullSearchSchema, TAllParams, InferAllContext<TParentRoute>>) => Promise<TRouteContextReturn> | TRouteContextReturn | void) | undefined;
|
|
17
17
|
loaderDeps?: ((opts: import('./route').FullSearchSchemaOption<TFullSearchSchema>) => TLoaderDeps) | undefined;
|
|
18
18
|
loader?: ((ctx: import('./route').LoaderFnContext<TAllParams, TLoaderDeps, TAllContext>) => TLoaderDataReturn | Promise<TLoaderDataReturn>) | undefined;
|
|
19
19
|
} & import('./route').ParamsOptions<TPath, TParams> & {
|
|
20
|
-
caseSensitive?: boolean
|
|
21
|
-
wrapInSuspense?: boolean
|
|
22
|
-
component?: import('./route').RouteComponent
|
|
23
|
-
errorComponent?: false | import('./route').ErrorRouteComponent
|
|
24
|
-
notFoundComponent?: import('./route').NotFoundRouteComponent
|
|
25
|
-
pendingComponent?: import('./route').RouteComponent
|
|
26
|
-
pendingMs?: number
|
|
27
|
-
pendingMinMs?: number
|
|
28
|
-
staleTime?: number
|
|
29
|
-
gcTime?: number
|
|
30
|
-
preloadStaleTime?: number
|
|
31
|
-
preloadGcTime?: number
|
|
20
|
+
caseSensitive?: boolean;
|
|
21
|
+
wrapInSuspense?: boolean;
|
|
22
|
+
component?: import('./route').RouteComponent;
|
|
23
|
+
errorComponent?: false | null | import('./route').ErrorRouteComponent;
|
|
24
|
+
notFoundComponent?: import('./route').NotFoundRouteComponent;
|
|
25
|
+
pendingComponent?: import('./route').RouteComponent;
|
|
26
|
+
pendingMs?: number;
|
|
27
|
+
pendingMinMs?: number;
|
|
28
|
+
staleTime?: number;
|
|
29
|
+
gcTime?: number;
|
|
30
|
+
preloadStaleTime?: number;
|
|
31
|
+
preloadGcTime?: number;
|
|
32
32
|
preSearchFilters?: import('./route').SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
33
33
|
postSearchFilters?: import('./route').SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
34
|
-
onCatch?: (
|
|
35
|
-
onError?: (
|
|
34
|
+
onCatch?: (error: Error, errorInfo: import('react').ErrorInfo) => void;
|
|
35
|
+
onError?: (err: any) => void;
|
|
36
36
|
onEnter?: ((match: import('./Matches').RouteMatch<TId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>) => void) | undefined;
|
|
37
37
|
onStay?: ((match: import('./Matches').RouteMatch<TId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>) => void) | undefined;
|
|
38
38
|
onLeave?: ((match: import('./Matches').RouteMatch<TId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>) => void) | undefined;
|
|
@@ -40,14 +40,14 @@ export declare function createFileRoute<TFilePath extends keyof FileRoutesByPath
|
|
|
40
40
|
matches: import('./Matches').RouteMatch<TId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>[];
|
|
41
41
|
params: TAllParams;
|
|
42
42
|
loaderData: TLoaderData;
|
|
43
|
-
}) =>
|
|
44
|
-
links?: (
|
|
45
|
-
scripts?: (
|
|
43
|
+
}) => Array<import("react").JSX.IntrinsicElements["meta"]>) | undefined;
|
|
44
|
+
links?: () => Array<import("react").JSX.IntrinsicElements["link"]>;
|
|
45
|
+
scripts?: () => Array<import("react").JSX.IntrinsicElements["script"]>;
|
|
46
46
|
headers?: ((ctx: {
|
|
47
47
|
loaderData: TLoaderData;
|
|
48
48
|
}) => Record<string, string>) | undefined;
|
|
49
49
|
} & {
|
|
50
|
-
staticData?: import('./route').StaticDataRouteOption
|
|
50
|
+
staticData?: import('./route').StaticDataRouteOption;
|
|
51
51
|
}) | undefined) => Route<TParentRoute, TPath, TFullPath, TFilePath, TId, TSearchSchemaInput, TSearchSchema, TSearchSchemaUsed, TFullSearchSchemaInput, TFullSearchSchema, TParams, TAllParams, TRouteContextReturn, TRouteContext, TAllContext, TLoaderDeps, TLoaderDataReturn, TLoaderData, TChildren>;
|
|
52
52
|
/**
|
|
53
53
|
@deprecated It's no longer recommended to use the `FileRoute` class directly.
|
|
@@ -79,19 +79,19 @@ export declare class LazyRoute<TRoute extends AnyRoute> {
|
|
|
79
79
|
select?: (match: TRouteMatch) => TSelected;
|
|
80
80
|
}) => TSelected;
|
|
81
81
|
useRouteContext: <TSelected = TRoute["types"]["allContext"]>(opts?: {
|
|
82
|
-
select?: (s: TRoute[
|
|
82
|
+
select?: (s: TRoute["types"]["allContext"]) => TSelected;
|
|
83
83
|
}) => TSelected;
|
|
84
84
|
useSearch: <TSelected = TRoute["types"]["fullSearchSchema"]>(opts?: {
|
|
85
|
-
select?: (s: TRoute[
|
|
85
|
+
select?: (s: TRoute["types"]["fullSearchSchema"]) => TSelected;
|
|
86
86
|
}) => TSelected;
|
|
87
87
|
useParams: <TSelected = TRoute["types"]["allParams"]>(opts?: {
|
|
88
|
-
select?: (s: TRoute[
|
|
88
|
+
select?: (s: TRoute["types"]["allParams"]) => TSelected;
|
|
89
89
|
}) => TSelected;
|
|
90
90
|
useLoaderDeps: <TSelected = TRoute["types"]["loaderDeps"]>(opts?: {
|
|
91
|
-
select?: (s: TRoute[
|
|
91
|
+
select?: (s: TRoute["types"]["loaderDeps"]) => TSelected;
|
|
92
92
|
}) => TSelected;
|
|
93
93
|
useLoaderData: <TSelected = TRoute["types"]["loaderData"]>(opts?: {
|
|
94
|
-
select?: (s: TRoute[
|
|
94
|
+
select?: (s: TRoute["types"]["loaderData"]) => TSelected;
|
|
95
95
|
}) => TSelected;
|
|
96
96
|
useNavigate: () => import('./useNavigate').UseNavigateResult<string>;
|
|
97
97
|
}
|
package/dist/esm/route.d.ts
CHANGED
|
@@ -245,7 +245,7 @@ export declare class RouteApi<TId extends RouteIds<RegisteredRouter['routeTree']
|
|
|
245
245
|
useLoaderData: <TSelected = TLoaderData>(opts?: {
|
|
246
246
|
select?: (s: TLoaderData) => TSelected;
|
|
247
247
|
}) => TSelected;
|
|
248
|
-
useNavigate: () => UseNavigateResult<TRoute[
|
|
248
|
+
useNavigate: () => UseNavigateResult<TRoute["fullPath"]>;
|
|
249
249
|
notFound: (opts?: NotFoundError) => NotFoundError;
|
|
250
250
|
}
|
|
251
251
|
export declare class Route<in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, in out TPath extends RouteConstraints['TPath'] = '/', in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, in out TCustomId extends RouteConstraints['TCustomId'] = string, in out TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, in out TSearchSchemaInput = Record<string, unknown>, in out TSearchSchema = {}, in out TSearchSchemaUsed = ResolveSearchSchemaUsed<TSearchSchemaInput, TSearchSchema>, in out TFullSearchSchemaInput = ResolveFullSearchSchemaInput<TParentRoute, TSearchSchemaUsed>, in out TFullSearchSchema = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, in out TParams = Record<ParsePathParams<TPath>, string>, in out TAllParams = ResolveAllParamsFromParent<TParentRoute, TParams>, TRouteContextReturn = RouteContext, in out TRouteContext = ResolveRouteContext<TRouteContextReturn>, in out TAllContext = ResolveAllContext<TParentRoute, TRouteContext>, in out TLoaderDeps extends Record<string, any> = {}, TLoaderDataReturn = {}, in out TLoaderData = ResolveLoaderData<TLoaderDataReturn>, in out TChildren = unknown> {
|
|
@@ -288,10 +288,10 @@ export declare class Route<in out TParentRoute extends RouteConstraints['TParent
|
|
|
288
288
|
init: (opts: {
|
|
289
289
|
originalIndex: number;
|
|
290
290
|
}) => void;
|
|
291
|
-
addChildren: <const TNewChildren extends Record<string, AnyRoute> |
|
|
291
|
+
addChildren: <const TNewChildren extends Record<string, AnyRoute> | ReadonlyArray<AnyRoute>>(children: TNewChildren) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchSchemaInput, TSearchSchema, TSearchSchemaUsed, TFullSearchSchemaInput, TFullSearchSchema, TParams, TAllParams, TRouteContextReturn, TRouteContext, TAllContext, TLoaderDeps, TLoaderDataReturn, TLoaderData, TNewChildren>;
|
|
292
292
|
updateLoader: <TNewLoaderData = unknown>(options: {
|
|
293
293
|
loader: RouteLoaderFn<TAllParams, TLoaderDeps, TAllContext, TNewLoaderData>;
|
|
294
|
-
}) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchSchemaInput, TSearchSchema, TSearchSchemaUsed, TFullSearchSchemaInput, TFullSearchSchema, TParams, TAllParams, TRouteContextReturn, TRouteContext, TAllContext, TLoaderDeps, TNewLoaderData, TChildren
|
|
294
|
+
}) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchSchemaInput, TSearchSchema, TSearchSchemaUsed, TFullSearchSchemaInput, TFullSearchSchema, TParams, TAllParams, TRouteContextReturn, TRouteContext, TAllContext, TLoaderDeps, TNewLoaderData, TChildren>;
|
|
295
295
|
update: (options: UpdatableRouteOptions<TCustomId, TAllParams, TFullSearchSchema, TLoaderData, TAllContext, TRouteContext, TLoaderDeps>) => this;
|
|
296
296
|
lazy: (lazyFn: () => Promise<LazyRoute<any>>) => this;
|
|
297
297
|
useMatch: <TRouter extends AnyRouter = AnyRouter, TRouteTree extends AnyRoute = TRouter["routeTree"], TRouteMatch = MakeRouteMatch<TRouteTree, TId>, TSelected = TRouteMatch>(opts?: {
|
package/dist/esm/router.d.ts
CHANGED
|
@@ -407,8 +407,8 @@ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailing
|
|
|
407
407
|
invalidate: () => Promise<void>;
|
|
408
408
|
resolveRedirect: (err: AnyRedirect) => ResolvedRedirect;
|
|
409
409
|
cleanCache: () => void;
|
|
410
|
-
preloadRoute: <TFrom extends
|
|
411
|
-
matchRoute: <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string = "", TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>>(location: ToOptions<Router<TRouteTree, TTrailingSlashOption, TDehydrated, TSerializedError>, TFrom, TTo>, opts?: MatchRouteOptions) => false | RouteById<TRouteTree, TResolved>[
|
|
410
|
+
preloadRoute: <TFrom extends RoutePaths<TRouteTree> | string = string, TTo extends string = "", TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom, TMaskTo extends string = "">(opts: NavigateOptions<Router<TRouteTree, TTrailingSlashOption, TDehydrated, TSerializedError>, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<Array<AnyRouteMatch> | undefined>;
|
|
411
|
+
matchRoute: <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string = "", TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>>(location: ToOptions<Router<TRouteTree, TTrailingSlashOption, TDehydrated, TSerializedError>, TFrom, TTo>, opts?: MatchRouteOptions) => false | RouteById<TRouteTree, TResolved>["types"]["allParams"];
|
|
412
412
|
dehydrate: () => DehydratedRouter;
|
|
413
413
|
hydrate: () => Promise<void>;
|
|
414
414
|
injectedHtml: Array<() => string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-router",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.13",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@tanstack/react-store": "^0.2.1",
|
|
53
53
|
"tiny-invariant": "^1.3.1",
|
|
54
54
|
"tiny-warning": "^1.0.3",
|
|
55
|
-
"@tanstack/history": "1.43.
|
|
55
|
+
"@tanstack/history": "1.43.13"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@testing-library/jest-dom": "^6.4.5",
|