@tanstack/solid-router 1.111.3 → 1.111.4

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 (118) hide show
  1. package/dist/source/Asset.d.ts +2 -0
  2. package/dist/source/Asset.jsx +22 -0
  3. package/dist/source/Asset.jsx.map +1 -0
  4. package/dist/source/CatchBoundary.d.ts +11 -0
  5. package/dist/source/CatchBoundary.jsx +43 -0
  6. package/dist/source/CatchBoundary.jsx.map +1 -0
  7. package/dist/source/HeadContent.d.ts +8 -0
  8. package/dist/source/HeadContent.jsx +125 -0
  9. package/dist/source/HeadContent.jsx.map +1 -0
  10. package/dist/source/Match.d.ts +8 -0
  11. package/dist/source/Match.jsx +256 -0
  12. package/dist/source/Match.jsx.map +1 -0
  13. package/dist/source/Matches.d.ts +67 -0
  14. package/dist/source/Matches.jsx +103 -0
  15. package/dist/source/Matches.jsx.map +1 -0
  16. package/dist/source/RouterProvider.d.ts +10 -0
  17. package/dist/source/RouterProvider.jsx +27 -0
  18. package/dist/source/RouterProvider.jsx.map +1 -0
  19. package/dist/source/SafeFragment.d.ts +1 -0
  20. package/dist/source/SafeFragment.jsx +4 -0
  21. package/dist/source/SafeFragment.jsx.map +1 -0
  22. package/dist/source/ScriptOnce.d.ts +5 -0
  23. package/dist/source/ScriptOnce.jsx +17 -0
  24. package/dist/source/ScriptOnce.jsx.map +1 -0
  25. package/dist/source/Scripts.d.ts +1 -0
  26. package/dist/source/Scripts.jsx +49 -0
  27. package/dist/source/Scripts.jsx.map +1 -0
  28. package/dist/source/ScrollRestoration.d.ts +15 -0
  29. package/dist/source/ScrollRestoration.jsx +36 -0
  30. package/dist/source/ScrollRestoration.jsx.map +1 -0
  31. package/dist/source/Transitioner.d.ts +1 -0
  32. package/dist/source/Transitioner.jsx +112 -0
  33. package/dist/source/Transitioner.jsx.map +1 -0
  34. package/dist/source/awaited.d.ts +11 -0
  35. package/dist/source/awaited.jsx +24 -0
  36. package/dist/source/awaited.jsx.map +1 -0
  37. package/dist/source/fileRoute.d.ts +46 -0
  38. package/dist/source/fileRoute.js +85 -0
  39. package/dist/source/fileRoute.js.map +1 -0
  40. package/dist/source/history.d.ts +8 -0
  41. package/dist/source/history.js +2 -0
  42. package/dist/source/history.js.map +1 -0
  43. package/dist/source/index.d.ts +52 -0
  44. package/dist/source/index.jsx +41 -0
  45. package/dist/source/index.jsx.map +1 -0
  46. package/dist/source/lazyRouteComponent.d.ts +7 -0
  47. package/dist/source/lazyRouteComponent.jsx +82 -0
  48. package/dist/source/lazyRouteComponent.jsx.map +1 -0
  49. package/dist/source/link.d.ts +41 -0
  50. package/dist/source/link.jsx +339 -0
  51. package/dist/source/link.jsx.map +1 -0
  52. package/dist/source/matchContext.d.ts +3 -0
  53. package/dist/source/matchContext.jsx +5 -0
  54. package/dist/source/matchContext.jsx.map +1 -0
  55. package/dist/source/not-found.d.ts +27 -0
  56. package/dist/source/not-found.jsx +39 -0
  57. package/dist/source/not-found.jsx.map +1 -0
  58. package/dist/source/redirects.d.ts +19 -0
  59. package/dist/source/redirects.js +25 -0
  60. package/dist/source/redirects.js.map +1 -0
  61. package/dist/source/renderRouteNotFound.d.ts +3 -0
  62. package/dist/source/renderRouteNotFound.jsx +15 -0
  63. package/dist/source/renderRouteNotFound.jsx.map +1 -0
  64. package/dist/source/route.d.ts +257 -0
  65. package/dist/source/route.js +240 -0
  66. package/dist/source/route.js.map +1 -0
  67. package/dist/source/router.d.ts +550 -0
  68. package/dist/source/router.js +1802 -0
  69. package/dist/source/router.js.map +1 -0
  70. package/dist/source/routerContext.d.ts +8 -0
  71. package/dist/source/routerContext.jsx +13 -0
  72. package/dist/source/routerContext.jsx.map +1 -0
  73. package/dist/source/scroll-restoration.d.ts +29 -0
  74. package/dist/source/scroll-restoration.jsx +244 -0
  75. package/dist/source/scroll-restoration.jsx.map +1 -0
  76. package/dist/source/typePrimitives.d.ts +70 -0
  77. package/dist/source/typePrimitives.js +2 -0
  78. package/dist/source/typePrimitives.js.map +1 -0
  79. package/dist/source/useBlocker.d.ts +68 -0
  80. package/dist/source/useBlocker.jsx +136 -0
  81. package/dist/source/useBlocker.jsx.map +1 -0
  82. package/dist/source/useCanGoBack.d.ts +1 -0
  83. package/dist/source/useCanGoBack.js +5 -0
  84. package/dist/source/useCanGoBack.js.map +1 -0
  85. package/dist/source/useLoaderData.d.ts +12 -0
  86. package/dist/source/useLoaderData.jsx +11 -0
  87. package/dist/source/useLoaderData.jsx.map +1 -0
  88. package/dist/source/useLoaderDeps.d.ts +11 -0
  89. package/dist/source/useLoaderDeps.jsx +11 -0
  90. package/dist/source/useLoaderDeps.jsx.map +1 -0
  91. package/dist/source/useLocation.d.ts +7 -0
  92. package/dist/source/useLocation.jsx +7 -0
  93. package/dist/source/useLocation.jsx.map +1 -0
  94. package/dist/source/useMatch.d.ts +14 -0
  95. package/dist/source/useMatch.jsx +19 -0
  96. package/dist/source/useMatch.jsx.map +1 -0
  97. package/dist/source/useNavigate.d.ts +7 -0
  98. package/dist/source/useNavigate.jsx +32 -0
  99. package/dist/source/useNavigate.jsx.map +1 -0
  100. package/dist/source/useParams.d.ts +14 -0
  101. package/dist/source/useParams.jsx +12 -0
  102. package/dist/source/useParams.jsx.map +1 -0
  103. package/dist/source/useRouteContext.d.ts +12 -0
  104. package/dist/source/useRouteContext.js +8 -0
  105. package/dist/source/useRouteContext.js.map +1 -0
  106. package/dist/source/useRouter.d.ts +4 -0
  107. package/dist/source/useRouter.jsx +9 -0
  108. package/dist/source/useRouter.jsx.map +1 -0
  109. package/dist/source/useRouterState.d.ts +8 -0
  110. package/dist/source/useRouterState.jsx +14 -0
  111. package/dist/source/useRouterState.jsx.map +1 -0
  112. package/dist/source/useSearch.d.ts +14 -0
  113. package/dist/source/useSearch.jsx +12 -0
  114. package/dist/source/useSearch.jsx.map +1 -0
  115. package/dist/source/utils.d.ts +43 -0
  116. package/dist/source/utils.js +59 -0
  117. package/dist/source/utils.js.map +1 -0
  118. package/package.json +5 -1
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B,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAA;QAChC,OAAO,IASN,CAAA;IACH,CAAC;IAED,aAAa;QAUX,OAAO,IAAW,CAAA;IACpB,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAQ7B,OAOC;IAED,OAAO,IAAI,SAAS,CAOlB,OAAO,CAAC,CAAA;AACZ,CAAC;AAmBD,MAAM,UAAU,eAAe,CAK7B,IAE0D;IAE1D,OAAO,IAAW,CAAA;AACpB,CAAC;AAgBD,MAAM,OAAO,aASX,SAAQ,KAcT;IACC,YACE,OAqBC;QAED,KAAK,CAAC;YACJ,GAAI,OAAe;YACnB,EAAE,EAAE,KAAK;SACV,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -0,0 +1,550 @@
1
+ import { Store } from '@tanstack/solid-store';
2
+ import type * as Solid from 'solid-js';
3
+ import type { HistoryLocation, HistoryState, ParsedHistoryState, RouterHistory } from '@tanstack/history';
4
+ import type { NoInfer } from '@tanstack/solid-store';
5
+ import type { AnyContext, AnySchema, BuildLocationFn, CommitLocationOptions, ControlledPromise, FullSearchSchema, MakeRemountDepsOptionsUnion, Manifest, NavigateFn, NavigateOptions, NonNullableUpdater, ParsedLocation, PickAsRequired, Register, ResolveRelativePath, RouteById, RoutePaths, RoutesById, RoutesByPath, SearchParser, SearchSerializer, StartSerializer, ToOptions, TrailingSlashOption, Updater, ViewTransitionOptions } from '@tanstack/router-core';
6
+ import type { AnyRoute, ErrorRouteComponent, NotFoundRouteComponent, RootRoute, RouteComponent, RouteMask } from './route';
7
+ import type { AnyRouteMatch, MakeRouteMatch, MakeRouteMatchUnion, MatchRouteOptions } from './Matches';
8
+ import type { AnyRedirect, ResolvedRedirect } from './redirects';
9
+ import type { NotFoundError } from './not-found';
10
+ declare global {
11
+ interface Window {
12
+ __TSR_ROUTER__?: AnyRouter;
13
+ }
14
+ }
15
+ export type AnyRouter = Router<any, any, any, any, any>;
16
+ export type RegisteredRouter = Register extends {
17
+ router: infer TRouter extends AnyRouter;
18
+ } ? TRouter : AnyRouter;
19
+ export type InferRouterContext<TRouteTree extends AnyRoute> = TRouteTree extends RootRoute<any, infer TRouterContext extends AnyContext, any, any, any, any, any, any> ? TRouterContext : AnyContext;
20
+ export type ControllablePromise<T = any> = Promise<T> & {
21
+ resolve: (value: T) => void;
22
+ reject: (value?: any) => void;
23
+ };
24
+ export type RouterContextOptions<TRouteTree extends AnyRoute> = AnyContext extends InferRouterContext<TRouteTree> ? {
25
+ context?: InferRouterContext<TRouteTree>;
26
+ } : {
27
+ context: InferRouterContext<TRouteTree>;
28
+ };
29
+ export type InjectedHtmlEntry = Promise<string>;
30
+ export interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TRouterHistory extends RouterHistory = RouterHistory, TDehydrated extends Record<string, any> = Record<string, any>> {
31
+ /**
32
+ * The history object that will be used to manage the browser history.
33
+ *
34
+ * If not provided, a new createBrowserHistory instance will be created and used.
35
+ *
36
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#history-property)
37
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/history-types)
38
+ */
39
+ history?: TRouterHistory;
40
+ /**
41
+ * A function that will be used to stringify search params when generating links.
42
+ *
43
+ * @default defaultStringifySearch
44
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#stringifysearch-method)
45
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization)
46
+ */
47
+ stringifySearch?: SearchSerializer;
48
+ /**
49
+ * A function that will be used to parse search params when parsing the current location.
50
+ *
51
+ * @default defaultParseSearch
52
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#parsesearch-method)
53
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization)
54
+ */
55
+ parseSearch?: SearchParser;
56
+ /**
57
+ * If `false`, routes will not be preloaded by default in any way.
58
+ *
59
+ * If `'intent'`, routes will be preloaded by default when the user hovers over a link or a `touchstart` event is detected on a `<Link>`.
60
+ *
61
+ * If `'viewport'`, routes will be preloaded by default when they are within the viewport.
62
+ *
63
+ * @default false
64
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreload-property)
65
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
66
+ */
67
+ defaultPreload?: false | 'intent' | 'viewport' | 'render';
68
+ /**
69
+ * The delay in milliseconds that a route must be hovered over or touched before it is preloaded.
70
+ *
71
+ * @default 50
72
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloaddelay-property)
73
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading#preload-delay)
74
+ */
75
+ defaultPreloadDelay?: number;
76
+ /**
77
+ * The default `component` a route should use if no component is provided.
78
+ *
79
+ * @default Outlet
80
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultcomponent-property)
81
+ */
82
+ defaultComponent?: RouteComponent;
83
+ /**
84
+ * The default `errorComponent` a route should use if no error component is provided.
85
+ *
86
+ * @default ErrorComponent
87
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulterrorcomponent-property)
88
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)
89
+ */
90
+ defaultErrorComponent?: ErrorRouteComponent;
91
+ /**
92
+ * The default `pendingComponent` a route should use if no pending component is provided.
93
+ *
94
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingcomponent-property)
95
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#showing-a-pending-component)
96
+ */
97
+ defaultPendingComponent?: RouteComponent;
98
+ /**
99
+ * The default `pendingMs` a route should use if no pendingMs is provided.
100
+ *
101
+ * @default 1000
102
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingms-property)
103
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#avoiding-pending-component-flash)
104
+ */
105
+ defaultPendingMs?: number;
106
+ /**
107
+ * The default `pendingMinMs` a route should use if no pendingMinMs is provided.
108
+ *
109
+ * @default 500
110
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingminms-property)
111
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#avoiding-pending-component-flash)
112
+ */
113
+ defaultPendingMinMs?: number;
114
+ /**
115
+ * The default `staleTime` a route should use if no staleTime is provided. This is the time in milliseconds that a route will be considered fresh.
116
+ *
117
+ * @default 0
118
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultstaletime-property)
119
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)
120
+ */
121
+ defaultStaleTime?: number;
122
+ /**
123
+ * The default `preloadStaleTime` a route should use if no preloadStaleTime is provided.
124
+ *
125
+ * @default 30_000 `(30 seconds)`
126
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadstaletime-property)
127
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
128
+ */
129
+ defaultPreloadStaleTime?: number;
130
+ /**
131
+ * The default `defaultPreloadGcTime` a route should use if no preloadGcTime is provided.
132
+ *
133
+ * @default 1_800_000 `(30 minutes)`
134
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadgctime-property)
135
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
136
+ */
137
+ defaultPreloadGcTime?: number;
138
+ /**
139
+ * The default `onCatch` handler for errors caught by the Router ErrorBoundary
140
+ *
141
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)
142
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)
143
+ */
144
+ defaultOnCatch?: (error: Error) => void;
145
+ /**
146
+ * If `true`, route navigations will called using `document.startViewTransition()`.
147
+ *
148
+ * If the browser does not support this api, this option will be ignored.
149
+ *
150
+ * See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for more information on how this function works.
151
+ *
152
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultviewtransition-property)
153
+ */
154
+ defaultViewTransition?: boolean | ViewTransitionOptions;
155
+ /**
156
+ * The default `hashScrollIntoView` a route should use if no hashScrollIntoView is provided while navigating
157
+ *
158
+ * See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) for more information on `ScrollIntoViewOptions`.
159
+ *
160
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulthashscrollintoview-property)
161
+ */
162
+ defaultHashScrollIntoView?: boolean | ScrollIntoViewOptions;
163
+ /**
164
+ * @default 'fuzzy'
165
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundmode-property)
166
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#the-notfoundmode-option)
167
+ */
168
+ notFoundMode?: 'root' | 'fuzzy';
169
+ /**
170
+ * The default `gcTime` a route should use if no gcTime is provided.
171
+ *
172
+ * @default 1_800_000 `(30 minutes)`
173
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultgctime-property)
174
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)
175
+ */
176
+ defaultGcTime?: number;
177
+ /**
178
+ * If `true`, all routes will be matched as case-sensitive.
179
+ *
180
+ * @default false
181
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#casesensitive-property)
182
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-trees#case-sensitivity)
183
+ */
184
+ caseSensitive?: boolean;
185
+ /**
186
+ *
187
+ * The route tree that will be used to configure the router instance.
188
+ *
189
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#routetree-property)
190
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-trees)
191
+ */
192
+ routeTree?: TRouteTree;
193
+ /**
194
+ * The basepath for then entire router. This is useful for mounting a router instance at a subpath.
195
+ *
196
+ * @default '/'
197
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#basepath-property)
198
+ */
199
+ basepath?: string;
200
+ /**
201
+ * The root context that will be provided to all routes in the route tree.
202
+ *
203
+ * This can be used to provide a context to all routes in the tree without having to provide it to each route individually.
204
+ *
205
+ * Optional or required if the root route was created with [`createRootRouteWithContext()`](https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction).
206
+ *
207
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#context-property)
208
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/router-context)
209
+ */
210
+ context?: InferRouterContext<TRouteTree>;
211
+ /**
212
+ * A function that will be called when the router is dehydrated.
213
+ *
214
+ * The return value of this function will be serialized and stored in the router's dehydrated state.
215
+ *
216
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#dehydrate-method)
217
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
218
+ */
219
+ dehydrate?: () => TDehydrated;
220
+ /**
221
+ * A function that will be called when the router is hydrated.
222
+ *
223
+ * The return value of this function will be serialized and stored in the router's dehydrated state.
224
+ *
225
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#hydrate-method)
226
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
227
+ */
228
+ hydrate?: (dehydrated: TDehydrated) => void;
229
+ /**
230
+ * An array of route masks that will be used to mask routes in the route tree.
231
+ *
232
+ * Route masking is when you display a route at a different path than the one it is configured to match, like a modal popup that when shared will unmask to the modal's content instead of the modal's context.
233
+ *
234
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#routemasks-property)
235
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-masking)
236
+ */
237
+ routeMasks?: Array<RouteMask<TRouteTree>>;
238
+ /**
239
+ * If `true`, route masks will, by default, be removed when the page is reloaded.
240
+ *
241
+ * This can be overridden on a per-mask basis by setting the `unmaskOnReload` option on the mask, or on a per-navigation basis by setting the `unmaskOnReload` option in the `Navigate` options.
242
+ *
243
+ * @default false
244
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#unmaskonreload-property)
245
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-masking#unmasking-on-page-reload)
246
+ */
247
+ unmaskOnReload?: boolean;
248
+ /**
249
+ * A component that will be used to wrap the entire router.
250
+ *
251
+ * This is useful for providing a context to the entire router.
252
+ *
253
+ * Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
254
+ *
255
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#wrap-property)
256
+ */
257
+ Wrap?: (props: {
258
+ children: any;
259
+ }) => Solid.JSX.Element;
260
+ /**
261
+ * A component that will be used to wrap the inner contents of the router.
262
+ *
263
+ * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.
264
+ *
265
+ * Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
266
+ *
267
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#innerwrap-property)
268
+ */
269
+ InnerWrap?: (props: {
270
+ children: any;
271
+ }) => Solid.JSX.Element;
272
+ /**
273
+ * Use `notFoundComponent` instead.
274
+ *
275
+ * @deprecated
276
+ * See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.
277
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundroute-property)
278
+ */
279
+ notFoundRoute?: AnyRoute;
280
+ /**
281
+ * The default `notFoundComponent` a route should use if no notFound component is provided.
282
+ *
283
+ * @default NotFound
284
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultnotfoundcomponent-property)
285
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#default-router-wide-not-found-handling)
286
+ */
287
+ defaultNotFoundComponent?: NotFoundRouteComponent;
288
+ /**
289
+ * Configures how trailing slashes are treated.
290
+ *
291
+ * - `'always'` will add a trailing slash if not present
292
+ * - `'never'` will remove the trailing slash if present
293
+ * - `'preserve'` will not modify the trailing slash.
294
+ *
295
+ * @default 'never'
296
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#trailingslash-property)
297
+ */
298
+ trailingSlash?: TTrailingSlashOption;
299
+ /**
300
+ * While usually automatic, sometimes it can be useful to force the router into a server-side state, e.g. when using the router in a non-browser environment that has access to a global.document object.
301
+ *
302
+ * @default typeof document !== 'undefined'
303
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#isserver-property)
304
+ */
305
+ isServer?: boolean;
306
+ defaultSsr?: boolean;
307
+ search?: {
308
+ /**
309
+ * Configures how unknown search params (= not returned by any `validateSearch`) are treated.
310
+ *
311
+ * @default false
312
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#search.strict-property)
313
+ */
314
+ strict?: boolean;
315
+ };
316
+ /**
317
+ * Configures which URI characters are allowed in path params that would ordinarily be escaped by encodeURIComponent.
318
+ *
319
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#pathparamsallowedcharacters-property)
320
+ * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/path-params#allowed-characters)
321
+ */
322
+ pathParamsAllowedCharacters?: Array<';' | ':' | '@' | '&' | '=' | '+' | '$' | ','>;
323
+ defaultRemountDeps?: (opts: MakeRemountDepsOptionsUnion<TRouteTree>) => any;
324
+ /**
325
+ * If `true`, scroll restoration will be enabled
326
+ *
327
+ * @default false
328
+ */
329
+ scrollRestoration?: boolean;
330
+ /**
331
+ * A function that will be called to get the key for the scroll restoration cache.
332
+ *
333
+ * @default (location) => location.href
334
+ */
335
+ getScrollRestorationKey?: (location: ParsedLocation) => string;
336
+ /**
337
+ * The default behavior for scroll restoration.
338
+ *
339
+ * @default 'auto'
340
+ */
341
+ scrollRestorationBehavior?: ScrollBehavior;
342
+ /**
343
+ * An array of selectors that will be used to scroll to the top of the page in addition to `window`
344
+ *
345
+ * @default ['window']
346
+ */
347
+ scrollToTopSelectors?: Array<string>;
348
+ }
349
+ export interface RouterErrorSerializer<TSerializedError> {
350
+ serialize: (err: unknown) => TSerializedError;
351
+ deserialize: (err: TSerializedError) => unknown;
352
+ }
353
+ export interface RouterState<TRouteTree extends AnyRoute = AnyRoute, TRouteMatch = MakeRouteMatchUnion> {
354
+ status: 'pending' | 'idle';
355
+ loadedAt: number;
356
+ isLoading: boolean;
357
+ isTransitioning: boolean;
358
+ matches: Array<TRouteMatch>;
359
+ pendingMatches?: Array<TRouteMatch>;
360
+ cachedMatches: Array<TRouteMatch>;
361
+ location: ParsedLocation<FullSearchSchema<TRouteTree>>;
362
+ resolvedLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>;
363
+ statusCode: number;
364
+ redirect?: ResolvedRedirect;
365
+ }
366
+ export type ListenerFn<TEvent extends RouterEvent> = (event: TEvent) => void;
367
+ export interface BuildNextOptions {
368
+ to?: string | number | null;
369
+ params?: true | Updater<unknown>;
370
+ search?: true | Updater<unknown>;
371
+ hash?: true | Updater<string>;
372
+ state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
373
+ mask?: {
374
+ to?: string | number | null;
375
+ params?: true | Updater<unknown>;
376
+ search?: true | Updater<unknown>;
377
+ hash?: true | Updater<string>;
378
+ state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
379
+ unmaskOnReload?: boolean;
380
+ };
381
+ from?: string;
382
+ _fromLocation?: ParsedLocation;
383
+ href?: string;
384
+ }
385
+ export interface MatchedRoutesResult {
386
+ matchedRoutes: Array<AnyRoute>;
387
+ routeParams: Record<string, string>;
388
+ }
389
+ export type RouterConstructorOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TRouterHistory extends RouterHistory, TDehydrated extends Record<string, any>> = Omit<RouterOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>, 'context'> & RouterContextOptions<TRouteTree>;
390
+ export declare const componentTypes: readonly ["component", "errorComponent", "pendingComponent", "notFoundComponent"];
391
+ type NavigationEventInfo = {
392
+ fromLocation?: ParsedLocation;
393
+ toLocation: ParsedLocation;
394
+ pathChanged: boolean;
395
+ hrefChanged: boolean;
396
+ hashChanged: boolean;
397
+ };
398
+ export type RouterEvents = {
399
+ onBeforeNavigate: {
400
+ type: 'onBeforeNavigate';
401
+ } & NavigationEventInfo;
402
+ onBeforeLoad: {
403
+ type: 'onBeforeLoad';
404
+ } & NavigationEventInfo;
405
+ onLoad: {
406
+ type: 'onLoad';
407
+ } & NavigationEventInfo;
408
+ onResolved: {
409
+ type: 'onResolved';
410
+ } & NavigationEventInfo;
411
+ onBeforeRouteMount: {
412
+ type: 'onBeforeRouteMount';
413
+ } & NavigationEventInfo;
414
+ onInjectedHtml: {
415
+ type: 'onInjectedHtml';
416
+ promise: Promise<string>;
417
+ };
418
+ onRendered: {
419
+ type: 'onRendered';
420
+ } & NavigationEventInfo;
421
+ };
422
+ export type RouterEvent = RouterEvents[keyof RouterEvents];
423
+ export type RouterListener<TRouterEvent extends RouterEvent> = {
424
+ eventType: TRouterEvent['type'];
425
+ fn: ListenerFn<TRouterEvent>;
426
+ };
427
+ export declare function createRouter<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TRouterHistory extends RouterHistory = RouterHistory, TDehydrated extends Record<string, any> = Record<string, any>, TSerializedError extends Record<string, any> = Record<string, any>>(options: undefined extends number ? 'strictNullChecks must be enabled in tsconfig.json' : RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>): Router<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated, TSerializedError>;
428
+ type MatchRoutesOpts = {
429
+ preload?: boolean;
430
+ throwOnError?: boolean;
431
+ _buildLocation?: boolean;
432
+ dest?: BuildNextOptions;
433
+ };
434
+ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>, in out TSerializedError extends Record<string, any> = Record<string, any>> {
435
+ tempLocationKey: string | undefined;
436
+ resetNextScroll: boolean;
437
+ shouldViewTransition?: boolean | ViewTransitionOptions;
438
+ isViewTransitionTypesSupported?: boolean;
439
+ subscribers: Set<RouterListener<RouterEvent>>;
440
+ viewTransitionPromise?: ControlledPromise<true>;
441
+ isScrollRestoring: boolean;
442
+ isScrollRestorationSetup: boolean;
443
+ __store: Store<RouterState<TRouteTree>>;
444
+ options: PickAsRequired<RouterOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>;
445
+ history: TRouterHistory;
446
+ latestLocation: ParsedLocation<FullSearchSchema<TRouteTree>>;
447
+ basepath: string;
448
+ routeTree: TRouteTree;
449
+ routesById: RoutesById<TRouteTree>;
450
+ routesByPath: RoutesByPath<TRouteTree>;
451
+ flatRoutes: Array<AnyRoute>;
452
+ isServer: boolean;
453
+ pathParamsDecodeCharMap?: Map<string, string>;
454
+ /**
455
+ * @deprecated Use the `createRouter` function instead
456
+ */
457
+ constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>);
458
+ startSolidTransition: (fn: () => void) => void;
459
+ update: (newOptions: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>) => void;
460
+ get state(): RouterState<TRouteTree, import("./Matches").RouteMatch<any, any, any, any, any, any, any>>;
461
+ buildRouteTree: () => void;
462
+ subscribe: <TType extends keyof RouterEvents>(eventType: TType, fn: ListenerFn<RouterEvents[TType]>) => () => void;
463
+ emit: (routerEvent: RouterEvent) => void;
464
+ parseLocation: (previousLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>, locationToParse?: HistoryLocation) => ParsedLocation<FullSearchSchema<TRouteTree>>;
465
+ resolvePathWithBase: (from: string, path: string) => string;
466
+ get looseRoutesById(): Record<string, AnyRoute>;
467
+ /**
468
+ @deprecated use the following signature instead
469
+ ```ts
470
+ matchRoutes (
471
+ next: ParsedLocation,
472
+ opts?: { preload?: boolean; throwOnError?: boolean },
473
+ ): Array<AnyRouteMatch>;
474
+ ```
475
+ */
476
+ matchRoutes(pathname: string, locationSearch: AnySchema, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
477
+ matchRoutes(next: ParsedLocation, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
478
+ private matchRoutesInternal;
479
+ getMatchedRoutes: (next: ParsedLocation, dest?: BuildNextOptions) => {
480
+ matchedRoutes: AnyRoute[];
481
+ routeParams: Record<string, string>;
482
+ foundRoute: AnyRoute | undefined;
483
+ };
484
+ cancelMatch: (id: string) => void;
485
+ cancelMatches: () => void;
486
+ buildLocation: BuildLocationFn;
487
+ commitLocationPromise: undefined | ControlledPromise<void>;
488
+ commitLocation: ({ viewTransition, ignoreBlocker, ...next }: ParsedLocation & CommitLocationOptions) => Promise<void>;
489
+ buildAndCommitLocation: ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, href, ...rest }?: BuildNextOptions & CommitLocationOptions) => Promise<void>;
490
+ navigate: NavigateFn;
491
+ latestLoadPromise: undefined | Promise<void>;
492
+ load: (opts?: {
493
+ sync?: boolean;
494
+ }) => Promise<void>;
495
+ startViewTransition: (fn: () => Promise<void>) => void;
496
+ updateMatch: (id: string, updater: (match: AnyRouteMatch) => AnyRouteMatch) => AnyRouteMatch;
497
+ getMatch: (matchId: string) => import("./Matches").RouteMatch<any, any, any, any, any, any, any> | undefined;
498
+ loadMatches: ({ location, matches, preload: allPreload, onReady, updateMatch, sync, }: {
499
+ location: ParsedLocation;
500
+ matches: Array<AnyRouteMatch>;
501
+ preload?: boolean;
502
+ onReady?: () => Promise<void>;
503
+ updateMatch?: (id: string, updater: (match: AnyRouteMatch) => AnyRouteMatch) => void;
504
+ getMatch?: (matchId: string) => AnyRouteMatch | undefined;
505
+ sync?: boolean;
506
+ }) => Promise<Array<MakeRouteMatch>>;
507
+ invalidate: <TRouter extends AnyRouter = this>(opts?: {
508
+ filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
509
+ sync?: boolean;
510
+ }) => Promise<void>;
511
+ resolveRedirect: (err: AnyRedirect) => ResolvedRedirect;
512
+ clearCache: <TRouter extends AnyRouter = this>(opts?: {
513
+ filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
514
+ }) => void;
515
+ clearExpiredCache: () => void;
516
+ loadRouteChunk: (route: AnyRoute) => Promise<void[]>;
517
+ preloadRoute: <TFrom extends RoutePaths<TRouteTree> | string = string, TTo extends string | undefined = undefined, TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom, TMaskTo extends string = "">(opts: NavigateOptions<Router<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated, TSerializedError>, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<Array<AnyRouteMatch> | undefined>;
518
+ matchRoute: <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string | undefined = undefined, TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>>(location: ToOptions<Router<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated, TSerializedError>, TFrom, TTo>, opts?: MatchRouteOptions) => false | RouteById<TRouteTree, TResolved>["types"]["allParams"];
519
+ ssr?: {
520
+ manifest: Manifest | undefined;
521
+ serializer: StartSerializer;
522
+ };
523
+ serverSsr?: {
524
+ injectedHtml: Array<InjectedHtmlEntry>;
525
+ injectHtml: (getHtml: () => string | Promise<string>) => Promise<void>;
526
+ injectScript: (getScript: () => string | Promise<string>, opts?: {
527
+ logScript?: boolean;
528
+ }) => Promise<void>;
529
+ streamValue: (key: string, value: any) => void;
530
+ streamedKeys: Set<string>;
531
+ onMatchSettled: (opts: {
532
+ router: AnyRouter;
533
+ match: AnyRouteMatch;
534
+ }) => any;
535
+ };
536
+ clientSsr?: {
537
+ getStreamedValue: <T>(key: string) => T | undefined;
538
+ };
539
+ _handleNotFound: (matches: Array<AnyRouteMatch>, err: NotFoundError, { updateMatch, }?: {
540
+ updateMatch?: (id: string, updater: (match: AnyRouteMatch) => AnyRouteMatch) => void;
541
+ }) => void;
542
+ hasNotFoundMatch: () => boolean;
543
+ }
544
+ export declare function lazyFn<T extends Record<string, (...args: Array<any>) => any>, TKey extends keyof T = 'default'>(fn: () => Promise<T>, key?: TKey): (...args: Parameters<T[TKey]>) => Promise<Awaited<ReturnType<T[TKey]>>>;
545
+ export declare class SearchParamError extends Error {
546
+ }
547
+ export declare class PathParamError extends Error {
548
+ }
549
+ export declare function getInitialRouterState(location: ParsedLocation): RouterState<any>;
550
+ export {};