@tanstack/react-router 0.0.1-beta.83 → 1.0.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.
Files changed (225) hide show
  1. package/LICENSE +1 -1
  2. package/build/cjs/CatchBoundary.js +128 -0
  3. package/build/cjs/CatchBoundary.js.map +1 -0
  4. package/build/cjs/Matches.js +233 -0
  5. package/build/cjs/Matches.js.map +1 -0
  6. package/build/cjs/RouterProvider.js +170 -0
  7. package/build/cjs/RouterProvider.js.map +1 -0
  8. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +2 -4
  9. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  10. package/build/cjs/_virtual/with-selector.development.js +16 -0
  11. package/build/cjs/_virtual/with-selector.development.js.map +1 -0
  12. package/build/cjs/_virtual/with-selector.js +16 -0
  13. package/build/cjs/_virtual/with-selector.js.map +1 -0
  14. package/build/cjs/_virtual/with-selector.production.min.js +16 -0
  15. package/build/cjs/_virtual/with-selector.production.min.js.map +1 -0
  16. package/build/cjs/awaited.js +43 -0
  17. package/build/cjs/awaited.js.map +1 -0
  18. package/build/cjs/build/esm/index.js +79 -0
  19. package/build/cjs/build/esm/index.js.map +1 -0
  20. package/build/cjs/defer.js +37 -0
  21. package/build/cjs/defer.js.map +1 -0
  22. package/build/cjs/fileRoute.js +27 -0
  23. package/build/cjs/fileRoute.js.map +1 -0
  24. package/build/cjs/index.js +113 -451
  25. package/build/cjs/index.js.map +1 -1
  26. package/build/cjs/lazyRouteComponent.js +54 -0
  27. package/build/cjs/lazyRouteComponent.js.map +1 -0
  28. package/build/cjs/link.js +223 -0
  29. package/build/cjs/link.js.map +1 -0
  30. package/build/cjs/node_modules/.pnpm/@tanstack_react-store@0.2.1_react-dom@18.2.0_react@18.2.0/node_modules/@tanstack/react-store/build/modern/index.js +47 -0
  31. package/build/cjs/node_modules/.pnpm/@tanstack_react-store@0.2.1_react-dom@18.2.0_react@18.2.0/node_modules/@tanstack/react-store/build/modern/index.js.map +1 -0
  32. package/build/cjs/node_modules/.pnpm/@tanstack_store@0.1.3/node_modules/@tanstack/store/build/modern/index.js +70 -0
  33. package/build/cjs/node_modules/.pnpm/@tanstack_store@0.1.3/node_modules/@tanstack/store/build/modern/index.js.map +1 -0
  34. package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +188 -0
  35. package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
  36. package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +39 -0
  37. package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -0
  38. package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/shim/with-selector.js +26 -0
  39. package/build/cjs/node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.2.0/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
  40. package/build/cjs/packages/react-router/src/CatchBoundary.js +123 -0
  41. package/build/cjs/packages/react-router/src/CatchBoundary.js.map +1 -0
  42. package/build/cjs/packages/react-router/src/Matches.js +235 -0
  43. package/build/cjs/packages/react-router/src/Matches.js.map +1 -0
  44. package/build/cjs/packages/react-router/src/RouterProvider.js +144 -0
  45. package/build/cjs/packages/react-router/src/RouterProvider.js.map +1 -0
  46. package/build/cjs/packages/react-router/src/awaited.js +43 -0
  47. package/build/cjs/packages/react-router/src/awaited.js.map +1 -0
  48. package/build/cjs/packages/react-router/src/defer.js +37 -0
  49. package/build/cjs/packages/react-router/src/defer.js.map +1 -0
  50. package/build/cjs/packages/react-router/src/fileRoute.js +27 -0
  51. package/build/cjs/packages/react-router/src/fileRoute.js.map +1 -0
  52. package/build/cjs/packages/react-router/src/index.js +61 -0
  53. package/build/cjs/packages/react-router/src/index.js.map +1 -0
  54. package/build/cjs/packages/react-router/src/lazyRouteComponent.js +54 -0
  55. package/build/cjs/packages/react-router/src/lazyRouteComponent.js.map +1 -0
  56. package/build/cjs/packages/react-router/src/link.js +148 -0
  57. package/build/cjs/packages/react-router/src/link.js.map +1 -0
  58. package/build/cjs/packages/react-router/src/path.js +209 -0
  59. package/build/cjs/packages/react-router/src/path.js.map +1 -0
  60. package/build/cjs/packages/react-router/src/qss.js +63 -0
  61. package/build/cjs/packages/react-router/src/qss.js.map +1 -0
  62. package/build/cjs/packages/react-router/src/react.js +634 -0
  63. package/build/cjs/packages/react-router/src/react.js.map +1 -0
  64. package/build/cjs/packages/react-router/src/redirects.js +25 -0
  65. package/build/cjs/packages/react-router/src/redirects.js.map +1 -0
  66. package/build/cjs/packages/react-router/src/route.js +134 -0
  67. package/build/cjs/packages/react-router/src/route.js.map +1 -0
  68. package/build/cjs/packages/react-router/src/router.js +1111 -0
  69. package/build/cjs/packages/react-router/src/router.js.map +1 -0
  70. package/build/cjs/packages/react-router/src/scroll-restoration.js +53 -0
  71. package/build/cjs/packages/react-router/src/scroll-restoration.js.map +1 -0
  72. package/build/cjs/packages/react-router/src/searchParams.js +81 -0
  73. package/build/cjs/packages/react-router/src/searchParams.js.map +1 -0
  74. package/build/cjs/packages/react-router/src/useBlocker.js +61 -0
  75. package/build/cjs/packages/react-router/src/useBlocker.js.map +1 -0
  76. package/build/cjs/packages/react-router/src/useNavigate.js +75 -0
  77. package/build/cjs/packages/react-router/src/useNavigate.js.map +1 -0
  78. package/build/cjs/packages/react-router/src/useParams.js +26 -0
  79. package/build/cjs/packages/react-router/src/useParams.js.map +1 -0
  80. package/build/cjs/packages/react-router/src/useSearch.js +25 -0
  81. package/build/cjs/packages/react-router/src/useSearch.js.map +1 -0
  82. package/build/cjs/packages/react-router/src/utils.js +239 -0
  83. package/build/cjs/packages/react-router/src/utils.js.map +1 -0
  84. package/build/cjs/path.js +214 -0
  85. package/build/cjs/path.js.map +1 -0
  86. package/build/cjs/qss.js +63 -0
  87. package/build/cjs/qss.js.map +1 -0
  88. package/build/cjs/react/CatchBoundary.js +123 -0
  89. package/build/cjs/react/CatchBoundary.js.map +1 -0
  90. package/build/cjs/react/awaited.js +43 -0
  91. package/build/cjs/react/awaited.js.map +1 -0
  92. package/build/cjs/react/defer.js +37 -0
  93. package/build/cjs/react/defer.js.map +1 -0
  94. package/build/cjs/react.js +650 -0
  95. package/build/cjs/react.js.map +1 -0
  96. package/build/cjs/redirects.js +28 -0
  97. package/build/cjs/redirects.js.map +1 -0
  98. package/build/cjs/route.js +191 -0
  99. package/build/cjs/route.js.map +1 -0
  100. package/build/cjs/router.js +1085 -0
  101. package/build/cjs/router.js.map +1 -0
  102. package/build/cjs/routerConfig.js +209 -0
  103. package/build/cjs/routerConfig.js.map +1 -0
  104. package/build/cjs/scroll-restoration.js +202 -0
  105. package/build/cjs/scroll-restoration.js.map +1 -0
  106. package/build/cjs/searchParams.js +81 -0
  107. package/build/cjs/searchParams.js.map +1 -0
  108. package/build/cjs/src/CatchBoundary.js +126 -0
  109. package/build/cjs/src/CatchBoundary.js.map +1 -0
  110. package/build/cjs/src/Matches.js +235 -0
  111. package/build/cjs/src/Matches.js.map +1 -0
  112. package/build/cjs/src/RouterProvider.js +1051 -0
  113. package/build/cjs/src/RouterProvider.js.map +1 -0
  114. package/build/cjs/src/awaited.js +45 -0
  115. package/build/cjs/src/awaited.js.map +1 -0
  116. package/build/cjs/src/defer.js +39 -0
  117. package/build/cjs/src/defer.js.map +1 -0
  118. package/build/cjs/src/fileRoute.js +29 -0
  119. package/build/cjs/src/fileRoute.js.map +1 -0
  120. package/build/cjs/src/index.js +134 -0
  121. package/build/cjs/src/index.js.map +1 -0
  122. package/build/cjs/src/lazyRouteComponent.js +57 -0
  123. package/build/cjs/src/lazyRouteComponent.js.map +1 -0
  124. package/build/cjs/src/link.js +151 -0
  125. package/build/cjs/src/link.js.map +1 -0
  126. package/build/cjs/src/path.js +211 -0
  127. package/build/cjs/src/path.js.map +1 -0
  128. package/build/cjs/src/qss.js +65 -0
  129. package/build/cjs/src/qss.js.map +1 -0
  130. package/build/cjs/src/redirects.js +27 -0
  131. package/build/cjs/src/redirects.js.map +1 -0
  132. package/build/cjs/src/route.js +139 -0
  133. package/build/cjs/src/route.js.map +1 -0
  134. package/build/cjs/src/router.js +203 -0
  135. package/build/cjs/src/router.js.map +1 -0
  136. package/build/cjs/src/scroll-restoration.js +186 -0
  137. package/build/cjs/src/scroll-restoration.js.map +1 -0
  138. package/build/cjs/src/searchParams.js +83 -0
  139. package/build/cjs/src/searchParams.js.map +1 -0
  140. package/build/cjs/src/useBlocker.js +64 -0
  141. package/build/cjs/src/useBlocker.js.map +1 -0
  142. package/build/cjs/src/useNavigate.js +78 -0
  143. package/build/cjs/src/useNavigate.js.map +1 -0
  144. package/build/cjs/src/useParams.js +28 -0
  145. package/build/cjs/src/useParams.js.map +1 -0
  146. package/build/cjs/src/useSearch.js +27 -0
  147. package/build/cjs/src/useSearch.js.map +1 -0
  148. package/build/cjs/src/utils.js +230 -0
  149. package/build/cjs/src/utils.js.map +1 -0
  150. package/build/cjs/useBlocker.js +55 -0
  151. package/build/cjs/useBlocker.js.map +1 -0
  152. package/build/cjs/useNavigate.js +86 -0
  153. package/build/cjs/useNavigate.js.map +1 -0
  154. package/build/cjs/useParams.js +26 -0
  155. package/build/cjs/useParams.js.map +1 -0
  156. package/build/cjs/useSearch.js +25 -0
  157. package/build/cjs/useSearch.js.map +1 -0
  158. package/build/cjs/useStore.js +99 -0
  159. package/build/cjs/useStore.js.map +1 -0
  160. package/build/cjs/utils.js +241 -0
  161. package/build/cjs/utils.js.map +1 -0
  162. package/build/esm/index.js +2581 -337
  163. package/build/esm/index.js.map +1 -1
  164. package/build/stats-html.html +3494 -2700
  165. package/build/stats-react.json +1134 -87
  166. package/build/types/CatchBoundary.d.ts +36 -0
  167. package/build/types/Matches.d.ts +64 -0
  168. package/build/types/RouteMatch.d.ts +23 -0
  169. package/build/types/RouterProvider.d.ts +35 -0
  170. package/build/types/awaited.d.ts +9 -0
  171. package/build/types/defer.d.ts +19 -0
  172. package/build/types/fileRoute.d.ts +38 -0
  173. package/build/types/history.d.ts +7 -0
  174. package/build/types/index.d.ts +911 -88
  175. package/build/types/injectHtml.d.ts +0 -0
  176. package/build/types/lazyRouteComponent.d.ts +2 -0
  177. package/build/types/link.d.ts +93 -0
  178. package/build/types/location.d.ts +12 -0
  179. package/build/types/path.d.ts +17 -0
  180. package/build/types/qss.d.ts +2 -0
  181. package/build/types/react/CatchBoundary.d.ts +33 -0
  182. package/build/types/react/awaited.d.ts +9 -0
  183. package/build/types/react/defer.d.ts +19 -0
  184. package/build/types/react.d.ts +141 -0
  185. package/build/types/redirects.d.ts +11 -0
  186. package/build/types/route.d.ts +283 -0
  187. package/build/types/routeInfo.d.ts +31 -0
  188. package/build/types/router.d.ts +186 -0
  189. package/build/types/scroll-restoration.d.ts +18 -0
  190. package/build/types/searchParams.d.ts +7 -0
  191. package/build/types/useBlocker.d.ts +9 -0
  192. package/build/types/useNavigate.d.ts +19 -0
  193. package/build/types/useParams.d.ts +7 -0
  194. package/build/types/useSearch.d.ts +7 -0
  195. package/build/types/useStore.d.ts +12 -0
  196. package/build/types/utils.d.ts +69 -0
  197. package/build/umd/index.development.js +2829 -1796
  198. package/build/umd/index.development.js.map +1 -1
  199. package/build/umd/index.production.js +4 -24
  200. package/build/umd/index.production.js.map +1 -1
  201. package/package.json +9 -7
  202. package/src/CatchBoundary.tsx +101 -0
  203. package/src/Matches.tsx +423 -0
  204. package/src/RouterProvider.tsx +252 -0
  205. package/src/awaited.tsx +40 -0
  206. package/src/defer.ts +55 -0
  207. package/src/fileRoute.ts +152 -0
  208. package/src/history.ts +8 -0
  209. package/src/index.tsx +28 -747
  210. package/src/lazyRouteComponent.tsx +33 -0
  211. package/src/link.tsx +603 -0
  212. package/src/location.ts +13 -0
  213. package/src/path.ts +261 -0
  214. package/src/qss.ts +53 -0
  215. package/src/redirects.ts +39 -0
  216. package/src/route.ts +882 -0
  217. package/src/routeInfo.ts +84 -0
  218. package/src/router.ts +1671 -0
  219. package/src/scroll-restoration.tsx +230 -0
  220. package/src/searchParams.ts +79 -0
  221. package/src/useBlocker.tsx +27 -0
  222. package/src/useNavigate.tsx +111 -0
  223. package/src/useParams.tsx +25 -0
  224. package/src/useSearch.tsx +25 -0
  225. package/src/utils.ts +360 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router
2
+ * @tanstack/react-router/src/index.tsx
3
3
  *
4
4
  * Copyright (c) TanStack
5
5
  *
@@ -8,105 +8,928 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import * as React from 'react';
12
- import { RegisteredRoutesInfo, LinkOptions, ToOptions, MatchRouteOptions, RouteByPath, ResolveRelativePath, NoInfer, ValidFromPath, NavigateOptions, RegisteredRouter, AnyRootRoute, RootRoute, AnyRoutesInfo, RoutesInfo, Router, RouterConstructorOptions, DefaultRoutesInfo, RouterOptions, RouterStore, RouteMatch, AnyRouteMatch } from '@tanstack/router';
13
- export * from '@tanstack/router';
14
- export { useStore } from '@tanstack/react-store';
11
+ import { HistoryState, RouterHistory, HistoryLocation, BlockerFn } from '@tanstack/history';
12
+ export * from '@tanstack/history';
13
+ export { default as invariant } from 'tiny-invariant';
14
+ export { default as warning } from 'tiny-warning';
15
+ import * as React$1 from 'react';
16
+ import { Store } from '@tanstack/store';
15
17
 
16
- type ReactNode = any;
17
- type SyncRouteComponent<TProps = {}> = (props: TProps) => ReactNode;
18
- type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {
19
- preload?: () => Promise<void>;
18
+ type DeferredPromiseState<T> = {
19
+ uid: string;
20
+ } & ({
21
+ status: 'pending';
22
+ data?: T;
23
+ error?: unknown;
24
+ } | {
25
+ status: 'success';
26
+ data: T;
27
+ } | {
28
+ status: 'error';
29
+ data?: T;
30
+ error: unknown;
31
+ });
32
+ type DeferredPromise<T> = Promise<T> & {
33
+ __deferredState: DeferredPromiseState<T>;
20
34
  };
21
- declare function lazy(importer: () => Promise<{
22
- default: SyncRouteComponent;
23
- }>): RouteComponent;
24
- type LinkPropsOptions<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = ''> = LinkOptions<RegisteredRoutesInfo, TFrom, TTo> & {
25
- activeProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
26
- inactiveProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
35
+ declare function defer<T>(_promise: Promise<T>): DeferredPromise<T>;
36
+ declare function isDehydratedDeferred(obj: any): boolean;
37
+
38
+ type AwaitOptions<T> = {
39
+ promise: DeferredPromise<T>;
27
40
  };
28
- type MakeUseMatchRouteOptions<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = ''> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions;
29
- type MakeMatchRouteOptions<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = ''> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions & {
30
- children?: ReactNode | ((params: RouteByPath<RegisteredRoutesInfo, ResolveRelativePath<TFrom, NoInfer<TTo>>>['__types']['allParams']) => ReactNode);
41
+ declare function useAwaited<T>({ promise }: AwaitOptions<T>): [T];
42
+ declare function Await<T>(props: AwaitOptions<T> & {
43
+ children: (result: T) => JSX.Element;
44
+ }): JSX.Element;
45
+
46
+ declare function CatchBoundary(props: {
47
+ getResetKey: () => string;
48
+ children: any;
49
+ errorComponent?: any;
50
+ onCatch: (error: any) => void;
51
+ }): React$1.JSX.Element;
52
+ declare class CatchBoundaryImpl extends React$1.Component<{
53
+ getResetKey: () => string;
54
+ children: (props: {
55
+ error: any;
56
+ reset: () => void;
57
+ }) => any;
58
+ onCatch?: (error: any) => void;
59
+ }> {
60
+ state: any;
61
+ static getDerivedStateFromProps(props: any): {
62
+ resetKey: any;
63
+ };
64
+ static getDerivedStateFromError(error: any): {
65
+ error: any;
66
+ };
67
+ componentDidUpdate(prevProps: Readonly<{
68
+ getResetKey: () => string;
69
+ children: (props: {
70
+ error: any;
71
+ reset: () => void;
72
+ }) => any;
73
+ onCatch?: ((error: any, info: any) => void) | undefined;
74
+ }>, prevState: any): void;
75
+ componentDidCatch(error: any): void;
76
+ render(): any;
77
+ }
78
+ declare function ErrorComponent({ error }: {
79
+ error: any;
80
+ }): React$1.JSX.Element;
81
+
82
+ interface ParsedLocation<TSearchObj extends AnySearchSchema = {}> {
83
+ href: string;
84
+ pathname: string;
85
+ search: TSearchObj;
86
+ searchStr: string;
87
+ state: HistoryState;
88
+ hash: string;
89
+ maskedLocation?: ParsedLocation<TSearchObj>;
90
+ unmaskOnReload?: boolean;
91
+ }
92
+
93
+ declare const defaultParseSearch: (searchStr: string) => AnySearchSchema;
94
+ declare const defaultStringifySearch: (search: Record<string, any>) => string;
95
+ declare function parseSearchWith(parser: (str: string) => any): (searchStr: string) => AnySearchSchema;
96
+ declare function stringifySearchWith(stringify: (search: any) => string, parser?: (str: string) => any): (search: Record<string, any>) => string;
97
+ type SearchSerializer = (searchObj: Record<string, any>) => string;
98
+ type SearchParser = (searchStr: string) => Record<string, any>;
99
+
100
+ interface CommitLocationOptions {
101
+ replace?: boolean;
102
+ resetScroll?: boolean;
103
+ startTransition?: boolean;
104
+ }
105
+ interface MatchLocation {
106
+ to?: string | number | null;
107
+ fuzzy?: boolean;
108
+ caseSensitive?: boolean;
109
+ from?: string;
110
+ }
111
+ type NavigateFn<TRouteTree extends AnyRoute> = <TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = TFrom, TMaskTo extends string = ''>(opts: NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<void>;
112
+ type MatchRouteFn<TRouteTree extends AnyRoute> = <TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>>(location: ToOptions<TRouteTree, TFrom, TTo>, opts?: MatchRouteOptions) => false | RouteById<TRouteTree, TResolved>['types']['allParams'];
113
+ type BuildLocationFn<TRouteTree extends AnyRoute> = (opts: ToOptions<TRouteTree>) => ParsedLocation;
114
+ type InjectedHtmlEntry = string | (() => Promise<string> | string);
115
+ declare let routerContext: React$1.Context<Router<any, Record<string, any>>>;
116
+ declare function RouterProvider<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TDehydrated extends Record<string, any> = Record<string, any>>({ router, ...rest }: RouterProps<TRouteTree, TDehydrated>): React$1.JSX.Element;
117
+ declare function getRouteMatch<TRouteTree extends AnyRoute>(state: RouterState<TRouteTree>, id: string): undefined | RouteMatch<TRouteTree>;
118
+ declare function useRouterState<TSelected = RouterState<RegisteredRouter['routeTree']>>(opts?: {
119
+ select: (state: RouterState<RegisteredRouter['routeTree']>) => TSelected;
120
+ }): TSelected;
121
+ type RouterProps<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TDehydrated extends Record<string, any> = Record<string, any>> = Omit<RouterOptions<TRouteTree, TDehydrated>, 'context'> & {
122
+ router: Router<TRouteTree>;
123
+ context?: Partial<RouterOptions<TRouteTree, TDehydrated>['context']>;
31
124
  };
32
- type MakeLinkPropsOptions<TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/', TTo extends string = ''> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>;
33
- type MakeLinkOptions<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = ''> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
34
- children?: ReactNode | ((state: {
35
- isActive: boolean;
36
- }) => ReactNode);
37
- };
38
- declare module '@tanstack/router' {
39
- interface FrameworkGenerics {
40
- Component: RouteComponent;
41
- ErrorComponent: RouteComponent<{
42
- error: Error;
43
- info: {
44
- componentStack: string;
45
- };
46
- }>;
47
- }
48
- interface RouterOptions<TRouteTree> {
49
- }
50
- interface FrameworkRouteOptions {
51
- wrapInSuspense?: boolean;
125
+ declare function useRouter<TRouteTree extends AnyRoute = RegisteredRouter['routeTree']>(): Router<TRouteTree>;
126
+
127
+ declare global {
128
+ interface Window {
129
+ __TSR_DEHYDRATED__?: HydrationCtx;
130
+ __TSR_ROUTER_CONTEXT__?: React.Context<Router<any>>;
52
131
  }
53
132
  }
54
- type PromptProps = {
55
- message: string;
56
- condition?: boolean | any;
57
- children?: ReactNode;
133
+ interface Register {
134
+ }
135
+ type AnyRouter = Router<AnyRoute, any>;
136
+ type RegisteredRouter = Register extends {
137
+ router: infer TRouter extends AnyRouter;
138
+ } ? TRouter : AnyRouter;
139
+ type HydrationCtx = {
140
+ router: DehydratedRouter;
141
+ payload: Record<string, any>;
58
142
  };
59
- declare function useLinkProps<TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/', TTo extends string = ''>(options: MakeLinkPropsOptions<TFrom, TTo>): React.AnchorHTMLAttributes<HTMLAnchorElement>;
60
- interface LinkFn<TDefaultFrom extends RegisteredRoutesInfo['routePaths'] = '/', TDefaultTo extends string = ''> {
61
- <TFrom extends RegisteredRoutesInfo['routePaths'] = TDefaultFrom, TTo extends string = TDefaultTo>(props: MakeLinkOptions<TFrom, TTo> & React.RefAttributes<HTMLAnchorElement>): ReactNode;
143
+ type RouterContextOptions<TRouteTree extends AnyRoute> = AnyContext extends TRouteTree['types']['routerContext'] ? {
144
+ context?: TRouteTree['types']['routerContext'];
145
+ } : {
146
+ context: TRouteTree['types']['routerContext'];
147
+ };
148
+ interface RouterOptions<TRouteTree extends AnyRoute, TDehydrated extends Record<string, any> = Record<string, any>> {
149
+ history?: RouterHistory;
150
+ stringifySearch?: SearchSerializer;
151
+ parseSearch?: SearchParser;
152
+ defaultPreload?: false | 'intent';
153
+ defaultPreloadDelay?: number;
154
+ defaultComponent?: RouteComponent;
155
+ defaultErrorComponent?: RouteComponent;
156
+ defaultPendingComponent?: RouteComponent;
157
+ defaultPendingMs?: number;
158
+ defaultPendingMinMs?: number;
159
+ defaultStaleTime?: number;
160
+ defaultPreloadStaleTime?: number;
161
+ defaultPreloadGcTime?: number;
162
+ defaultGcTime?: number;
163
+ caseSensitive?: boolean;
164
+ routeTree?: TRouteTree;
165
+ basepath?: string;
166
+ context?: TRouteTree['types']['routerContext'];
167
+ dehydrate?: () => TDehydrated;
168
+ hydrate?: (dehydrated: TDehydrated) => void;
169
+ routeMasks?: RouteMask<TRouteTree>[];
170
+ unmaskOnReload?: boolean;
171
+ Wrap?: (props: {
172
+ children: any;
173
+ }) => JSX.Element;
174
+ InnerWrap?: (props: {
175
+ children: any;
176
+ }) => JSX.Element;
177
+ notFoundRoute?: AnyRoute;
62
178
  }
63
- declare const Link: LinkFn;
64
- declare function Navigate<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = ''>(props: NavigateOptions<RegisteredRoutesInfo, TFrom, TTo>): null;
65
- type MatchesContextValue = AnyRouteMatch[];
66
- declare const matchesContext: React.Context<MatchesContextValue>;
67
- declare const routerContext: React.Context<{
68
- router: RegisteredRouter;
69
- }>;
70
- type MatchesProviderProps = {
71
- value: MatchesContextValue;
72
- children: ReactNode;
179
+ interface RouterState<TRouteTree extends AnyRoute = AnyRoute> {
180
+ status: 'pending' | 'idle';
181
+ isLoading: boolean;
182
+ isTransitioning: boolean;
183
+ matches: RouteMatch<TRouteTree>[];
184
+ pendingMatches?: RouteMatch<TRouteTree>[];
185
+ cachedMatches: RouteMatch<TRouteTree>[];
186
+ location: ParsedLocation<FullSearchSchema<TRouteTree>>;
187
+ resolvedLocation: ParsedLocation<FullSearchSchema<TRouteTree>>;
188
+ lastUpdated: number;
189
+ }
190
+ type ListenerFn<TEvent extends RouterEvent> = (event: TEvent) => void;
191
+ interface BuildNextOptions {
192
+ to?: string | number | null;
193
+ params?: true | Updater<unknown>;
194
+ search?: true | Updater<unknown>;
195
+ hash?: true | Updater<string>;
196
+ state?: true | NonNullableUpdater<HistoryState>;
197
+ mask?: {
198
+ to?: string | number | null;
199
+ params?: true | Updater<unknown>;
200
+ search?: true | Updater<unknown>;
201
+ hash?: true | Updater<string>;
202
+ state?: true | NonNullableUpdater<HistoryState>;
203
+ unmaskOnReload?: boolean;
204
+ };
205
+ from?: string;
206
+ }
207
+ interface DehydratedRouterState {
208
+ dehydratedMatches: DehydratedRouteMatch[];
209
+ }
210
+ type DehydratedRouteMatch = Pick<RouteMatch, 'id' | 'status' | 'updatedAt'>;
211
+ interface DehydratedRouter {
212
+ state: DehydratedRouterState;
213
+ }
214
+ type RouterConstructorOptions<TRouteTree extends AnyRoute, TDehydrated extends Record<string, any>> = Omit<RouterOptions<TRouteTree, TDehydrated>, 'context'> & RouterContextOptions<TRouteTree>;
215
+ declare const componentTypes: readonly ["component", "errorComponent", "pendingComponent"];
216
+ type RouterEvents = {
217
+ onBeforeLoad: {
218
+ type: 'onBeforeLoad';
219
+ fromLocation: ParsedLocation;
220
+ toLocation: ParsedLocation;
221
+ pathChanged: boolean;
222
+ };
223
+ onLoad: {
224
+ type: 'onLoad';
225
+ fromLocation: ParsedLocation;
226
+ toLocation: ParsedLocation;
227
+ pathChanged: boolean;
228
+ };
229
+ onResolved: {
230
+ type: 'onResolved';
231
+ fromLocation: ParsedLocation;
232
+ toLocation: ParsedLocation;
233
+ pathChanged: boolean;
234
+ };
235
+ };
236
+ type RouterEvent = RouterEvents[keyof RouterEvents];
237
+ type RouterListener<TRouterEvent extends RouterEvent> = {
238
+ eventType: TRouterEvent['type'];
239
+ fn: ListenerFn<TRouterEvent>;
73
240
  };
74
- declare class ReactRouter<TRouteConfig extends AnyRootRoute = RootRoute, TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>> extends Router<TRouteConfig, TRoutesInfo> {
75
- constructor(opts: RouterConstructorOptions<TRouteConfig>);
241
+ declare class Router<TRouteTree extends AnyRoute = AnyRoute, TDehydrated extends Record<string, any> = Record<string, any>> {
242
+ tempLocationKey: string | undefined;
243
+ resetNextScroll: boolean;
244
+ navigateTimeout: Timeout | null;
245
+ latestLoadPromise: Promise<void>;
246
+ subscribers: Set<RouterListener<RouterEvent>>;
247
+ injectedHtml: InjectedHtmlEntry[];
248
+ dehydratedData?: TDehydrated;
249
+ __store: Store<RouterState<TRouteTree>>;
250
+ options: PickAsRequired<RouterOptions<TRouteTree, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>;
251
+ history: RouterHistory;
252
+ latestLocation: ParsedLocation;
253
+ basepath: string;
254
+ routeTree: TRouteTree;
255
+ routesById: RoutesById<TRouteTree>;
256
+ routesByPath: RoutesByPath<TRouteTree>;
257
+ flatRoutes: AnyRoute[];
258
+ constructor(options: RouterConstructorOptions<TRouteTree, TDehydrated>);
259
+ startReactTransition: (fn: () => void) => void;
260
+ update: (newOptions: RouterConstructorOptions<TRouteTree, TDehydrated>) => void;
261
+ get state(): RouterState<TRouteTree>;
262
+ buildRouteTree: () => void;
263
+ subscribe: <TType extends keyof RouterEvents>(eventType: TType, fn: ListenerFn<RouterEvents[TType]>) => () => void;
264
+ emit: (routerEvent: RouterEvent) => void;
265
+ checkLatest: (promise: Promise<void>) => undefined | Promise<void>;
266
+ parseLocation: (previousLocation?: ParsedLocation) => ParsedLocation<FullSearchSchema<TRouteTree>>;
267
+ resolvePathWithBase: (from: string, path: string) => string;
268
+ get looseRoutesById(): Record<string, AnyRoute>;
269
+ matchRoutes: <TRouteTree_1 extends AnyRoute>(pathname: string, locationSearch: AnySearchSchema, opts?: {
270
+ throwOnError?: boolean;
271
+ debug?: boolean;
272
+ }) => RouteMatch<TRouteTree_1, ParseRoute<TRouteTree_1>["id"]>[];
273
+ cancelMatch: (id: string) => void;
274
+ cancelMatches: () => void;
275
+ buildLocation: BuildLocationFn<TRouteTree>;
276
+ commitLocation: ({ startTransition, ...next }: ParsedLocation & CommitLocationOptions) => Promise<void>;
277
+ buildAndCommitLocation: ({ replace, resetScroll, startTransition, ...rest }?: BuildNextOptions & CommitLocationOptions) => Promise<void>;
278
+ navigate: NavigateFn<TRouteTree>;
279
+ loadMatches: ({ checkLatest, matches, preload, }: {
280
+ checkLatest: () => Promise<void> | undefined;
281
+ matches: AnyRouteMatch[];
282
+ preload?: boolean | undefined;
283
+ }) => Promise<RouteMatch[]>;
284
+ invalidate: () => void;
285
+ load: () => Promise<void>;
286
+ cleanCache: () => void;
287
+ preloadRoute: (navigateOpts?: ToOptions<TRouteTree>) => Promise<RouteMatch<AnyRoute, any>[]>;
288
+ matchRoute: MatchRouteFn<TRouteTree>;
289
+ injectHtml: (html: string | (() => Promise<string> | string)) => Promise<void>;
290
+ dehydrateData: <T>(key: any, getData: T | (() => T | Promise<T>)) => () => T | undefined;
291
+ hydrateData: <T extends unknown = unknown>(key: any) => T | undefined;
292
+ dehydrate: () => DehydratedRouter;
293
+ hydrate: (__do_not_use_server_ctx?: HydrationCtx) => Promise<void>;
76
294
  }
77
- type RouterProps<TRouteConfig extends AnyRootRoute = RootRoute, TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo> = RouterOptions<TRouteConfig> & {
78
- router: Router<TRouteConfig, TRoutesInfo>;
295
+ declare function lazyFn<T extends Record<string, (...args: any[]) => any>, TKey extends keyof T = 'default'>(fn: () => Promise<T>, key?: TKey): (...args: Parameters<T[TKey]>) => Promise<ReturnType<T[TKey]>>;
296
+ declare class SearchParamError extends Error {
297
+ }
298
+ declare class PathParamError extends Error {
299
+ }
300
+ declare function getInitialRouterState(location: ParsedLocation): RouterState<any>;
301
+
302
+ type NoInfer<T> = [T][T extends any ? 0 : never];
303
+ type IsAny<T, Y, N = T> = 1 extends 0 & T ? Y : N;
304
+ type IsAnyBoolean<T> = 1 extends 0 & T ? true : false;
305
+ type IsKnown<T, Y, N> = unknown extends T ? N : Y;
306
+ type PickAsRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
307
+ type PickAsPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
308
+ type PickUnsafe<T, K> = K extends keyof T ? Pick<T, K> : never;
309
+ type PickExtra<T, K> = {
310
+ [TKey in keyof K as string extends TKey ? never : TKey extends keyof T ? never : TKey]: K[TKey];
79
311
  };
80
- declare function RouterProvider<TRouteConfig extends AnyRootRoute = RootRoute, TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo>): JSX.Element;
81
- declare function useRouterContext(): RegisteredRouter;
82
- declare function useRouter<T = RouterStore>(track?: (state: Router['__store']) => T, shallow?: boolean): RegisteredRouter;
83
- declare function useMatches(): RouteMatch[];
84
- declare function useMatch<TFrom extends keyof RegisteredRoutesInfo['routesById'], TStrict extends boolean = true, TRouteMatch = RouteMatch<RegisteredRoutesInfo, RegisteredRoutesInfo['routesById'][TFrom]>>(opts?: {
85
- from: TFrom;
86
- strict?: TStrict;
87
- track?: (match: TRouteMatch) => any;
88
- shallow?: boolean;
89
- }): TStrict extends true ? TRouteMatch : TRouteMatch | undefined;
90
- declare function useRoute<TId extends keyof RegisteredRoutesInfo['routesById'] = '/'>(routeId: TId): RegisteredRoutesInfo['routesById'][TId];
91
- declare function useSearch<TFrom extends keyof RegisteredRoutesInfo['routesById'], TStrict extends boolean = true, TSearch = RegisteredRoutesInfo['routesById'][TFrom]['__types']['fullSearchSchema'], TSelected = TSearch>(opts?: {
312
+ type PickRequired<T> = {
313
+ [K in keyof T as undefined extends T[K] ? never : K]: T[K];
314
+ };
315
+ type Expand<T> = T extends object ? T extends infer O ? {
316
+ [K in keyof O]: O[K];
317
+ } : never : T;
318
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => any ? I : never;
319
+ type Assign<Left, Right> = Omit<Left, keyof Right> & Right;
320
+ type AssignAll<T extends any[]> = T extends [infer Left, ...infer Right] ? Right extends any[] ? Assign<Left, AssignAll<Right>> : Left : {};
321
+ type Values<O> = O[ValueKeys<O>];
322
+ type ValueKeys<O> = Extract<keyof O, PropertyKey>;
323
+ type DeepAwaited<T> = T extends Promise<infer A> ? DeepAwaited<A> : T extends Record<infer A, Promise<infer B>> ? {
324
+ [K in A]: DeepAwaited<B>;
325
+ } : T;
326
+ type PathParamMask<TRoutePath extends string> = TRoutePath extends `${infer L}/$${infer C}/${infer R}` ? PathParamMask<`${L}/${string}/${R}`> : TRoutePath extends `${infer L}/$${infer C}` ? PathParamMask<`${L}/${string}`> : TRoutePath;
327
+ type Timeout = ReturnType<typeof setTimeout>;
328
+ type Updater<TPrevious, TResult = TPrevious> = TResult | ((prev?: TPrevious) => TResult);
329
+ type NonNullableUpdater<TPrevious, TResult = TPrevious> = TResult | ((prev: TPrevious) => TResult);
330
+ type PickExtract<T, U> = {
331
+ [K in keyof T as T[K] extends U ? K : never]: T[K];
332
+ };
333
+ type PickExclude<T, U> = {
334
+ [K in keyof T as T[K] extends U ? never : K]: T[K];
335
+ };
336
+ type LastInUnion<U> = UnionToIntersection<U extends unknown ? (x: U) => 0 : never> extends (x: infer L) => 0 ? L : never;
337
+ type UnionToTuple<U, Last = LastInUnion<U>> = [U] extends [never] ? [] : [...UnionToTuple<Exclude<U, Last>>, Last];
338
+ declare const isServer: boolean;
339
+ declare function last<T>(arr: T[]): T | undefined;
340
+ declare function functionalUpdate<TResult>(updater: Updater<TResult> | NonNullableUpdater<TResult>, previous: TResult): TResult;
341
+ declare function pick<T, K extends keyof T>(parent: T, keys: K[]): Pick<T, K>;
342
+ /**
343
+ * This function returns `a` if `b` is deeply equal.
344
+ * If not, it will replace any deeply equal children of `b` with those of `a`.
345
+ * This can be used for structural sharing between immutable JSON values for example.
346
+ * Do not use this with signals
347
+ */
348
+ declare function replaceEqualDeep<T>(prev: any, _next: T): T;
349
+ declare function isPlainObject(o: any): boolean;
350
+ declare function deepEqual(a: any, b: any, partial?: boolean): boolean;
351
+ declare function useStableCallback<T extends (...args: any[]) => any>(fn: T): T;
352
+ declare function shallow<T>(objA: T, objB: T): boolean;
353
+ type StrictOrFrom<TFrom> = {
92
354
  from: TFrom;
93
- strict?: TStrict;
94
- track?: (search: TSearch) => TSelected;
355
+ strict?: true;
356
+ } | {
357
+ from?: never;
358
+ strict: false;
359
+ };
360
+ type RouteFromIdOrRoute<T, TRouteTree extends AnyRoute = RegisteredRouter['routeTree']> = T extends ParseRoute<TRouteTree> ? T : T extends RouteIds<TRouteTree> ? RoutesById<TRouteTree>[T] : T extends string ? RouteIds<TRouteTree> : never;
361
+ declare function useRouteContext<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteContext = RouteById<TRouteTree, TFrom>['types']['allContext'], TSelected = TRouteContext>(opts: StrictOrFrom<TFrom> & {
362
+ select?: (search: TRouteContext) => TSelected;
95
363
  }): TStrict extends true ? TSelected : TSelected | undefined;
96
- declare function useParams<TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/', TDefaultSelected = RegisteredRoutesInfo['allParams'] & RegisteredRoutesInfo['routesById'][TFrom]['__types']['allParams'], TSelected = TDefaultSelected>(opts?: {
97
- from: TFrom;
98
- track?: (search: TDefaultSelected) => TSelected;
99
- }): TSelected;
100
- declare function useNavigate<TDefaultFrom extends keyof RegisteredRoutesInfo['routesById'] = '/'>(defaultOpts?: {
364
+ declare const useLayoutEffect: typeof React$1.useLayoutEffect;
365
+ declare function escapeJSON(jsonString: string): string;
366
+
367
+ type ParseRoute<TRouteTree extends AnyRoute> = TRouteTree | ParseRouteChildren<TRouteTree>;
368
+ type ParseRouteChildren<TRouteTree extends AnyRoute> = TRouteTree extends Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any, infer TChildren, any> ? unknown extends TChildren ? never : TChildren extends AnyRoute[] ? {
369
+ [TId in TChildren[number]['id'] as string]: ParseRoute<TChildren[number]>;
370
+ }[string] : never : never;
371
+ type RoutesById<TRouteTree extends AnyRoute> = {
372
+ [K in ParseRoute<TRouteTree> as K['id']]: K;
373
+ };
374
+ type RouteById<TRouteTree extends AnyRoute, TId> = Extract<ParseRoute<TRouteTree>, {
375
+ id: TId;
376
+ }>;
377
+ type RouteIds<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree>['id'];
378
+ type RoutesByPath<TRouteTree extends AnyRoute> = {
379
+ [K in ParseRoute<TRouteTree> as K['fullPath']]: K;
380
+ };
381
+ type RouteByPath<TRouteTree extends AnyRoute, TPath> = Extract<ParseRoute<TRouteTree>, {
382
+ fullPath: TPath;
383
+ }>;
384
+ type RoutePaths<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree>['fullPath'] | '/';
385
+ type UnionizeCollisions<T, U> = {
386
+ [P in keyof T & keyof U]: T[P] extends U[P] ? T[P] : T[P] | U[P];
387
+ };
388
+ type Reducer<T, U, C = UnionizeCollisions<T, U>> = C & Omit<T, keyof C> & Omit<U, keyof C>;
389
+ type Reduce<T extends any[], Result = unknown> = T extends [
390
+ infer First,
391
+ ...infer Rest
392
+ ] ? Reduce<Rest, Reducer<Result, First>> : Result;
393
+ type FullSearchSchema<TRouteTree extends AnyRoute> = Partial<Expand<Reduce<UnionToTuple<ParseRoute<TRouteTree>['types']['fullSearchSchema']>>>>;
394
+ type AllParams<TRouteTree extends AnyRoute> = Expand<UnionToIntersection<ParseRoute<TRouteTree>['types']['allParams']>>;
395
+
396
+ declare const rootRouteId: "__root__";
397
+ type RootRouteId = typeof rootRouteId;
398
+ type AnyPathParams = {};
399
+ type AnySearchSchema = {};
400
+ type AnyContext = {};
401
+ interface RouteContext {
402
+ }
403
+ interface RouteMeta {
404
+ }
405
+ type PreloadableObj = {
406
+ preload?: () => Promise<void>;
407
+ };
408
+ type RoutePathOptions<TCustomId, TPath> = {
409
+ path: TPath;
410
+ } | {
411
+ id: TCustomId;
412
+ };
413
+ type RoutePathOptionsIntersection<TCustomId, TPath> = UnionToIntersection<RoutePathOptions<TCustomId, TPath>>;
414
+ type MetaOptions = keyof PickRequired<RouteMeta> extends never ? {
415
+ meta?: RouteMeta;
416
+ } : {
417
+ meta: RouteMeta;
418
+ };
419
+ type RouteOptions<TParentRoute extends AnyRoute = AnyRoute, TCustomId extends string = string, TPath extends string = string, TSearchSchema extends Record<string, any> = {}, TFullSearchSchema extends Record<string, any> = TSearchSchema, TParams extends AnyPathParams = AnyPathParams, TAllParams extends AnyPathParams = TParams, TRouteContext extends RouteContext = RouteContext, TAllContext extends Record<string, any> = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderData extends any = unknown> = BaseRouteOptions<TParentRoute, TCustomId, TPath, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TAllContext, TLoaderDeps, TLoaderData> & UpdatableRouteOptions<NoInfer<TFullSearchSchema>>;
420
+ type ParamsFallback<TPath extends string, TParams> = unknown extends TParams ? Record<ParsePathParams<TPath>, string> : TParams;
421
+ type BaseRouteOptions<TParentRoute extends AnyRoute = AnyRoute, TCustomId extends string = string, TPath extends string = string, TSearchSchema extends Record<string, any> = {}, TFullSearchSchema extends Record<string, any> = TSearchSchema, TParams extends AnyPathParams = {}, TAllParams = ParamsFallback<TPath, TParams>, TRouteContext extends RouteContext = RouteContext, TAllContext extends Record<string, any> = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderData extends any = unknown> = RoutePathOptions<TCustomId, TPath> & {
422
+ getParentRoute: () => TParentRoute;
423
+ validateSearch?: SearchSchemaValidator<TSearchSchema>;
424
+ shouldReload?: boolean | ((match: LoaderFnContext<TAllParams, TFullSearchSchema, TAllContext, TRouteContext>) => any);
425
+ } & (keyof PickRequired<RouteContext> extends never ? {
426
+ beforeLoad?: BeforeLoadFn<TFullSearchSchema, TParentRoute, TAllParams, TRouteContext>;
427
+ } : {
428
+ beforeLoad: BeforeLoadFn<TFullSearchSchema, TParentRoute, TAllParams, TRouteContext>;
429
+ }) & {
430
+ loaderDeps?: (opts: {
431
+ search: TFullSearchSchema;
432
+ }) => TLoaderDeps;
433
+ loader?: RouteLoaderFn<TAllParams, NoInfer<TLoaderDeps>, NoInfer<TAllContext>, NoInfer<TRouteContext>, TLoaderData>;
434
+ } & ({
435
+ parseParams?: (rawParams: IsAny<TPath, any, Record<ParsePathParams<TPath>, string>>) => TParams extends Record<ParsePathParams<TPath>, any> ? TParams : 'parseParams must return an object';
436
+ stringifyParams?: (params: NoInfer<ParamsFallback<TPath, TParams>>) => Record<ParsePathParams<TPath>, string>;
437
+ } | {
438
+ stringifyParams?: never;
439
+ parseParams?: never;
440
+ });
441
+ type BeforeLoadFn<TFullSearchSchema extends Record<string, any>, TParentRoute extends AnyRoute, TAllParams, TRouteContext> = (opts: {
442
+ search: TFullSearchSchema;
443
+ abortController: AbortController;
444
+ preload: boolean;
445
+ params: TAllParams;
446
+ context: TParentRoute['types']['allContext'];
447
+ location: ParsedLocation;
448
+ navigate: NavigateFn<AnyRoute>;
449
+ buildLocation: BuildLocationFn<TParentRoute>;
450
+ cause: 'preload' | 'enter' | 'stay';
451
+ }) => Promise<TRouteContext> | TRouteContext | void;
452
+ type UpdatableRouteOptions<TFullSearchSchema extends Record<string, any>> = MetaOptions & {
453
+ caseSensitive?: boolean;
454
+ wrapInSuspense?: boolean;
455
+ component?: RouteComponent;
456
+ errorComponent?: false | null | ErrorRouteComponent;
457
+ pendingComponent?: RouteComponent;
458
+ pendingMs?: number;
459
+ pendingMinMs?: number;
460
+ staleTime?: number;
461
+ gcTime?: number;
462
+ preloadStaleTime?: number;
463
+ preloadGcTime?: number;
464
+ preSearchFilters?: SearchFilter<TFullSearchSchema>[];
465
+ postSearchFilters?: SearchFilter<TFullSearchSchema>[];
466
+ onError?: (err: any) => void;
467
+ onEnter?: (match: AnyRouteMatch) => void;
468
+ onStay?: (match: AnyRouteMatch) => void;
469
+ onLeave?: (match: AnyRouteMatch) => void;
470
+ };
471
+ type ParseParamsOption<TPath extends string, TParams> = ParseParamsFn<TPath, TParams>;
472
+ type ParseParamsFn<TPath extends string, TParams> = (rawParams: IsAny<TPath, any, Record<ParsePathParams<TPath>, string>>) => TParams extends Record<ParsePathParams<TPath>, any> ? TParams : 'parseParams must return an object';
473
+ type ParseParamsObj<TPath extends string, TParams> = {
474
+ parse?: ParseParamsFn<TPath, TParams>;
475
+ };
476
+ type SearchSchemaValidator<TReturn> = SearchSchemaValidatorObj<TReturn> | SearchSchemaValidatorFn<TReturn>;
477
+ type SearchSchemaValidatorObj<TReturn> = {
478
+ parse?: SearchSchemaValidatorFn<TReturn>;
479
+ };
480
+ type SearchSchemaValidatorFn<TReturn> = (searchObj: Record<string, unknown>) => TReturn;
481
+ type DefinedPathParamWarning = 'Path params cannot be redefined by child routes!';
482
+ type ParentParams<TParentParams> = AnyPathParams extends TParentParams ? {} : {
483
+ [Key in keyof TParentParams]?: DefinedPathParamWarning;
484
+ };
485
+ type RouteLoaderFn<TAllParams = {}, TLoaderDeps extends Record<string, any> = {}, TAllContext extends Record<string, any> = AnyContext, TRouteContext extends Record<string, any> = AnyContext, TLoaderData extends any = unknown> = (match: LoaderFnContext<TAllParams, TLoaderDeps, TAllContext, TRouteContext>) => Promise<TLoaderData> | TLoaderData;
486
+ interface LoaderFnContext<TAllParams = {}, TLoaderDeps extends Record<string, any> = {}, TAllContext extends Record<string, any> = AnyContext, TRouteContext extends Record<string, any> = AnyContext> {
487
+ abortController: AbortController;
488
+ preload: boolean;
489
+ params: TAllParams;
490
+ deps: TLoaderDeps;
491
+ context: Expand<Assign<TAllContext, TRouteContext>>;
492
+ location: ParsedLocation;
493
+ navigate: (opts: NavigateOptions<AnyRoute>) => Promise<void>;
494
+ parentMatchPromise?: Promise<void>;
495
+ cause: 'preload' | 'enter' | 'stay';
496
+ }
497
+ type SearchFilter<T, U = T> = (prev: T) => U;
498
+ type ResolveId<TParentRoute, TCustomId extends string, TPath extends string> = TParentRoute extends {
499
+ id: infer TParentId extends string;
500
+ } ? RoutePrefix<TParentId, string extends TCustomId ? TPath : TCustomId> : RootRouteId;
501
+ type InferFullSearchSchema<TRoute> = TRoute extends {
502
+ types: {
503
+ fullSearchSchema: infer TFullSearchSchema;
504
+ };
505
+ } ? TFullSearchSchema : {};
506
+ type ResolveFullSearchSchema<TParentRoute, TSearchSchema> = Expand<Assign<InferFullSearchSchema<TParentRoute>, TSearchSchema>>;
507
+ interface AnyRoute extends Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
508
+ }
509
+ type MergeFromFromParent<T, U> = IsAny<T, U, T & U>;
510
+ type ResolveAllParams<TParentRoute extends AnyRoute, TParams extends AnyPathParams> = Record<never, string> extends TParentRoute['types']['allParams'] ? TParams : Expand<UnionToIntersection<TParentRoute['types']['allParams'] & TParams> & {}>;
511
+ type RouteConstraints = {
512
+ TParentRoute: AnyRoute;
513
+ TPath: string;
514
+ TFullPath: string;
515
+ TCustomId: string;
516
+ TId: string;
517
+ TSearchSchema: AnySearchSchema;
518
+ TFullSearchSchema: AnySearchSchema;
519
+ TParams: Record<string, any>;
520
+ TAllParams: Record<string, any>;
521
+ TParentContext: AnyContext;
522
+ TRouteContext: RouteContext;
523
+ TAllContext: AnyContext;
524
+ TRouterContext: AnyContext;
525
+ TChildren: unknown;
526
+ TRouteTree: AnyRoute;
527
+ };
528
+ declare class RouteApi<TId extends RouteIds<RegisteredRouter['routeTree']>, TRoute extends AnyRoute = RouteById<RegisteredRouter['routeTree'], TId>, TFullSearchSchema extends Record<string, any> = TRoute['types']['fullSearchSchema'], TAllParams extends AnyPathParams = TRoute['types']['allParams'], TAllContext extends Record<string, any> = TRoute['types']['allContext'], TLoaderDeps extends Record<string, any> = TRoute['types']['loaderDeps'], TLoaderData extends any = TRoute['types']['loaderData']> {
529
+ id: TId;
530
+ constructor({ id }: {
531
+ id: TId;
532
+ });
533
+ useMatch: <TSelected = TAllContext>(opts?: {
534
+ select?: ((s: TAllContext) => TSelected) | undefined;
535
+ } | undefined) => TSelected;
536
+ useRouteContext: <TSelected = TAllContext>(opts?: {
537
+ select?: ((s: TAllContext) => TSelected) | undefined;
538
+ } | undefined) => TSelected;
539
+ useSearch: <TSelected = TFullSearchSchema>(opts?: {
540
+ select?: ((s: TFullSearchSchema) => TSelected) | undefined;
541
+ } | undefined) => TSelected;
542
+ useParams: <TSelected = TAllParams>(opts?: {
543
+ select?: ((s: TAllParams) => TSelected) | undefined;
544
+ } | undefined) => TSelected;
545
+ useLoaderDeps: <TSelected = TLoaderDeps>(opts?: {
546
+ select?: ((s: TLoaderDeps) => TSelected) | undefined;
547
+ } | undefined) => TSelected;
548
+ useLoaderData: <TSelected = TLoaderData>(opts?: {
549
+ select?: ((s: TLoaderData) => TSelected) | undefined;
550
+ } | undefined) => TSelected;
551
+ }
552
+ declare class Route<TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TSearchSchema extends RouteConstraints['TSearchSchema'] = {}, TFullSearchSchema extends RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TParams extends RouteConstraints['TParams'] = Expand<Record<ParsePathParams<TPath>, string>>, TAllParams extends RouteConstraints['TAllParams'] = ResolveAllParams<TParentRoute, TParams>, TRouteContext extends RouteConstraints['TRouteContext'] = RouteContext, TAllContext extends Expand<Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>> = Expand<Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>>, TRouterContext extends RouteConstraints['TRouterContext'] = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderData extends any = unknown, TChildren extends RouteConstraints['TChildren'] = unknown, TRouteTree extends RouteConstraints['TRouteTree'] = AnyRoute> {
553
+ isRoot: TParentRoute extends Route<any> ? true : false;
554
+ options: RouteOptions<TParentRoute, TCustomId, TPath, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TAllContext, TLoaderDeps, TLoaderData>;
555
+ test: Expand<Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>>;
556
+ parentRoute: TParentRoute;
557
+ id: TId;
558
+ path: TPath;
559
+ fullPath: TFullPath;
560
+ to: TrimPathRight<TFullPath>;
561
+ children?: TChildren;
562
+ originalIndex?: number;
563
+ router?: AnyRouter;
564
+ rank: number;
565
+ constructor(options: RouteOptions<TParentRoute, TCustomId, TPath, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TAllContext, TLoaderDeps, TLoaderData>);
566
+ types: {
567
+ parentRoute: TParentRoute;
568
+ path: TPath;
569
+ to: TrimPathRight<TFullPath>;
570
+ fullPath: TFullPath;
571
+ customId: TCustomId;
572
+ id: TId;
573
+ searchSchema: TSearchSchema;
574
+ fullSearchSchema: TFullSearchSchema;
575
+ params: TParams;
576
+ allParams: TAllParams;
577
+ routeContext: TRouteContext;
578
+ allContext: TAllContext;
579
+ children: TChildren;
580
+ routeTree: TRouteTree;
581
+ routerContext: TRouterContext;
582
+ loaderData: TLoaderData;
583
+ loaderDeps: TLoaderDeps;
584
+ };
585
+ init: (opts: {
586
+ originalIndex: number;
587
+ }) => void;
588
+ addChildren: <TNewChildren extends AnyRoute[]>(children: TNewChildren) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TAllContext, TRouterContext, TLoaderDeps, TLoaderData, TNewChildren, TRouteTree>;
589
+ update: (options: UpdatableRouteOptions<TFullSearchSchema>) => this;
590
+ useMatch: <TSelected = TAllContext>(opts?: {
591
+ select?: ((search: TAllContext) => TSelected) | undefined;
592
+ } | undefined) => TSelected;
593
+ useRouteContext: <TSelected = TAllContext>(opts?: {
594
+ select?: ((search: TAllContext) => TSelected) | undefined;
595
+ } | undefined) => TSelected;
596
+ useSearch: <TSelected = TFullSearchSchema>(opts?: {
597
+ select?: ((search: TFullSearchSchema) => TSelected) | undefined;
598
+ } | undefined) => TSelected;
599
+ useParams: <TSelected = TAllParams>(opts?: {
600
+ select?: ((search: TAllParams) => TSelected) | undefined;
601
+ } | undefined) => TSelected;
602
+ useLoaderDeps: <TSelected = TLoaderDeps>(opts?: {
603
+ select?: ((s: TLoaderDeps) => TSelected) | undefined;
604
+ } | undefined) => TSelected;
605
+ useLoaderData: <TSelected = TLoaderData>(opts?: {
606
+ select?: ((search: TLoaderData) => TSelected) | undefined;
607
+ } | undefined) => TSelected;
608
+ }
609
+ type AnyRootRoute = RootRoute<any, any, any, any>;
610
+ declare function rootRouteWithContext<TRouterContext extends {}>(): <TSearchSchema extends Record<string, any> = {}, TRouteContext extends RouteContext = RouteContext, TLoaderDeps extends Record<string, any> = {}, TLoaderData extends unknown = unknown>(options?: Omit<RouteOptions<AnyRoute, "__root__", "", TSearchSchema, TSearchSchema, {}, {}, TRouteContext, Assign<TRouterContext, TRouteContext>, TLoaderDeps, TLoaderData>, "path" | "id" | "getParentRoute" | "stringifyParams" | "parseParams" | "caseSensitive"> | undefined) => RootRoute<TSearchSchema, TRouteContext, TRouterContext, {}, unknown>;
611
+ declare class RootRoute<TSearchSchema extends Record<string, any> = {}, TRouteContext extends RouteContext = RouteContext, TRouterContext extends {} = {}, TLoaderDeps extends Record<string, any> = {}, TLoaderData extends any = unknown> extends Route<any, // TParentRoute
612
+ '/', // TPath
613
+ '/', // TFullPath
614
+ string, // TCustomId
615
+ RootRouteId, // TId
616
+ TSearchSchema, // TSearchSchema
617
+ TSearchSchema, // TFullSearchSchema
618
+ {}, // TParams
619
+ {}, // TAllParams
620
+ TRouteContext, // TRouteContext
621
+ Expand<Assign<TRouterContext, TRouteContext>>, // TAllContext
622
+ TRouterContext, // TRouterContext
623
+ TLoaderDeps, TLoaderData, any, // TChildren
624
+ any> {
625
+ constructor(options?: Omit<RouteOptions<AnyRoute, // TParentRoute
626
+ RootRouteId, // TCustomId
627
+ '', // TPath
628
+ TSearchSchema, // TSearchSchema
629
+ TSearchSchema, // TFullSearchSchema
630
+ {}, // TParams
631
+ {}, // TAllParams
632
+ TRouteContext, // TRouteContext
633
+ Assign<TRouterContext, TRouteContext>, // TAllContext
634
+ TLoaderDeps, TLoaderData>, 'path' | 'id' | 'getParentRoute' | 'caseSensitive' | 'parseParams' | 'stringifyParams'>);
635
+ }
636
+ type ResolveFullPath<TParentRoute extends AnyRoute, TPath extends string, TPrefixed = RoutePrefix<TParentRoute['fullPath'], TPath>> = TPrefixed extends RootRouteId ? '/' : TPrefixed;
637
+ type RoutePrefix<TPrefix extends string, TPath extends string> = string extends TPath ? RootRouteId : TPath extends string ? TPrefix extends RootRouteId ? TPath extends '/' ? '/' : `/${TrimPath<TPath>}` : `${TPrefix}/${TPath}` extends '/' ? '/' : `/${TrimPathLeft<`${TrimPathRight<TPrefix>}/${TrimPath<TPath>}`>}` : never;
638
+ type TrimPath<T extends string> = '' extends T ? '' : TrimPathRight<TrimPathLeft<T>>;
639
+ type TrimPathLeft<T extends string> = T extends `${RootRouteId}/${infer U}` ? TrimPathLeft<U> : T extends `/${infer U}` ? TrimPathLeft<U> : T;
640
+ type TrimPathRight<T extends string> = T extends '/' ? '/' : T extends `${infer U}/` ? TrimPathRight<U> : T;
641
+ type RouteMask<TRouteTree extends AnyRoute> = {
642
+ routeTree: TRouteTree;
643
+ from: RoutePaths<TRouteTree>;
644
+ to?: any;
645
+ params?: any;
646
+ search?: any;
647
+ hash?: any;
648
+ state?: any;
649
+ unmaskOnReload?: boolean;
650
+ };
651
+ declare function createRouteMask<TRouteTree extends AnyRoute, TFrom extends RoutePaths<TRouteTree>, TTo extends string>(opts: {
652
+ routeTree: TRouteTree;
653
+ } & ToSubOptions<TRouteTree, TFrom, TTo>): RouteMask<TRouteTree>;
654
+ type ErrorRouteProps = {
655
+ error: unknown;
656
+ info: {
657
+ componentStack: string;
658
+ };
659
+ };
660
+ type ReactNode = any;
661
+ type SyncRouteComponent<TProps> = ((props: TProps) => ReactNode) | React$1.LazyExoticComponent<(props: TProps) => ReactNode>;
662
+ type AsyncRouteComponent<TProps> = SyncRouteComponent<TProps> & {
663
+ preload?: () => Promise<void>;
664
+ };
665
+ type RouteComponent<TProps = any> = SyncRouteComponent<TProps> & AsyncRouteComponent<TProps>;
666
+ type ErrorRouteComponent = RouteComponent<ErrorRouteProps>;
667
+ declare class NotFoundRoute<TParentRoute extends AnyRootRoute, TSearchSchema extends RouteConstraints['TSearchSchema'] = {}, TFullSearchSchema extends RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TRouteContext extends RouteConstraints['TRouteContext'] = RouteContext, TAllContext extends Expand<Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>> = Expand<Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>>, TRouterContext extends RouteConstraints['TRouterContext'] = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderData extends any = unknown, TChildren extends RouteConstraints['TChildren'] = unknown, TRouteTree extends RouteConstraints['TRouteTree'] = AnyRoute> extends Route<TParentRoute, '/404', '/404', '404', '404', TSearchSchema, TFullSearchSchema, {}, {}, TRouteContext, TAllContext, TRouterContext, TLoaderDeps, TLoaderData, TChildren, TRouteTree> {
668
+ constructor(options: Omit<RouteOptions<TParentRoute, string, string, TSearchSchema, TFullSearchSchema, {}, {}, TRouteContext, TAllContext, TLoaderDeps, TLoaderData>, 'caseSensitive' | 'parseParams' | 'stringifyParams' | 'path' | 'id'>);
669
+ }
670
+
671
+ declare function useNavigate<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TDefaultFrom extends RoutePaths<TRouteTree> = '/'>(defaultOpts?: {
101
672
  from?: TDefaultFrom;
102
- }): <TFrom extends string = TDefaultFrom, TTo extends string = "">(opts?: MakeLinkOptions<TFrom, TTo> | undefined) => Promise<void>;
103
- declare function useMatchRoute(): <TFrom extends ValidFromPath<AnyRoutesInfo> = "/", TTo extends string = "">(opts: MakeUseMatchRouteOptions<TFrom, TTo>) => false | {};
104
- declare function MatchRoute<TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/', TTo extends string = ''>(props: MakeMatchRouteOptions<TFrom, TTo>): any;
105
- declare function Outlet(): JSX.Element | null;
106
- declare function ErrorComponent({ error }: {
107
- error: any;
108
- }): JSX.Element;
109
- declare function useBlocker(message: string, condition?: boolean | any): void;
110
- declare function Block({ message, condition, children }: PromptProps): any;
673
+ }): <TFrom extends RoutePaths<TRouteTree> = TDefaultFrom, TTo extends string = "", TMaskFrom extends RoutePaths<TRouteTree> = "/", TMaskTo extends string = "">(opts?: NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> | undefined) => Promise<void>;
674
+ declare function Navigate<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''>(props: NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>): null;
675
+ type UseLinkPropsOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ActiveLinkOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & React$1.AnchorHTMLAttributes<HTMLAnchorElement>;
676
+ type LinkProps<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ActiveLinkOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & Omit<React$1.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
677
+ children?: React$1.ReactNode | ((state: {
678
+ isActive: boolean;
679
+ }) => React$1.ReactNode);
680
+ };
681
+ type ActiveLinkOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = LinkOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & {
682
+ activeProps?: React$1.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React$1.AnchorHTMLAttributes<HTMLAnchorElement>);
683
+ inactiveProps?: React$1.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React$1.AnchorHTMLAttributes<HTMLAnchorElement>);
684
+ };
685
+
686
+ type CleanPath<T extends string> = T extends `${infer L}//${infer R}` ? CleanPath<`${CleanPath<L>}/${CleanPath<R>}`> : T extends `${infer L}//` ? `${CleanPath<L>}/` : T extends `//${infer L}` ? `/${CleanPath<L>}` : T;
687
+ type Split<S, TIncludeTrailingSlash = true> = S extends unknown ? string extends S ? string[] : S extends string ? CleanPath<S> extends '' ? [] : TIncludeTrailingSlash extends true ? CleanPath<S> extends `${infer T}/` ? [...Split<T>, '/'] : CleanPath<S> extends `/${infer U}` ? Split<U> : CleanPath<S> extends `${infer T}/${infer U}` ? [...Split<T>, ...Split<U>] : [S] : CleanPath<S> extends `${infer T}/${infer U}` ? [...Split<T>, ...Split<U>] : S extends string ? [S] : never : never : never;
688
+ type ParsePathParams<T extends string> = keyof {
689
+ [K in Trim<Split<T>[number], '_'> as K extends `$${infer L}` ? L : never]: K;
690
+ };
691
+ type Join<T, Delimiter extends string = '/'> = T extends [] ? '' : T extends [infer L extends string] ? L : T extends [infer L extends string, ...infer Tail extends [...string[]]] ? CleanPath<`${L}${Delimiter}${Join<Tail>}`> : never;
692
+ type Last<T extends any[]> = T extends [...infer _, infer L] ? L : never;
693
+ type RelativeToPathAutoComplete<AllPaths extends string, TFrom extends string, TTo extends string, SplitPaths extends string[] = Split<AllPaths, false>> = TTo extends `..${infer _}` ? SplitPaths extends [
694
+ ...Split<ResolveRelativePath<TFrom, TTo>, false>,
695
+ ...infer TToRest
696
+ ] ? `${CleanPath<Join<[
697
+ ...Split<TTo, false>,
698
+ ...(TToRest | (Split<ResolveRelativePath<TFrom, TTo>, false>['length'] extends 1 ? never : ['../']))
699
+ ]>>}` : never : TTo extends `./${infer RestTTo}` ? SplitPaths extends [
700
+ ...Split<TFrom, false>,
701
+ ...Split<RestTTo, false>,
702
+ ...infer RestPath
703
+ ] ? `${TTo}${Join<RestPath>}` : never : (TFrom extends `/` ? never : SplitPaths extends [...Split<TFrom, false>, ...infer RestPath] ? Join<RestPath> extends {
704
+ length: 0;
705
+ } ? never : './' : never) | (TFrom extends `/` ? never : '../') | AllPaths;
706
+ type NavigateOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = TFrom, TMaskTo extends string = ''> = ToOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & {
707
+ replace?: boolean;
708
+ resetScroll?: boolean;
709
+ startTransition?: boolean;
710
+ };
711
+ type ToOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ToSubOptions<TRouteTree, TFrom, TTo> & {
712
+ mask?: ToMaskOptions<TRouteTree, TMaskFrom, TMaskTo>;
713
+ };
714
+ type ToMaskOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ToSubOptions<TRouteTree, TMaskFrom, TMaskTo> & {
715
+ unmaskOnReload?: boolean;
716
+ };
717
+ type ToSubOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>> = {
718
+ to?: ToPathOption<TRouteTree, TFrom, TTo>;
719
+ hash?: true | Updater<string>;
720
+ state?: true | NonNullableUpdater<HistoryState>;
721
+ from?: TFrom;
722
+ } & CheckPath<TRouteTree, NoInfer<TResolved>, {}> & SearchParamOptions<TRouteTree, TFrom, TTo, TResolved> & PathParamOptions<TRouteTree, TFrom, TResolved>;
723
+ type SearchParamOptions<TRouteTree extends AnyRoute, TFrom, TTo, TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>, TFromSearchEnsured = '/' extends TFrom ? FullSearchSchema<TRouteTree> : Expand<PickRequired<RouteByPath<TRouteTree, TFrom>['types']['fullSearchSchema']>>, TFromSearchOptional = Omit<FullSearchSchema<TRouteTree>, keyof TFromSearchEnsured>, TFromSearch = Expand<TFromSearchEnsured & TFromSearchOptional>, TToSearch = '' extends TTo ? FullSearchSchema<TRouteTree> : Expand<RouteByPath<TRouteTree, TResolved>['types']['fullSearchSchema']>> = keyof PickRequired<TToSearch> extends never ? {
724
+ search?: true | SearchReducer<TFromSearch, TToSearch>;
725
+ } : {
726
+ search: TFromSearchEnsured extends PickRequired<TToSearch> ? true | SearchReducer<TFromSearch, TToSearch> : SearchReducer<TFromSearch, TToSearch>;
727
+ };
728
+ type SearchReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo);
729
+ type PathParamOptions<TRouteTree extends AnyRoute, TFrom, TTo, TFromParamsEnsured = Expand<UnionToIntersection<PickRequired<RouteByPath<TRouteTree, TFrom>['types']['allParams']>>>, TFromParamsOptional = Omit<AllParams<TRouteTree>, keyof TFromParamsEnsured>, TFromParams = Expand<TFromParamsOptional & TFromParamsEnsured>, TToParams = Expand<RouteByPath<TRouteTree, TTo>['types']['allParams']>> = never extends TToParams ? {
730
+ params?: true | ParamsReducer<Partial<TFromParams>, Partial<TFromParams>>;
731
+ } : keyof PickRequired<TToParams> extends never ? {
732
+ params?: true | ParamsReducer<TFromParams, TToParams>;
733
+ } : {
734
+ params: TFromParamsEnsured extends PickRequired<TToParams> ? true | ParamsReducer<TFromParams, TToParams> : ParamsReducer<TFromParams, TToParams>;
735
+ };
736
+ type ParamsReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo);
737
+ type ToPathOption<TRouteTree extends AnyRoute = AnyRoute, TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = ''> = TTo | RelativeToPathAutoComplete<RoutePaths<TRouteTree>, NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
738
+ type ToIdOption<TRouteTree extends AnyRoute = AnyRoute, TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = ''> = TTo | RelativeToPathAutoComplete<RouteIds<TRouteTree>, NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
739
+ interface ActiveOptions {
740
+ exact?: boolean;
741
+ includeHash?: boolean;
742
+ includeSearch?: boolean;
743
+ }
744
+ type LinkOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = TFrom, TMaskTo extends string = ''> = NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & {
745
+ target?: HTMLAnchorElement['target'];
746
+ activeOptions?: ActiveOptions;
747
+ preload?: false | 'intent';
748
+ preloadDelay?: number;
749
+ disabled?: boolean;
750
+ };
751
+ type CheckRelativePath<TRouteTree extends AnyRoute, TFrom, TTo> = TTo extends string ? TFrom extends string ? ResolveRelativePath<TFrom, TTo> extends RoutePaths<TRouteTree> ? {} : {
752
+ Error: `${TFrom} + ${TTo} resolves to ${ResolveRelativePath<TFrom, TTo>}, which is not a valid route path.`;
753
+ 'Valid Route Paths': RoutePaths<TRouteTree>;
754
+ } : {} : {};
755
+ type CheckPath<TRouteTree extends AnyRoute, TPath, TPass> = Exclude<TPath, RoutePaths<TRouteTree>> extends never ? TPass : CheckPathError<TRouteTree, Exclude<TPath, RoutePaths<TRouteTree>>>;
756
+ type CheckPathError<TRouteTree extends AnyRoute, TInvalids> = {
757
+ to: RoutePaths<TRouteTree>;
758
+ };
759
+ type CheckId<TRouteTree extends AnyRoute, TPath, TPass> = Exclude<TPath, RouteIds<TRouteTree>> extends never ? TPass : CheckIdError<TRouteTree, Exclude<TPath, RouteIds<TRouteTree>>>;
760
+ type CheckIdError<TRouteTree extends AnyRoute, TInvalids> = {
761
+ Error: `${TInvalids extends string ? TInvalids : never} is not a valid route ID.`;
762
+ 'Valid Route IDs': RouteIds<TRouteTree>;
763
+ };
764
+ type ResolveRelativePath<TFrom, TTo = '.'> = TFrom extends string ? TTo extends string ? TTo extends '.' ? TFrom : TTo extends `./` ? Join<[TFrom, '/']> : TTo extends `./${infer TRest}` ? ResolveRelativePath<TFrom, TRest> : TTo extends `/${infer TRest}` ? TTo : Split<TTo> extends ['..', ...infer ToRest] ? Split<TFrom> extends [...infer FromRest, infer FromTail] ? ToRest extends ['/'] ? Join<[...FromRest, '/']> : ResolveRelativePath<Join<FromRest>, Join<ToRest>> : never : Split<TTo> extends ['.', ...infer ToRest] ? ToRest extends ['/'] ? Join<[TFrom, '/']> : ResolveRelativePath<TFrom, Join<ToRest>> : CleanPath<Join<['/', ...Split<TFrom>, ...Split<TTo>]>> : never : never;
765
+ declare function useLinkProps<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''>(options: UseLinkPropsOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>): React$1.AnchorHTMLAttributes<HTMLAnchorElement>;
766
+ interface LinkComponent<TProps extends Record<string, any> = {}> {
767
+ <TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''>(props: LinkProps<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & TProps & React$1.RefAttributes<HTMLAnchorElement>): ReactNode;
768
+ }
769
+ declare const Link: LinkComponent;
770
+
771
+ declare const matchContext: React$1.Context<string | undefined>;
772
+ interface RouteMatch<TRouteTree extends AnyRoute = AnyRoute, TRouteId extends RouteIds<TRouteTree> = ParseRoute<TRouteTree>['id']> {
773
+ id: string;
774
+ routeId: TRouteId;
775
+ pathname: string;
776
+ params: RouteById<TRouteTree, TRouteId>['types']['allParams'];
777
+ status: 'pending' | 'success' | 'error';
778
+ isFetching: boolean;
779
+ showPending: boolean;
780
+ error: unknown;
781
+ paramsError: unknown;
782
+ searchError: unknown;
783
+ updatedAt: number;
784
+ loadPromise?: Promise<void>;
785
+ loaderData?: RouteById<TRouteTree, TRouteId>['types']['loaderData'];
786
+ routeContext: RouteById<TRouteTree, TRouteId>['types']['routeContext'];
787
+ context: RouteById<TRouteTree, TRouteId>['types']['allContext'];
788
+ search: FullSearchSchema<TRouteTree> & RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'];
789
+ fetchCount: number;
790
+ abortController: AbortController;
791
+ cause: 'preload' | 'enter' | 'stay';
792
+ loaderDeps: RouteById<TRouteTree, TRouteId>['types']['loaderDeps'];
793
+ preload: boolean;
794
+ invalid: boolean;
795
+ }
796
+ type AnyRouteMatch = RouteMatch<any, any>;
797
+ declare function Matches(): React$1.JSX.Element;
798
+ declare function Match({ matchId }: {
799
+ matchId: string;
800
+ }): React$1.JSX.Element;
801
+ declare const Outlet: React$1.NamedExoticComponent<object>;
802
+ interface MatchRouteOptions {
803
+ pending?: boolean;
804
+ caseSensitive?: boolean;
805
+ includeSearch?: boolean;
806
+ fuzzy?: boolean;
807
+ }
808
+ type UseMatchRouteOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ToOptions<AnyRoute, TFrom, TTo, TMaskFrom, TMaskTo> & MatchRouteOptions;
809
+ declare function useMatchRoute<TRouteTree extends AnyRoute = RegisteredRouter['routeTree']>(): <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string = "", TMaskFrom extends RoutePaths<TRouteTree> = "/", TMaskTo extends string = "", TResolved extends string = ResolveRelativePath<TFrom, NoInfer<TTo>>>(opts: UseMatchRouteOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>) => false | RouteById<TRouteTree, TResolved>["types"]["allParams"];
810
+ type MakeMatchRouteOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ToOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & MatchRouteOptions & {
811
+ children?: ((params?: RouteByPath<TRouteTree, ResolveRelativePath<TFrom, NoInfer<TTo>>>['types']['allParams']) => ReactNode) | React$1.ReactNode;
812
+ };
813
+ declare function MatchRoute<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''>(props: MakeMatchRouteOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>): any;
814
+ declare function useMatch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteMatchState = RouteMatch<TRouteTree, TFrom>, TSelected = TRouteMatchState>(opts: StrictOrFrom<TFrom> & {
815
+ select?: (match: TRouteMatchState) => TSelected;
816
+ }): TStrict extends true ? TSelected : TSelected | undefined;
817
+ declare function useMatches<T = RouteMatch[]>(opts?: {
818
+ select?: (matches: RouteMatch[]) => T;
819
+ }): T;
820
+ declare function useParentMatches<T = RouteMatch[]>(opts?: {
821
+ select?: (matches: RouteMatch[]) => T;
822
+ }): T;
823
+ declare function useLoaderDeps<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteMatch extends RouteMatch<TRouteTree, TFrom> = RouteMatch<TRouteTree, TFrom>, TSelected = Required<TRouteMatch>['loaderDeps']>(opts: StrictOrFrom<TFrom> & {
824
+ select?: (match: TRouteMatch) => TSelected;
825
+ }): TStrict extends true ? TSelected : TSelected | undefined;
826
+ declare function useLoaderData<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TRouteMatch extends RouteMatch<TRouteTree, TFrom> = RouteMatch<TRouteTree, TFrom>, TSelected = Required<TRouteMatch>['loaderData']>(opts: StrictOrFrom<TFrom> & {
827
+ select?: (match: TRouteMatch) => TSelected;
828
+ }): TStrict extends true ? TSelected : TSelected | undefined;
829
+
830
+ interface FileRoutesByPath {
831
+ }
832
+ type Replace<S extends string, From extends string, To extends string> = S extends `${infer Start}${From}${infer Rest}` ? `${Start}${To}${Replace<Rest, From, To>}` : S;
833
+ type TrimLeft<T extends string, S extends string> = T extends `${S}${infer U}` ? U : T;
834
+ type TrimRight<T extends string, S extends string> = T extends `${infer U}${S}` ? U : T;
835
+ type Trim<T extends string, S extends string> = TrimLeft<TrimRight<T, S>, S>;
836
+ type RemoveUnderScores<T extends string> = Replace<Replace<TrimRight<TrimLeft<T, '/_'>, '_'>, '_/', '/'>, '/_', '/'>;
837
+ type ResolveFilePath<TParentRoute extends AnyRoute, TFilePath extends string> = TParentRoute['id'] extends RootRouteId ? TrimPathLeft<TFilePath> : Replace<TrimPathLeft<TFilePath>, TrimPathLeft<TParentRoute['types']['customId']>, ''>;
838
+ type FileRoutePath<TParentRoute extends AnyRoute, TFilePath extends string> = ResolveFilePath<TParentRoute, TFilePath> extends `_${infer _}` ? string : ResolveFilePath<TParentRoute, TFilePath>;
839
+ declare class FileRoute<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'], TId extends RouteConstraints['TId'] = TFilePath, TPath extends RouteConstraints['TPath'] = FileRoutePath<TParentRoute, TFilePath>, TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, RemoveUnderScores<TPath>>> {
840
+ path: TFilePath;
841
+ constructor(path: TFilePath);
842
+ createRoute: <TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TParams extends Record<string, any> = Expand<Record<ParsePathParams<TPath>, string>>, TAllParams extends Record<string, any> = MergeFromFromParent<TParentRoute["types"]["allParams"], TParams>, TRouteContext extends RouteContext = RouteContext, TContext extends Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}>, TRouteContext>> = Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}>, TRouteContext>>, TRouterContext extends AnyContext = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderData extends unknown = unknown, TChildren extends unknown = unknown, TRouteTree extends AnyRoute = AnyRoute>(options?: (Omit<RouteOptions<TParentRoute, string, TPath, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TContext, TLoaderDeps, TLoaderData>, "path" | "id" | "getParentRoute"> & {
843
+ meta?: RouteMeta | undefined;
844
+ } & {
845
+ caseSensitive?: boolean | undefined;
846
+ wrapInSuspense?: boolean | undefined;
847
+ component?: RouteComponent<any> | undefined;
848
+ errorComponent?: false | ErrorRouteComponent | null | undefined;
849
+ pendingComponent?: RouteComponent<any> | undefined;
850
+ pendingMs?: number | undefined;
851
+ pendingMinMs?: number | undefined;
852
+ staleTime?: number | undefined;
853
+ gcTime?: number | undefined;
854
+ preloadStaleTime?: number | undefined;
855
+ preloadGcTime?: number | undefined;
856
+ preSearchFilters?: SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
857
+ postSearchFilters?: SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
858
+ onError?: ((err: any) => void) | undefined;
859
+ onEnter?: ((match: AnyRouteMatch) => void) | undefined;
860
+ onStay?: ((match: AnyRouteMatch) => void) | undefined;
861
+ onLeave?: ((match: AnyRouteMatch) => void) | undefined;
862
+ }) | undefined) => Route<TParentRoute, TPath, TFullPath, TFilePath, TId, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TContext, TRouterContext, TLoaderDeps, TLoaderData, TChildren, TRouteTree>;
863
+ }
864
+
865
+ declare module '@tanstack/history' {
866
+ interface HistoryState {
867
+ __tempLocation?: HistoryLocation;
868
+ __tempKey?: string;
869
+ }
870
+ }
871
+
872
+ declare function lazyRouteComponent<T extends Record<string, any>, TKey extends keyof T = 'default'>(importer: () => Promise<T>, exportName?: TKey): T[TKey] extends (props: infer TProps) => any ? AsyncRouteComponent<TProps> : never;
873
+
874
+ interface Segment {
875
+ type: 'pathname' | 'param' | 'wildcard';
876
+ value: string;
877
+ }
878
+ declare function joinPaths(paths: (string | undefined)[]): string;
879
+ declare function cleanPath(path: string): string;
880
+ declare function trimPathLeft(path: string): string;
881
+ declare function trimPathRight(path: string): string;
882
+ declare function trimPath(path: string): string;
883
+ declare function resolvePath(basepath: string, base: string, to: string): string;
884
+ declare function parsePathname(pathname?: string): Segment[];
885
+ declare function interpolatePath(path: string | undefined, params: any, leaveWildcards?: boolean): string;
886
+ declare function matchPathname(basepath: string, currentPathname: string, matchLocation: Pick<MatchLocation, 'to' | 'fuzzy' | 'caseSensitive'>): AnyPathParams | undefined;
887
+ declare function removeBasepath(basepath: string, pathname: string): string;
888
+ declare function matchByPath(basepath: string, from: string, matchLocation: Pick<MatchLocation, 'to' | 'caseSensitive' | 'fuzzy'>): Record<string, string> | undefined;
889
+
890
+ declare function encode(obj: any, pfx?: string): string;
891
+ declare function decode(str: any): {};
892
+
893
+ type AnyRedirect = Redirect<any, any, any, any, any>;
894
+ type Redirect<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = TFrom, TMaskTo extends string = ''> = {
895
+ code?: number;
896
+ throw?: any;
897
+ } & NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>;
898
+ declare function redirect<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = TFrom, TMaskTo extends string = ''>(opts: Redirect<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>): Redirect<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>;
899
+ declare function isRedirect(obj: any): obj is AnyRedirect;
900
+
901
+ type ScrollRestorationOptions = {
902
+ getKey?: (location: ParsedLocation) => string;
903
+ };
904
+ declare function useScrollRestoration(options?: ScrollRestorationOptions): void;
905
+ declare function ScrollRestoration(props: ScrollRestorationOptions): null;
906
+ declare function useElementScrollRestoration(options: ({
907
+ id: string;
908
+ getElement?: () => Element | undefined | null;
909
+ } | {
910
+ id?: string;
911
+ getElement: () => Element | undefined | null;
912
+ }) & {
913
+ getKey?: (location: ParsedLocation) => string;
914
+ }): {
915
+ scrollX: number;
916
+ scrollY: number;
917
+ } | undefined;
918
+
919
+ declare function useBlocker(blockerFn: BlockerFn, condition?: boolean | any): void;
920
+ declare function Block({ blocker, condition, children }: PromptProps): any;
921
+ type PromptProps = {
922
+ blocker: BlockerFn;
923
+ condition?: boolean | any;
924
+ children?: ReactNode;
925
+ };
926
+
927
+ declare function useParams<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TDefaultSelected = AllParams<TRouteTree> & RouteById<TRouteTree, TFrom>['types']['allParams'], TSelected = TDefaultSelected>(opts: StrictOrFrom<TFrom> & {
928
+ select?: (search: TDefaultSelected) => TSelected;
929
+ }): TSelected;
930
+
931
+ declare function useSearch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RouteIds<TRouteTree> = RouteIds<TRouteTree>, TStrict extends boolean = true, TSearch = RouteById<TRouteTree, TFrom>['types']['fullSearchSchema'], TSelected = TSearch>(opts: StrictOrFrom<TFrom> & {
932
+ select?: (search: TSearch) => TSelected;
933
+ }): TStrict extends true ? TSelected : TSelected | undefined;
111
934
 
112
- export { Block, ErrorComponent, Link, LinkFn, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, MatchesProviderProps, Navigate, Outlet, PromptProps, ReactRouter, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, lazy, matchesContext, routerContext, useBlocker, useLinkProps, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRoute, useRouter, useRouterContext, useSearch };
935
+ export { type ActiveLinkOptions, type ActiveOptions, type AllParams, type AnyContext, type AnyPathParams, type AnyRedirect, type AnyRootRoute, type AnyRoute, type AnyRouteMatch, type AnyRouter, type AnySearchSchema, type Assign, type AssignAll, type AsyncRouteComponent, Await, type AwaitOptions, type BaseRouteOptions, Block, type BuildLocationFn, type BuildNextOptions, CatchBoundary, CatchBoundaryImpl, type CheckId, type CheckIdError, type CheckPath, type CheckPathError, type CheckRelativePath, type CleanPath, type CommitLocationOptions, type DeepAwaited, type DeferredPromise, type DeferredPromiseState, type DefinedPathParamWarning, type DehydratedRouteMatch, type DehydratedRouter, type DehydratedRouterState, ErrorComponent, type ErrorRouteComponent, type ErrorRouteProps, type Expand, FileRoute, type FileRoutePath, type FileRoutesByPath, type FullSearchSchema, type HydrationCtx, type InferFullSearchSchema, type InjectedHtmlEntry, type IsAny, type IsAnyBoolean, type IsKnown, type Join, type Last, Link, type LinkComponent, type LinkOptions, type LinkProps, type ListenerFn, type LoaderFnContext, type MakeMatchRouteOptions, Match, type MatchLocation, MatchRoute, type MatchRouteFn, type MatchRouteOptions, Matches, type MergeFromFromParent, type MetaOptions, Navigate, type NavigateFn, type NavigateOptions, type NoInfer, type NonNullableUpdater, NotFoundRoute, Outlet, type ParamsFallback, type ParentParams, type ParseParamsFn, type ParseParamsObj, type ParseParamsOption, type ParsePathParams, type ParseRoute, type ParseRouteChildren, type ParsedLocation, PathParamError, type PathParamMask, type PathParamOptions, type PickAsPartial, type PickAsRequired, type PickExclude, type PickExtra, type PickExtract, type PickRequired, type PickUnsafe, type PreloadableObj, type PromptProps, type ReactNode, type Redirect, type Register, type RegisteredRouter, type RelativeToPathAutoComplete, type RemoveUnderScores, type ResolveAllParams, type ResolveFilePath, type ResolveFullPath, type ResolveFullSearchSchema, type ResolveId, type ResolveRelativePath, RootRoute, type RootRouteId, Route, RouteApi, type RouteById, type RouteByPath, type RouteComponent, type RouteConstraints, type RouteContext, type RouteFromIdOrRoute, type RouteIds, type RouteLoaderFn, type RouteMask, type RouteMatch, type RouteMeta, type RouteOptions, type RoutePathOptions, type RoutePathOptionsIntersection, type RoutePaths, Router, type RouterConstructorOptions, type RouterContextOptions, type RouterEvent, type RouterEvents, type RouterListener, type RouterOptions, type RouterProps, RouterProvider, type RouterState, type RoutesById, type RoutesByPath, ScrollRestoration, type ScrollRestorationOptions, type SearchFilter, SearchParamError, type SearchParamOptions, type SearchParser, type SearchSchemaValidator, type SearchSchemaValidatorFn, type SearchSchemaValidatorObj, type SearchSerializer, type Segment, type Split, type StrictOrFrom, type SyncRouteComponent, type Timeout, type ToIdOption, type ToMaskOptions, type ToOptions, type ToPathOption, type ToSubOptions, type Trim, type TrimLeft, type TrimPath, type TrimPathLeft, type TrimPathRight, type TrimRight, type UnionToIntersection, type UnionToTuple, type UpdatableRouteOptions, type Updater, type UseLinkPropsOptions, type UseMatchRouteOptions, type ValueKeys, type Values, cleanPath, componentTypes, createRouteMask, decode, deepEqual, defaultParseSearch, defaultStringifySearch, defer, encode, escapeJSON, functionalUpdate, getInitialRouterState, getRouteMatch, interpolatePath, isDehydratedDeferred, isPlainObject, isRedirect, isServer, joinPaths, last, lazyFn, lazyRouteComponent, matchByPath, matchContext, matchPathname, parsePathname, parseSearchWith, pick, redirect, removeBasepath, replaceEqualDeep, resolvePath, rootRouteId, rootRouteWithContext, routerContext, shallow, stringifySearchWith, trimPath, trimPathLeft, trimPathRight, useAwaited, useBlocker, useElementScrollRestoration, useLayoutEffect, useLinkProps, useLoaderData, useLoaderDeps, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useParentMatches, useRouteContext, useRouter, useRouterState, useScrollRestoration, useSearch, useStableCallback };