@tanstack/react-router 1.112.11 → 1.112.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.
Files changed (136) hide show
  1. package/dist/cjs/Match.cjs +2 -2
  2. package/dist/cjs/Match.cjs.map +1 -1
  3. package/dist/cjs/Matches.cjs.map +1 -1
  4. package/dist/cjs/Matches.d.cts +1 -8
  5. package/dist/cjs/RouterProvider.cjs.map +1 -1
  6. package/dist/cjs/RouterProvider.d.cts +2 -2
  7. package/dist/cjs/Transitioner.cjs +1 -1
  8. package/dist/cjs/Transitioner.cjs.map +1 -1
  9. package/dist/cjs/fileRoute.cjs.map +1 -1
  10. package/dist/cjs/fileRoute.d.cts +4 -7
  11. package/dist/cjs/index.d.cts +4 -6
  12. package/dist/cjs/link.cjs.map +1 -1
  13. package/dist/cjs/link.d.cts +1 -2
  14. package/dist/cjs/not-found.cjs.map +1 -1
  15. package/dist/cjs/not-found.d.cts +1 -2
  16. package/dist/cjs/redirects.cjs.map +1 -1
  17. package/dist/cjs/redirects.d.cts +1 -2
  18. package/dist/cjs/renderRouteNotFound.cjs.map +1 -1
  19. package/dist/cjs/renderRouteNotFound.d.cts +1 -2
  20. package/dist/cjs/route.cjs +15 -23
  21. package/dist/cjs/route.cjs.map +1 -1
  22. package/dist/cjs/route.d.cts +18 -43
  23. package/dist/cjs/router.cjs +18 -20
  24. package/dist/cjs/router.cjs.map +1 -1
  25. package/dist/cjs/router.d.cts +82 -458
  26. package/dist/cjs/routerContext.cjs.map +1 -1
  27. package/dist/cjs/routerContext.d.cts +2 -2
  28. package/dist/cjs/scroll-restoration.cjs.map +1 -1
  29. package/dist/cjs/scroll-restoration.d.cts +1 -2
  30. package/dist/cjs/structuralSharing.d.cts +1 -2
  31. package/dist/cjs/typePrimitives.d.cts +1 -2
  32. package/dist/cjs/useBlocker.cjs.map +1 -1
  33. package/dist/cjs/useBlocker.d.cts +1 -3
  34. package/dist/cjs/useLoaderData.cjs.map +1 -1
  35. package/dist/cjs/useLoaderData.d.cts +1 -2
  36. package/dist/cjs/useLoaderDeps.cjs.map +1 -1
  37. package/dist/cjs/useLoaderDeps.d.cts +1 -2
  38. package/dist/cjs/useLocation.cjs.map +1 -1
  39. package/dist/cjs/useLocation.d.cts +1 -1
  40. package/dist/cjs/useMatch.cjs.map +1 -1
  41. package/dist/cjs/useMatch.d.cts +1 -2
  42. package/dist/cjs/useNavigate.cjs.map +1 -1
  43. package/dist/cjs/useNavigate.d.cts +1 -2
  44. package/dist/cjs/useParams.cjs.map +1 -1
  45. package/dist/cjs/useParams.d.cts +1 -2
  46. package/dist/cjs/useRouteContext.cjs.map +1 -1
  47. package/dist/cjs/useRouteContext.d.cts +1 -2
  48. package/dist/cjs/useRouter.cjs.map +1 -1
  49. package/dist/cjs/useRouter.d.cts +1 -1
  50. package/dist/cjs/useRouterState.cjs.map +1 -1
  51. package/dist/cjs/useRouterState.d.cts +1 -1
  52. package/dist/cjs/useSearch.cjs.map +1 -1
  53. package/dist/cjs/useSearch.d.cts +1 -2
  54. package/dist/cjs/utils.d.cts +1 -1
  55. package/dist/esm/Match.js +2 -2
  56. package/dist/esm/Match.js.map +1 -1
  57. package/dist/esm/Matches.d.ts +1 -8
  58. package/dist/esm/Matches.js.map +1 -1
  59. package/dist/esm/RouterProvider.d.ts +2 -2
  60. package/dist/esm/RouterProvider.js.map +1 -1
  61. package/dist/esm/Transitioner.js +1 -1
  62. package/dist/esm/Transitioner.js.map +1 -1
  63. package/dist/esm/fileRoute.d.ts +4 -7
  64. package/dist/esm/fileRoute.js.map +1 -1
  65. package/dist/esm/index.d.ts +4 -6
  66. package/dist/esm/link.d.ts +1 -2
  67. package/dist/esm/link.js.map +1 -1
  68. package/dist/esm/not-found.d.ts +1 -2
  69. package/dist/esm/not-found.js.map +1 -1
  70. package/dist/esm/redirects.d.ts +1 -2
  71. package/dist/esm/redirects.js.map +1 -1
  72. package/dist/esm/renderRouteNotFound.d.ts +1 -2
  73. package/dist/esm/renderRouteNotFound.js.map +1 -1
  74. package/dist/esm/route.d.ts +18 -43
  75. package/dist/esm/route.js +15 -23
  76. package/dist/esm/route.js.map +1 -1
  77. package/dist/esm/router.d.ts +82 -458
  78. package/dist/esm/router.js +18 -20
  79. package/dist/esm/router.js.map +1 -1
  80. package/dist/esm/routerContext.d.ts +2 -2
  81. package/dist/esm/routerContext.js.map +1 -1
  82. package/dist/esm/scroll-restoration.d.ts +1 -2
  83. package/dist/esm/scroll-restoration.js.map +1 -1
  84. package/dist/esm/structuralSharing.d.ts +1 -2
  85. package/dist/esm/typePrimitives.d.ts +1 -2
  86. package/dist/esm/useBlocker.d.ts +1 -3
  87. package/dist/esm/useBlocker.js.map +1 -1
  88. package/dist/esm/useLoaderData.d.ts +1 -2
  89. package/dist/esm/useLoaderData.js.map +1 -1
  90. package/dist/esm/useLoaderDeps.d.ts +1 -2
  91. package/dist/esm/useLoaderDeps.js.map +1 -1
  92. package/dist/esm/useLocation.d.ts +1 -1
  93. package/dist/esm/useLocation.js.map +1 -1
  94. package/dist/esm/useMatch.d.ts +1 -2
  95. package/dist/esm/useMatch.js.map +1 -1
  96. package/dist/esm/useNavigate.d.ts +1 -2
  97. package/dist/esm/useNavigate.js.map +1 -1
  98. package/dist/esm/useParams.d.ts +1 -2
  99. package/dist/esm/useParams.js.map +1 -1
  100. package/dist/esm/useRouteContext.d.ts +1 -2
  101. package/dist/esm/useRouteContext.js.map +1 -1
  102. package/dist/esm/useRouter.d.ts +1 -1
  103. package/dist/esm/useRouter.js.map +1 -1
  104. package/dist/esm/useRouterState.d.ts +1 -1
  105. package/dist/esm/useRouterState.js.map +1 -1
  106. package/dist/esm/useSearch.d.ts +1 -2
  107. package/dist/esm/useSearch.js.map +1 -1
  108. package/dist/esm/utils.d.ts +1 -1
  109. package/package.json +2 -2
  110. package/src/Match.tsx +7 -4
  111. package/src/Matches.tsx +4 -8
  112. package/src/RouterProvider.tsx +2 -8
  113. package/src/Transitioner.tsx +1 -1
  114. package/src/fileRoute.ts +9 -25
  115. package/src/index.tsx +20 -26
  116. package/src/link.tsx +2 -2
  117. package/src/not-found.tsx +1 -2
  118. package/src/redirects.ts +1 -1
  119. package/src/renderRouteNotFound.tsx +1 -2
  120. package/src/route.ts +91 -211
  121. package/src/router.ts +151 -610
  122. package/src/routerContext.tsx +1 -1
  123. package/src/scroll-restoration.tsx +5 -2
  124. package/src/structuralSharing.ts +1 -1
  125. package/src/typePrimitives.ts +2 -2
  126. package/src/useBlocker.tsx +6 -3
  127. package/src/useLoaderData.tsx +2 -1
  128. package/src/useLoaderDeps.tsx +2 -1
  129. package/src/useLocation.tsx +5 -1
  130. package/src/useMatch.tsx +2 -1
  131. package/src/useNavigate.tsx +2 -1
  132. package/src/useParams.tsx +2 -1
  133. package/src/useRouteContext.ts +2 -1
  134. package/src/useRouter.tsx +1 -1
  135. package/src/useRouterState.tsx +5 -1
  136. package/src/useSearch.tsx +2 -1
package/src/fileRoute.ts CHANGED
@@ -10,21 +10,20 @@ import { useNavigate } from './useNavigate'
10
10
  import type { UseParamsRoute } from './useParams'
11
11
  import type { UseMatchRoute } from './useMatch'
12
12
  import type { UseSearchRoute } from './useSearch'
13
-
14
- import type { AnyRoute, Route, RouteConstraints } from './route'
15
- import type { RegisteredRouter } from './router'
16
13
  import type {
17
14
  AnyContext,
18
- AnyRoute as AnyCoreRoute,
19
- AnyPathParams,
15
+ AnyRoute,
20
16
  AnyRouter,
21
- AnyValidator,
22
17
  Constrain,
23
18
  ConstrainLiteral,
24
19
  FileBaseRouteOptions,
25
20
  FileRoutesByPath,
21
+ LazyRouteOptions,
22
+ RegisteredRouter,
26
23
  ResolveParams,
24
+ Route,
27
25
  RouteById,
26
+ RouteConstraints,
28
27
  RouteIds,
29
28
  RouteLoaderFn,
30
29
  UpdatableRouteOptions,
@@ -115,7 +114,8 @@ export class FileRoute<
115
114
  TBeforeLoadFn,
116
115
  TLoaderDeps,
117
116
  TLoaderFn,
118
- TChildren
117
+ TChildren,
118
+ unknown
119
119
  > => {
120
120
  warning(
121
121
  this.silent,
@@ -158,23 +158,7 @@ export function FileRouteLoader<
158
158
  return (loaderFn) => loaderFn as any
159
159
  }
160
160
 
161
- export type LazyRouteOptions = Pick<
162
- UpdatableRouteOptions<
163
- AnyRoute,
164
- string,
165
- string,
166
- AnyPathParams,
167
- AnyValidator,
168
- {},
169
- AnyContext,
170
- AnyContext,
171
- AnyContext,
172
- AnyContext
173
- >,
174
- 'component' | 'errorComponent' | 'pendingComponent' | 'notFoundComponent'
175
- >
176
-
177
- export class LazyRoute<TRoute extends AnyCoreRoute> {
161
+ export class LazyRoute<TRoute extends AnyRoute> {
178
162
  options: {
179
163
  id: string
180
164
  } & LazyRouteOptions
@@ -237,7 +221,7 @@ export class LazyRoute<TRoute extends AnyCoreRoute> {
237
221
  export function createLazyRoute<
238
222
  TRouter extends AnyRouter = RegisteredRouter,
239
223
  TId extends string = string,
240
- TRoute extends AnyCoreRoute = RouteById<TRouter['routeTree'], TId>,
224
+ TRoute extends AnyRoute = RouteById<TRouter['routeTree'], TId>,
241
225
  >(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {
242
226
  return (opts: LazyRouteOptions) => {
243
227
  return new LazyRoute<TRoute>({
package/src/index.tsx CHANGED
@@ -38,6 +38,7 @@ export {
38
38
  } from '@tanstack/router-core'
39
39
 
40
40
  export type {
41
+ AnyRoute,
41
42
  StartSerializer,
42
43
  Serializable,
43
44
  SerializerParse,
@@ -154,7 +155,6 @@ export {
154
155
  createLazyRoute,
155
156
  createLazyFileRoute,
156
157
  } from './fileRoute'
157
- export type { LazyRouteOptions } from './fileRoute'
158
158
 
159
159
  export * from './history'
160
160
 
@@ -215,6 +215,24 @@ export type {
215
215
  UpdatableRouteOptions,
216
216
  RouteLoaderFn,
217
217
  LoaderFnContext,
218
+ LazyRouteOptions,
219
+ AnyRouter,
220
+ RegisteredRouter,
221
+ RouterContextOptions,
222
+ ControllablePromise,
223
+ InjectedHtmlEntry,
224
+ RouterOptions,
225
+ RouterErrorSerializer,
226
+ RouterState,
227
+ ListenerFn,
228
+ BuildNextOptions,
229
+ RouterConstructorOptions,
230
+ RouterEvents,
231
+ RouterEvent,
232
+ RouterListener,
233
+ RouteConstraints,
234
+ RouteMask,
235
+ MatchRouteOptions,
218
236
  } from '@tanstack/router-core'
219
237
  export type {
220
238
  UseLinkPropsOptions,
@@ -234,11 +252,7 @@ export {
234
252
  useChildMatches,
235
253
  } from './Matches'
236
254
 
237
- export type {
238
- MatchRouteOptions,
239
- UseMatchRouteOptions,
240
- MakeMatchRouteOptions,
241
- } from './Matches'
255
+ export type { UseMatchRouteOptions, MakeMatchRouteOptions } from './Matches'
242
256
 
243
257
  export { matchContext } from './matchContext'
244
258
  export { Match, Outlet } from './Match'
@@ -262,10 +276,7 @@ export {
262
276
  NotFoundRoute,
263
277
  } from './route'
264
278
  export type {
265
- AnyRoute,
266
- RouteConstraints,
267
279
  AnyRootRoute,
268
- RouteMask,
269
280
  ReactNode,
270
281
  SyncRouteComponent,
271
282
  AsyncRouteComponent,
@@ -284,23 +295,6 @@ export {
284
295
  getInitialRouterState,
285
296
  } from './router'
286
297
 
287
- export type {
288
- AnyRouter,
289
- RegisteredRouter,
290
- RouterContextOptions,
291
- RouterOptions,
292
- RouterErrorSerializer,
293
- RouterState,
294
- ListenerFn,
295
- BuildNextOptions,
296
- RouterConstructorOptions,
297
- RouterEvents,
298
- RouterEvent,
299
- RouterListener,
300
- ControllablePromise,
301
- InjectedHtmlEntry,
302
- } from './router'
303
-
304
298
  export { RouterProvider, RouterContextProvider } from './RouterProvider'
305
299
  export type { RouterProps } from './RouterProvider'
306
300
 
package/src/link.tsx CHANGED
@@ -18,13 +18,13 @@ import {
18
18
 
19
19
  import { useMatch } from './useMatch'
20
20
  import type {
21
+ AnyRouter,
21
22
  Constrain,
22
23
  LinkCurrentTargetElement,
23
24
  LinkOptions,
25
+ RegisteredRouter,
24
26
  RoutePaths,
25
27
  } from '@tanstack/router-core'
26
-
27
- import type { AnyRouter, RegisteredRouter } from './router'
28
28
  import type { ReactNode } from 'react'
29
29
  import type {
30
30
  ValidateLinkOptions,
package/src/not-found.tsx CHANGED
@@ -2,8 +2,7 @@ import * as React from 'react'
2
2
  import { CatchBoundary } from './CatchBoundary'
3
3
  import { useRouterState } from './useRouterState'
4
4
  import type { ErrorInfo } from 'react'
5
- import type { RegisteredRouter } from './router'
6
- import type { RouteIds } from '@tanstack/router-core'
5
+ import type { RegisteredRouter, RouteIds } from '@tanstack/router-core'
7
6
 
8
7
  export type NotFoundError = {
9
8
  /**
package/src/redirects.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type {
2
2
  AnyRedirect,
3
3
  Redirect,
4
+ RegisteredRouter,
4
5
  ResolvedRedirect,
5
6
  } from '@tanstack/router-core'
6
- import type { RegisteredRouter } from './router'
7
7
 
8
8
  export function redirect<
9
9
  TRouter extends RegisteredRouter,
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import warning from 'tiny-warning'
3
3
  import { DefaultGlobalNotFound } from './not-found'
4
- import type { AnyRouter } from './router'
5
- import type { AnyRoute } from './route'
4
+ import type { AnyRoute, AnyRouter } from '@tanstack/router-core'
6
5
 
7
6
  export function renderRouteNotFound(
8
7
  router: AnyRouter,
package/src/route.ts CHANGED
@@ -9,26 +9,33 @@ import { useNavigate } from './useNavigate'
9
9
  import { useMatch } from './useMatch'
10
10
  import type {
11
11
  AnyContext,
12
- AnySchema,
12
+ AnyRoute,
13
+ AnyRouter,
13
14
  Constrain,
14
15
  ConstrainLiteral,
15
- RootRoute as CoreRootRoute,
16
+ LazyRoute as CoreLazyRoute,
16
17
  Route as CoreRoute,
17
18
  ErrorComponentProps,
18
19
  NotFoundRouteProps,
20
+ RegisteredRouter,
19
21
  ResolveFullPath,
20
22
  ResolveId,
21
23
  ResolveParams,
22
24
  RootRouteId,
23
25
  RootRouteOptions,
24
- RouteById,
25
- RouteContext,
26
+ RouteAddChildrenFn,
27
+ RouteAddFileChildrenFn,
28
+ RouteAddFileTypesFn,
29
+ RouteConstraints,
26
30
  RouteIds,
31
+ RouteLazyFn,
27
32
  RouteLoaderFn,
33
+ RouteMask,
28
34
  RouteOptions,
29
35
  RoutePathOptionsIntersection,
30
- RoutePaths,
31
36
  RouteTypes,
37
+ RouteTypesById,
38
+ Router,
32
39
  ToMaskOptions,
33
40
  TrimPathRight,
34
41
  UpdatableRouteOptions,
@@ -40,10 +47,7 @@ import type { UseLoaderDepsRoute } from './useLoaderDeps'
40
47
  import type { UseParamsRoute } from './useParams'
41
48
  import type { UseSearchRoute } from './useSearch'
42
49
  import type * as React from 'react'
43
- import type {} from './Matches'
44
- import type { AnyRouter, RegisteredRouter, Router } from './router'
45
50
  import type { NotFoundError } from './not-found'
46
- import type { LazyRoute } from './fileRoute'
47
51
  import type { UseRouteContextRoute } from './useRouteContext'
48
52
 
49
53
  declare module '@tanstack/router-core' {
@@ -53,49 +57,21 @@ declare module '@tanstack/router-core' {
53
57
  notFoundComponent?: NotFoundRouteComponent
54
58
  pendingComponent?: RouteComponent
55
59
  }
56
- }
57
60
 
58
- export interface AnyRoute
59
- extends Route<
60
- any,
61
- any,
62
- any,
63
- any,
64
- any,
65
- any,
66
- any,
67
- any,
68
- any,
69
- any,
70
- any,
71
- any,
72
- any,
73
- any
74
- > {}
75
-
76
- export type RouteConstraints = {
77
- TParentRoute: AnyRoute
78
- TPath: string
79
- TFullPath: string
80
- TCustomId: string
81
- TId: string
82
- TSearchSchema: AnySchema
83
- TFullSearchSchema: AnySchema
84
- TParams: Record<string, any>
85
- TAllParams: Record<string, any>
86
- TParentContext: AnyContext
87
- TRouteContext: RouteContext
88
- TAllContext: AnyContext
89
- TRouterContext: AnyContext
90
- TChildren: unknown
91
- TRouteTree: AnyRoute
61
+ export interface RouteExtensions<
62
+ TId extends string,
63
+ TFullPath extends string,
64
+ > {
65
+ useMatch: UseMatchRoute<TId>
66
+ useRouteContext: UseRouteContextRoute<TId>
67
+ useSearch: UseSearchRoute<TId>
68
+ useParams: UseParamsRoute<TId>
69
+ useLoaderDeps: UseLoaderDepsRoute<TId>
70
+ useLoaderData: UseLoaderDataRoute<TId>
71
+ useNavigate: () => UseNavigateResult<TFullPath>
72
+ }
92
73
  }
93
74
 
94
- export type RouteTypesById<TRouter extends AnyRouter, TId> = RouteById<
95
- TRouter['routeTree'],
96
- TId
97
- >['types']
98
-
99
75
  export function getRouteApi<
100
76
  const TId,
101
77
  TRouter extends AnyRouter = RegisteredRouter,
@@ -205,7 +181,7 @@ export class Route<
205
181
  TFileRouteTypes
206
182
  >
207
183
  {
208
- isRoot: TParentRoute extends Route<any> ? true : false
184
+ isRoot: TParentRoute extends AnyRoute ? true : false
209
185
  options: RouteOptions<
210
186
  TParentRoute,
211
187
  TId,
@@ -270,7 +246,7 @@ export class Route<
270
246
  children?: TChildren
271
247
  originalIndex?: number
272
248
  rank!: number
273
- lazyFn?: () => Promise<LazyRoute<any>>
249
+ lazyFn?: () => Promise<CoreLazyRoute>
274
250
  _lazyPromise?: Promise<void>
275
251
  _componentsPromise?: Promise<Array<void>>
276
252
 
@@ -391,12 +367,7 @@ export class Route<
391
367
  this._ssr = options?.ssr ?? opts.defaultSsr ?? true
392
368
  }
393
369
 
394
- addChildren<const TNewChildren>(
395
- children: Constrain<
396
- TNewChildren,
397
- ReadonlyArray<AnyRoute> | Record<string, AnyRoute>
398
- >,
399
- ): Route<
370
+ addChildren: RouteAddChildrenFn<
400
371
  TParentRoute,
401
372
  TPath,
402
373
  TFullPath,
@@ -409,30 +380,12 @@ export class Route<
409
380
  TBeforeLoadFn,
410
381
  TLoaderDeps,
411
382
  TLoaderFn,
412
- TNewChildren,
413
383
  TFileRouteTypes
414
- > {
415
- return this._addFileChildren(children) as Route<
416
- TParentRoute,
417
- TPath,
418
- TFullPath,
419
- TCustomId,
420
- TId,
421
- TSearchValidator,
422
- TParams,
423
- TRouterContext,
424
- TRouteContextFn,
425
- TBeforeLoadFn,
426
- TLoaderDeps,
427
- TLoaderFn,
428
- TNewChildren,
429
- TFileRouteTypes
430
- >
384
+ > = (children) => {
385
+ return this._addFileChildren(children) as any
431
386
  }
432
387
 
433
- _addFileChildren<const TNewChildren>(
434
- children: TNewChildren,
435
- ): Route<
388
+ _addFileChildren: RouteAddFileChildrenFn<
436
389
  TParentRoute,
437
390
  TPath,
438
391
  TFullPath,
@@ -445,9 +398,8 @@ export class Route<
445
398
  TBeforeLoadFn,
446
399
  TLoaderDeps,
447
400
  TLoaderFn,
448
- TNewChildren,
449
401
  TFileRouteTypes
450
- > {
402
+ > = (children) => {
451
403
  if (Array.isArray(children)) {
452
404
  this.children = children as TChildren
453
405
  }
@@ -456,22 +408,25 @@ export class Route<
456
408
  this.children = Object.values(children) as TChildren
457
409
  }
458
410
 
459
- return this as unknown as Route<
460
- TParentRoute,
461
- TPath,
462
- TFullPath,
463
- TCustomId,
464
- TId,
465
- TSearchValidator,
466
- TParams,
467
- TRouterContext,
468
- TRouteContextFn,
469
- TBeforeLoadFn,
470
- TLoaderDeps,
471
- TLoaderFn,
472
- TNewChildren,
473
- TFileRouteTypes
474
- >
411
+ return this as any
412
+ }
413
+
414
+ _addFileTypes: RouteAddFileTypesFn<
415
+ TParentRoute,
416
+ TPath,
417
+ TFullPath,
418
+ TCustomId,
419
+ TId,
420
+ TSearchValidator,
421
+ TParams,
422
+ TRouterContext,
423
+ TRouteContextFn,
424
+ TBeforeLoadFn,
425
+ TLoaderDeps,
426
+ TLoaderFn,
427
+ TChildren
428
+ > = () => {
429
+ return this as any
475
430
  }
476
431
 
477
432
  updateLoader = <TNewLoaderFn>(options: {
@@ -525,7 +480,7 @@ export class Route<
525
480
  return this
526
481
  }
527
482
 
528
- lazy = (lazyFn: () => Promise<LazyRoute<any>>): this => {
483
+ lazy: RouteLazyFn<this> = (lazyFn) => {
529
484
  this.lazyFn = lazyFn
530
485
  return this
531
486
  }
@@ -612,7 +567,22 @@ export function createRoute<
612
567
  TRouteContextFn,
613
568
  TBeforeLoadFn
614
569
  >,
615
- ) {
570
+ ): CoreRoute<
571
+ TParentRoute,
572
+ TPath,
573
+ TFullPath,
574
+ TCustomId,
575
+ TId,
576
+ TSearchValidator,
577
+ TParams,
578
+ AnyContext,
579
+ TRouteContextFn,
580
+ TBeforeLoadFn,
581
+ TLoaderDeps,
582
+ TLoaderFn,
583
+ TChildren,
584
+ unknown
585
+ > {
616
586
  return new Route<
617
587
  TParentRoute,
618
588
  TPath,
@@ -666,43 +636,30 @@ export function createRootRouteWithContext<TRouterContext extends {}>() {
666
636
  export const rootRouteWithContext = createRootRouteWithContext
667
637
 
668
638
  export class RootRoute<
669
- in out TSearchValidator = undefined,
670
- in out TRouterContext = {},
671
- in out TRouteContextFn = AnyContext,
672
- in out TBeforeLoadFn = AnyContext,
673
- in out TLoaderDeps extends Record<string, any> = {},
674
- in out TLoaderFn = undefined,
675
- in out TChildren = unknown,
676
- in out TFileRouteTypes = unknown,
677
- >
678
- extends Route<
679
- any, // TParentRoute
680
- '/', // TPath
681
- '/', // TFullPath
682
- string, // TCustomId
683
- RootRouteId, // TId
684
- TSearchValidator, // TSearchValidator
685
- {}, // TParams
686
- TRouterContext,
687
- TRouteContextFn,
688
- TBeforeLoadFn,
689
- TLoaderDeps,
690
- TLoaderFn,
691
- TChildren, // TChildren
692
- TFileRouteTypes
693
- >
694
- implements
695
- CoreRootRoute<
696
- TSearchValidator,
697
- TRouterContext,
698
- TRouteContextFn,
699
- TBeforeLoadFn,
700
- TLoaderDeps,
701
- TLoaderFn,
702
- TChildren,
703
- TFileRouteTypes
704
- >
705
- {
639
+ in out TSearchValidator = undefined,
640
+ in out TRouterContext = {},
641
+ in out TRouteContextFn = AnyContext,
642
+ in out TBeforeLoadFn = AnyContext,
643
+ in out TLoaderDeps extends Record<string, any> = {},
644
+ in out TLoaderFn = undefined,
645
+ in out TChildren = unknown,
646
+ in out TFileRouteTypes = unknown,
647
+ > extends Route<
648
+ any, // TParentRoute
649
+ '/', // TPath
650
+ '/', // TFullPath
651
+ string, // TCustomId
652
+ RootRouteId, // TId
653
+ TSearchValidator, // TSearchValidator
654
+ {}, // TParams
655
+ TRouterContext,
656
+ TRouteContextFn,
657
+ TBeforeLoadFn,
658
+ TLoaderDeps,
659
+ TLoaderFn,
660
+ TChildren, // TChildren
661
+ TFileRouteTypes
662
+ > {
706
663
  /**
707
664
  * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
708
665
  */
@@ -718,72 +675,6 @@ export class RootRoute<
718
675
  ) {
719
676
  super(options as any)
720
677
  }
721
-
722
- addChildren<const TNewChildren>(
723
- children: Constrain<
724
- TNewChildren,
725
- ReadonlyArray<AnyRoute> | Record<string, AnyRoute>
726
- >,
727
- ): RootRoute<
728
- TSearchValidator,
729
- TRouterContext,
730
- TRouteContextFn,
731
- TBeforeLoadFn,
732
- TLoaderDeps,
733
- TLoaderFn,
734
- TNewChildren,
735
- TFileRouteTypes
736
- > {
737
- super.addChildren(children)
738
- return this as unknown as RootRoute<
739
- TSearchValidator,
740
- TRouterContext,
741
- TRouteContextFn,
742
- TBeforeLoadFn,
743
- TLoaderDeps,
744
- TLoaderFn,
745
- TNewChildren,
746
- TFileRouteTypes
747
- >
748
- }
749
-
750
- _addFileChildren<const TNewChildren>(
751
- children: TNewChildren,
752
- ): RootRoute<
753
- TSearchValidator,
754
- TRouterContext,
755
- TRouteContextFn,
756
- TBeforeLoadFn,
757
- TLoaderDeps,
758
- TLoaderFn,
759
- TNewChildren,
760
- TFileRouteTypes
761
- > {
762
- super._addFileChildren(children)
763
- return this as unknown as RootRoute<
764
- TSearchValidator,
765
- TRouterContext,
766
- TRouteContextFn,
767
- TBeforeLoadFn,
768
- TLoaderDeps,
769
- TLoaderFn,
770
- TNewChildren,
771
- TFileRouteTypes
772
- >
773
- }
774
-
775
- _addFileTypes<TFileRouteTypes>(): RootRoute<
776
- TSearchValidator,
777
- TRouterContext,
778
- TRouteContextFn,
779
- TBeforeLoadFn,
780
- TLoaderDeps,
781
- TLoaderFn,
782
- TChildren,
783
- TFileRouteTypes
784
- > {
785
- return this as any
786
- }
787
678
  }
788
679
 
789
680
  export function createRootRoute<
@@ -813,17 +704,6 @@ export function createRootRoute<
813
704
  >(options)
814
705
  }
815
706
 
816
- export type RouteMask<TRouteTree extends AnyRoute> = {
817
- routeTree: TRouteTree
818
- from: RoutePaths<TRouteTree>
819
- to?: any
820
- params?: any
821
- search?: any
822
- hash?: any
823
- state?: any
824
- unmaskOnReload?: boolean
825
- }
826
-
827
707
  export function createRouteMask<
828
708
  TRouteTree extends AnyRoute,
829
709
  TFrom extends string,