react-router 7.13.1 → 7.13.2

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 (76) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/{production/browser-DzsJABDQ.d.mts → development/browser-Bfn3xw9E.d.ts} +2 -1
  3. package/dist/development/{browser-DzsJABDQ.d.mts → browser-Di6-vSl-.d.mts} +2 -1
  4. package/dist/development/{chunk-XOLAXE2Z.js → chunk-GO74ODU3.js} +190 -111
  5. package/dist/{production/chunk-B5UMK6O7.js → development/chunk-HPFFRPKK.js} +100 -99
  6. package/dist/development/{chunk-KSEWV2VO.js → chunk-LLP6DRWX.js} +7 -7
  7. package/dist/{production/chunk-TXB4YXR2.mjs → development/chunk-UALY5CBT.mjs} +83 -49
  8. package/dist/development/{chunk-LFPYN7LY.mjs → chunk-UVKPFVEO.mjs} +124 -44
  9. package/dist/development/context-phCt_zmH.d.mts +1713 -0
  10. package/dist/development/dom-export.d.mts +3 -2
  11. package/dist/development/dom-export.d.ts +3 -2
  12. package/dist/development/dom-export.js +45 -29
  13. package/dist/development/dom-export.mjs +21 -5
  14. package/dist/development/{index-react-server-client-C4tCIird.d.ts → index-react-server-client-BcrVT7Dd.d.mts} +4 -2
  15. package/dist/{production/index-react-server-client-EzWJGpN_.d.mts → development/index-react-server-client-CCwMoQIT.d.ts} +1067 -10
  16. package/dist/development/index-react-server-client.d.mts +3 -2
  17. package/dist/development/index-react-server-client.d.ts +3 -2
  18. package/dist/development/index-react-server-client.js +4 -4
  19. package/dist/development/index-react-server-client.mjs +2 -2
  20. package/dist/development/index-react-server.d.mts +293 -246
  21. package/dist/development/index-react-server.d.ts +293 -246
  22. package/dist/development/index-react-server.js +121 -43
  23. package/dist/development/index-react-server.mjs +121 -43
  24. package/dist/development/index.d.mts +15 -13
  25. package/dist/development/index.d.ts +15 -13
  26. package/dist/development/index.js +176 -142
  27. package/dist/development/index.mjs +3 -3
  28. package/dist/development/instrumentation-BYr6ff5D.d.ts +657 -0
  29. package/dist/development/lib/types/internal.d.mts +2 -2
  30. package/dist/development/lib/types/internal.d.ts +2 -2
  31. package/dist/development/lib/types/internal.js +1 -1
  32. package/dist/development/lib/types/internal.mjs +1 -1
  33. package/dist/development/{register-CBoanF80.d.ts → register-CTxsJBKQ.d.mts} +1 -1
  34. package/dist/development/{register-cRYJ3CjG.d.mts → register-CkcGwv27.d.ts} +1 -1
  35. package/dist/development/routeModules-BRrCYrSL.d.mts +1693 -0
  36. package/dist/development/routeModules-CA7kSxJJ.d.ts +1693 -0
  37. package/dist/production/{browser-sPQ7eaK4.d.ts → browser-Bfn3xw9E.d.ts} +2 -1
  38. package/dist/{development/browser-sPQ7eaK4.d.ts → production/browser-Di6-vSl-.d.mts} +2 -1
  39. package/dist/production/{chunk-RJCJ3EYF.mjs → chunk-2BDJPJTA.mjs} +124 -44
  40. package/dist/production/{chunk-ZJMCM6KT.js → chunk-CAFVLUDY.js} +7 -7
  41. package/dist/production/{chunk-772H4TVR.js → chunk-LKUVSIBA.js} +190 -111
  42. package/dist/{development/chunk-JPUPSTYD.mjs → production/chunk-PY35PE22.mjs} +83 -49
  43. package/dist/{development/chunk-2YMDXNOJ.js → production/chunk-XAAX7KIK.js} +100 -99
  44. package/dist/production/context-phCt_zmH.d.mts +1713 -0
  45. package/dist/production/dom-export.d.mts +3 -2
  46. package/dist/production/dom-export.d.ts +3 -2
  47. package/dist/production/dom-export.js +45 -29
  48. package/dist/production/dom-export.mjs +21 -5
  49. package/dist/{development/index-react-server-client-EzWJGpN_.d.mts → production/index-react-server-client-BcrVT7Dd.d.mts} +4 -2
  50. package/dist/production/{index-react-server-client-C4tCIird.d.ts → index-react-server-client-CCwMoQIT.d.ts} +1067 -10
  51. package/dist/production/index-react-server-client.d.mts +3 -2
  52. package/dist/production/index-react-server-client.d.ts +3 -2
  53. package/dist/production/index-react-server-client.js +4 -4
  54. package/dist/production/index-react-server-client.mjs +2 -2
  55. package/dist/production/index-react-server.d.mts +293 -246
  56. package/dist/production/index-react-server.d.ts +293 -246
  57. package/dist/production/index-react-server.js +121 -43
  58. package/dist/production/index-react-server.mjs +121 -43
  59. package/dist/production/index.d.mts +15 -13
  60. package/dist/production/index.d.ts +15 -13
  61. package/dist/production/index.js +176 -142
  62. package/dist/production/index.mjs +3 -3
  63. package/dist/production/instrumentation-BYr6ff5D.d.ts +657 -0
  64. package/dist/production/lib/types/internal.d.mts +2 -2
  65. package/dist/production/lib/types/internal.d.ts +2 -2
  66. package/dist/production/lib/types/internal.js +1 -1
  67. package/dist/production/lib/types/internal.mjs +1 -1
  68. package/dist/production/{register-CBoanF80.d.ts → register-CTxsJBKQ.d.mts} +1 -1
  69. package/dist/production/{register-cRYJ3CjG.d.mts → register-CkcGwv27.d.ts} +1 -1
  70. package/dist/production/routeModules-BRrCYrSL.d.mts +1693 -0
  71. package/dist/production/routeModules-CA7kSxJJ.d.ts +1693 -0
  72. package/package.json +1 -1
  73. package/dist/development/instrumentation--6Pioq_G.d.ts +0 -3344
  74. package/dist/development/router-cLsU7kHk.d.mts +0 -3344
  75. package/dist/production/instrumentation--6Pioq_G.d.ts +0 -3344
  76. package/dist/production/router-cLsU7kHk.d.mts +0 -3344
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.13.1
2
+ * react-router v7.13.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -28,7 +28,7 @@ import {
28
28
  isSession,
29
29
  routeRSCServerRequest,
30
30
  setDevServerHooks
31
- } from "./chunk-TXB4YXR2.mjs";
31
+ } from "./chunk-PY35PE22.mjs";
32
32
  import {
33
33
  Action,
34
34
  Await,
@@ -141,7 +141,7 @@ import {
141
141
  withComponentProps,
142
142
  withErrorBoundaryProps,
143
143
  withHydrateFallbackProps
144
- } from "./chunk-RJCJ3EYF.mjs";
144
+ } from "./chunk-2BDJPJTA.mjs";
145
145
  export {
146
146
  Await,
147
147
  BrowserRouter,
@@ -0,0 +1,657 @@
1
+ import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, U as UIMatch, T as To, o as HTMLFormMethod, F as FormEncType, p as Path, q as LoaderFunctionArgs, r as MiddlewareEnabled, s as AppLoadContext } from './routeModules-CA7kSxJJ.js';
2
+
3
+ /**
4
+ * A Router instance manages all navigation and data loading/mutations
5
+ */
6
+ interface Router {
7
+ /**
8
+ * @private
9
+ * PRIVATE - DO NOT USE
10
+ *
11
+ * Return the basename for the router
12
+ */
13
+ get basename(): RouterInit["basename"];
14
+ /**
15
+ * @private
16
+ * PRIVATE - DO NOT USE
17
+ *
18
+ * Return the future config for the router
19
+ */
20
+ get future(): FutureConfig;
21
+ /**
22
+ * @private
23
+ * PRIVATE - DO NOT USE
24
+ *
25
+ * Return the current state of the router
26
+ */
27
+ get state(): RouterState;
28
+ /**
29
+ * @private
30
+ * PRIVATE - DO NOT USE
31
+ *
32
+ * Return the routes for this router instance
33
+ */
34
+ get routes(): DataRouteObject[];
35
+ /**
36
+ * @private
37
+ * PRIVATE - DO NOT USE
38
+ *
39
+ * Return the window associated with the router
40
+ */
41
+ get window(): RouterInit["window"];
42
+ /**
43
+ * @private
44
+ * PRIVATE - DO NOT USE
45
+ *
46
+ * Initialize the router, including adding history listeners and kicking off
47
+ * initial data fetches. Returns a function to cleanup listeners and abort
48
+ * any in-progress loads
49
+ */
50
+ initialize(): Router;
51
+ /**
52
+ * @private
53
+ * PRIVATE - DO NOT USE
54
+ *
55
+ * Subscribe to router.state updates
56
+ *
57
+ * @param fn function to call with the new state
58
+ */
59
+ subscribe(fn: RouterSubscriber): () => void;
60
+ /**
61
+ * @private
62
+ * PRIVATE - DO NOT USE
63
+ *
64
+ * Enable scroll restoration behavior in the router
65
+ *
66
+ * @param savedScrollPositions Object that will manage positions, in case
67
+ * it's being restored from sessionStorage
68
+ * @param getScrollPosition Function to get the active Y scroll position
69
+ * @param getKey Function to get the key to use for restoration
70
+ */
71
+ enableScrollRestoration(savedScrollPositions: Record<string, number>, getScrollPosition: GetScrollPositionFunction, getKey?: GetScrollRestorationKeyFunction): () => void;
72
+ /**
73
+ * @private
74
+ * PRIVATE - DO NOT USE
75
+ *
76
+ * Navigate forward/backward in the history stack
77
+ * @param to Delta to move in the history stack
78
+ */
79
+ navigate(to: number): Promise<void>;
80
+ /**
81
+ * Navigate to the given path
82
+ * @param to Path to navigate to
83
+ * @param opts Navigation options (method, submission, etc.)
84
+ */
85
+ navigate(to: To | null, opts?: RouterNavigateOptions): Promise<void>;
86
+ /**
87
+ * @private
88
+ * PRIVATE - DO NOT USE
89
+ *
90
+ * Trigger a fetcher load/submission
91
+ *
92
+ * @param key Fetcher key
93
+ * @param routeId Route that owns the fetcher
94
+ * @param href href to fetch
95
+ * @param opts Fetcher options, (method, submission, etc.)
96
+ */
97
+ fetch(key: string, routeId: string, href: string | null, opts?: RouterFetchOptions): Promise<void>;
98
+ /**
99
+ * @private
100
+ * PRIVATE - DO NOT USE
101
+ *
102
+ * Trigger a revalidation of all current route loaders and fetcher loads
103
+ */
104
+ revalidate(): Promise<void>;
105
+ /**
106
+ * @private
107
+ * PRIVATE - DO NOT USE
108
+ *
109
+ * Utility function to create an href for the given location
110
+ * @param location
111
+ */
112
+ createHref(location: Location | URL): string;
113
+ /**
114
+ * @private
115
+ * PRIVATE - DO NOT USE
116
+ *
117
+ * Utility function to URL encode a destination path according to the internal
118
+ * history implementation
119
+ * @param to
120
+ */
121
+ encodeLocation(to: To): Path;
122
+ /**
123
+ * @private
124
+ * PRIVATE - DO NOT USE
125
+ *
126
+ * Get/create a fetcher for the given key
127
+ * @param key
128
+ */
129
+ getFetcher<TData = any>(key: string): Fetcher<TData>;
130
+ /**
131
+ * @internal
132
+ * PRIVATE - DO NOT USE
133
+ *
134
+ * Reset the fetcher for a given key
135
+ * @param key
136
+ */
137
+ resetFetcher(key: string, opts?: {
138
+ reason?: unknown;
139
+ }): void;
140
+ /**
141
+ * @private
142
+ * PRIVATE - DO NOT USE
143
+ *
144
+ * Delete the fetcher for a given key
145
+ * @param key
146
+ */
147
+ deleteFetcher(key: string): void;
148
+ /**
149
+ * @private
150
+ * PRIVATE - DO NOT USE
151
+ *
152
+ * Cleanup listeners and abort any in-progress loads
153
+ */
154
+ dispose(): void;
155
+ /**
156
+ * @private
157
+ * PRIVATE - DO NOT USE
158
+ *
159
+ * Get a navigation blocker
160
+ * @param key The identifier for the blocker
161
+ * @param fn The blocker function implementation
162
+ */
163
+ getBlocker(key: string, fn: BlockerFunction): Blocker;
164
+ /**
165
+ * @private
166
+ * PRIVATE - DO NOT USE
167
+ *
168
+ * Delete a navigation blocker
169
+ * @param key The identifier for the blocker
170
+ */
171
+ deleteBlocker(key: string): void;
172
+ /**
173
+ * @private
174
+ * PRIVATE DO NOT USE
175
+ *
176
+ * Patch additional children routes into an existing parent route
177
+ * @param routeId The parent route id or a callback function accepting `patch`
178
+ * to perform batch patching
179
+ * @param children The additional children routes
180
+ * @param unstable_allowElementMutations Allow mutation or route elements on
181
+ * existing routes. Intended for RSC-usage
182
+ * only.
183
+ */
184
+ patchRoutes(routeId: string | null, children: RouteObject[], unstable_allowElementMutations?: boolean): void;
185
+ /**
186
+ * @private
187
+ * PRIVATE - DO NOT USE
188
+ *
189
+ * HMR needs to pass in-flight route updates to React Router
190
+ * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
191
+ */
192
+ _internalSetRoutes(routes: RouteObject[]): void;
193
+ /**
194
+ * @private
195
+ * PRIVATE - DO NOT USE
196
+ *
197
+ * Cause subscribers to re-render. This is used to force a re-render.
198
+ */
199
+ _internalSetStateDoNotUseOrYouWillBreakYourApp(state: Partial<RouterState>): void;
200
+ /**
201
+ * @private
202
+ * PRIVATE - DO NOT USE
203
+ *
204
+ * Internal fetch AbortControllers accessed by unit tests
205
+ */
206
+ _internalFetchControllers: Map<string, AbortController>;
207
+ }
208
+ /**
209
+ * State maintained internally by the router. During a navigation, all states
210
+ * reflect the "old" location unless otherwise noted.
211
+ */
212
+ interface RouterState {
213
+ /**
214
+ * The action of the most recent navigation
215
+ */
216
+ historyAction: Action;
217
+ /**
218
+ * The current location reflected by the router
219
+ */
220
+ location: Location;
221
+ /**
222
+ * The current set of route matches
223
+ */
224
+ matches: DataRouteMatch[];
225
+ /**
226
+ * Tracks whether we've completed our initial data load
227
+ */
228
+ initialized: boolean;
229
+ /**
230
+ * Tracks whether we should be rendering a HydrateFallback during hydration
231
+ */
232
+ renderFallback: boolean;
233
+ /**
234
+ * Current scroll position we should start at for a new view
235
+ * - number -> scroll position to restore to
236
+ * - false -> do not restore scroll at all (used during submissions/revalidations)
237
+ * - null -> don't have a saved position, scroll to hash or top of page
238
+ */
239
+ restoreScrollPosition: number | false | null;
240
+ /**
241
+ * Indicate whether this navigation should skip resetting the scroll position
242
+ * if we are unable to restore the scroll position
243
+ */
244
+ preventScrollReset: boolean;
245
+ /**
246
+ * Tracks the state of the current navigation
247
+ */
248
+ navigation: Navigation;
249
+ /**
250
+ * Tracks any in-progress revalidations
251
+ */
252
+ revalidation: RevalidationState;
253
+ /**
254
+ * Data from the loaders for the current matches
255
+ */
256
+ loaderData: RouteData;
257
+ /**
258
+ * Data from the action for the current matches
259
+ */
260
+ actionData: RouteData | null;
261
+ /**
262
+ * Errors caught from loaders for the current matches
263
+ */
264
+ errors: RouteData | null;
265
+ /**
266
+ * Map of current fetchers
267
+ */
268
+ fetchers: Map<string, Fetcher>;
269
+ /**
270
+ * Map of current blockers
271
+ */
272
+ blockers: Map<string, Blocker>;
273
+ }
274
+ /**
275
+ * Data that can be passed into hydrate a Router from SSR
276
+ */
277
+ type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
278
+ /**
279
+ * Future flags to toggle new feature behavior
280
+ */
281
+ interface FutureConfig {
282
+ unstable_passThroughRequests: boolean;
283
+ }
284
+ /**
285
+ * Initialization options for createRouter
286
+ */
287
+ interface RouterInit {
288
+ routes: RouteObject[];
289
+ history: History;
290
+ basename?: string;
291
+ getContext?: () => MaybePromise<RouterContextProvider>;
292
+ unstable_instrumentations?: unstable_ClientInstrumentation[];
293
+ mapRouteProperties?: MapRoutePropertiesFunction;
294
+ future?: Partial<FutureConfig>;
295
+ hydrationRouteProperties?: string[];
296
+ hydrationData?: HydrationState;
297
+ window?: Window;
298
+ dataStrategy?: DataStrategyFunction;
299
+ patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
300
+ }
301
+ /**
302
+ * State returned from a server-side query() call
303
+ */
304
+ interface StaticHandlerContext {
305
+ basename: Router["basename"];
306
+ location: RouterState["location"];
307
+ matches: RouterState["matches"];
308
+ loaderData: RouterState["loaderData"];
309
+ actionData: RouterState["actionData"];
310
+ errors: RouterState["errors"];
311
+ statusCode: number;
312
+ loaderHeaders: Record<string, Headers>;
313
+ actionHeaders: Record<string, Headers>;
314
+ _deepestRenderedBoundaryId?: string | null;
315
+ }
316
+ /**
317
+ * A StaticHandler instance manages a singular SSR navigation/fetch event
318
+ */
319
+ interface StaticHandler {
320
+ dataRoutes: DataRouteObject[];
321
+ query(request: Request, opts?: {
322
+ requestContext?: unknown;
323
+ filterMatchesToLoad?: (match: DataRouteMatch) => boolean;
324
+ skipLoaderErrorBubbling?: boolean;
325
+ skipRevalidation?: boolean;
326
+ dataStrategy?: DataStrategyFunction<unknown>;
327
+ generateMiddlewareResponse?: (query: (r: Request, args?: {
328
+ filterMatchesToLoad?: (match: DataRouteMatch) => boolean;
329
+ }) => Promise<StaticHandlerContext | Response>) => MaybePromise<Response>;
330
+ unstable_normalizePath?: (request: Request) => Path;
331
+ }): Promise<StaticHandlerContext | Response>;
332
+ queryRoute(request: Request, opts?: {
333
+ routeId?: string;
334
+ requestContext?: unknown;
335
+ dataStrategy?: DataStrategyFunction<unknown>;
336
+ generateMiddlewareResponse?: (queryRoute: (r: Request) => Promise<Response>) => MaybePromise<Response>;
337
+ unstable_normalizePath?: (request: Request) => Path;
338
+ }): Promise<any>;
339
+ }
340
+ type ViewTransitionOpts = {
341
+ currentLocation: Location;
342
+ nextLocation: Location;
343
+ };
344
+ /**
345
+ * Subscriber function signature for changes to router state
346
+ */
347
+ interface RouterSubscriber {
348
+ (state: RouterState, opts: {
349
+ deletedFetchers: string[];
350
+ newErrors: RouteData | null;
351
+ viewTransitionOpts?: ViewTransitionOpts;
352
+ flushSync: boolean;
353
+ }): void;
354
+ }
355
+ /**
356
+ * Function signature for determining the key to be used in scroll restoration
357
+ * for a given location
358
+ */
359
+ interface GetScrollRestorationKeyFunction {
360
+ (location: Location, matches: UIMatch[]): string | null;
361
+ }
362
+ /**
363
+ * Function signature for determining the current scroll position
364
+ */
365
+ interface GetScrollPositionFunction {
366
+ (): number;
367
+ }
368
+ /**
369
+ * - "route": relative to the route hierarchy so `..` means remove all segments
370
+ * of the current route even if it has many. For example, a `route("posts/:id")`
371
+ * would have both `:id` and `posts` removed from the url.
372
+ * - "path": relative to the pathname so `..` means remove one segment of the
373
+ * pathname. For example, a `route("posts/:id")` would have only `:id` removed
374
+ * from the url.
375
+ */
376
+ type RelativeRoutingType = "route" | "path";
377
+ type BaseNavigateOrFetchOptions = {
378
+ preventScrollReset?: boolean;
379
+ relative?: RelativeRoutingType;
380
+ flushSync?: boolean;
381
+ unstable_defaultShouldRevalidate?: boolean;
382
+ };
383
+ type BaseNavigateOptions = BaseNavigateOrFetchOptions & {
384
+ replace?: boolean;
385
+ state?: any;
386
+ fromRouteId?: string;
387
+ viewTransition?: boolean;
388
+ unstable_mask?: To;
389
+ };
390
+ type BaseSubmissionOptions = {
391
+ formMethod?: HTMLFormMethod;
392
+ formEncType?: FormEncType;
393
+ } & ({
394
+ formData: FormData;
395
+ body?: undefined;
396
+ } | {
397
+ formData?: undefined;
398
+ body: any;
399
+ });
400
+ /**
401
+ * Options for a navigate() call for a normal (non-submission) navigation
402
+ */
403
+ type LinkNavigateOptions = BaseNavigateOptions;
404
+ /**
405
+ * Options for a navigate() call for a submission navigation
406
+ */
407
+ type SubmissionNavigateOptions = BaseNavigateOptions & BaseSubmissionOptions;
408
+ /**
409
+ * Options to pass to navigate() for a navigation
410
+ */
411
+ type RouterNavigateOptions = LinkNavigateOptions | SubmissionNavigateOptions;
412
+ /**
413
+ * Options for a fetch() load
414
+ */
415
+ type LoadFetchOptions = BaseNavigateOrFetchOptions;
416
+ /**
417
+ * Options for a fetch() submission
418
+ */
419
+ type SubmitFetchOptions = BaseNavigateOrFetchOptions & BaseSubmissionOptions;
420
+ /**
421
+ * Options to pass to fetch()
422
+ */
423
+ type RouterFetchOptions = LoadFetchOptions | SubmitFetchOptions;
424
+ /**
425
+ * Potential states for state.navigation
426
+ */
427
+ type NavigationStates = {
428
+ Idle: {
429
+ state: "idle";
430
+ location: undefined;
431
+ formMethod: undefined;
432
+ formAction: undefined;
433
+ formEncType: undefined;
434
+ formData: undefined;
435
+ json: undefined;
436
+ text: undefined;
437
+ };
438
+ Loading: {
439
+ state: "loading";
440
+ location: Location;
441
+ formMethod: Submission["formMethod"] | undefined;
442
+ formAction: Submission["formAction"] | undefined;
443
+ formEncType: Submission["formEncType"] | undefined;
444
+ formData: Submission["formData"] | undefined;
445
+ json: Submission["json"] | undefined;
446
+ text: Submission["text"] | undefined;
447
+ };
448
+ Submitting: {
449
+ state: "submitting";
450
+ location: Location;
451
+ formMethod: Submission["formMethod"];
452
+ formAction: Submission["formAction"];
453
+ formEncType: Submission["formEncType"];
454
+ formData: Submission["formData"];
455
+ json: Submission["json"];
456
+ text: Submission["text"];
457
+ };
458
+ };
459
+ type Navigation = NavigationStates[keyof NavigationStates];
460
+ type RevalidationState = "idle" | "loading";
461
+ /**
462
+ * Potential states for fetchers
463
+ */
464
+ type FetcherStates<TData = any> = {
465
+ /**
466
+ * The fetcher is not calling a loader or action
467
+ *
468
+ * ```tsx
469
+ * fetcher.state === "idle"
470
+ * ```
471
+ */
472
+ Idle: {
473
+ state: "idle";
474
+ formMethod: undefined;
475
+ formAction: undefined;
476
+ formEncType: undefined;
477
+ text: undefined;
478
+ formData: undefined;
479
+ json: undefined;
480
+ /**
481
+ * If the fetcher has never been called, this will be undefined.
482
+ */
483
+ data: TData | undefined;
484
+ };
485
+ /**
486
+ * The fetcher is loading data from a {@link LoaderFunction | loader} from a
487
+ * call to {@link FetcherWithComponents.load | `fetcher.load`}.
488
+ *
489
+ * ```tsx
490
+ * // somewhere
491
+ * <button onClick={() => fetcher.load("/some/route") }>Load</button>
492
+ *
493
+ * // the state will update
494
+ * fetcher.state === "loading"
495
+ * ```
496
+ */
497
+ Loading: {
498
+ state: "loading";
499
+ formMethod: Submission["formMethod"] | undefined;
500
+ formAction: Submission["formAction"] | undefined;
501
+ formEncType: Submission["formEncType"] | undefined;
502
+ text: Submission["text"] | undefined;
503
+ formData: Submission["formData"] | undefined;
504
+ json: Submission["json"] | undefined;
505
+ data: TData | undefined;
506
+ };
507
+ /**
508
+ 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`}.
509
+
510
+ ```tsx
511
+ // somewhere
512
+ <input
513
+ onChange={e => {
514
+ fetcher.submit(event.currentTarget.form, { method: "post" });
515
+ }}
516
+ />
517
+
518
+ // the state will update
519
+ fetcher.state === "submitting"
520
+
521
+ // and formData will be available
522
+ fetcher.formData
523
+ ```
524
+ */
525
+ Submitting: {
526
+ state: "submitting";
527
+ formMethod: Submission["formMethod"];
528
+ formAction: Submission["formAction"];
529
+ formEncType: Submission["formEncType"];
530
+ text: Submission["text"];
531
+ formData: Submission["formData"];
532
+ json: Submission["json"];
533
+ data: TData | undefined;
534
+ };
535
+ };
536
+ type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
537
+ interface BlockerBlocked {
538
+ state: "blocked";
539
+ reset: () => void;
540
+ proceed: () => void;
541
+ location: Location;
542
+ }
543
+ interface BlockerUnblocked {
544
+ state: "unblocked";
545
+ reset: undefined;
546
+ proceed: undefined;
547
+ location: undefined;
548
+ }
549
+ interface BlockerProceeding {
550
+ state: "proceeding";
551
+ reset: undefined;
552
+ proceed: undefined;
553
+ location: Location;
554
+ }
555
+ type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
556
+ type BlockerFunction = (args: {
557
+ currentLocation: Location;
558
+ nextLocation: Location;
559
+ historyAction: Action;
560
+ }) => boolean;
561
+ declare const IDLE_NAVIGATION: NavigationStates["Idle"];
562
+ declare const IDLE_FETCHER: FetcherStates["Idle"];
563
+ declare const IDLE_BLOCKER: BlockerUnblocked;
564
+ /**
565
+ * Create a router and listen to history POP navigations
566
+ */
567
+ declare function createRouter(init: RouterInit): Router;
568
+ interface CreateStaticHandlerOptions {
569
+ basename?: string;
570
+ mapRouteProperties?: MapRoutePropertiesFunction;
571
+ unstable_instrumentations?: Pick<unstable_ServerInstrumentation, "route">[];
572
+ future?: Partial<FutureConfig>;
573
+ }
574
+
575
+ type unstable_ServerInstrumentation = {
576
+ handler?: unstable_InstrumentRequestHandlerFunction;
577
+ route?: unstable_InstrumentRouteFunction;
578
+ };
579
+ type unstable_ClientInstrumentation = {
580
+ router?: unstable_InstrumentRouterFunction;
581
+ route?: unstable_InstrumentRouteFunction;
582
+ };
583
+ type unstable_InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
584
+ type unstable_InstrumentRouterFunction = (router: InstrumentableRouter) => void;
585
+ type unstable_InstrumentRouteFunction = (route: InstrumentableRoute) => void;
586
+ type unstable_InstrumentationHandlerResult = {
587
+ status: "success";
588
+ error: undefined;
589
+ } | {
590
+ status: "error";
591
+ error: Error;
592
+ };
593
+ type InstrumentFunction<T> = (handler: () => Promise<unstable_InstrumentationHandlerResult>, info: T) => Promise<void>;
594
+ type ReadonlyRequest = {
595
+ method: string;
596
+ url: string;
597
+ headers: Pick<Headers, "get">;
598
+ };
599
+ type ReadonlyContext = MiddlewareEnabled extends true ? Pick<RouterContextProvider, "get"> : Readonly<AppLoadContext>;
600
+ type InstrumentableRoute = {
601
+ id: string;
602
+ index: boolean | undefined;
603
+ path: string | undefined;
604
+ instrument(instrumentations: RouteInstrumentations): void;
605
+ };
606
+ type RouteInstrumentations = {
607
+ lazy?: InstrumentFunction<RouteLazyInstrumentationInfo>;
608
+ "lazy.loader"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
609
+ "lazy.action"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
610
+ "lazy.middleware"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
611
+ middleware?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
612
+ loader?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
613
+ action?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
614
+ };
615
+ type RouteLazyInstrumentationInfo = undefined;
616
+ type RouteHandlerInstrumentationInfo = Readonly<{
617
+ request: ReadonlyRequest;
618
+ params: LoaderFunctionArgs["params"];
619
+ unstable_pattern: string;
620
+ context: ReadonlyContext;
621
+ }>;
622
+ type InstrumentableRouter = {
623
+ instrument(instrumentations: RouterInstrumentations): void;
624
+ };
625
+ type RouterInstrumentations = {
626
+ navigate?: InstrumentFunction<RouterNavigationInstrumentationInfo>;
627
+ fetch?: InstrumentFunction<RouterFetchInstrumentationInfo>;
628
+ };
629
+ type RouterNavigationInstrumentationInfo = Readonly<{
630
+ to: string | number;
631
+ currentUrl: string;
632
+ formMethod?: HTMLFormMethod;
633
+ formEncType?: FormEncType;
634
+ formData?: FormData;
635
+ body?: any;
636
+ }>;
637
+ type RouterFetchInstrumentationInfo = Readonly<{
638
+ href: string;
639
+ currentUrl: string;
640
+ fetcherKey: string;
641
+ formMethod?: HTMLFormMethod;
642
+ formEncType?: FormEncType;
643
+ formData?: FormData;
644
+ body?: any;
645
+ }>;
646
+ type InstrumentableRequestHandler = {
647
+ instrument(instrumentations: RequestHandlerInstrumentations): void;
648
+ };
649
+ type RequestHandlerInstrumentations = {
650
+ request?: InstrumentFunction<RequestHandlerInstrumentationInfo>;
651
+ };
652
+ type RequestHandlerInstrumentationInfo = Readonly<{
653
+ request: ReadonlyRequest;
654
+ context: ReadonlyContext | undefined;
655
+ }>;
656
+
657
+ export { type BlockerFunction as B, type CreateStaticHandlerOptions as C, type Fetcher as F, type GetScrollPositionFunction as G, type HydrationState as H, IDLE_NAVIGATION as I, type Navigation as N, type RouterInit as R, type StaticHandler as S, type Router as a, type Blocker as b, type RelativeRoutingType as c, type RouterState as d, type GetScrollRestorationKeyFunction as e, type StaticHandlerContext as f, type NavigationStates as g, type RouterSubscriber as h, type RouterNavigateOptions as i, type RouterFetchOptions as j, type RevalidationState as k, type unstable_ServerInstrumentation as l, type unstable_InstrumentRequestHandlerFunction as m, type unstable_InstrumentRouterFunction as n, type unstable_InstrumentRouteFunction as o, type unstable_InstrumentationHandlerResult as p, IDLE_FETCHER as q, IDLE_BLOCKER as r, createRouter as s, type FutureConfig as t, type unstable_ClientInstrumentation as u };
@@ -1,5 +1,5 @@
1
- import { R as RouteModule, h as LinkDescriptor, L as Location, F as Func, i as Pretty, j as MetaDescriptor, G as GetLoaderData, k as ServerDataFunctionArgs, l as MiddlewareNextFunction, m as ClientDataFunctionArgs, D as DataStrategyResult, n as ServerDataFrom, N as Normalize, o as GetActionData } from '../../router-cLsU7kHk.mjs';
2
- import { R as RouteFiles, P as Pages } from '../../register-cRYJ3CjG.mjs';
1
+ import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../routeModules-BRrCYrSL.mjs';
2
+ import { R as RouteFiles, P as Pages } from '../../register-CTxsJBKQ.mjs';
3
3
  import 'react';
4
4
 
5
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,5 +1,5 @@
1
- import { R as RouteModule, f as LinkDescriptor, L as Location, F as Func, g as Pretty, h as MetaDescriptor, G as GetLoaderData, i as ServerDataFunctionArgs, j as MiddlewareNextFunction, k as ClientDataFunctionArgs, D as DataStrategyResult, l as ServerDataFrom, N as Normalize, m as GetActionData } from '../../instrumentation--6Pioq_G.js';
2
- import { R as RouteFiles, P as Pages } from '../../register-CBoanF80.js';
1
+ import { R as RouteModule, t as LinkDescriptor, L as Location, u as Func, v as Pretty, w as MetaDescriptor, G as GetLoaderData, x as ServerDataFunctionArgs, y as MiddlewareNextFunction, z as ClientDataFunctionArgs, B as DataStrategyResult, E as ServerDataFrom, N as Normalize, I as GetActionData } from '../../routeModules-CA7kSxJJ.js';
2
+ import { R as RouteFiles, P as Pages } from '../../register-CkcGwv27.js';
3
3
  import 'react';
4
4
 
5
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * react-router v7.13.1
2
+ * react-router v7.13.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *