react-router 7.0.0-pre.2 → 7.0.0-pre.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 (89) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/chunk-FT3T2DDR.mjs +9617 -0
  3. package/dist/dom-export.d.mts +13 -0
  4. package/dist/dom-export.d.ts +13 -3
  5. package/dist/dom-export.js +5502 -0
  6. package/dist/dom-export.mjs +112 -126
  7. package/dist/{lib/dom/lib.d.ts → fog-of-war-BijhfqFM.d.ts} +699 -45
  8. package/dist/fog-of-war-Bz_EDtxF.d.mts +1595 -0
  9. package/dist/index.d.mts +839 -0
  10. package/dist/index.d.ts +839 -73
  11. package/dist/index.js +9763 -0
  12. package/dist/index.mjs +225 -12689
  13. package/dist/lib/types.d.mts +2 -0
  14. package/dist/lib/types.d.ts +2 -83
  15. package/dist/lib/types.js +28 -0
  16. package/dist/lib/types.mjs +1 -1
  17. package/dist/types-BlYP8xpH.d.mts +1620 -0
  18. package/dist/types-BlYP8xpH.d.ts +1620 -0
  19. package/package.json +52 -12
  20. package/dist/dom-export.mjs.map +0 -1
  21. package/dist/index.mjs.map +0 -1
  22. package/dist/lib/components.d.ts +0 -372
  23. package/dist/lib/context.d.ts +0 -115
  24. package/dist/lib/dom/dom.d.ts +0 -123
  25. package/dist/lib/dom/global.d.ts +0 -40
  26. package/dist/lib/dom/server.d.ts +0 -41
  27. package/dist/lib/dom/ssr/components.d.ts +0 -122
  28. package/dist/lib/dom/ssr/data.d.ts +0 -2
  29. package/dist/lib/dom/ssr/entry.d.ts +0 -48
  30. package/dist/lib/dom/ssr/errorBoundaries.d.ts +0 -36
  31. package/dist/lib/dom/ssr/errors.d.ts +0 -2
  32. package/dist/lib/dom/ssr/fallback.d.ts +0 -2
  33. package/dist/lib/dom/ssr/fog-of-war.d.ts +0 -28
  34. package/dist/lib/dom/ssr/invariant.d.ts +0 -2
  35. package/dist/lib/dom/ssr/links.d.ts +0 -25
  36. package/dist/lib/dom/ssr/markup.d.ts +0 -5
  37. package/dist/lib/dom/ssr/routeModules.d.ts +0 -183
  38. package/dist/lib/dom/ssr/routes-test-stub.d.ts +0 -59
  39. package/dist/lib/dom/ssr/routes.d.ts +0 -29
  40. package/dist/lib/dom/ssr/server.d.ts +0 -16
  41. package/dist/lib/dom/ssr/single-fetch.d.ts +0 -37
  42. package/dist/lib/dom-export/dom-router-provider.d.ts +0 -5
  43. package/dist/lib/dom-export/hydrated-router.d.ts +0 -5
  44. package/dist/lib/dom-export.d.ts +0 -3
  45. package/dist/lib/hooks.d.ts +0 -411
  46. package/dist/lib/router/history.d.ts +0 -253
  47. package/dist/lib/router/links.d.ts +0 -104
  48. package/dist/lib/router/router.d.ts +0 -544
  49. package/dist/lib/router/utils.d.ts +0 -497
  50. package/dist/lib/server-runtime/build.d.ts +0 -38
  51. package/dist/lib/server-runtime/cookies.d.ts +0 -62
  52. package/dist/lib/server-runtime/crypto.d.ts +0 -2
  53. package/dist/lib/server-runtime/data.d.ts +0 -11
  54. package/dist/lib/server-runtime/dev.d.ts +0 -8
  55. package/dist/lib/server-runtime/entry.d.ts +0 -3
  56. package/dist/lib/server-runtime/errors.d.ts +0 -51
  57. package/dist/lib/server-runtime/headers.d.ts +0 -3
  58. package/dist/lib/server-runtime/invariant.d.ts +0 -2
  59. package/dist/lib/server-runtime/markup.d.ts +0 -1
  60. package/dist/lib/server-runtime/mode.d.ts +0 -9
  61. package/dist/lib/server-runtime/routeMatching.d.ts +0 -8
  62. package/dist/lib/server-runtime/routeModules.d.ts +0 -40
  63. package/dist/lib/server-runtime/routes.d.ts +0 -11
  64. package/dist/lib/server-runtime/server.d.ts +0 -5
  65. package/dist/lib/server-runtime/serverHandoff.d.ts +0 -11
  66. package/dist/lib/server-runtime/sessions/cookieStorage.d.ts +0 -19
  67. package/dist/lib/server-runtime/sessions/memoryStorage.d.ts +0 -17
  68. package/dist/lib/server-runtime/sessions.d.ts +0 -140
  69. package/dist/lib/server-runtime/single-fetch.d.ts +0 -30
  70. package/dist/lib/server-runtime/typecheck.d.ts +0 -4
  71. package/dist/lib/server-runtime/warnings.d.ts +0 -1
  72. package/dist/main-dom-export.js +0 -19
  73. package/dist/main.js +0 -19
  74. package/dist/react-router-dom.development.js +0 -199
  75. package/dist/react-router-dom.development.js.map +0 -1
  76. package/dist/react-router-dom.production.min.js +0 -12
  77. package/dist/react-router-dom.production.min.js.map +0 -1
  78. package/dist/react-router.development.js +0 -12528
  79. package/dist/react-router.development.js.map +0 -1
  80. package/dist/react-router.production.min.js +0 -12
  81. package/dist/react-router.production.min.js.map +0 -1
  82. package/dist/umd/react-router-dom.development.js +0 -241
  83. package/dist/umd/react-router-dom.development.js.map +0 -1
  84. package/dist/umd/react-router-dom.production.min.js +0 -12
  85. package/dist/umd/react-router-dom.production.min.js.map +0 -1
  86. package/dist/umd/react-router.development.js +0 -12834
  87. package/dist/umd/react-router.development.js.map +0 -1
  88. package/dist/umd/react-router.production.min.js +0 -12
  89. package/dist/umd/react-router.production.min.js.map +0 -1
@@ -0,0 +1,1620 @@
1
+ import * as React from 'react';
2
+ import { ComponentType, ReactElement } from 'react';
3
+
4
+ /**
5
+ * Actions represent the type of change to a location value.
6
+ */
7
+ declare enum Action {
8
+ /**
9
+ * A POP indicates a change to an arbitrary index in the history stack, such
10
+ * as a back or forward navigation. It does not describe the direction of the
11
+ * navigation, only that the current index changed.
12
+ *
13
+ * Note: This is the default action for newly created history objects.
14
+ */
15
+ Pop = "POP",
16
+ /**
17
+ * A PUSH indicates a new entry being added to the history stack, such as when
18
+ * a link is clicked and a new page loads. When this happens, all subsequent
19
+ * entries in the stack are lost.
20
+ */
21
+ Push = "PUSH",
22
+ /**
23
+ * A REPLACE indicates the entry at the current index in the history stack
24
+ * being replaced by a new one.
25
+ */
26
+ Replace = "REPLACE"
27
+ }
28
+ /**
29
+ * The pathname, search, and hash values of a URL.
30
+ */
31
+ interface Path {
32
+ /**
33
+ * A URL pathname, beginning with a /.
34
+ */
35
+ pathname: string;
36
+ /**
37
+ * A URL search string, beginning with a ?.
38
+ */
39
+ search: string;
40
+ /**
41
+ * A URL fragment identifier, beginning with a #.
42
+ */
43
+ hash: string;
44
+ }
45
+ /**
46
+ * An entry in a history stack. A location contains information about the
47
+ * URL path, as well as possibly some arbitrary state and a key.
48
+ */
49
+ interface Location<State = any> extends Path {
50
+ /**
51
+ * A value of arbitrary data associated with this location.
52
+ */
53
+ state: State;
54
+ /**
55
+ * A unique string associated with this location. May be used to safely store
56
+ * and retrieve data in some other storage API, like `localStorage`.
57
+ *
58
+ * Note: This value is always "default" on the initial location.
59
+ */
60
+ key: string;
61
+ }
62
+ /**
63
+ * A change to the current location.
64
+ */
65
+ interface Update {
66
+ /**
67
+ * The action that triggered the change.
68
+ */
69
+ action: Action;
70
+ /**
71
+ * The new location.
72
+ */
73
+ location: Location;
74
+ /**
75
+ * The delta between this location and the former location in the history stack
76
+ */
77
+ delta: number | null;
78
+ }
79
+ /**
80
+ * A function that receives notifications about location changes.
81
+ */
82
+ interface Listener {
83
+ (update: Update): void;
84
+ }
85
+ /**
86
+ * Describes a location that is the destination of some navigation used in
87
+ * {@link Link}, {@link useNavigate}, etc.
88
+ */
89
+ type To = string | Partial<Path>;
90
+ /**
91
+ * A history is an interface to the navigation stack. The history serves as the
92
+ * source of truth for the current location, as well as provides a set of
93
+ * methods that may be used to change it.
94
+ *
95
+ * It is similar to the DOM's `window.history` object, but with a smaller, more
96
+ * focused API.
97
+ */
98
+ interface History {
99
+ /**
100
+ * The last action that modified the current location. This will always be
101
+ * Action.Pop when a history instance is first created. This value is mutable.
102
+ */
103
+ readonly action: Action;
104
+ /**
105
+ * The current location. This value is mutable.
106
+ */
107
+ readonly location: Location;
108
+ /**
109
+ * Returns a valid href for the given `to` value that may be used as
110
+ * the value of an <a href> attribute.
111
+ *
112
+ * @param to - The destination URL
113
+ */
114
+ createHref(to: To): string;
115
+ /**
116
+ * Returns a URL for the given `to` value
117
+ *
118
+ * @param to - The destination URL
119
+ */
120
+ createURL(to: To): URL;
121
+ /**
122
+ * Encode a location the same way window.history would do (no-op for memory
123
+ * history) so we ensure our PUSH/REPLACE navigations for data routers
124
+ * behave the same as POP
125
+ *
126
+ * @param to Unencoded path
127
+ */
128
+ encodeLocation(to: To): Path;
129
+ /**
130
+ * Pushes a new location onto the history stack, increasing its length by one.
131
+ * If there were any entries in the stack after the current one, they are
132
+ * lost.
133
+ *
134
+ * @param to - The new URL
135
+ * @param state - Data to associate with the new location
136
+ */
137
+ push(to: To, state?: any): void;
138
+ /**
139
+ * Replaces the current location in the history stack with a new one. The
140
+ * location that was replaced will no longer be available.
141
+ *
142
+ * @param to - The new URL
143
+ * @param state - Data to associate with the new location
144
+ */
145
+ replace(to: To, state?: any): void;
146
+ /**
147
+ * Navigates `n` entries backward/forward in the history stack relative to the
148
+ * current index. For example, a "back" navigation would use go(-1).
149
+ *
150
+ * @param delta - The delta in the stack index
151
+ */
152
+ go(delta: number): void;
153
+ /**
154
+ * Sets up a listener that will be called whenever the current location
155
+ * changes.
156
+ *
157
+ * @param listener - A function that will be called when the location changes
158
+ * @returns unlisten - A function that may be used to stop listening
159
+ */
160
+ listen(listener: Listener): () => void;
161
+ }
162
+ /**
163
+ * A user-supplied object that describes a location. Used when providing
164
+ * entries to `createMemoryHistory` via its `initialEntries` option.
165
+ */
166
+ type InitialEntry = string | Partial<Location>;
167
+ /**
168
+ * A browser history stores the current location in regular URLs in a web
169
+ * browser environment. This is the standard for most web apps and provides the
170
+ * cleanest URLs the browser's address bar.
171
+ *
172
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#browserhistory
173
+ */
174
+ interface BrowserHistory extends UrlHistory {
175
+ }
176
+ type BrowserHistoryOptions = UrlHistoryOptions;
177
+ /**
178
+ * Browser history stores the location in regular URLs. This is the standard for
179
+ * most web apps, but it requires some configuration on the server to ensure you
180
+ * serve the same app at multiple URLs.
181
+ *
182
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory
183
+ */
184
+ declare function createBrowserHistory(options?: BrowserHistoryOptions): BrowserHistory;
185
+ /**
186
+ * @private
187
+ */
188
+ declare function invariant(value: boolean, message?: string): asserts value;
189
+ declare function invariant<T>(value: T | null | undefined, message?: string): asserts value is T;
190
+ /**
191
+ * Creates a string URL path from the given pathname, search, and hash components.
192
+ *
193
+ * @category Utils
194
+ */
195
+ declare function createPath({ pathname, search, hash, }: Partial<Path>): string;
196
+ /**
197
+ * Parses a string URL path into its separate pathname, search, and hash components.
198
+ *
199
+ * @category Utils
200
+ */
201
+ declare function parsePath(path: string): Partial<Path>;
202
+ interface UrlHistory extends History {
203
+ }
204
+ type UrlHistoryOptions = {
205
+ window?: Window;
206
+ v5Compat?: boolean;
207
+ };
208
+
209
+ /**
210
+ * Map of routeId -> data returned from a loader/action/error
211
+ */
212
+ interface RouteData {
213
+ [routeId: string]: any;
214
+ }
215
+ type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
216
+ type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
217
+ /**
218
+ * Users can specify either lowercase or uppercase form methods on `<Form>`,
219
+ * useSubmit(), `<fetcher.Form>`, etc.
220
+ */
221
+ type HTMLFormMethod = LowerCaseFormMethod | UpperCaseFormMethod;
222
+ /**
223
+ * Active navigation/fetcher form methods are exposed in uppercase on the
224
+ * RouterState. This is to align with the normalization done via fetch().
225
+ */
226
+ type FormMethod = UpperCaseFormMethod;
227
+ type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";
228
+ type JsonObject = {
229
+ [Key in string]: JsonValue;
230
+ } & {
231
+ [Key in string]?: JsonValue | undefined;
232
+ };
233
+ type JsonArray = JsonValue[] | readonly JsonValue[];
234
+ type JsonPrimitive = string | number | boolean | null;
235
+ type JsonValue = JsonPrimitive | JsonObject | JsonArray;
236
+ /**
237
+ * @private
238
+ * Internal interface to pass around for action submissions, not intended for
239
+ * external consumption
240
+ */
241
+ type Submission = {
242
+ formMethod: FormMethod;
243
+ formAction: string;
244
+ formEncType: FormEncType;
245
+ formData: FormData;
246
+ json: undefined;
247
+ text: undefined;
248
+ } | {
249
+ formMethod: FormMethod;
250
+ formAction: string;
251
+ formEncType: FormEncType;
252
+ formData: undefined;
253
+ json: JsonValue;
254
+ text: undefined;
255
+ } | {
256
+ formMethod: FormMethod;
257
+ formAction: string;
258
+ formEncType: FormEncType;
259
+ formData: undefined;
260
+ json: undefined;
261
+ text: string;
262
+ };
263
+ /**
264
+ * @private
265
+ * Arguments passed to route loader/action functions. Same for now but we keep
266
+ * this as a private implementation detail in case they diverge in the future.
267
+ */
268
+ interface DataFunctionArgs<Context> {
269
+ request: Request;
270
+ params: Params;
271
+ context?: Context;
272
+ }
273
+ /**
274
+ * Arguments passed to loader functions
275
+ */
276
+ interface LoaderFunctionArgs<Context = any> extends DataFunctionArgs<Context> {
277
+ }
278
+ /**
279
+ * Arguments passed to action functions
280
+ */
281
+ interface ActionFunctionArgs<Context = any> extends DataFunctionArgs<Context> {
282
+ }
283
+ /**
284
+ * Loaders and actions can return anything except `undefined` (`null` is a
285
+ * valid return value if there is no data to return). Responses are preferred
286
+ * and will ease any future migration to Remix
287
+ */
288
+ type DataFunctionValue = Response | NonNullable<unknown> | null;
289
+ type DataFunctionReturnValue = Promise<DataFunctionValue> | DataFunctionValue;
290
+ /**
291
+ * Route loader function signature
292
+ */
293
+ type LoaderFunction<Context = any> = {
294
+ (args: LoaderFunctionArgs<Context>, handlerCtx?: unknown): DataFunctionReturnValue;
295
+ } & {
296
+ hydrate?: boolean;
297
+ };
298
+ /**
299
+ * Route action function signature
300
+ */
301
+ interface ActionFunction<Context = any> {
302
+ (args: ActionFunctionArgs<Context>, handlerCtx?: unknown): DataFunctionReturnValue;
303
+ }
304
+ /**
305
+ * Arguments passed to shouldRevalidate function
306
+ */
307
+ interface ShouldRevalidateFunctionArgs {
308
+ currentUrl: URL;
309
+ currentParams: AgnosticDataRouteMatch["params"];
310
+ nextUrl: URL;
311
+ nextParams: AgnosticDataRouteMatch["params"];
312
+ formMethod?: Submission["formMethod"];
313
+ formAction?: Submission["formAction"];
314
+ formEncType?: Submission["formEncType"];
315
+ text?: Submission["text"];
316
+ formData?: Submission["formData"];
317
+ json?: Submission["json"];
318
+ actionStatus?: number;
319
+ actionResult?: any;
320
+ defaultShouldRevalidate: boolean;
321
+ }
322
+ /**
323
+ * Route shouldRevalidate function signature. This runs after any submission
324
+ * (navigation or fetcher), so we flatten the navigation/fetcher submission
325
+ * onto the arguments. It shouldn't matter whether it came from a navigation
326
+ * or a fetcher, what really matters is the URLs and the formData since loaders
327
+ * have to re-run based on the data models that were potentially mutated.
328
+ */
329
+ interface ShouldRevalidateFunction {
330
+ (args: ShouldRevalidateFunctionArgs): boolean;
331
+ }
332
+ interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
333
+ shouldLoad: boolean;
334
+ resolve: (handlerOverride?: (handler: (ctx?: unknown) => DataFunctionReturnValue) => DataFunctionReturnValue) => Promise<DataStrategyResult>;
335
+ }
336
+ interface DataStrategyFunctionArgs<Context = any> extends DataFunctionArgs<Context> {
337
+ matches: DataStrategyMatch[];
338
+ fetcherKey: string | null;
339
+ }
340
+ /**
341
+ * Result from a loader or action called via dataStrategy
342
+ */
343
+ interface DataStrategyResult {
344
+ type: "data" | "error";
345
+ result: unknown;
346
+ }
347
+ interface DataStrategyFunction {
348
+ (args: DataStrategyFunctionArgs): Promise<Record<string, DataStrategyResult>>;
349
+ }
350
+ type AgnosticPatchRoutesOnNavigationFunctionArgs<O extends AgnosticRouteObject = AgnosticRouteObject, M extends AgnosticRouteMatch = AgnosticRouteMatch> = {
351
+ path: string;
352
+ matches: M[];
353
+ patch: (routeId: string | null, children: O[]) => void;
354
+ };
355
+ type AgnosticPatchRoutesOnNavigationFunction<O extends AgnosticRouteObject = AgnosticRouteObject, M extends AgnosticRouteMatch = AgnosticRouteMatch> = (opts: AgnosticPatchRoutesOnNavigationFunctionArgs<O, M>) => void | Promise<void>;
356
+ /**
357
+ * Function provided by the framework-aware layers to set any framework-specific
358
+ * properties from framework-agnostic properties
359
+ */
360
+ interface MapRoutePropertiesFunction {
361
+ (route: AgnosticRouteObject): {
362
+ hasErrorBoundary: boolean;
363
+ } & Record<string, any>;
364
+ }
365
+ /**
366
+ * Keys we cannot change from within a lazy() function. We spread all other keys
367
+ * onto the route. Either they're meaningful to the router, or they'll get
368
+ * ignored.
369
+ */
370
+ type ImmutableRouteKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children";
371
+ type RequireOne<T, Key = keyof T> = Exclude<{
372
+ [K in keyof T]: K extends Key ? Omit<T, K> & Required<Pick<T, K>> : never;
373
+ }[keyof T], undefined>;
374
+ /**
375
+ * lazy() function to load a route definition, which can add non-matching
376
+ * related properties to a route
377
+ */
378
+ interface LazyRouteFunction<R extends AgnosticRouteObject> {
379
+ (): Promise<RequireOne<Omit<R, ImmutableRouteKey>>>;
380
+ }
381
+ /**
382
+ * Base RouteObject with common props shared by all types of routes
383
+ */
384
+ type AgnosticBaseRouteObject = {
385
+ caseSensitive?: boolean;
386
+ path?: string;
387
+ id?: string;
388
+ loader?: LoaderFunction | boolean;
389
+ action?: ActionFunction | boolean;
390
+ hasErrorBoundary?: boolean;
391
+ shouldRevalidate?: ShouldRevalidateFunction;
392
+ handle?: any;
393
+ lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;
394
+ };
395
+ /**
396
+ * Index routes must not have children
397
+ */
398
+ type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {
399
+ children?: undefined;
400
+ index: true;
401
+ };
402
+ /**
403
+ * Non-index routes may have children, but cannot have index
404
+ */
405
+ type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {
406
+ children?: AgnosticRouteObject[];
407
+ index?: false;
408
+ };
409
+ /**
410
+ * A route object represents a logical route, with (optionally) its child
411
+ * routes organized in a tree-like structure.
412
+ */
413
+ type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
414
+ type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
415
+ id: string;
416
+ };
417
+ type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
418
+ children?: AgnosticDataRouteObject[];
419
+ id: string;
420
+ };
421
+ /**
422
+ * A data route object, which is just a RouteObject with a required unique ID
423
+ */
424
+ type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
425
+ type RouteManifest<R = AgnosticDataRouteObject> = Record<string, R | undefined>;
426
+ type _PathParam<Path extends string> = Path extends `${infer L}/${infer R}` ? _PathParam<L> | _PathParam<R> : Path extends `:${infer Param}` ? Param extends `${infer Optional}?` ? Optional : Param : never;
427
+ /**
428
+ * Examples:
429
+ * "/a/b/*" -> "*"
430
+ * ":a" -> "a"
431
+ * "/a/:b" -> "b"
432
+ * "/a/blahblahblah:b" -> "b"
433
+ * "/:a/:b" -> "a" | "b"
434
+ * "/:a/b/:c/*" -> "a" | "c" | "*"
435
+ */
436
+ type PathParam<Path extends string> = Path extends "*" | "/*" ? "*" : Path extends `${infer Rest}/*` ? "*" | _PathParam<Rest> : _PathParam<Path>;
437
+ type ParamParseKey<Segment extends string> = [
438
+ PathParam<Segment>
439
+ ] extends [never] ? string : PathParam<Segment>;
440
+ /**
441
+ * The parameters that were parsed from the URL path.
442
+ */
443
+ type Params<Key extends string = string> = {
444
+ readonly [key in Key]: string | undefined;
445
+ };
446
+ /**
447
+ * A RouteMatch contains info about how a route matched a URL.
448
+ */
449
+ interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
450
+ /**
451
+ * The names and values of dynamic parameters in the URL.
452
+ */
453
+ params: Params<ParamKey>;
454
+ /**
455
+ * The portion of the URL pathname that was matched.
456
+ */
457
+ pathname: string;
458
+ /**
459
+ * The portion of the URL pathname that was matched before child routes.
460
+ */
461
+ pathnameBase: string;
462
+ /**
463
+ * The route object that was used to match.
464
+ */
465
+ route: RouteObjectType;
466
+ }
467
+ interface AgnosticDataRouteMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
468
+ }
469
+ /**
470
+ * Matches the given routes to a location and returns the match data.
471
+ *
472
+ * @category Utils
473
+ */
474
+ declare function matchRoutes<RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject>(routes: RouteObjectType[], locationArg: Partial<Location> | string, basename?: string): AgnosticRouteMatch<string, RouteObjectType>[] | null;
475
+ interface UIMatch<Data = unknown, Handle = unknown> {
476
+ id: string;
477
+ pathname: string;
478
+ params: AgnosticRouteMatch["params"];
479
+ data: Data;
480
+ handle: Handle;
481
+ }
482
+ /**
483
+ * Returns a path with params interpolated.
484
+ *
485
+ * @category Utils
486
+ */
487
+ declare function generatePath<Path extends string>(originalPath: Path, params?: {
488
+ [key in PathParam<Path>]: string | null;
489
+ }): string;
490
+ /**
491
+ * A PathPattern is used to match on some portion of a URL pathname.
492
+ */
493
+ interface PathPattern<Path extends string = string> {
494
+ /**
495
+ * A string to match against a URL pathname. May contain `:id`-style segments
496
+ * to indicate placeholders for dynamic parameters. May also end with `/*` to
497
+ * indicate matching the rest of the URL pathname.
498
+ */
499
+ path: Path;
500
+ /**
501
+ * Should be `true` if the static portions of the `path` should be matched in
502
+ * the same case.
503
+ */
504
+ caseSensitive?: boolean;
505
+ /**
506
+ * Should be `true` if this pattern should match the entire URL pathname.
507
+ */
508
+ end?: boolean;
509
+ }
510
+ /**
511
+ * A PathMatch contains info about how a PathPattern matched on a URL pathname.
512
+ */
513
+ interface PathMatch<ParamKey extends string = string> {
514
+ /**
515
+ * The names and values of dynamic parameters in the URL.
516
+ */
517
+ params: Params<ParamKey>;
518
+ /**
519
+ * The portion of the URL pathname that was matched.
520
+ */
521
+ pathname: string;
522
+ /**
523
+ * The portion of the URL pathname that was matched before child routes.
524
+ */
525
+ pathnameBase: string;
526
+ /**
527
+ * The pattern that was used to match.
528
+ */
529
+ pattern: PathPattern;
530
+ }
531
+ /**
532
+ * Performs pattern matching on a URL pathname and returns information about
533
+ * the match.
534
+ *
535
+ * @category Utils
536
+ */
537
+ declare function matchPath<ParamKey extends ParamParseKey<Path>, Path extends string>(pattern: PathPattern<Path> | Path, pathname: string): PathMatch<ParamKey> | null;
538
+ /**
539
+ * Returns a resolved path object relative to the given pathname.
540
+ *
541
+ * @category Utils
542
+ */
543
+ declare function resolvePath(to: To, fromPathname?: string): Path;
544
+ declare class DataWithResponseInit<D> {
545
+ type: string;
546
+ data: D;
547
+ init: ResponseInit | null;
548
+ constructor(data: D, init?: ResponseInit);
549
+ }
550
+ /**
551
+ * Create "responses" that contain `status`/`headers` without forcing
552
+ * serialization into an actual `Response` - used by Remix single fetch
553
+ *
554
+ * @category Utils
555
+ */
556
+ declare function data<D>(data: D, init?: number | ResponseInit): DataWithResponseInit<D>;
557
+ type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
558
+ /**
559
+ * A redirect response. Sets the status code and the `Location` header.
560
+ * Defaults to "302 Found".
561
+ *
562
+ * @category Utils
563
+ */
564
+ declare const redirect: RedirectFunction;
565
+ /**
566
+ * A redirect response that will force a document reload to the new location.
567
+ * Sets the status code and the `Location` header.
568
+ * Defaults to "302 Found".
569
+ *
570
+ * @category Utils
571
+ */
572
+ declare const redirectDocument: RedirectFunction;
573
+ /**
574
+ * A redirect response that will perform a `history.replaceState` instead of a
575
+ * `history.pushState` for client-side navigation redirects.
576
+ * Sets the status code and the `Location` header.
577
+ * Defaults to "302 Found".
578
+ *
579
+ * @category Utils
580
+ */
581
+ declare const replace: RedirectFunction;
582
+ type ErrorResponse = {
583
+ status: number;
584
+ statusText: string;
585
+ data: any;
586
+ };
587
+ /**
588
+ * @private
589
+ * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies
590
+ *
591
+ * We don't export the class for public use since it's an implementation
592
+ * detail, but we export the interface above so folks can build their own
593
+ * abstractions around instances via isRouteErrorResponse()
594
+ */
595
+ declare class ErrorResponseImpl implements ErrorResponse {
596
+ status: number;
597
+ statusText: string;
598
+ data: any;
599
+ private error?;
600
+ private internal;
601
+ constructor(status: number, statusText: string | undefined, data: any, internal?: boolean);
602
+ }
603
+ /**
604
+ * Check if the given error is an ErrorResponse generated from a 4xx/5xx
605
+ * Response thrown from an action/loader
606
+ *
607
+ * @category Utils
608
+ */
609
+ declare function isRouteErrorResponse(error: any): error is ErrorResponse;
610
+
611
+ /**
612
+ * A Router instance manages all navigation and data loading/mutations
613
+ */
614
+ interface Router {
615
+ /**
616
+ * @private
617
+ * PRIVATE - DO NOT USE
618
+ *
619
+ * Return the basename for the router
620
+ */
621
+ get basename(): RouterInit["basename"];
622
+ /**
623
+ * @private
624
+ * PRIVATE - DO NOT USE
625
+ *
626
+ * Return the future config for the router
627
+ */
628
+ get future(): FutureConfig;
629
+ /**
630
+ * @private
631
+ * PRIVATE - DO NOT USE
632
+ *
633
+ * Return the current state of the router
634
+ */
635
+ get state(): RouterState;
636
+ /**
637
+ * @private
638
+ * PRIVATE - DO NOT USE
639
+ *
640
+ * Return the routes for this router instance
641
+ */
642
+ get routes(): AgnosticDataRouteObject[];
643
+ /**
644
+ * @private
645
+ * PRIVATE - DO NOT USE
646
+ *
647
+ * Return the window associated with the router
648
+ */
649
+ get window(): RouterInit["window"];
650
+ /**
651
+ * @private
652
+ * PRIVATE - DO NOT USE
653
+ *
654
+ * Initialize the router, including adding history listeners and kicking off
655
+ * initial data fetches. Returns a function to cleanup listeners and abort
656
+ * any in-progress loads
657
+ */
658
+ initialize(): Router;
659
+ /**
660
+ * @private
661
+ * PRIVATE - DO NOT USE
662
+ *
663
+ * Subscribe to router.state updates
664
+ *
665
+ * @param fn function to call with the new state
666
+ */
667
+ subscribe(fn: RouterSubscriber): () => void;
668
+ /**
669
+ * @private
670
+ * PRIVATE - DO NOT USE
671
+ *
672
+ * Enable scroll restoration behavior in the router
673
+ *
674
+ * @param savedScrollPositions Object that will manage positions, in case
675
+ * it's being restored from sessionStorage
676
+ * @param getScrollPosition Function to get the active Y scroll position
677
+ * @param getKey Function to get the key to use for restoration
678
+ */
679
+ enableScrollRestoration(savedScrollPositions: Record<string, number>, getScrollPosition: GetScrollPositionFunction, getKey?: GetScrollRestorationKeyFunction): () => void;
680
+ /**
681
+ * @private
682
+ * PRIVATE - DO NOT USE
683
+ *
684
+ * Navigate forward/backward in the history stack
685
+ * @param to Delta to move in the history stack
686
+ */
687
+ navigate(to: number): Promise<void>;
688
+ /**
689
+ * Navigate to the given path
690
+ * @param to Path to navigate to
691
+ * @param opts Navigation options (method, submission, etc.)
692
+ */
693
+ navigate(to: To | null, opts?: RouterNavigateOptions): Promise<void>;
694
+ /**
695
+ * @private
696
+ * PRIVATE - DO NOT USE
697
+ *
698
+ * Trigger a fetcher load/submission
699
+ *
700
+ * @param key Fetcher key
701
+ * @param routeId Route that owns the fetcher
702
+ * @param href href to fetch
703
+ * @param opts Fetcher options, (method, submission, etc.)
704
+ */
705
+ fetch(key: string, routeId: string, href: string | null, opts?: RouterFetchOptions): Promise<void>;
706
+ /**
707
+ * @private
708
+ * PRIVATE - DO NOT USE
709
+ *
710
+ * Trigger a revalidation of all current route loaders and fetcher loads
711
+ */
712
+ revalidate(): Promise<void>;
713
+ /**
714
+ * @private
715
+ * PRIVATE - DO NOT USE
716
+ *
717
+ * Utility function to create an href for the given location
718
+ * @param location
719
+ */
720
+ createHref(location: Location | URL): string;
721
+ /**
722
+ * @private
723
+ * PRIVATE - DO NOT USE
724
+ *
725
+ * Utility function to URL encode a destination path according to the internal
726
+ * history implementation
727
+ * @param to
728
+ */
729
+ encodeLocation(to: To): Path;
730
+ /**
731
+ * @private
732
+ * PRIVATE - DO NOT USE
733
+ *
734
+ * Get/create a fetcher for the given key
735
+ * @param key
736
+ */
737
+ getFetcher<TData = any>(key: string): Fetcher<TData>;
738
+ /**
739
+ * @private
740
+ * PRIVATE - DO NOT USE
741
+ *
742
+ * Delete the fetcher for a given key
743
+ * @param key
744
+ */
745
+ deleteFetcher(key: string): void;
746
+ /**
747
+ * @private
748
+ * PRIVATE - DO NOT USE
749
+ *
750
+ * Cleanup listeners and abort any in-progress loads
751
+ */
752
+ dispose(): void;
753
+ /**
754
+ * @private
755
+ * PRIVATE - DO NOT USE
756
+ *
757
+ * Get a navigation blocker
758
+ * @param key The identifier for the blocker
759
+ * @param fn The blocker function implementation
760
+ */
761
+ getBlocker(key: string, fn: BlockerFunction): Blocker;
762
+ /**
763
+ * @private
764
+ * PRIVATE - DO NOT USE
765
+ *
766
+ * Delete a navigation blocker
767
+ * @param key The identifier for the blocker
768
+ */
769
+ deleteBlocker(key: string): void;
770
+ /**
771
+ * @private
772
+ * PRIVATE DO NOT USE
773
+ *
774
+ * Patch additional children routes into an existing parent route
775
+ * @param routeId The parent route id or a callback function accepting `patch`
776
+ * to perform batch patching
777
+ * @param children The additional children routes
778
+ */
779
+ patchRoutes(routeId: string | null, children: AgnosticRouteObject[]): void;
780
+ /**
781
+ * @private
782
+ * PRIVATE - DO NOT USE
783
+ *
784
+ * HMR needs to pass in-flight route updates to React Router
785
+ * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
786
+ */
787
+ _internalSetRoutes(routes: AgnosticRouteObject[]): void;
788
+ /**
789
+ * @private
790
+ * PRIVATE - DO NOT USE
791
+ *
792
+ * Internal fetch AbortControllers accessed by unit tests
793
+ */
794
+ _internalFetchControllers: Map<string, AbortController>;
795
+ }
796
+ /**
797
+ * State maintained internally by the router. During a navigation, all states
798
+ * reflect the the "old" location unless otherwise noted.
799
+ */
800
+ interface RouterState {
801
+ /**
802
+ * The action of the most recent navigation
803
+ */
804
+ historyAction: Action;
805
+ /**
806
+ * The current location reflected by the router
807
+ */
808
+ location: Location;
809
+ /**
810
+ * The current set of route matches
811
+ */
812
+ matches: AgnosticDataRouteMatch[];
813
+ /**
814
+ * Tracks whether we've completed our initial data load
815
+ */
816
+ initialized: boolean;
817
+ /**
818
+ * Current scroll position we should start at for a new view
819
+ * - number -> scroll position to restore to
820
+ * - false -> do not restore scroll at all (used during submissions)
821
+ * - null -> don't have a saved position, scroll to hash or top of page
822
+ */
823
+ restoreScrollPosition: number | false | null;
824
+ /**
825
+ * Indicate whether this navigation should skip resetting the scroll position
826
+ * if we are unable to restore the scroll position
827
+ */
828
+ preventScrollReset: boolean;
829
+ /**
830
+ * Tracks the state of the current navigation
831
+ */
832
+ navigation: Navigation;
833
+ /**
834
+ * Tracks any in-progress revalidations
835
+ */
836
+ revalidation: RevalidationState;
837
+ /**
838
+ * Data from the loaders for the current matches
839
+ */
840
+ loaderData: RouteData;
841
+ /**
842
+ * Data from the action for the current matches
843
+ */
844
+ actionData: RouteData | null;
845
+ /**
846
+ * Errors caught from loaders for the current matches
847
+ */
848
+ errors: RouteData | null;
849
+ /**
850
+ * Map of current fetchers
851
+ */
852
+ fetchers: Map<string, Fetcher>;
853
+ /**
854
+ * Map of current blockers
855
+ */
856
+ blockers: Map<string, Blocker>;
857
+ }
858
+ /**
859
+ * Data that can be passed into hydrate a Router from SSR
860
+ */
861
+ type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
862
+ /**
863
+ * Future flags to toggle new feature behavior
864
+ */
865
+ interface FutureConfig {
866
+ }
867
+ /**
868
+ * Initialization options for createRouter
869
+ */
870
+ interface RouterInit {
871
+ routes: AgnosticRouteObject[];
872
+ history: History;
873
+ basename?: string;
874
+ mapRouteProperties?: MapRoutePropertiesFunction;
875
+ future?: Partial<FutureConfig>;
876
+ hydrationData?: HydrationState;
877
+ window?: Window;
878
+ dataStrategy?: DataStrategyFunction;
879
+ patchRoutesOnNavigation?: AgnosticPatchRoutesOnNavigationFunction;
880
+ }
881
+ /**
882
+ * State returned from a server-side query() call
883
+ */
884
+ interface StaticHandlerContext {
885
+ basename: Router["basename"];
886
+ location: RouterState["location"];
887
+ matches: RouterState["matches"];
888
+ loaderData: RouterState["loaderData"];
889
+ actionData: RouterState["actionData"];
890
+ errors: RouterState["errors"];
891
+ statusCode: number;
892
+ loaderHeaders: Record<string, Headers>;
893
+ actionHeaders: Record<string, Headers>;
894
+ _deepestRenderedBoundaryId?: string | null;
895
+ }
896
+ /**
897
+ * A StaticHandler instance manages a singular SSR navigation/fetch event
898
+ */
899
+ interface StaticHandler {
900
+ dataRoutes: AgnosticDataRouteObject[];
901
+ query(request: Request, opts?: {
902
+ requestContext?: unknown;
903
+ skipLoaderErrorBubbling?: boolean;
904
+ dataStrategy?: DataStrategyFunction;
905
+ }): Promise<StaticHandlerContext | Response>;
906
+ queryRoute(request: Request, opts?: {
907
+ routeId?: string;
908
+ requestContext?: unknown;
909
+ dataStrategy?: DataStrategyFunction;
910
+ }): Promise<any>;
911
+ }
912
+ type ViewTransitionOpts = {
913
+ currentLocation: Location;
914
+ nextLocation: Location;
915
+ };
916
+ /**
917
+ * Subscriber function signature for changes to router state
918
+ */
919
+ interface RouterSubscriber {
920
+ (state: RouterState, opts: {
921
+ deletedFetchers: string[];
922
+ viewTransitionOpts?: ViewTransitionOpts;
923
+ flushSync: boolean;
924
+ }): void;
925
+ }
926
+ /**
927
+ * Function signature for determining the key to be used in scroll restoration
928
+ * for a given location
929
+ */
930
+ interface GetScrollRestorationKeyFunction {
931
+ (location: Location, matches: UIMatch[]): string | null;
932
+ }
933
+ /**
934
+ * Function signature for determining the current scroll position
935
+ */
936
+ interface GetScrollPositionFunction {
937
+ (): number;
938
+ }
939
+ /**
940
+ - "route": relative to the route hierarchy so `..` means remove all segments of the current route even if it has many. For example, a `route("posts/:id")` would have both `:id` and `posts` removed from the url.
941
+ - "path": relative to the pathname so `..` means remove one segment of the pathname. For example, a `route("posts/:id")` would have only `:id` removed from the url.
942
+ */
943
+ type RelativeRoutingType = "route" | "path";
944
+ type BaseNavigateOrFetchOptions = {
945
+ preventScrollReset?: boolean;
946
+ relative?: RelativeRoutingType;
947
+ flushSync?: boolean;
948
+ };
949
+ type BaseNavigateOptions = BaseNavigateOrFetchOptions & {
950
+ replace?: boolean;
951
+ state?: any;
952
+ fromRouteId?: string;
953
+ viewTransition?: boolean;
954
+ };
955
+ type BaseSubmissionOptions = {
956
+ formMethod?: HTMLFormMethod;
957
+ formEncType?: FormEncType;
958
+ } & ({
959
+ formData: FormData;
960
+ body?: undefined;
961
+ } | {
962
+ formData?: undefined;
963
+ body: any;
964
+ });
965
+ /**
966
+ * Options for a navigate() call for a normal (non-submission) navigation
967
+ */
968
+ type LinkNavigateOptions = BaseNavigateOptions;
969
+ /**
970
+ * Options for a navigate() call for a submission navigation
971
+ */
972
+ type SubmissionNavigateOptions = BaseNavigateOptions & BaseSubmissionOptions;
973
+ /**
974
+ * Options to pass to navigate() for a navigation
975
+ */
976
+ type RouterNavigateOptions = LinkNavigateOptions | SubmissionNavigateOptions;
977
+ /**
978
+ * Options for a fetch() load
979
+ */
980
+ type LoadFetchOptions = BaseNavigateOrFetchOptions;
981
+ /**
982
+ * Options for a fetch() submission
983
+ */
984
+ type SubmitFetchOptions = BaseNavigateOrFetchOptions & BaseSubmissionOptions;
985
+ /**
986
+ * Options to pass to fetch()
987
+ */
988
+ type RouterFetchOptions = LoadFetchOptions | SubmitFetchOptions;
989
+ /**
990
+ * Potential states for state.navigation
991
+ */
992
+ type NavigationStates = {
993
+ Idle: {
994
+ state: "idle";
995
+ location: undefined;
996
+ formMethod: undefined;
997
+ formAction: undefined;
998
+ formEncType: undefined;
999
+ formData: undefined;
1000
+ json: undefined;
1001
+ text: undefined;
1002
+ };
1003
+ Loading: {
1004
+ state: "loading";
1005
+ location: Location;
1006
+ formMethod: Submission["formMethod"] | undefined;
1007
+ formAction: Submission["formAction"] | undefined;
1008
+ formEncType: Submission["formEncType"] | undefined;
1009
+ formData: Submission["formData"] | undefined;
1010
+ json: Submission["json"] | undefined;
1011
+ text: Submission["text"] | undefined;
1012
+ };
1013
+ Submitting: {
1014
+ state: "submitting";
1015
+ location: Location;
1016
+ formMethod: Submission["formMethod"];
1017
+ formAction: Submission["formAction"];
1018
+ formEncType: Submission["formEncType"];
1019
+ formData: Submission["formData"];
1020
+ json: Submission["json"];
1021
+ text: Submission["text"];
1022
+ };
1023
+ };
1024
+ type Navigation = NavigationStates[keyof NavigationStates];
1025
+ type RevalidationState = "idle" | "loading";
1026
+ /**
1027
+ * Potential states for fetchers
1028
+ */
1029
+ type FetcherStates<TData = any> = {
1030
+ /**
1031
+ * The fetcher is not calling a loader or action
1032
+ *
1033
+ * ```tsx
1034
+ * fetcher.state === "idle"
1035
+ * ```
1036
+ */
1037
+ Idle: {
1038
+ state: "idle";
1039
+ formMethod: undefined;
1040
+ formAction: undefined;
1041
+ formEncType: undefined;
1042
+ text: undefined;
1043
+ formData: undefined;
1044
+ json: undefined;
1045
+ /**
1046
+ * If the fetcher has never been called, this will be undefined.
1047
+ */
1048
+ data: TData | undefined;
1049
+ };
1050
+ /**
1051
+ * The fetcher is loading data from a {@link LoaderFunction | loader} from a
1052
+ * call to {@link FetcherWithComponents.load | `fetcher.load`}.
1053
+ *
1054
+ * ```tsx
1055
+ * // somewhere
1056
+ * <button onClick={() => fetcher.load("/some/route") }>Load</button>
1057
+ *
1058
+ * // the state will update
1059
+ * fetcher.state === "loading"
1060
+ * ```
1061
+ */
1062
+ Loading: {
1063
+ state: "loading";
1064
+ formMethod: Submission["formMethod"] | undefined;
1065
+ formAction: Submission["formAction"] | undefined;
1066
+ formEncType: Submission["formEncType"] | undefined;
1067
+ text: Submission["text"] | undefined;
1068
+ formData: Submission["formData"] | undefined;
1069
+ json: Submission["json"] | undefined;
1070
+ data: TData | undefined;
1071
+ };
1072
+ /**
1073
+ The fetcher is submitting to a {@link LoaderFunction} (GET) or {@link ActionFunction} (POST) from a {@link FetcherWithComponents.Form | `fetcher.Form`} or {@link FetcherWithComponents.submit | `fetcher.submit`}.
1074
+
1075
+ ```tsx
1076
+ // somewhere
1077
+ <input
1078
+ onChange={e => {
1079
+ fetcher.submit(event.currentTarget.form, { method: "post" });
1080
+ }}
1081
+ />
1082
+
1083
+ // the state will update
1084
+ fetcher.state === "submitting"
1085
+
1086
+ // and formData will be available
1087
+ fetcher.formData
1088
+ ```
1089
+ */
1090
+ Submitting: {
1091
+ state: "submitting";
1092
+ formMethod: Submission["formMethod"];
1093
+ formAction: Submission["formAction"];
1094
+ formEncType: Submission["formEncType"];
1095
+ text: Submission["text"];
1096
+ formData: Submission["formData"];
1097
+ json: Submission["json"];
1098
+ data: TData | undefined;
1099
+ };
1100
+ };
1101
+ type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
1102
+ interface BlockerBlocked {
1103
+ state: "blocked";
1104
+ reset(): void;
1105
+ proceed(): void;
1106
+ location: Location;
1107
+ }
1108
+ interface BlockerUnblocked {
1109
+ state: "unblocked";
1110
+ reset: undefined;
1111
+ proceed: undefined;
1112
+ location: undefined;
1113
+ }
1114
+ interface BlockerProceeding {
1115
+ state: "proceeding";
1116
+ reset: undefined;
1117
+ proceed: undefined;
1118
+ location: Location;
1119
+ }
1120
+ type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
1121
+ type BlockerFunction = (args: {
1122
+ currentLocation: Location;
1123
+ nextLocation: Location;
1124
+ historyAction: Action;
1125
+ }) => boolean;
1126
+ declare const IDLE_NAVIGATION: NavigationStates["Idle"];
1127
+ declare const IDLE_FETCHER: FetcherStates["Idle"];
1128
+ declare const IDLE_BLOCKER: BlockerUnblocked;
1129
+ /**
1130
+ * Create a router and listen to history POP navigations
1131
+ */
1132
+ declare function createRouter(init: RouterInit): Router;
1133
+ interface CreateStaticHandlerOptions {
1134
+ basename?: string;
1135
+ mapRouteProperties?: MapRoutePropertiesFunction;
1136
+ future?: {};
1137
+ }
1138
+
1139
+ interface IndexRouteObject {
1140
+ caseSensitive?: AgnosticIndexRouteObject["caseSensitive"];
1141
+ path?: AgnosticIndexRouteObject["path"];
1142
+ id?: AgnosticIndexRouteObject["id"];
1143
+ loader?: AgnosticIndexRouteObject["loader"];
1144
+ action?: AgnosticIndexRouteObject["action"];
1145
+ hasErrorBoundary?: AgnosticIndexRouteObject["hasErrorBoundary"];
1146
+ shouldRevalidate?: AgnosticIndexRouteObject["shouldRevalidate"];
1147
+ handle?: AgnosticIndexRouteObject["handle"];
1148
+ index: true;
1149
+ children?: undefined;
1150
+ element?: React.ReactNode | null;
1151
+ hydrateFallbackElement?: React.ReactNode | null;
1152
+ errorElement?: React.ReactNode | null;
1153
+ Component?: React.ComponentType | null;
1154
+ HydrateFallback?: React.ComponentType | null;
1155
+ ErrorBoundary?: React.ComponentType | null;
1156
+ lazy?: LazyRouteFunction<RouteObject>;
1157
+ }
1158
+ interface NonIndexRouteObject {
1159
+ caseSensitive?: AgnosticNonIndexRouteObject["caseSensitive"];
1160
+ path?: AgnosticNonIndexRouteObject["path"];
1161
+ id?: AgnosticNonIndexRouteObject["id"];
1162
+ loader?: AgnosticNonIndexRouteObject["loader"];
1163
+ action?: AgnosticNonIndexRouteObject["action"];
1164
+ hasErrorBoundary?: AgnosticNonIndexRouteObject["hasErrorBoundary"];
1165
+ shouldRevalidate?: AgnosticNonIndexRouteObject["shouldRevalidate"];
1166
+ handle?: AgnosticNonIndexRouteObject["handle"];
1167
+ index?: false;
1168
+ children?: RouteObject[];
1169
+ element?: React.ReactNode | null;
1170
+ hydrateFallbackElement?: React.ReactNode | null;
1171
+ errorElement?: React.ReactNode | null;
1172
+ Component?: React.ComponentType | null;
1173
+ HydrateFallback?: React.ComponentType | null;
1174
+ ErrorBoundary?: React.ComponentType | null;
1175
+ lazy?: LazyRouteFunction<RouteObject>;
1176
+ }
1177
+ type RouteObject = IndexRouteObject | NonIndexRouteObject;
1178
+ type DataRouteObject = RouteObject & {
1179
+ children?: DataRouteObject[];
1180
+ id: string;
1181
+ };
1182
+ interface RouteMatch<ParamKey extends string = string, RouteObjectType extends RouteObject = RouteObject> extends AgnosticRouteMatch<ParamKey, RouteObjectType> {
1183
+ }
1184
+ interface DataRouteMatch extends RouteMatch<string, DataRouteObject> {
1185
+ }
1186
+ type PatchRoutesOnNavigationFunctionArgs = AgnosticPatchRoutesOnNavigationFunctionArgs<RouteObject, RouteMatch>;
1187
+ type PatchRoutesOnNavigationFunction = AgnosticPatchRoutesOnNavigationFunction<RouteObject, RouteMatch>;
1188
+ interface DataRouterContextObject extends Omit<NavigationContextObject, "future"> {
1189
+ router: Router;
1190
+ staticContext?: StaticHandlerContext;
1191
+ }
1192
+ declare const DataRouterContext: React.Context<DataRouterContextObject | null>;
1193
+ declare const DataRouterStateContext: React.Context<RouterState | null>;
1194
+ type ViewTransitionContextObject = {
1195
+ isTransitioning: false;
1196
+ } | {
1197
+ isTransitioning: true;
1198
+ flushSync: boolean;
1199
+ currentLocation: Location;
1200
+ nextLocation: Location;
1201
+ };
1202
+ declare const ViewTransitionContext: React.Context<ViewTransitionContextObject>;
1203
+ type FetchersContextObject = Map<string, any>;
1204
+ declare const FetchersContext: React.Context<FetchersContextObject>;
1205
+ interface NavigateOptions {
1206
+ replace?: boolean;
1207
+ state?: any;
1208
+ preventScrollReset?: boolean;
1209
+ relative?: RelativeRoutingType;
1210
+ flushSync?: boolean;
1211
+ viewTransition?: boolean;
1212
+ }
1213
+ /**
1214
+ * A Navigator is a "location changer"; it's how you get to different locations.
1215
+ *
1216
+ * Every history instance conforms to the Navigator interface, but the
1217
+ * distinction is useful primarily when it comes to the low-level `<Router>` API
1218
+ * where both the location and a navigator must be provided separately in order
1219
+ * to avoid "tearing" that may occur in a suspense-enabled app if the action
1220
+ * and/or location were to be read directly from the history instance.
1221
+ */
1222
+ interface Navigator {
1223
+ createHref: History["createHref"];
1224
+ encodeLocation?: History["encodeLocation"];
1225
+ go: History["go"];
1226
+ push(to: To, state?: any, opts?: NavigateOptions): void;
1227
+ replace(to: To, state?: any, opts?: NavigateOptions): void;
1228
+ }
1229
+ interface NavigationContextObject {
1230
+ basename: string;
1231
+ navigator: Navigator;
1232
+ static: boolean;
1233
+ future: {};
1234
+ }
1235
+ declare const NavigationContext: React.Context<NavigationContextObject>;
1236
+ interface LocationContextObject {
1237
+ location: Location;
1238
+ navigationType: Action;
1239
+ }
1240
+ declare const LocationContext: React.Context<LocationContextObject>;
1241
+ interface RouteContextObject {
1242
+ outlet: React.ReactElement | null;
1243
+ matches: RouteMatch[];
1244
+ isDataRoute: boolean;
1245
+ }
1246
+ declare const RouteContext: React.Context<RouteContextObject>;
1247
+
1248
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
1249
+ type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
1250
+ interface HtmlLinkProps {
1251
+ /**
1252
+ * Address of the hyperlink
1253
+ */
1254
+ href?: string;
1255
+ /**
1256
+ * How the element handles crossorigin requests
1257
+ */
1258
+ crossOrigin?: "anonymous" | "use-credentials";
1259
+ /**
1260
+ * Relationship between the document containing the hyperlink and the destination resource
1261
+ */
1262
+ rel: LiteralUnion<"alternate" | "dns-prefetch" | "icon" | "manifest" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "search" | "stylesheet", string>;
1263
+ /**
1264
+ * Applicable media: "screen", "print", "(max-width: 764px)"
1265
+ */
1266
+ media?: string;
1267
+ /**
1268
+ * Integrity metadata used in Subresource Integrity checks
1269
+ */
1270
+ integrity?: string;
1271
+ /**
1272
+ * Language of the linked resource
1273
+ */
1274
+ hrefLang?: string;
1275
+ /**
1276
+ * Hint for the type of the referenced resource
1277
+ */
1278
+ type?: string;
1279
+ /**
1280
+ * Referrer policy for fetches initiated by the element
1281
+ */
1282
+ referrerPolicy?: "" | "no-referrer" | "no-referrer-when-downgrade" | "same-origin" | "origin" | "strict-origin" | "origin-when-cross-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
1283
+ /**
1284
+ * Sizes of the icons (for rel="icon")
1285
+ */
1286
+ sizes?: string;
1287
+ /**
1288
+ * Potential destination for a preload request (for rel="preload" and rel="modulepreload")
1289
+ */
1290
+ as?: LiteralUnion<"audio" | "audioworklet" | "document" | "embed" | "fetch" | "font" | "frame" | "iframe" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "serviceworker" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt", string>;
1291
+ /**
1292
+ * Color to use when customizing a site's icon (for rel="mask-icon")
1293
+ */
1294
+ color?: string;
1295
+ /**
1296
+ * Whether the link is disabled
1297
+ */
1298
+ disabled?: boolean;
1299
+ /**
1300
+ * The title attribute has special semantics on this element: Title of the link; CSS style sheet set name.
1301
+ */
1302
+ title?: string;
1303
+ /**
1304
+ * Images to use in different situations, e.g., high-resolution displays,
1305
+ * small monitors, etc. (for rel="preload")
1306
+ */
1307
+ imageSrcSet?: string;
1308
+ /**
1309
+ * Image sizes for different page layouts (for rel="preload")
1310
+ */
1311
+ imageSizes?: string;
1312
+ }
1313
+ interface HtmlLinkPreloadImage extends HtmlLinkProps {
1314
+ /**
1315
+ * Relationship between the document containing the hyperlink and the destination resource
1316
+ */
1317
+ rel: "preload";
1318
+ /**
1319
+ * Potential destination for a preload request (for rel="preload" and rel="modulepreload")
1320
+ */
1321
+ as: "image";
1322
+ /**
1323
+ * Address of the hyperlink
1324
+ */
1325
+ href?: string;
1326
+ /**
1327
+ * Images to use in different situations, e.g., high-resolution displays,
1328
+ * small monitors, etc. (for rel="preload")
1329
+ */
1330
+ imageSrcSet: string;
1331
+ /**
1332
+ * Image sizes for different page layouts (for rel="preload")
1333
+ */
1334
+ imageSizes?: string;
1335
+ }
1336
+ /**
1337
+ * Represents a `<link>` element.
1338
+ *
1339
+ * WHATWG Specification: https://html.spec.whatwg.org/multipage/semantics.html#the-link-element
1340
+ */
1341
+ type HtmlLinkDescriptor = (HtmlLinkProps & Pick<Required<HtmlLinkProps>, "href">) | (HtmlLinkPreloadImage & Pick<Required<HtmlLinkPreloadImage>, "imageSizes">) | (HtmlLinkPreloadImage & Pick<Required<HtmlLinkPreloadImage>, "href"> & {
1342
+ imageSizes?: never;
1343
+ });
1344
+ interface PageLinkDescriptor extends Omit<HtmlLinkDescriptor, "href" | "rel" | "type" | "sizes" | "imageSrcSet" | "imageSizes" | "as" | "color" | "title"> {
1345
+ /**
1346
+ * The absolute path of the page to prefetch.
1347
+ */
1348
+ page: string;
1349
+ }
1350
+ type LinkDescriptor = HtmlLinkDescriptor | PageLinkDescriptor;
1351
+
1352
+ interface RouteModules {
1353
+ [routeId: string]: RouteModule$1 | undefined;
1354
+ }
1355
+ interface RouteModule$1 {
1356
+ clientAction?: ClientActionFunction;
1357
+ clientLoader?: ClientLoaderFunction;
1358
+ ErrorBoundary?: ErrorBoundaryComponent;
1359
+ HydrateFallback?: HydrateFallbackComponent;
1360
+ Layout?: LayoutComponent;
1361
+ default: RouteComponent;
1362
+ handle?: RouteHandle;
1363
+ links?: LinksFunction;
1364
+ meta?: MetaFunction;
1365
+ shouldRevalidate?: ShouldRevalidateFunction;
1366
+ }
1367
+ /**
1368
+ * A function that handles data mutations for a route on the client
1369
+ */
1370
+ type ClientActionFunction = (args: ClientActionFunctionArgs) => ReturnType<ActionFunction>;
1371
+ /**
1372
+ * Arguments passed to a route `clientAction` function
1373
+ */
1374
+ type ClientActionFunctionArgs = ActionFunctionArgs<undefined> & {
1375
+ serverAction: <T = unknown>() => Promise<SerializeFrom<T>>;
1376
+ };
1377
+ /**
1378
+ * A function that loads data for a route on the client
1379
+ */
1380
+ type ClientLoaderFunction = ((args: ClientLoaderFunctionArgs) => ReturnType<LoaderFunction>) & {
1381
+ hydrate?: boolean;
1382
+ };
1383
+ /**
1384
+ * Arguments passed to a route `clientLoader` function
1385
+ */
1386
+ type ClientLoaderFunctionArgs = LoaderFunctionArgs<undefined> & {
1387
+ serverLoader: <T = unknown>() => Promise<SerializeFrom<T>>;
1388
+ };
1389
+ /**
1390
+ * ErrorBoundary to display for this route
1391
+ */
1392
+ type ErrorBoundaryComponent = ComponentType;
1393
+ /**
1394
+ * `<Route HydrateFallback>` component to render on initial loads
1395
+ * when client loaders are present
1396
+ */
1397
+ type HydrateFallbackComponent = ComponentType;
1398
+ /**
1399
+ * Optional, root-only `<Route Layout>` component to wrap the root content in.
1400
+ * Useful for defining the <html>/<head>/<body> document shell shared by the
1401
+ * Component, HydrateFallback, and ErrorBoundary
1402
+ */
1403
+ type LayoutComponent = ComponentType<{
1404
+ children: ReactElement<unknown, ErrorBoundaryComponent | HydrateFallbackComponent | RouteComponent>;
1405
+ }>;
1406
+ /**
1407
+ * A function that defines `<link>` tags to be inserted into the `<head>` of
1408
+ * the document on route transitions.
1409
+ *
1410
+ * @see https://remix.run/route/meta
1411
+ */
1412
+ interface LinksFunction {
1413
+ (): LinkDescriptor[];
1414
+ }
1415
+ interface MetaMatch<RouteId extends string = string, Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown> {
1416
+ id: RouteId;
1417
+ pathname: DataRouteMatch["pathname"];
1418
+ data: Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown;
1419
+ handle?: RouteHandle;
1420
+ params: DataRouteMatch["params"];
1421
+ meta: MetaDescriptor[];
1422
+ error?: unknown;
1423
+ }
1424
+ type MetaMatches<MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> = Array<{
1425
+ [K in keyof MatchLoaders]: MetaMatch<Exclude<K, number | symbol>, MatchLoaders[K]>;
1426
+ }[keyof MatchLoaders]>;
1427
+ interface MetaArgs<Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown, MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> {
1428
+ data: (Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown) | undefined;
1429
+ params: Params;
1430
+ location: Location;
1431
+ matches: MetaMatches<MatchLoaders>;
1432
+ error?: unknown;
1433
+ }
1434
+ /**
1435
+ * A function that returns an array of data objects to use for rendering
1436
+ * metadata HTML tags in a route. These tags are not rendered on descendant
1437
+ * routes in the route hierarchy. In other words, they will only be rendered on
1438
+ * the route in which they are exported.
1439
+ *
1440
+ * @param Loader - The type of the current route's loader function
1441
+ * @param MatchLoaders - Mapping from a parent route's filepath to its loader
1442
+ * function type
1443
+ *
1444
+ * Note that parent route filepaths are relative to the `app/` directory.
1445
+ *
1446
+ * For example, if this meta function is for `/sales/customers/$customerId`:
1447
+ *
1448
+ * ```ts
1449
+ * // app/root.tsx
1450
+ * const loader = () => ({ hello: "world" })
1451
+ * export type Loader = typeof loader
1452
+ *
1453
+ * // app/routes/sales.tsx
1454
+ * const loader = () => ({ salesCount: 1074 })
1455
+ * export type Loader = typeof loader
1456
+ *
1457
+ * // app/routes/sales/customers.tsx
1458
+ * const loader = () => ({ customerCount: 74 })
1459
+ * export type Loader = typeof loader
1460
+ *
1461
+ * // app/routes/sales/customers/$customersId.tsx
1462
+ * import type { Loader as RootLoader } from "../../../root"
1463
+ * import type { Loader as SalesLoader } from "../../sales"
1464
+ * import type { Loader as CustomersLoader } from "../../sales/customers"
1465
+ *
1466
+ * const loader = () => ({ name: "Customer name" })
1467
+ *
1468
+ * const meta: MetaFunction<typeof loader, {
1469
+ * "root": RootLoader,
1470
+ * "routes/sales": SalesLoader,
1471
+ * "routes/sales/customers": CustomersLoader,
1472
+ * }> = ({ data, matches }) => {
1473
+ * const { name } = data
1474
+ * // ^? string
1475
+ * const { customerCount } = matches.find((match) => match.id === "routes/sales/customers").data
1476
+ * // ^? number
1477
+ * const { salesCount } = matches.find((match) => match.id === "routes/sales").data
1478
+ * // ^? number
1479
+ * const { hello } = matches.find((match) => match.id === "root").data
1480
+ * // ^? "world"
1481
+ * }
1482
+ * ```
1483
+ */
1484
+ interface MetaFunction<Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown, MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> {
1485
+ (args: MetaArgs<Loader, MatchLoaders>): MetaDescriptor[] | undefined;
1486
+ }
1487
+ type MetaDescriptor = {
1488
+ charSet: "utf-8";
1489
+ } | {
1490
+ title: string;
1491
+ } | {
1492
+ name: string;
1493
+ content: string;
1494
+ } | {
1495
+ property: string;
1496
+ content: string;
1497
+ } | {
1498
+ httpEquiv: string;
1499
+ content: string;
1500
+ } | {
1501
+ "script:ld+json": LdJsonObject;
1502
+ } | {
1503
+ tagName: "meta" | "link";
1504
+ [name: string]: string;
1505
+ } | {
1506
+ [name: string]: unknown;
1507
+ };
1508
+ type LdJsonObject = {
1509
+ [Key in string]: LdJsonValue;
1510
+ } & {
1511
+ [Key in string]?: LdJsonValue | undefined;
1512
+ };
1513
+ type LdJsonArray = LdJsonValue[] | readonly LdJsonValue[];
1514
+ type LdJsonPrimitive = string | number | boolean | null;
1515
+ type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
1516
+ /**
1517
+ * A React component that is rendered for a route.
1518
+ */
1519
+ type RouteComponent = ComponentType<{}>;
1520
+ /**
1521
+ * An arbitrary object that is associated with a route.
1522
+ *
1523
+ * @see https://remix.run/route/handle
1524
+ */
1525
+ type RouteHandle = unknown;
1526
+
1527
+ /**
1528
+ * An object of unknown type for route loaders and actions provided by the
1529
+ * server's `getLoadContext()` function. This is defined as an empty interface
1530
+ * specifically so apps can leverage declaration merging to augment this type
1531
+ * globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
1532
+ */
1533
+ interface AppLoadContext {
1534
+ [key: string]: unknown;
1535
+ }
1536
+
1537
+ type Serializable = undefined | null | boolean | string | symbol | number | Array<Serializable> | {
1538
+ [key: PropertyKey]: Serializable;
1539
+ } | bigint | Date | URL | RegExp | Error | Map<Serializable, Serializable> | Set<Serializable> | Promise<Serializable>;
1540
+
1541
+ type Expect<T extends true> = T;
1542
+ type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
1543
+ type IsAny<T> = 0 extends 1 & T ? true : false;
1544
+ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
1545
+ type Fn = (...args: any[]) => unknown;
1546
+ type RouteModule = {
1547
+ loader?: Fn;
1548
+ clientLoader?: Fn;
1549
+ action?: Fn;
1550
+ clientAction?: Fn;
1551
+ HydrateFallback?: unknown;
1552
+ default?: unknown;
1553
+ ErrorBoundary?: unknown;
1554
+ };
1555
+ type VoidToUndefined<T> = Equal<T, void> extends true ? undefined : T;
1556
+ type DataFrom<T> = IsAny<T> extends true ? undefined : T extends Fn ? VoidToUndefined<Awaited<ReturnType<T>>> : undefined;
1557
+ type ClientData<T> = T extends DataWithResponseInit<infer U> ? U : T;
1558
+ type ServerData<T> = T extends DataWithResponseInit<infer U> ? Serialize<U> : Serialize<T>;
1559
+ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
1560
+ type ClientDataFrom<T> = ClientData<DataFrom<T>>;
1561
+ type IsHydrate<ClientLoader> = ClientLoader extends {
1562
+ hydrate: true;
1563
+ } ? true : ClientLoader extends {
1564
+ hydrate: false;
1565
+ } ? false : false;
1566
+ type CreateLoaderData<T extends RouteModule> = _CreateLoaderData<ServerDataFrom<T["loader"]>, ClientDataFrom<T["clientLoader"]>, IsHydrate<T["clientLoader"]>, T extends {
1567
+ HydrateFallback: Fn;
1568
+ } ? true : false>;
1569
+ type _CreateLoaderData<ServerLoaderData, ClientLoaderData, ClientLoaderHydrate extends boolean, HasHydrateFallback> = [
1570
+ HasHydrateFallback,
1571
+ ClientLoaderHydrate
1572
+ ] extends [true, true] ? IsDefined<ClientLoaderData> extends true ? ClientLoaderData : undefined : [
1573
+ IsDefined<ClientLoaderData>,
1574
+ IsDefined<ServerLoaderData>
1575
+ ] extends [true, true] ? ServerLoaderData | ClientLoaderData : IsDefined<ClientLoaderData> extends true ? ClientLoaderData : IsDefined<ServerLoaderData> extends true ? ServerLoaderData : undefined;
1576
+ type CreateActionData<T extends RouteModule> = _CreateActionData<ServerDataFrom<T["action"]>, ClientDataFrom<T["clientAction"]>>;
1577
+ type _CreateActionData<ServerActionData, ClientActionData> = Awaited<[
1578
+ IsDefined<ServerActionData>,
1579
+ IsDefined<ClientActionData>
1580
+ ] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
1581
+ type ClientDataFunctionArgs<Params> = {
1582
+ request: Request;
1583
+ params: Params;
1584
+ };
1585
+ type ServerDataFunctionArgs<Params> = ClientDataFunctionArgs<Params> & {
1586
+ context: AppLoadContext;
1587
+ };
1588
+ type Serialize<T> = T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
1589
+ [K in keyof T]: Serialize<T[K]>;
1590
+ } : undefined;
1591
+ /**
1592
+ * @deprecated Generics on data APIs such as `useLoaderData`, `useActionData`,
1593
+ * `meta`, etc. are deprecated in favor of the `Route.*` types generated via
1594
+ * `react-router typegen`
1595
+ */
1596
+ type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientData<DataFrom<T>> : ServerData<DataFrom<T>> : T;
1597
+ type CreateServerLoaderArgs<Params> = ServerDataFunctionArgs<Params>;
1598
+ type CreateClientLoaderArgs<Params, T extends RouteModule> = ClientDataFunctionArgs<Params> & {
1599
+ serverLoader: () => Promise<ServerDataFrom<T["loader"]>>;
1600
+ };
1601
+ type CreateServerActionArgs<Params> = ServerDataFunctionArgs<Params>;
1602
+ type CreateClientActionArgs<Params, T extends RouteModule> = ClientDataFunctionArgs<Params> & {
1603
+ serverAction: () => Promise<ServerDataFrom<T["action"]>>;
1604
+ };
1605
+ type CreateHydrateFallbackProps<Params> = {
1606
+ params: Params;
1607
+ };
1608
+ type CreateComponentProps<Params, LoaderData, ActionData> = {
1609
+ params: Params;
1610
+ loaderData: LoaderData;
1611
+ actionData?: ActionData;
1612
+ };
1613
+ type CreateErrorBoundaryProps<Params, LoaderData, ActionData> = {
1614
+ params: Params;
1615
+ error: unknown;
1616
+ loaderData?: LoaderData;
1617
+ actionData?: ActionData;
1618
+ };
1619
+
1620
+ export { type FormMethod as $, type ActionFunction as A, type BlockerFunction as B, type ClientActionFunction as C, type DataStrategyFunction as D, type NavigationStates as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type RouterInit as J, type RouterSubscriber as K, type LoaderFunction as L, type MetaFunction as M, type NavigateOptions as N, type RouterNavigateOptions as O, type ParamParseKey as P, type RouterFetchOptions as Q, type RouteModules as R, type SerializeFrom as S, type To as T, type UIMatch as U, type DataStrategyFunctionArgs as V, type DataStrategyMatch as W, type DataStrategyResult as X, DataWithResponseInit as Y, type ErrorResponse as Z, type FormEncType as _, type Router as a, type HTMLFormMethod as a0, type LazyRouteFunction as a1, type PathParam as a2, type RedirectFunction as a3, type ShouldRevalidateFunction as a4, type ShouldRevalidateFunctionArgs as a5, createPath as a6, parsePath as a7, IDLE_NAVIGATION as a8, IDLE_FETCHER as a9, ErrorResponseImpl as aA, DataRouterContext as aB, DataRouterStateContext as aC, FetchersContext as aD, LocationContext as aE, NavigationContext as aF, RouteContext as aG, ViewTransitionContext as aH, type RouteModule$1 as aI, type History as aJ, type Expect as aK, type CreateLoaderData as aL, type CreateActionData as aM, type CreateServerLoaderArgs as aN, type CreateClientLoaderArgs as aO, type CreateServerActionArgs as aP, type CreateClientActionArgs as aQ, type CreateHydrateFallbackProps as aR, type CreateComponentProps as aS, type CreateErrorBoundaryProps as aT, IDLE_BLOCKER as aa, data as ab, generatePath as ac, isRouteErrorResponse as ad, matchPath as ae, matchRoutes as af, redirect as ag, redirectDocument as ah, replace as ai, resolvePath as aj, type DataRouteMatch as ak, type DataRouteObject as al, type Navigator as am, type PatchRoutesOnNavigationFunction as an, type PatchRoutesOnNavigationFunctionArgs as ao, type RouteMatch as ap, type ClientActionFunctionArgs as aq, type ClientLoaderFunctionArgs as ar, type MetaArgs as as, type MetaDescriptor as at, type PageLinkDescriptor as au, type HtmlLinkDescriptor as av, type LinkDescriptor as aw, createBrowserHistory as ax, invariant as ay, createRouter as az, type ClientLoaderFunction as b, type LinksFunction as c, type RouteManifest as d, type AppLoadContext as e, type LoaderFunctionArgs as f, type ActionFunctionArgs as g, type RelativeRoutingType as h, type Location as i, Action as j, type Path as k, type PathPattern as l, type PathMatch as m, type Params as n, type RouteObject as o, type Navigation as p, type RevalidationState as q, type Blocker as r, type StaticHandlerContext as s, type StaticHandler as t, type CreateStaticHandlerOptions as u, type IndexRouteObject as v, type NonIndexRouteObject as w, type RouterState as x, type GetScrollRestorationKeyFunction as y, type Fetcher as z };