react-router 7.15.1 → 8.0.0-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/CHANGELOG.md +18 -2
  2. package/dist/development/dom-export.d.ts +6 -172
  3. package/dist/development/dom-export.js +12 -1007
  4. package/dist/development/index-react-server-client.d.ts +7 -4
  5. package/dist/development/index-react-server-client.js +8 -52
  6. package/dist/development/index-react-server.d.ts +1645 -1635
  7. package/dist/development/index-react-server.js +2880 -3642
  8. package/dist/development/index.d.ts +43 -1469
  9. package/dist/development/index.js +37 -2621
  10. package/dist/development/lib/actions.js +62 -0
  11. package/dist/development/lib/components.d.ts +1022 -0
  12. package/dist/development/lib/components.js +835 -0
  13. package/dist/development/lib/context.d.ts +83 -0
  14. package/dist/development/lib/context.js +41 -0
  15. package/dist/development/lib/dom/dom.d.ts +119 -0
  16. package/dist/development/lib/dom/dom.js +143 -0
  17. package/dist/development/lib/dom/lib.d.ts +2042 -0
  18. package/dist/development/lib/dom/lib.js +1259 -0
  19. package/dist/development/lib/dom/server.d.ts +138 -0
  20. package/dist/development/lib/dom/server.js +301 -0
  21. package/dist/development/lib/dom/ssr/components.d.ts +196 -0
  22. package/dist/development/lib/dom/ssr/components.js +579 -0
  23. package/dist/development/lib/dom/ssr/data.js +29 -0
  24. package/dist/development/lib/dom/ssr/entry.d.ts +59 -0
  25. package/dist/development/lib/dom/ssr/errorBoundaries.d.ts +27 -0
  26. package/dist/development/lib/dom/ssr/errorBoundaries.js +83 -0
  27. package/dist/development/lib/dom/ssr/errors.d.ts +7 -0
  28. package/dist/development/lib/dom/ssr/errors.js +36 -0
  29. package/dist/development/lib/dom/ssr/fallback.js +28 -0
  30. package/dist/development/lib/dom/ssr/fog-of-war.d.ts +12 -0
  31. package/dist/development/lib/dom/ssr/fog-of-war.js +170 -0
  32. package/dist/development/lib/dom/ssr/hydration.d.ts +32 -0
  33. package/dist/development/lib/dom/ssr/hydration.js +29 -0
  34. package/dist/development/lib/dom/ssr/invariant.js +16 -0
  35. package/dist/development/lib/dom/ssr/links.js +170 -0
  36. package/dist/development/lib/dom/ssr/markup.js +24 -0
  37. package/dist/development/lib/dom/ssr/routeModules.d.ts +206 -0
  38. package/dist/development/lib/dom/ssr/routeModules.js +31 -0
  39. package/dist/development/lib/dom/ssr/routes-test-stub.d.ts +62 -0
  40. package/dist/development/lib/dom/ssr/routes-test-stub.js +108 -0
  41. package/dist/development/lib/dom/ssr/routes.d.ts +33 -0
  42. package/dist/development/lib/dom/ssr/routes.js +303 -0
  43. package/dist/development/lib/dom/ssr/server.d.ts +45 -0
  44. package/dist/development/lib/dom/ssr/server.js +68 -0
  45. package/dist/development/lib/dom/ssr/single-fetch.d.ts +14 -0
  46. package/dist/development/lib/dom/ssr/single-fetch.js +346 -0
  47. package/dist/development/lib/dom-export/dom-router-provider.d.ts +9 -0
  48. package/dist/development/lib/dom-export/dom-router-provider.js +22 -0
  49. package/dist/development/lib/dom-export/hydrated-router.d.ts +125 -0
  50. package/dist/development/lib/dom-export/hydrated-router.js +153 -0
  51. package/dist/development/lib/errors.js +29 -0
  52. package/dist/development/lib/hooks.d.ts +947 -0
  53. package/dist/development/lib/hooks.js +1386 -0
  54. package/dist/development/lib/href.d.ts +20 -0
  55. package/dist/development/lib/href.js +50 -0
  56. package/dist/development/lib/router/history.d.ts +258 -0
  57. package/dist/development/lib/router/history.js +371 -0
  58. package/dist/development/lib/router/instrumentation.d.ts +86 -0
  59. package/dist/development/lib/router/instrumentation.js +213 -0
  60. package/dist/development/lib/router/links.d.ts +113 -0
  61. package/dist/development/lib/router/router.d.ts +663 -0
  62. package/dist/development/lib/router/router.js +2981 -0
  63. package/dist/development/lib/router/utils.d.ts +942 -0
  64. package/dist/development/lib/router/utils.js +791 -0
  65. package/dist/development/lib/rsc/browser.d.ts +137 -0
  66. package/dist/development/lib/rsc/browser.js +599 -0
  67. package/dist/development/lib/rsc/errorBoundaries.d.ts +11 -0
  68. package/dist/development/lib/rsc/errorBoundaries.js +90 -0
  69. package/dist/development/lib/rsc/html-stream/browser.d.ts +48 -0
  70. package/dist/development/lib/rsc/html-stream/browser.js +74 -0
  71. package/dist/development/lib/rsc/html-stream/server.js +78 -0
  72. package/dist/development/lib/rsc/route-modules.js +27 -0
  73. package/dist/development/lib/rsc/server.rsc.d.ts +219 -0
  74. package/dist/development/lib/rsc/server.ssr.d.ts +129 -0
  75. package/dist/development/lib/rsc/server.ssr.js +388 -0
  76. package/dist/development/lib/server-runtime/build.d.ts +66 -0
  77. package/dist/development/lib/server-runtime/cookies.d.ts +66 -0
  78. package/dist/development/lib/server-runtime/cookies.js +139 -0
  79. package/dist/development/lib/server-runtime/crypto.js +43 -0
  80. package/dist/development/lib/server-runtime/data.d.ts +13 -0
  81. package/dist/development/lib/server-runtime/data.js +25 -0
  82. package/dist/development/lib/server-runtime/dev.d.ts +9 -0
  83. package/dist/development/lib/server-runtime/dev.js +26 -0
  84. package/dist/development/lib/server-runtime/entry.js +20 -0
  85. package/dist/development/lib/server-runtime/errors.js +95 -0
  86. package/dist/development/lib/server-runtime/headers.js +73 -0
  87. package/dist/development/lib/server-runtime/invariant.js +19 -0
  88. package/dist/development/lib/server-runtime/mode.d.ts +12 -0
  89. package/dist/development/lib/server-runtime/mode.js +25 -0
  90. package/dist/development/lib/server-runtime/routeMatching.js +28 -0
  91. package/dist/development/lib/server-runtime/routes.d.ts +13 -0
  92. package/dist/development/lib/server-runtime/routes.js +74 -0
  93. package/dist/development/lib/server-runtime/server.d.ts +10 -0
  94. package/dist/development/lib/server-runtime/server.js +351 -0
  95. package/dist/development/lib/server-runtime/serverHandoff.js +17 -0
  96. package/dist/development/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
  97. package/dist/development/lib/server-runtime/sessions/cookieStorage.js +45 -0
  98. package/dist/development/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
  99. package/dist/development/lib/server-runtime/sessions/memoryStorage.js +52 -0
  100. package/dist/development/lib/server-runtime/sessions.d.ts +145 -0
  101. package/dist/development/lib/server-runtime/sessions.js +98 -0
  102. package/dist/development/lib/server-runtime/single-fetch.d.ts +7 -0
  103. package/dist/development/lib/server-runtime/single-fetch.js +215 -0
  104. package/dist/development/lib/server-runtime/urls.js +31 -0
  105. package/dist/development/lib/server-runtime/warnings.js +20 -0
  106. package/dist/development/lib/types/future.d.ts +9 -0
  107. package/dist/development/lib/types/internal.d.ts +26 -177
  108. package/dist/development/lib/types/internal.js +3 -2
  109. package/dist/{production/register-Bsscfj79.d.ts → development/lib/types/register.d.ts} +9 -15
  110. package/dist/development/lib/types/route-data.d.ts +113 -0
  111. package/dist/development/lib/types/route-module-annotations.d.ts +149 -0
  112. package/dist/development/lib/types/route-module.d.ts +19 -0
  113. package/dist/development/lib/types/serializes-to.d.ts +13 -0
  114. package/dist/development/lib/types/utils.d.ts +11 -0
  115. package/dist/development/vendor/turbo-stream-v2/flatten.js +159 -0
  116. package/dist/development/vendor/turbo-stream-v2/turbo-stream.js +178 -0
  117. package/dist/development/vendor/turbo-stream-v2/unflatten.js +198 -0
  118. package/dist/development/vendor/turbo-stream-v2/utils.js +47 -0
  119. package/dist/production/dom-export.d.ts +6 -172
  120. package/dist/production/dom-export.js +12 -1007
  121. package/dist/production/index-react-server-client.d.ts +7 -4
  122. package/dist/production/index-react-server-client.js +8 -52
  123. package/dist/production/index-react-server.d.ts +1645 -1635
  124. package/dist/production/index-react-server.js +2871 -3642
  125. package/dist/production/index.d.ts +43 -1469
  126. package/dist/production/index.js +37 -2621
  127. package/dist/production/lib/actions.js +62 -0
  128. package/dist/production/lib/components.d.ts +1022 -0
  129. package/dist/production/lib/components.js +835 -0
  130. package/dist/production/lib/context.d.ts +83 -0
  131. package/dist/production/lib/context.js +41 -0
  132. package/dist/production/lib/dom/dom.d.ts +119 -0
  133. package/dist/production/lib/dom/dom.js +143 -0
  134. package/dist/production/lib/dom/lib.d.ts +2042 -0
  135. package/dist/production/lib/dom/lib.js +1259 -0
  136. package/dist/production/lib/dom/server.d.ts +138 -0
  137. package/dist/production/lib/dom/server.js +301 -0
  138. package/dist/production/lib/dom/ssr/components.d.ts +196 -0
  139. package/dist/production/lib/dom/ssr/components.js +579 -0
  140. package/dist/production/lib/dom/ssr/data.js +29 -0
  141. package/dist/production/lib/dom/ssr/entry.d.ts +59 -0
  142. package/dist/production/lib/dom/ssr/errorBoundaries.d.ts +27 -0
  143. package/dist/production/lib/dom/ssr/errorBoundaries.js +83 -0
  144. package/dist/production/lib/dom/ssr/errors.d.ts +7 -0
  145. package/dist/production/lib/dom/ssr/errors.js +36 -0
  146. package/dist/production/lib/dom/ssr/fallback.js +21 -0
  147. package/dist/production/lib/dom/ssr/fog-of-war.d.ts +12 -0
  148. package/dist/production/lib/dom/ssr/fog-of-war.js +170 -0
  149. package/dist/production/lib/dom/ssr/hydration.d.ts +32 -0
  150. package/dist/production/lib/dom/ssr/hydration.js +29 -0
  151. package/dist/production/lib/dom/ssr/invariant.js +16 -0
  152. package/dist/production/lib/dom/ssr/links.js +170 -0
  153. package/dist/production/lib/dom/ssr/markup.js +24 -0
  154. package/dist/production/lib/dom/ssr/routeModules.d.ts +206 -0
  155. package/dist/production/lib/dom/ssr/routeModules.js +31 -0
  156. package/dist/production/lib/dom/ssr/routes-test-stub.d.ts +62 -0
  157. package/dist/production/lib/dom/ssr/routes-test-stub.js +108 -0
  158. package/dist/production/lib/dom/ssr/routes.d.ts +33 -0
  159. package/dist/production/lib/dom/ssr/routes.js +303 -0
  160. package/dist/production/lib/dom/ssr/server.d.ts +45 -0
  161. package/dist/production/lib/dom/ssr/server.js +68 -0
  162. package/dist/production/lib/dom/ssr/single-fetch.d.ts +14 -0
  163. package/dist/production/lib/dom/ssr/single-fetch.js +346 -0
  164. package/dist/production/lib/dom-export/dom-router-provider.d.ts +9 -0
  165. package/dist/production/lib/dom-export/dom-router-provider.js +22 -0
  166. package/dist/production/lib/dom-export/hydrated-router.d.ts +125 -0
  167. package/dist/production/lib/dom-export/hydrated-router.js +153 -0
  168. package/dist/production/lib/errors.js +29 -0
  169. package/dist/production/lib/hooks.d.ts +947 -0
  170. package/dist/production/lib/hooks.js +1371 -0
  171. package/dist/production/lib/href.d.ts +20 -0
  172. package/dist/production/lib/href.js +50 -0
  173. package/dist/production/lib/router/history.d.ts +258 -0
  174. package/dist/production/lib/router/history.js +371 -0
  175. package/dist/production/lib/router/instrumentation.d.ts +86 -0
  176. package/dist/production/lib/router/instrumentation.js +213 -0
  177. package/dist/production/lib/router/links.d.ts +113 -0
  178. package/dist/production/lib/router/router.d.ts +663 -0
  179. package/dist/production/lib/router/router.js +2981 -0
  180. package/dist/production/lib/router/utils.d.ts +942 -0
  181. package/dist/production/lib/router/utils.js +782 -0
  182. package/dist/production/lib/rsc/browser.d.ts +137 -0
  183. package/dist/production/lib/rsc/browser.js +599 -0
  184. package/dist/production/lib/rsc/errorBoundaries.d.ts +11 -0
  185. package/dist/production/lib/rsc/errorBoundaries.js +90 -0
  186. package/dist/production/lib/rsc/html-stream/browser.d.ts +48 -0
  187. package/dist/production/lib/rsc/html-stream/browser.js +74 -0
  188. package/dist/production/lib/rsc/html-stream/server.js +78 -0
  189. package/dist/production/lib/rsc/route-modules.js +27 -0
  190. package/dist/production/lib/rsc/server.rsc.d.ts +219 -0
  191. package/dist/production/lib/rsc/server.ssr.d.ts +129 -0
  192. package/dist/production/lib/rsc/server.ssr.js +388 -0
  193. package/dist/production/lib/server-runtime/build.d.ts +66 -0
  194. package/dist/production/lib/server-runtime/cookies.d.ts +66 -0
  195. package/dist/production/lib/server-runtime/cookies.js +139 -0
  196. package/dist/production/lib/server-runtime/crypto.js +43 -0
  197. package/dist/production/lib/server-runtime/data.d.ts +13 -0
  198. package/dist/production/lib/server-runtime/data.js +25 -0
  199. package/dist/production/lib/server-runtime/dev.d.ts +9 -0
  200. package/dist/production/lib/server-runtime/dev.js +26 -0
  201. package/dist/production/lib/server-runtime/entry.js +20 -0
  202. package/dist/production/lib/server-runtime/errors.js +95 -0
  203. package/dist/production/lib/server-runtime/headers.js +73 -0
  204. package/dist/production/lib/server-runtime/invariant.js +19 -0
  205. package/dist/production/lib/server-runtime/mode.d.ts +12 -0
  206. package/dist/production/lib/server-runtime/mode.js +25 -0
  207. package/dist/production/lib/server-runtime/routeMatching.js +28 -0
  208. package/dist/production/lib/server-runtime/routes.d.ts +13 -0
  209. package/dist/production/lib/server-runtime/routes.js +74 -0
  210. package/dist/production/lib/server-runtime/server.d.ts +10 -0
  211. package/dist/production/lib/server-runtime/server.js +351 -0
  212. package/dist/production/lib/server-runtime/serverHandoff.js +17 -0
  213. package/dist/production/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
  214. package/dist/production/lib/server-runtime/sessions/cookieStorage.js +45 -0
  215. package/dist/production/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
  216. package/dist/production/lib/server-runtime/sessions/memoryStorage.js +52 -0
  217. package/dist/production/lib/server-runtime/sessions.d.ts +145 -0
  218. package/dist/production/lib/server-runtime/sessions.js +98 -0
  219. package/dist/production/lib/server-runtime/single-fetch.d.ts +7 -0
  220. package/dist/production/lib/server-runtime/single-fetch.js +215 -0
  221. package/dist/production/lib/server-runtime/urls.js +31 -0
  222. package/dist/production/lib/server-runtime/warnings.js +20 -0
  223. package/dist/production/lib/types/future.d.ts +9 -0
  224. package/dist/production/lib/types/internal.d.ts +26 -177
  225. package/dist/production/lib/types/internal.js +3 -2
  226. package/dist/{development/register-Bsscfj79.d.ts → production/lib/types/register.d.ts} +9 -15
  227. package/dist/production/lib/types/route-data.d.ts +113 -0
  228. package/dist/production/lib/types/route-module-annotations.d.ts +149 -0
  229. package/dist/production/lib/types/route-module.d.ts +19 -0
  230. package/dist/production/lib/types/serializes-to.d.ts +13 -0
  231. package/dist/production/lib/types/utils.d.ts +11 -0
  232. package/dist/production/vendor/turbo-stream-v2/flatten.js +159 -0
  233. package/dist/production/vendor/turbo-stream-v2/turbo-stream.js +178 -0
  234. package/dist/production/vendor/turbo-stream-v2/unflatten.js +198 -0
  235. package/dist/production/vendor/turbo-stream-v2/utils.js +47 -0
  236. package/docs/explanation/backend-for-frontend.md +50 -0
  237. package/docs/explanation/code-splitting.md +77 -0
  238. package/docs/explanation/concurrency.md +135 -0
  239. package/docs/explanation/form-vs-fetcher.md +292 -0
  240. package/docs/explanation/hot-module-replacement.md +137 -0
  241. package/docs/explanation/hydration.md +14 -0
  242. package/docs/explanation/index-query-param.md +86 -0
  243. package/docs/explanation/index.md +4 -0
  244. package/docs/explanation/lazy-route-discovery.md +78 -0
  245. package/docs/explanation/location.md +6 -0
  246. package/docs/explanation/progressive-enhancement.md +150 -0
  247. package/docs/explanation/race-conditions.md +88 -0
  248. package/docs/explanation/react-transitions.md +160 -0
  249. package/docs/explanation/route-matching.md +7 -0
  250. package/docs/explanation/server-client-execution.md +4 -0
  251. package/docs/explanation/sessions-and-cookies.md +465 -0
  252. package/docs/explanation/special-files.md +16 -0
  253. package/docs/explanation/state-management.md +524 -0
  254. package/docs/explanation/styling.md +87 -0
  255. package/docs/explanation/type-safety.md +82 -0
  256. package/docs/how-to/accessibility.md +44 -0
  257. package/docs/how-to/client-data.md +199 -0
  258. package/docs/how-to/data-strategy.md +317 -0
  259. package/docs/how-to/error-boundary.md +231 -0
  260. package/docs/how-to/error-reporting.md +134 -0
  261. package/docs/how-to/fetchers.md +307 -0
  262. package/docs/how-to/file-route-conventions.md +410 -0
  263. package/docs/how-to/file-uploads.md +217 -0
  264. package/docs/how-to/form-validation.md +120 -0
  265. package/docs/how-to/headers.md +164 -0
  266. package/docs/how-to/index.md +4 -0
  267. package/docs/how-to/instrumentation.md +556 -0
  268. package/docs/how-to/meta.md +40 -0
  269. package/docs/how-to/middleware.md +728 -0
  270. package/docs/how-to/navigation-blocking.md +233 -0
  271. package/docs/how-to/optimize-revalidation.md +12 -0
  272. package/docs/how-to/pre-rendering.md +225 -0
  273. package/docs/how-to/presets.md +103 -0
  274. package/docs/how-to/react-server-components.md +899 -0
  275. package/docs/how-to/resource-routes.md +126 -0
  276. package/docs/how-to/route-module-type-safety.md +100 -0
  277. package/docs/how-to/search-params.md +4 -0
  278. package/docs/how-to/security.md +30 -0
  279. package/docs/how-to/server-bundles.md +66 -0
  280. package/docs/how-to/spa.md +120 -0
  281. package/docs/how-to/status.md +63 -0
  282. package/docs/how-to/suspense.md +132 -0
  283. package/docs/how-to/using-handle.md +117 -0
  284. package/docs/how-to/view-transitions.md +237 -0
  285. package/docs/how-to/webhook.md +50 -0
  286. package/docs/index.md +39 -0
  287. package/docs/start/data/actions.md +138 -0
  288. package/docs/start/data/custom.md +198 -0
  289. package/docs/start/data/data-loading.md +44 -0
  290. package/docs/start/data/index.md +4 -0
  291. package/docs/start/data/installation.md +52 -0
  292. package/docs/start/data/navigating.md +12 -0
  293. package/docs/start/data/pending-ui.md +12 -0
  294. package/docs/start/data/route-object.md +248 -0
  295. package/docs/start/data/routing.md +281 -0
  296. package/docs/start/data/testing.md +8 -0
  297. package/docs/start/declarative/index.md +4 -0
  298. package/docs/start/declarative/installation.md +43 -0
  299. package/docs/start/declarative/navigating.md +133 -0
  300. package/docs/start/declarative/routing.md +237 -0
  301. package/docs/start/declarative/url-values.md +65 -0
  302. package/docs/start/framework/actions.md +175 -0
  303. package/docs/start/framework/data-loading.md +201 -0
  304. package/docs/start/framework/deploying.md +96 -0
  305. package/docs/start/framework/index.md +4 -0
  306. package/docs/start/framework/installation.md +42 -0
  307. package/docs/start/framework/navigating.md +182 -0
  308. package/docs/start/framework/pending-ui.md +142 -0
  309. package/docs/start/framework/rendering.md +59 -0
  310. package/docs/start/framework/route-module.md +527 -0
  311. package/docs/start/framework/routing.md +362 -0
  312. package/docs/start/framework/testing.md +133 -0
  313. package/docs/start/index.md +4 -0
  314. package/docs/start/modes.md +201 -0
  315. package/docs/upgrading/component-routes.md +363 -0
  316. package/docs/upgrading/future.md +31 -0
  317. package/docs/upgrading/index.md +4 -0
  318. package/docs/upgrading/remix.md +403 -0
  319. package/docs/upgrading/router-provider.md +442 -0
  320. package/docs/upgrading/v6.md +379 -0
  321. package/package.json +44 -87
  322. package/dist/development/browser-3AnU12UI.d.mts +0 -318
  323. package/dist/development/browser-BOdXz9dK.d.ts +0 -318
  324. package/dist/development/chunk-4N6VE7H7.mjs +0 -11528
  325. package/dist/development/chunk-4YRVXM2U.js +0 -188
  326. package/dist/development/chunk-66UKHEGQ.js +0 -1362
  327. package/dist/development/chunk-D6LUOGOQ.js +0 -10229
  328. package/dist/development/chunk-RJYABSBD.mjs +0 -2585
  329. package/dist/development/context-ByvtofY2.d.mts +0 -1771
  330. package/dist/development/data-BVUf681J.d.mts +0 -1732
  331. package/dist/development/data-BqZ2x964.d.ts +0 -1732
  332. package/dist/development/dom-export.d.mts +0 -172
  333. package/dist/development/dom-export.mjs +0 -1008
  334. package/dist/development/index-react-server-client-BS5F89FR.d.ts +0 -3655
  335. package/dist/development/index-react-server-client-DY04-103.d.mts +0 -2600
  336. package/dist/development/index-react-server-client.d.mts +0 -4
  337. package/dist/development/index-react-server-client.mjs +0 -59
  338. package/dist/development/index-react-server.d.mts +0 -2703
  339. package/dist/development/index-react-server.mjs +0 -3780
  340. package/dist/development/index.d.mts +0 -1472
  341. package/dist/development/index.mjs +0 -277
  342. package/dist/development/instrumentation-cRWWLfsU.d.ts +0 -715
  343. package/dist/development/lib/types/internal.d.mts +0 -184
  344. package/dist/development/lib/types/internal.mjs +0 -10
  345. package/dist/development/register-Df8okEea.d.mts +0 -30
  346. package/dist/production/browser-3AnU12UI.d.mts +0 -318
  347. package/dist/production/browser-BOdXz9dK.d.ts +0 -318
  348. package/dist/production/chunk-6S4627ZB.mjs +0 -2585
  349. package/dist/production/chunk-HUBUW7R3.js +0 -10229
  350. package/dist/production/chunk-JAKZPQZC.mjs +0 -11528
  351. package/dist/production/chunk-PNZCCTKT.js +0 -1362
  352. package/dist/production/chunk-Y6IFXO7V.js +0 -188
  353. package/dist/production/context-ByvtofY2.d.mts +0 -1771
  354. package/dist/production/data-BVUf681J.d.mts +0 -1732
  355. package/dist/production/data-BqZ2x964.d.ts +0 -1732
  356. package/dist/production/dom-export.d.mts +0 -172
  357. package/dist/production/dom-export.mjs +0 -1008
  358. package/dist/production/index-react-server-client-BS5F89FR.d.ts +0 -3655
  359. package/dist/production/index-react-server-client-DY04-103.d.mts +0 -2600
  360. package/dist/production/index-react-server-client.d.mts +0 -4
  361. package/dist/production/index-react-server-client.mjs +0 -59
  362. package/dist/production/index-react-server.d.mts +0 -2703
  363. package/dist/production/index-react-server.mjs +0 -3780
  364. package/dist/production/index.d.mts +0 -1472
  365. package/dist/production/index.mjs +0 -277
  366. package/dist/production/instrumentation-cRWWLfsU.d.ts +0 -715
  367. package/dist/production/lib/types/internal.d.mts +0 -184
  368. package/dist/production/lib/types/internal.mjs +0 -10
  369. package/dist/production/register-Df8okEea.d.mts +0 -30
@@ -1,1472 +1,46 @@
1
- import { O as RouteModules, l as DataStrategyFunction, t as MiddlewareEnabled, c as RouterContextProvider, u as AppLoadContext, T as To, L as Location, P as Params, U as UIMatch, i as Action, Q as SerializeFrom, V as PathPattern, W as PathMatch, X as ParamParseKey, r as Path, e as RouteObject, G as GetLoaderData, K as GetActionData, Y as InitialEntry, Z as IndexRouteObject, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, _ as NonIndexRouteObject, $ as Equal, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, a as ClientLoaderFunction } from './data-BqZ2x964.js';
2
- export { a0 as ActionFunctionArgs, a1 as BaseRouteObject, C as ClientActionFunction, ar as ClientActionFunctionArgs, as as ClientLoaderFunctionArgs, D as DataRouteMatch, a2 as DataStrategyFunctionArgs, a3 as DataStrategyMatch, I as DataStrategyResult, a5 as ErrorResponse, F as FormEncType, a6 as FormMethod, ax as Future, q as HTMLFormMethod, at as HeadersArgs, H as HeadersFunction, aw as HtmlLinkDescriptor, a7 as LazyRouteFunction, v as LinkDescriptor, s as LoaderFunctionArgs, au as MetaArgs, y as MetaDescriptor, a8 as MiddlewareFunction, av as PageLinkDescriptor, a9 as PatchRoutesOnNavigationFunctionArgs, aa as PathParam, ab as RedirectFunction, ac as RouteMatch, ad as RouterContext, S as ShouldRevalidateFunction, ae as ShouldRevalidateFunctionArgs, a4 as UNSAFE_DataWithResponseInit, aD as UNSAFE_ErrorResponseImpl, aA as UNSAFE_createBrowserHistory, aB as UNSAFE_createHashHistory, az as UNSAFE_createMemoryHistory, aC as UNSAFE_invariant, af as createContext, ag as createPath, ai as data, aj as generatePath, ak as isRouteErrorResponse, al as matchPath, am as matchRoutes, ah as parsePath, an as redirect, ao as redirectDocument, ap as replace, aq as resolvePath, ay as unstable_SerializesTo } from './data-BqZ2x964.js';
3
- import { a as Router, N as NavigationStates, B as BlockerFunction, b as Blocker, c as RelativeRoutingType, d as Navigation, H as HydrationState, e as RouterState } from './instrumentation-cRWWLfsU.js';
4
- export { C as ClientInstrumentation, F as Fetcher, G as GetScrollPositionFunction, f as GetScrollRestorationKeyFunction, r as IDLE_BLOCKER, q as IDLE_FETCHER, p as IDLE_NAVIGATION, I as InstrumentRequestHandlerFunction, n as InstrumentRouteFunction, m as InstrumentRouterFunction, o as InstrumentationHandlerResult, k as RevalidationState, j as RouterFetchOptions, R as RouterInit, i as RouterNavigateOptions, h as RouterSubscriber, l as ServerInstrumentation, S as StaticHandler, g as StaticHandlerContext, s as UNSAFE_createRouter } from './instrumentation-cRWWLfsU.js';
5
- import { A as AssetsManifest, S as ServerBuild, N as NavigateOptions, E as EntryContext, F as FutureConfig } from './index-react-server-client-BS5F89FR.js';
6
- export { i as Await, c as AwaitProps, W as BrowserRouter, B as BrowserRouterProps, C as ClientOnErrorFunction, D as DOMRouterOpts, at as DiscoverBehavior, y as FetcherFormProps, Q as FetcherSubmitFunction, aa as FetcherSubmitOptions, T as FetcherWithComponents, $ as Form, z as FormProps, au as HandleDataRequestFunction, av as HandleDocumentRequestFunction, aw as HandleErrorFunction, X as HashRouter, H as HashRouterProps, u as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Y as Link, v as LinkProps, an as Links, aq as LinksProps, j as MemoryRouter, M as MemoryRouterOpts, d as MemoryRouterProps, am as Meta, _ as NavLink, w as NavLinkProps, x as NavLinkRenderProps, k as Navigate, e as NavigateProps, a as Navigator, l as Outlet, O as OutletProps, ab as ParamKeyValuePair, P as PathRouteProps, as as PrefetchBehavior, ap as PrefetchPageLinks, m as Route, R as RouteProps, n as Router, f as RouterProps, o as RouterProvider, g as RouterProviderProps, p as Routes, h as RoutesProps, ao as Scripts, ar as ScriptsProps, a0 as ScrollRestoration, G as ScrollRestorationProps, ax as ServerEntryModule, J as SetURLSearchParams, ak as StaticRouter, ag as StaticRouterProps, al as StaticRouterProvider, ah as StaticRouterProviderProps, K as SubmitFunction, ac as SubmitOptions, ae as SubmitTarget, b as UNSAFE_AwaitContextProvider, ay as UNSAFE_DataRouterContext, az as UNSAFE_DataRouterStateContext, aA as UNSAFE_FetchersContext, aN as UNSAFE_FrameworkContext, aB as UNSAFE_LocationContext, aC as UNSAFE_NavigationContext, aD as UNSAFE_RouteContext, aE as UNSAFE_ViewTransitionContext, aH as UNSAFE_WithComponentProps, aL as UNSAFE_WithErrorBoundaryProps, aJ as UNSAFE_WithHydrateFallbackProps, aO as UNSAFE_createClientRoutes, aP as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, aF as UNSAFE_hydrationRouteProperties, aG as UNSAFE_mapRouteProperties, aQ as UNSAFE_shouldHydrateRouteLoader, aR as UNSAFE_useScrollRestoration, aI as UNSAFE_withComponentProps, aM as UNSAFE_withErrorBoundaryProps, aK as UNSAFE_withHydrateFallbackProps, ad as URLSearchParamsInit, U as createBrowserRouter, V as createHashRouter, q as createMemoryRouter, r as createRoutesFromChildren, s as createRoutesFromElements, af as createSearchParams, ai as createStaticHandler, aj as createStaticRouter, t as renderMatches, Z as unstable_HistoryRouter, a8 as unstable_usePrompt, a7 as useBeforeUnload, a5 as useFetcher, a6 as useFetchers, a4 as useFormAction, a1 as useLinkClickHandler, a2 as useSearchParams, a3 as useSubmit, a9 as useViewTransitionState } from './index-react-server-client-BS5F89FR.js';
7
- import * as React from 'react';
8
- import React__default, { ReactElement } from 'react';
9
- import { a as RouteModules$1, P as Pages } from './register-Bsscfj79.js';
10
- export { b as Register } from './register-Bsscfj79.js';
11
- import { ParseOptions, SerializeOptions } from 'cookie';
12
- export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
13
- import { e as RSCPayload, g as getRequest, m as matchRSCServerRequest } from './browser-BOdXz9dK.js';
14
- export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, h as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, i as unstable_RSCMatch, f as unstable_RSCRenderPayload, n as unstable_RSCRouteConfig, l as unstable_RSCRouteConfigEntry, j as unstable_RSCRouteManifest, k as unstable_RSCRouteMatch } from './browser-BOdXz9dK.js';
15
-
16
- declare const SingleFetchRedirectSymbol: unique symbol;
17
- declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined, trailingSlashAware: boolean): DataStrategyFunction;
18
- declare function decodeViaTurboStream(body: ReadableStream<Uint8Array>, global: Window | typeof globalThis): Promise<{
19
- done: Promise<undefined>;
20
- value: unknown;
21
- }>;
22
-
23
- /**
24
- * The mode to use when running the server.
25
- */
26
- declare enum ServerMode {
27
- Development = "development",
28
- Production = "production",
29
- Test = "test"
30
- }
31
-
32
- type RequestHandler = (request: Request, loadContext?: MiddlewareEnabled extends true ? RouterContextProvider : AppLoadContext) => Promise<Response>;
33
- type CreateRequestHandlerFunction = (build: ServerBuild | (() => ServerBuild | Promise<ServerBuild>), mode?: string) => RequestHandler;
34
- declare const createRequestHandler: CreateRequestHandlerFunction;
35
-
36
- /**
37
- * Resolves a URL against the current {@link Location}.
38
- *
39
- * @example
40
- * import { useHref } from "react-router";
41
- *
42
- * function SomeComponent() {
43
- * let href = useHref("some/where");
44
- * // "/resolved/some/where"
45
- * }
46
- *
47
- * @public
48
- * @category Hooks
49
- * @param to The path to resolve
50
- * @param options Options
51
- * @param options.relative Defaults to `"route"` so routing is relative to the
52
- * route tree.
53
- * Set to `"path"` to make relative routing operate against path segments.
54
- * @returns The resolved href string
55
- */
56
- declare function useHref(to: To, { relative }?: {
57
- relative?: RelativeRoutingType;
58
- }): string;
59
- /**
60
- * Returns `true` if this component is a descendant of a {@link Router}, useful
61
- * to ensure a component is used within a {@link Router}.
62
- *
63
- * @public
64
- * @category Hooks
65
- * @mode framework
66
- * @mode data
67
- * @returns Whether the component is within a {@link Router} context
68
- */
69
- declare function useInRouterContext(): boolean;
70
- /**
71
- * Returns the current {@link Location}. This can be useful if you'd like to
72
- * perform some side effect whenever it changes.
73
- *
74
- * @example
75
- * import * as React from 'react'
76
- * import { useLocation } from 'react-router'
77
- *
78
- * function SomeComponent() {
79
- * let location = useLocation()
80
- *
81
- * React.useEffect(() => {
82
- * // Google Analytics
83
- * ga('send', 'pageview')
84
- * }, [location]);
85
- *
86
- * return (
87
- * // ...
88
- * );
89
- * }
90
- *
91
- * @public
92
- * @category Hooks
93
- * @returns The current {@link Location} object
94
- */
95
- declare function useLocation(): Location;
96
- /**
97
- * Returns the current {@link Navigation} action which describes how the router
98
- * came to the current {@link Location}, either by a pop, push, or replace on
99
- * the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack.
100
- *
101
- * @public
102
- * @category Hooks
103
- * @returns The current {@link NavigationType} (`"POP"`, `"PUSH"`, or `"REPLACE"`)
104
- */
105
- declare function useNavigationType(): Action;
106
- /**
107
- * Returns a {@link PathMatch} object if the given pattern matches the current URL.
108
- * This is useful for components that need to know "active" state, e.g.
109
- * {@link NavLink | `<NavLink>`}.
110
- *
111
- * @public
112
- * @category Hooks
113
- * @param pattern The pattern to match against the current {@link Location}
114
- * @returns The path match object if the pattern matches, `null` otherwise
115
- */
116
- declare function useMatch<Path extends string>(pattern: PathPattern<Path> | Path): PathMatch<ParamParseKey<Path>> | null;
117
- /**
118
- * The interface for the `navigate` function returned from {@link useNavigate}.
119
- */
120
- interface NavigateFunction {
121
- (to: To, options?: NavigateOptions): void | Promise<void>;
122
- (delta: number): void | Promise<void>;
123
- }
124
- /**
125
- * Returns a function that lets you navigate programmatically in the browser in
126
- * response to user interactions or effects.
127
- *
128
- * It's often better to use {@link redirect} in [`action`](../../start/framework/route-module#action)/[`loader`](../../start/framework/route-module#loader)
129
- * functions than this hook.
130
- *
131
- * The returned function signature is `navigate(to, options?)`/`navigate(delta)` where:
132
- *
133
- * * `to` can be a string path, a {@link To} object, or a number (delta)
134
- * * `options` contains options for modifying the navigation
135
- * * These options work in all modes (Framework, Data, and Declarative):
136
- * * `relative`: `"route"` or `"path"` to control relative routing logic
137
- * * `replace`: Replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack
138
- * * `state`: Optional [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state) to include with the new {@link Location}
139
- * * These options only work in Framework and Data modes:
140
- * * `flushSync`: Wrap the DOM updates in [`ReactDom.flushSync`](https://react.dev/reference/react-dom/flushSync)
141
- * * `preventScrollReset`: Do not scroll back to the top of the page after navigation
142
- * * `viewTransition`: Enable [`document.startViewTransition`](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for this navigation
143
- *
144
- * @example
145
- * import { useNavigate } from "react-router";
146
- *
147
- * function SomeComponent() {
148
- * let navigate = useNavigate();
149
- * return (
150
- * <button onClick={() => navigate(-1)}>
151
- * Go Back
152
- * </button>
153
- * );
154
- * }
155
- *
156
- * @additionalExamples
157
- * ### Navigate to another path
158
- *
159
- * ```tsx
160
- * navigate("/some/route");
161
- * navigate("/some/route?search=param");
162
- * ```
163
- *
164
- * ### Navigate with a {@link To} object
165
- *
166
- * All properties are optional.
167
- *
168
- * ```tsx
169
- * navigate({
170
- * pathname: "/some/route",
171
- * search: "?search=param",
172
- * hash: "#hash",
173
- * state: { some: "state" },
174
- * });
175
- * ```
176
- *
177
- * If you use `state`, that will be available on the {@link Location} object on
178
- * the next page. Access it with `useLocation().state` (see {@link useLocation}).
179
- *
180
- * ### Navigate back or forward in the history stack
181
- *
182
- * ```tsx
183
- * // back
184
- * // often used to close modals
185
- * navigate(-1);
186
- *
187
- * // forward
188
- * // often used in a multistep wizard workflows
189
- * navigate(1);
190
- * ```
191
- *
192
- * Be cautious with `navigate(number)`. If your application can load up to a
193
- * route that has a button that tries to navigate forward/back, there may not be
194
- * a [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
195
- * entry to go back or forward to, or it can go somewhere you don't expect
196
- * (like a different domain).
197
- *
198
- * Only use this if you're sure they will have an entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
199
- * stack to navigate to.
200
- *
201
- * ### Replace the current entry in the history stack
202
- *
203
- * This will remove the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
204
- * stack, replacing it with a new one, similar to a server side redirect.
205
- *
206
- * ```tsx
207
- * navigate("/some/route", { replace: true });
208
- * ```
209
- *
210
- * ### Prevent Scroll Reset
211
- *
212
- * [MODES: framework, data]
213
- *
214
- * <br/>
215
- * <br/>
216
- *
217
- * To prevent {@link ScrollRestoration | `<ScrollRestoration>`} from resetting
218
- * the scroll position, use the `preventScrollReset` option.
219
- *
220
- * ```tsx
221
- * navigate("?some-tab=1", { preventScrollReset: true });
222
- * ```
223
- *
224
- * For example, if you have a tab interface connected to search params in the
225
- * middle of a page, and you don't want it to scroll to the top when a tab is
226
- * clicked.
227
- *
228
- * ### Return Type Augmentation
229
- *
230
- * Internally, `useNavigate` uses a separate implementation when you are in
231
- * Declarative mode versus Data/Framework mode - the primary difference being
232
- * that the latter is able to return a stable reference that does not change
233
- * identity across navigations. The implementation in Data/Framework mode also
234
- * returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
235
- * that resolves when the navigation is completed. This means the return type of
236
- * `useNavigate` is `void | Promise<void>`. This is accurate, but can lead to
237
- * some red squigglies based on the union in the return value:
238
- *
239
- * - If you're using `typescript-eslint`, you may see errors from
240
- * [`@typescript-eslint/no-floating-promises`](https://typescript-eslint.io/rules/no-floating-promises)
241
- * - In Framework/Data mode, `React.use(navigate())` will show a false-positive
242
- * `Argument of type 'void | Promise<void>' is not assignable to parameter of
243
- * type 'Usable<void>'` error
244
- *
245
- * The easiest way to work around these issues is to augment the type based on the
246
- * router you're using:
247
- *
248
- * ```ts
249
- * // If using <BrowserRouter>
250
- * declare module "react-router" {
251
- * interface NavigateFunction {
252
- * (to: To, options?: NavigateOptions): void;
253
- * (delta: number): void;
254
- * }
255
- * }
256
- *
257
- * // If using <RouterProvider> or Framework mode
258
- * declare module "react-router" {
259
- * interface NavigateFunction {
260
- * (to: To, options?: NavigateOptions): Promise<void>;
261
- * (delta: number): Promise<void>;
262
- * }
263
- * }
264
- * ```
265
- *
266
- * @public
267
- * @category Hooks
268
- * @returns A navigate function for programmatic navigation
269
- */
270
- declare function useNavigate(): NavigateFunction;
271
- /**
272
- * Returns the parent route {@link Outlet | `<Outlet context>`}.
273
- *
274
- * Often parent routes manage state or other values you want shared with child
275
- * routes. You can create your own [context provider](https://react.dev/learn/passing-data-deeply-with-context)
276
- * if you like, but this is such a common situation that it's built-into
277
- * {@link Outlet | `<Outlet>`}.
278
- *
279
- * ```tsx
280
- * // Parent route
281
- * function Parent() {
282
- * const [count, setCount] = React.useState(0);
283
- * return <Outlet context={[count, setCount]} />;
284
- * }
285
- * ```
286
- *
287
- * ```tsx
288
- * // Child route
289
- * import { useOutletContext } from "react-router";
290
- *
291
- * function Child() {
292
- * const [count, setCount] = useOutletContext();
293
- * const increment = () => setCount((c) => c + 1);
294
- * return <button onClick={increment}>{count}</button>;
295
- * }
296
- * ```
297
- *
298
- * If you're using TypeScript, we recommend the parent component provide a
299
- * custom hook for accessing the context value. This makes it easier for
300
- * consumers to get nice typings, control consumers, and know who's consuming
301
- * the context value.
302
- *
303
- * Here's a more realistic example:
304
- *
305
- * ```tsx filename=src/routes/dashboard.tsx lines=[14,20]
306
- * import { useState } from "react";
307
- * import { Outlet, useOutletContext } from "react-router";
308
- *
309
- * import type { User } from "./types";
310
- *
311
- * type ContextType = { user: User | null };
312
- *
313
- * export default function Dashboard() {
314
- * const [user, setUser] = useState<User | null>(null);
315
- *
316
- * return (
317
- * <div>
318
- * <h1>Dashboard</h1>
319
- * <Outlet context={{ user } satisfies ContextType} />
320
- * </div>
321
- * );
322
- * }
323
- *
324
- * export function useUser() {
325
- * return useOutletContext<ContextType>();
326
- * }
327
- * ```
328
- *
329
- * ```tsx filename=src/routes/dashboard/messages.tsx lines=[1,4]
330
- * import { useUser } from "../dashboard";
331
- *
332
- * export default function DashboardMessages() {
333
- * const { user } = useUser();
334
- * return (
335
- * <div>
336
- * <h2>Messages</h2>
337
- * <p>Hello, {user.name}!</p>
338
- * </div>
339
- * );
340
- * }
341
- * ```
342
- *
343
- * @public
344
- * @category Hooks
345
- * @returns The context value passed to the parent {@link Outlet} component
346
- */
347
- declare function useOutletContext<Context = unknown>(): Context;
348
- /**
349
- * Returns the element for the child route at this level of the route
350
- * hierarchy. Used internally by {@link Outlet | `<Outlet>`} to render child
351
- * routes.
352
- *
353
- * @public
354
- * @category Hooks
355
- * @param context The context to pass to the outlet
356
- * @returns The child route element or `null` if no child routes match
357
- */
358
- declare function useOutlet(context?: unknown): React.ReactElement | null;
359
- /**
360
- * Returns an object of key/value-pairs of the dynamic params from the current
361
- * URL that were matched by the routes. Child routes inherit all params from
362
- * their parent routes.
363
- *
364
- * Assuming a route pattern like `/posts/:postId` is matched by `/posts/123`
365
- * then `params.postId` will be `"123"`.
366
- *
367
- * @example
368
- * import { useParams } from "react-router";
369
- *
370
- * function SomeComponent() {
371
- * let params = useParams();
372
- * params.postId;
373
- * }
374
- *
375
- * @additionalExamples
376
- * ### Basic Usage
377
- *
378
- * ```tsx
379
- * import { useParams } from "react-router";
380
- *
381
- * // given a route like:
382
- * <Route path="/posts/:postId" element={<Post />} />;
383
- *
384
- * // or a data route like:
385
- * createBrowserRouter([
386
- * {
387
- * path: "/posts/:postId",
388
- * component: Post,
389
- * },
390
- * ]);
391
- *
392
- * // or in routes.ts
393
- * route("/posts/:postId", "routes/post.tsx");
394
- * ```
395
- *
396
- * Access the params in a component:
397
- *
398
- * ```tsx
399
- * import { useParams } from "react-router";
400
- *
401
- * export default function Post() {
402
- * let params = useParams();
403
- * return <h1>Post: {params.postId}</h1>;
404
- * }
405
- * ```
406
- *
407
- * ### Multiple Params
408
- *
409
- * Patterns can have multiple params:
410
- *
411
- * ```tsx
412
- * "/posts/:postId/comments/:commentId";
413
- * ```
414
- *
415
- * All will be available in the params object:
416
- *
417
- * ```tsx
418
- * import { useParams } from "react-router";
419
- *
420
- * export default function Post() {
421
- * let params = useParams();
422
- * return (
423
- * <h1>
424
- * Post: {params.postId}, Comment: {params.commentId}
425
- * </h1>
426
- * );
427
- * }
428
- * ```
429
- *
430
- * ### Catchall Params
431
- *
432
- * Catchall params are defined with `*`:
433
- *
434
- * ```tsx
435
- * "/files/*";
436
- * ```
437
- *
438
- * The matched value will be available in the params object as follows:
439
- *
440
- * ```tsx
441
- * import { useParams } from "react-router";
442
- *
443
- * export default function File() {
444
- * let params = useParams();
445
- * let catchall = params["*"];
446
- * // ...
447
- * }
448
- * ```
449
- *
450
- * You can destructure the catchall param:
451
- *
452
- * ```tsx
453
- * export default function File() {
454
- * let { "*": catchall } = useParams();
455
- * console.log(catchall);
456
- * }
457
- * ```
458
- *
459
- * @public
460
- * @category Hooks
461
- * @returns An object containing the dynamic route parameters
462
- */
463
- declare function useParams<ParamsOrKey extends string | Record<string, string | undefined> = string>(): Readonly<[
464
- ParamsOrKey
465
- ] extends [string] ? Params<ParamsOrKey> : Partial<ParamsOrKey>>;
466
- /**
467
- * Resolves the pathname of the given `to` value against the current
468
- * {@link Location}. Similar to {@link useHref}, but returns a
469
- * {@link Path} instead of a string.
470
- *
471
- * @example
472
- * import { useResolvedPath } from "react-router";
473
- *
474
- * function SomeComponent() {
475
- * // if the user is at /dashboard/profile
476
- * let path = useResolvedPath("../accounts");
477
- * path.pathname; // "/dashboard/accounts"
478
- * path.search; // ""
479
- * path.hash; // ""
480
- * }
481
- *
482
- * @public
483
- * @category Hooks
484
- * @param to The path to resolve
485
- * @param options Options
486
- * @param options.relative Defaults to `"route"` so routing is relative to the route tree.
487
- * Set to `"path"` to make relative routing operate against path segments.
488
- * @returns The resolved {@link Path} object with `pathname`, `search`, and `hash`
489
- */
490
- declare function useResolvedPath(to: To, { relative }?: {
491
- relative?: RelativeRoutingType;
492
- }): Path;
493
- /**
494
- * Hook version of {@link Routes | `<Routes>`} that uses objects instead of
495
- * components. These objects have the same properties as the component props.
496
- * The return value of `useRoutes` is either a valid React element you can use
497
- * to render the route tree, or `null` if nothing matched.
498
- *
499
- * @example
500
- * import { useRoutes } from "react-router";
501
- *
502
- * function App() {
503
- * let element = useRoutes([
504
- * {
505
- * path: "/",
506
- * element: <Dashboard />,
507
- * children: [
508
- * {
509
- * path: "messages",
510
- * element: <DashboardMessages />,
511
- * },
512
- * { path: "tasks", element: <DashboardTasks /> },
513
- * ],
514
- * },
515
- * { path: "team", element: <AboutPage /> },
516
- * ]);
517
- *
518
- * return element;
519
- * }
520
- *
521
- * @public
522
- * @category Hooks
523
- * @param routes An array of {@link RouteObject}s that define the route hierarchy
524
- * @param locationArg An optional {@link Location} object or pathname string to
525
- * use instead of the current {@link Location}
526
- * @returns A React element to render the matched route, or `null` if no routes matched
527
- */
528
- declare function useRoutes(routes: RouteObject[], locationArg?: Partial<Location> | string): React.ReactElement | null;
529
- /**
530
- * Returns the current {@link Navigation}, defaulting to an "idle" navigation
531
- * when no navigation is in progress. You can use this to render pending UI
532
- * (like a global spinner) or read [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData)
533
- * from a form navigation.
534
- *
535
- * @example
536
- * import { useNavigation } from "react-router";
537
- *
538
- * function SomeComponent() {
539
- * let navigation = useNavigation();
540
- * navigation.state;
541
- * navigation.formData;
542
- * // etc.
543
- * }
544
- *
545
- * @public
546
- * @category Hooks
547
- * @mode framework
548
- * @mode data
549
- * @returns The current {@link Navigation} object
550
- */
551
- declare function useNavigation(): Omit<Navigation, "matches" | "historyAction">;
552
- /**
553
- * Revalidate the data on the page for reasons outside of normal data mutations
554
- * like [`Window` focus](https://developer.mozilla.org/en-US/docs/Web/API/Window/focus_event)
555
- * or polling on an interval.
556
- *
557
- * Note that page data is already revalidated automatically after actions.
558
- * If you find yourself using this for normal CRUD operations on your data in
559
- * response to user interactions, you're probably not taking advantage of the
560
- * other APIs like {@link useFetcher}, {@link Form}, {@link useSubmit} that do
561
- * this automatically.
562
- *
563
- * @example
564
- * import { useRevalidator } from "react-router";
565
- *
566
- * function WindowFocusRevalidator() {
567
- * const revalidator = useRevalidator();
568
- *
569
- * useFakeWindowFocus(() => {
570
- * revalidator.revalidate();
571
- * });
572
- *
573
- * return (
574
- * <div hidden={revalidator.state === "idle"}>
575
- * Revalidating...
576
- * </div>
577
- * );
578
- * }
579
- *
580
- * @public
581
- * @category Hooks
582
- * @mode framework
583
- * @mode data
584
- * @returns An object with a `revalidate` function and the current revalidation
585
- * `state`
586
- */
587
- declare function useRevalidator(): {
588
- revalidate: () => Promise<void>;
589
- state: Router["state"]["revalidation"];
590
- };
591
- /**
592
- * Returns the active route matches, useful for accessing `loaderData` for
593
- * parent/child routes or the route [`handle`](../../start/framework/route-module#handle)
594
- * property
595
- *
596
- * @public
597
- * @category Hooks
598
- * @mode framework
599
- * @mode data
600
- * @returns An array of {@link UIMatch | UI matches} for the current route hierarchy
601
- */
602
- declare function useMatches(): UIMatch[];
603
- /**
604
- * Returns the data from the closest route
605
- * [`loader`](../../start/framework/route-module#loader) or
606
- * [`clientLoader`](../../start/framework/route-module#clientloader).
607
- *
608
- * @example
609
- * import { useLoaderData } from "react-router";
610
- *
611
- * export async function loader() {
612
- * return await fakeDb.invoices.findAll();
613
- * }
614
- *
615
- * export default function Invoices() {
616
- * let invoices = useLoaderData<typeof loader>();
617
- * // ...
618
- * }
619
- *
620
- * @public
621
- * @category Hooks
622
- * @mode framework
623
- * @mode data
624
- * @returns The data returned from the route's [`loader`](../../start/framework/route-module#loader) or [`clientLoader`](../../start/framework/route-module#clientloader) function
625
- */
626
- declare function useLoaderData<T = any>(): SerializeFrom<T>;
627
- /**
628
- * Returns the [`loader`](../../start/framework/route-module#loader) data for a
629
- * given route by route ID.
630
- *
631
- * Route IDs are created automatically. They are simply the path of the route file
632
- * relative to the app folder without the extension.
633
- *
634
- * | Route Filename | Route ID |
635
- * | ---------------------------- | ---------------------- |
636
- * | `app/root.tsx` | `"root"` |
637
- * | `app/routes/teams.tsx` | `"routes/teams"` |
638
- * | `app/whatever/teams.$id.tsx` | `"whatever/teams.$id"` |
639
- *
640
- * @example
641
- * import { useRouteLoaderData } from "react-router";
642
- *
643
- * function SomeComponent() {
644
- * const { user } = useRouteLoaderData("root");
645
- * }
646
- *
647
- * // You can also specify your own route ID's manually in your routes.ts file:
648
- * route("/", "containers/app.tsx", { id: "app" })
649
- * useRouteLoaderData("app");
650
- *
651
- * @public
652
- * @category Hooks
653
- * @mode framework
654
- * @mode data
655
- * @param routeId The ID of the route to return loader data from
656
- * @returns The data returned from the specified route's [`loader`](../../start/framework/route-module#loader)
657
- * function, or `undefined` if not found
658
- */
659
- declare function useRouteLoaderData<T = any>(routeId: string): SerializeFrom<T> | undefined;
660
- /**
661
- * Returns the [`action`](../../start/framework/route-module#action) data from
662
- * the most recent `POST` navigation form submission or `undefined` if there
663
- * hasn't been one.
664
- *
665
- * @example
666
- * import { Form, useActionData } from "react-router";
667
- *
668
- * export async function action({ request }) {
669
- * const body = await request.formData();
670
- * const name = body.get("visitorsName");
671
- * return { message: `Hello, ${name}` };
672
- * }
673
- *
674
- * export default function Invoices() {
675
- * const data = useActionData();
676
- * return (
677
- * <Form method="post">
678
- * <input type="text" name="visitorsName" />
679
- * {data ? data.message : "Waiting..."}
680
- * </Form>
681
- * );
682
- * }
683
- *
684
- * @public
685
- * @category Hooks
686
- * @mode framework
687
- * @mode data
688
- * @returns The data returned from the route's [`action`](../../start/framework/route-module#action)
689
- * function, or `undefined` if no [`action`](../../start/framework/route-module#action)
690
- * has been called
691
- */
692
- declare function useActionData<T = any>(): SerializeFrom<T> | undefined;
693
- /**
694
- * Accesses the error thrown during an
695
- * [`action`](../../start/framework/route-module#action),
696
- * [`loader`](../../start/framework/route-module#loader),
697
- * or component render to be used in a route module
698
- * [`ErrorBoundary`](../../start/framework/route-module#errorboundary).
699
- *
700
- * @example
701
- * export function ErrorBoundary() {
702
- * const error = useRouteError();
703
- * return <div>{error.message}</div>;
704
- * }
705
- *
706
- * @public
707
- * @category Hooks
708
- * @mode framework
709
- * @mode data
710
- * @returns The error that was thrown during route [loading](../../start/framework/route-module#loader),
711
- * [`action`](../../start/framework/route-module#action) execution, or rendering
712
- */
713
- declare function useRouteError(): unknown;
714
- /**
715
- * Returns the resolved promise value from the closest {@link Await | `<Await>`}.
716
- *
717
- * @example
718
- * function SomeDescendant() {
719
- * const value = useAsyncValue();
720
- * // ...
721
- * }
722
- *
723
- * // somewhere in your app
724
- * <Await resolve={somePromise}>
725
- * <SomeDescendant />
726
- * </Await>;
727
- *
728
- * @public
729
- * @category Hooks
730
- * @mode framework
731
- * @mode data
732
- * @returns The resolved value from the nearest {@link Await} component
733
- */
734
- declare function useAsyncValue(): unknown;
735
- /**
736
- * Returns the rejection value from the closest {@link Await | `<Await>`}.
737
- *
738
- * @example
739
- * import { Await, useAsyncError } from "react-router";
740
- *
741
- * function ErrorElement() {
742
- * const error = useAsyncError();
743
- * return (
744
- * <p>Uh Oh, something went wrong! {error.message}</p>
745
- * );
746
- * }
747
- *
748
- * // somewhere in your app
749
- * <Await
750
- * resolve={promiseThatRejects}
751
- * errorElement={<ErrorElement />}
752
- * />;
753
- *
754
- * @public
755
- * @category Hooks
756
- * @mode framework
757
- * @mode data
758
- * @returns The error that was thrown in the nearest {@link Await} component
759
- */
760
- declare function useAsyncError(): unknown;
761
- /**
762
- * Allow the application to block navigations within the SPA and present the
763
- * user a confirmation dialog to confirm the navigation. Mostly used to avoid
764
- * using half-filled form data. This does not handle hard-reloads or
765
- * cross-origin navigations.
766
- *
767
- * The {@link Blocker} object returned by the hook has the following properties:
768
- *
769
- * - **`state`**
770
- * - `unblocked` - the blocker is idle and has not prevented any navigation
771
- * - `blocked` - the blocker has prevented a navigation
772
- * - `proceeding` - the blocker is proceeding through from a blocked navigation
773
- * - **`location`**
774
- * - When in a `blocked` state, this represents the {@link Location} to which
775
- * we blocked a navigation. When in a `proceeding` state, this is the
776
- * location being navigated to after a `blocker.proceed()` call.
777
- * - **`proceed()`**
778
- * - When in a `blocked` state, you may call `blocker.proceed()` to proceed to
779
- * the blocked location.
780
- * - **`reset()`**
781
- * - When in a `blocked` state, you may call `blocker.reset()` to return the
782
- * blocker to an `unblocked` state and leave the user at the current
783
- * location.
784
- *
785
- * @example
786
- * // Boolean version
787
- * let blocker = useBlocker(value !== "");
788
- *
789
- * // Function version
790
- * let blocker = useBlocker(
791
- * ({ currentLocation, nextLocation, historyAction }) =>
792
- * value !== "" &&
793
- * currentLocation.pathname !== nextLocation.pathname
794
- * );
795
- *
796
- * @additionalExamples
797
- * ```tsx
798
- * import { useCallback, useState } from "react";
799
- * import { BlockerFunction, useBlocker } from "react-router";
800
- *
801
- * export function ImportantForm() {
802
- * const [value, setValue] = useState("");
803
- *
804
- * const shouldBlock = useCallback<BlockerFunction>(
805
- * () => value !== "",
806
- * [value]
807
- * );
808
- * const blocker = useBlocker(shouldBlock);
809
- *
810
- * return (
811
- * <form
812
- * onSubmit={(e) => {
813
- * e.preventDefault();
814
- * setValue("");
815
- * if (blocker.state === "blocked") {
816
- * blocker.proceed();
817
- * }
818
- * }}
819
- * >
820
- * <input
821
- * name="data"
822
- * value={value}
823
- * onChange={(e) => setValue(e.target.value)}
824
- * />
825
- *
826
- * <button type="submit">Save</button>
827
- *
828
- * {blocker.state === "blocked" ? (
829
- * <>
830
- * <p style={{ color: "red" }}>
831
- * Blocked the last navigation to
832
- * </p>
833
- * <button
834
- * type="button"
835
- * onClick={() => blocker.proceed()}
836
- * >
837
- * Let me through
838
- * </button>
839
- * <button
840
- * type="button"
841
- * onClick={() => blocker.reset()}
842
- * >
843
- * Keep me here
844
- * </button>
845
- * </>
846
- * ) : blocker.state === "proceeding" ? (
847
- * <p style={{ color: "orange" }}>
848
- * Proceeding through blocked navigation
849
- * </p>
850
- * ) : (
851
- * <p style={{ color: "green" }}>
852
- * Blocker is currently unblocked
853
- * </p>
854
- * )}
855
- * </form>
856
- * );
857
- * }
858
- * ```
859
- *
860
- * @public
861
- * @category Hooks
862
- * @mode framework
863
- * @mode data
864
- * @param shouldBlock Either a boolean or a function returning a boolean which
865
- * indicates whether the navigation should be blocked. The function format
866
- * receives a single object parameter containing the `currentLocation`,
867
- * `nextLocation`, and `historyAction` of the potential navigation.
868
- * @returns A {@link Blocker} object with state and reset functionality
869
- */
870
- declare function useBlocker(shouldBlock: boolean | BlockerFunction): Blocker;
871
- type UseRouteArgs = [] | [routeId: keyof RouteModules$1];
872
- type UseRouteResult<Args extends UseRouteArgs> = Args extends [] ? UseRoute<unknown> : Args extends ["root"] ? UseRoute<"root"> : Args extends [infer RouteId extends keyof RouteModules$1] ? UseRoute<RouteId> | undefined : never;
873
- type UseRoute<RouteId extends keyof RouteModules$1 | unknown> = {
874
- handle: RouteId extends keyof RouteModules$1 ? RouteModules$1[RouteId] extends {
875
- handle: infer handle;
876
- } ? handle : unknown : unknown;
877
- loaderData: RouteId extends keyof RouteModules$1 ? GetLoaderData<RouteModules$1[RouteId]> | undefined : unknown;
878
- actionData: RouteId extends keyof RouteModules$1 ? GetActionData<RouteModules$1[RouteId]> | undefined : unknown;
879
- };
880
- declare function useRoute<Args extends UseRouteArgs>(...args: Args): UseRouteResult<Args>;
881
- /**
882
- * A single route match returned from {@link unstable_useRouterState}. Mirrors
883
- * {@link UIMatch} minus the data-related fields (`data`, `loaderData`).
884
- */
885
- type unstable_RouterStateMatch<Handle = unknown> = Omit<UIMatch<unknown, Handle>, "data" | "loaderData">;
886
- /**
887
- * The shape of the `active` variant returned from
888
- * {@link unstable_useRouterState}.
889
- */
890
- type unstable_RouterStateActiveVariant = {
891
- location: Location;
892
- searchParams: URLSearchParams;
893
- params: Params;
894
- matches: unstable_RouterStateMatch[];
895
- type: Action;
896
- };
897
- /**
898
- * The shape of the `pending` variant returned from
899
- * {@link unstable_useRouterState}. Extends
900
- * {@link unstable_RouterStateActiveVariant} with the navigation `state` and
901
- * submission fields mirroring {@link useNavigation} — submission fields are
902
- * populated when the in-flight navigation was triggered by a form submission,
903
- * otherwise `undefined`.
904
- */
905
- type unstable_RouterStatePendingVariant = unstable_RouterStatePendingVariants[keyof unstable_RouterStatePendingVariants];
906
- type unstable_RouterStatePendingVariants = {
907
- Loading: unstable_RouterStateActiveVariant & Omit<NavigationStates["Loading"], "matches" | "historyAction">;
908
- Submitting: unstable_RouterStateActiveVariant & Omit<NavigationStates["Submitting"], "matches" | "historyAction">;
909
- };
910
- /**
911
- * The return shape of {@link unstable_useRouterState}.
912
- *
913
- * `active` reflects the currently-committed location. `pending` reflects the
914
- * in-flight navigation (if any).
915
- */
916
- type unstable_RouterState = {
917
- active: unstable_RouterStateActiveVariant;
918
- pending: unstable_RouterStatePendingVariant | null;
919
- };
920
- /**
921
- * A unified hook for reading router state: current (`active`) and in-flight
922
- * (`pending`) locations, search params, params, matches, and navigation type.
923
- *
924
- * This hook consolidates the information you used to get from {@link useLocation},
925
- * {@link useSearchParams}, {@link useParams}, {@link useMatches}, {@link useNavigation},
926
- * and {@link useNavigationType} into a single hook.
927
- *
928
- *
929
- * @example
930
- * import { unstable_useRouterState as useRouterState } from "react-router";
931
- *
932
- * let { active, pending } = unstable_useRouterState();
933
- *
934
- * // Active is always populated with the current location
935
- * active.location; // replaces `useLocation()`
936
- * active.searchParams; // replaces `useSearchParams()[0]`
937
- * active.params; // replaces `useParams()`
938
- * active.matches; // replaces `useMatches()`
939
- * active.type; // replaces `useNavigationType()`
940
- *
941
- * // Pending is only populated during a navigation
942
- * pending.location; // replaces `useNavigation().location`
943
- * pending.searchParams; // equivalent to `new URLSearchParams(useNavigation().search)`
944
- * pending.params; // Not directly accessible today
945
- * pending.matches; // Not directly accessible today
946
- * pending.type; // Not directly accessible today
947
- * pending.state; // replaces `useNavigation().state`
948
- * pending.formMethod; // replaces useNavigation().formMethod
949
- * pending.formAction; // replaces useNavigation().formAction
950
- * pending.formEncType; // replaces useNavigation().formEncType
951
- * pending.formData; // replaces useNavigation().formData
952
- * pending.json; // replaces useNavigation().json
953
- * pending.text; // replaces useNavigation().text
954
- *
955
- * @name unstable_useRouterState
956
- * @public
957
- * @category Hooks
958
- * @mode framework
959
- * @mode data
960
- * @returns The current router state with `active` and `pending` variants
961
- */
962
- declare function useRouterState(): unstable_RouterState;
963
-
964
- /**
965
- * @category Types
966
- */
967
- interface ServerRouterProps {
968
- /**
969
- * The entry context containing the manifest, route modules, and other data
970
- * needed for rendering.
971
- */
972
- context: EntryContext;
973
- /**
974
- * The URL of the request being handled.
975
- */
976
- url: string | URL;
977
- /**
978
- * An optional `nonce` for [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP)
979
- * compliance, used to allow inline scripts to run safely.
980
- */
981
- nonce?: string;
982
- }
983
- /**
984
- * The server entry point for a React Router app in Framework Mode. This
985
- * component is used to generate the HTML in the response from the server. See
986
- * [`entry.server.tsx`](../framework-conventions/entry.server.tsx).
987
- *
988
- * @public
989
- * @category Framework Routers
990
- * @mode framework
991
- * @param props Props
992
- * @param {ServerRouterProps.context} props.context n/a
993
- * @param {ServerRouterProps.nonce} props.nonce n/a
994
- * @param {ServerRouterProps.url} props.url n/a
995
- * @returns A React element that represents the server-rendered application.
996
- */
997
- declare function ServerRouter({ context, url, nonce, }: ServerRouterProps): ReactElement;
998
-
999
- interface StubRouteExtensions {
1000
- Component?: React.ComponentType<any>;
1001
- HydrateFallback?: React.ComponentType<any>;
1002
- ErrorBoundary?: React.ComponentType<any>;
1003
- loader?: LoaderFunction;
1004
- action?: ActionFunction;
1005
- children?: StubRouteObject[];
1006
- meta?: MetaFunction;
1007
- links?: LinksFunction;
1008
- }
1009
- interface StubIndexRouteObject extends Omit<IndexRouteObject, "Component" | "HydrateFallback" | "ErrorBoundary" | "loader" | "action" | "element" | "errorElement" | "children">, StubRouteExtensions {
1010
- }
1011
- interface StubNonIndexRouteObject extends Omit<NonIndexRouteObject, "Component" | "HydrateFallback" | "ErrorBoundary" | "loader" | "action" | "element" | "errorElement" | "children">, StubRouteExtensions {
1012
- }
1013
- type StubRouteObject = StubIndexRouteObject | StubNonIndexRouteObject;
1014
- interface RoutesTestStubProps {
1015
- /**
1016
- * The initial entries in the history stack. This allows you to start a test with
1017
- * multiple locations already in the history stack (for testing a back navigation, etc.)
1018
- * The test will default to the last entry in initialEntries if no initialIndex is provided.
1019
- * e.g. initialEntries={["/home", "/about", "/contact"]}
1020
- */
1021
- initialEntries?: InitialEntry[];
1022
- /**
1023
- * The initial index in the history stack to render. This allows you to start a test at a specific entry.
1024
- * It defaults to the last entry in initialEntries.
1025
- * e.g.
1026
- * initialEntries: ["/", "/events/123"]
1027
- * initialIndex: 1 // start at "/events/123"
1028
- */
1029
- initialIndex?: number;
1030
- /**
1031
- * Used to set the route's initial loader and action data.
1032
- * e.g. hydrationData={{
1033
- * loaderData: { "/contact": { locale: "en-US" } },
1034
- * actionData: { "/login": { errors: { email: "invalid email" } }}
1035
- * }}
1036
- */
1037
- hydrationData?: HydrationState;
1038
- /**
1039
- * Future flags mimicking the settings in react-router.config.ts
1040
- */
1041
- future?: Partial<FutureConfig>;
1042
- }
1043
- /**
1044
- * @category Utils
1045
- */
1046
- declare function createRoutesStub(routes: StubRouteObject[], _context?: AppLoadContext | RouterContextProvider): ({ initialEntries, initialIndex, hydrationData, future, }: RoutesTestStubProps) => React.JSX.Element;
1047
-
1048
- interface CookieSignatureOptions {
1049
- /**
1050
- * An array of secrets that may be used to sign/unsign the value of a cookie.
1051
- *
1052
- * The array makes it easy to rotate secrets. New secrets should be added to
1053
- * the beginning of the array. `cookie.serialize()` will always use the first
1054
- * value in the array, but `cookie.parse()` may use any of them so that
1055
- * cookies that were signed with older secrets still work.
1056
- */
1057
- secrets?: string[];
1058
- }
1059
- type CookieOptions = ParseOptions & SerializeOptions & CookieSignatureOptions;
1060
- /**
1061
- * A HTTP cookie.
1062
- *
1063
- * A Cookie is a logical container for metadata about a HTTP cookie; its name
1064
- * and options. But it doesn't contain a value. Instead, it has `parse()` and
1065
- * `serialize()` methods that allow a single instance to be reused for
1066
- * parsing/encoding multiple different values.
1067
- *
1068
- * @see https://remix.run/utils/cookies#cookie-api
1069
- */
1070
- interface Cookie {
1071
- /**
1072
- * The name of the cookie, used in the `Cookie` and `Set-Cookie` headers.
1073
- */
1074
- readonly name: string;
1075
- /**
1076
- * True if this cookie uses one or more secrets for verification.
1077
- */
1078
- readonly isSigned: boolean;
1079
- /**
1080
- * The Date this cookie expires.
1081
- *
1082
- * Note: This is calculated at access time using `maxAge` when no `expires`
1083
- * option is provided to `createCookie()`.
1084
- */
1085
- readonly expires?: Date;
1086
- /**
1087
- * Parses a raw `Cookie` header and returns the value of this cookie or
1088
- * `null` if it's not present.
1089
- */
1090
- parse(cookieHeader: string | null, options?: ParseOptions): Promise<any>;
1091
- /**
1092
- * Serializes the given value to a string and returns the `Set-Cookie`
1093
- * header.
1094
- */
1095
- serialize(value: any, options?: SerializeOptions): Promise<string>;
1096
- }
1097
- /**
1098
- * Creates a logical container for managing a browser cookie from the server.
1099
- */
1100
- declare const createCookie: (name: string, cookieOptions?: CookieOptions) => Cookie;
1101
- type IsCookieFunction = (object: any) => object is Cookie;
1102
- /**
1103
- * Returns true if an object is a Remix cookie container.
1104
- *
1105
- * @see https://remix.run/utils/cookies#iscookie
1106
- */
1107
- declare const isCookie: IsCookieFunction;
1108
-
1109
- /**
1110
- * An object of name/value pairs to be used in the session.
1111
- */
1112
- interface SessionData {
1113
- [name: string]: any;
1114
- }
1115
- /**
1116
- * Session persists data across HTTP requests.
1117
- *
1118
- * @see https://reactrouter.com/explanation/sessions-and-cookies#sessions
1119
- */
1120
- interface Session<Data = SessionData, FlashData = Data> {
1121
- /**
1122
- * A unique identifier for this session.
1123
- *
1124
- * Note: This will be the empty string for newly created sessions and
1125
- * sessions that are not backed by a database (i.e. cookie-based sessions).
1126
- */
1127
- readonly id: string;
1128
- /**
1129
- * The raw data contained in this session.
1130
- *
1131
- * This is useful mostly for SessionStorage internally to access the raw
1132
- * session data to persist.
1133
- */
1134
- readonly data: FlashSessionData<Data, FlashData>;
1135
- /**
1136
- * Returns `true` if the session has a value for the given `name`, `false`
1137
- * otherwise.
1138
- */
1139
- has(name: (keyof Data | keyof FlashData) & string): boolean;
1140
- /**
1141
- * Returns the value for the given `name` in this session.
1142
- */
1143
- get<Key extends (keyof Data | keyof FlashData) & string>(name: Key): (Key extends keyof Data ? Data[Key] : undefined) | (Key extends keyof FlashData ? FlashData[Key] : undefined) | undefined;
1144
- /**
1145
- * Sets a value in the session for the given `name`.
1146
- */
1147
- set<Key extends keyof Data & string>(name: Key, value: Data[Key]): void;
1148
- /**
1149
- * Sets a value in the session that is only valid until the next `get()`.
1150
- * This can be useful for temporary values, like error messages.
1151
- */
1152
- flash<Key extends keyof FlashData & string>(name: Key, value: FlashData[Key]): void;
1153
- /**
1154
- * Removes a value from the session.
1155
- */
1156
- unset(name: keyof Data & string): void;
1157
- }
1158
- type FlashSessionData<Data, FlashData> = Partial<Data & {
1159
- [Key in keyof FlashData as FlashDataKey<Key & string>]: FlashData[Key];
1160
- }>;
1161
- type FlashDataKey<Key extends string> = `__flash_${Key}__`;
1162
- type CreateSessionFunction = <Data = SessionData, FlashData = Data>(initialData?: Data, id?: string) => Session<Data, FlashData>;
1163
- /**
1164
- * Creates a new Session object.
1165
- *
1166
- * Note: This function is typically not invoked directly by application code.
1167
- * Instead, use a `SessionStorage` object's `getSession` method.
1168
- */
1169
- declare const createSession: CreateSessionFunction;
1170
- type IsSessionFunction = (object: any) => object is Session;
1171
- /**
1172
- * Returns true if an object is a React Router session.
1173
- *
1174
- * @see https://reactrouter.com/api/utils/isSession
1175
- */
1176
- declare const isSession: IsSessionFunction;
1177
- /**
1178
- * SessionStorage stores session data between HTTP requests and knows how to
1179
- * parse and create cookies.
1180
- *
1181
- * A SessionStorage creates Session objects using a `Cookie` header as input.
1182
- * Then, later it generates the `Set-Cookie` header to be used in the response.
1183
- */
1184
- interface SessionStorage<Data = SessionData, FlashData = Data> {
1185
- /**
1186
- * Parses a Cookie header from a HTTP request and returns the associated
1187
- * Session. If there is no session associated with the cookie, this will
1188
- * return a new Session with no data.
1189
- */
1190
- getSession: (cookieHeader?: string | null, options?: ParseOptions) => Promise<Session<Data, FlashData>>;
1191
- /**
1192
- * Stores all data in the Session and returns the Set-Cookie header to be
1193
- * used in the HTTP response.
1194
- */
1195
- commitSession: (session: Session<Data, FlashData>, options?: SerializeOptions) => Promise<string>;
1196
- /**
1197
- * Deletes all data associated with the Session and returns the Set-Cookie
1198
- * header to be used in the HTTP response.
1199
- */
1200
- destroySession: (session: Session<Data, FlashData>, options?: SerializeOptions) => Promise<string>;
1201
- }
1202
- /**
1203
- * SessionIdStorageStrategy is designed to allow anyone to easily build their
1204
- * own SessionStorage using `createSessionStorage(strategy)`.
1205
- *
1206
- * This strategy describes a common scenario where the session id is stored in
1207
- * a cookie but the actual session data is stored elsewhere, usually in a
1208
- * database or on disk. A set of create, read, update, and delete operations
1209
- * are provided for managing the session data.
1210
- */
1211
- interface SessionIdStorageStrategy<Data = SessionData, FlashData = Data> {
1212
- /**
1213
- * The Cookie used to store the session id, or options used to automatically
1214
- * create one.
1215
- */
1216
- cookie?: Cookie | (CookieOptions & {
1217
- name?: string;
1218
- });
1219
- /**
1220
- * Creates a new record with the given data and returns the session id.
1221
- */
1222
- createData: (data: FlashSessionData<Data, FlashData>, expires?: Date) => Promise<string>;
1223
- /**
1224
- * Returns data for a given session id, or `null` if there isn't any.
1225
- */
1226
- readData: (id: string) => Promise<FlashSessionData<Data, FlashData> | null>;
1227
- /**
1228
- * Updates data for the given session id.
1229
- */
1230
- updateData: (id: string, data: FlashSessionData<Data, FlashData>, expires?: Date) => Promise<void>;
1231
- /**
1232
- * Deletes data for a given session id from the data store.
1233
- */
1234
- deleteData: (id: string) => Promise<void>;
1235
- }
1236
- /**
1237
- * Creates a SessionStorage object using a SessionIdStorageStrategy.
1238
- *
1239
- * Note: This is a low-level API that should only be used if none of the
1240
- * existing session storage options meet your requirements.
1241
- */
1242
- declare function createSessionStorage<Data = SessionData, FlashData = Data>({ cookie: cookieArg, createData, readData, updateData, deleteData, }: SessionIdStorageStrategy<Data, FlashData>): SessionStorage<Data, FlashData>;
1243
-
1244
- interface CookieSessionStorageOptions {
1245
- /**
1246
- * The Cookie used to store the session data on the client, or options used
1247
- * to automatically create one.
1248
- */
1249
- cookie?: SessionIdStorageStrategy["cookie"];
1250
- }
1251
- /**
1252
- * Creates and returns a SessionStorage object that stores all session data
1253
- * directly in the session cookie itself.
1254
- *
1255
- * This has the advantage that no database or other backend services are
1256
- * needed, and can help to simplify some load-balanced scenarios. However, it
1257
- * also has the limitation that serialized session data may not exceed the
1258
- * browser's maximum cookie size. Trade-offs!
1259
- */
1260
- declare function createCookieSessionStorage<Data = SessionData, FlashData = Data>({ cookie: cookieArg }?: CookieSessionStorageOptions): SessionStorage<Data, FlashData>;
1261
-
1262
- interface MemorySessionStorageOptions {
1263
- /**
1264
- * The Cookie used to store the session id on the client, or options used
1265
- * to automatically create one.
1266
- */
1267
- cookie?: SessionIdStorageStrategy["cookie"];
1268
- }
1269
- /**
1270
- * Creates and returns a simple in-memory SessionStorage object, mostly useful
1271
- * for testing and as a reference implementation.
1272
- *
1273
- * Note: This storage does not scale beyond a single process, so it is not
1274
- * suitable for most production scenarios.
1275
- */
1276
- declare function createMemorySessionStorage<Data = SessionData, FlashData = Data>({ cookie }?: MemorySessionStorageOptions): SessionStorage<Data, FlashData>;
1277
-
1278
- type DevServerHooks = {
1279
- getCriticalCss?: (pathname: string) => Promise<string | undefined>;
1280
- processRequestError?: (error: unknown) => void;
1281
- };
1282
- declare function setDevServerHooks(devServerHooks: DevServerHooks): void;
1283
-
1284
- type Args = {
1285
- [K in keyof Pages]: ToArgs<Pages[K]["params"]>;
1286
- };
1287
- type ToArgs<Params extends Record<string, string | undefined>> = Equal<Params, {}> extends true ? [] : Partial<Params> extends Params ? [Params] | [] : [
1288
- Params
1289
- ];
1290
- /**
1291
- Returns a resolved URL path for the specified route.
1292
-
1293
- ```tsx
1294
- const h = href("/:lang?/about", { lang: "en" })
1295
- // -> `/en/about`
1296
-
1297
- <Link to={href("/products/:id", { id: "abc123" })} />
1298
- ```
1299
- */
1300
- declare function href<Path extends keyof Args>(path: Path, ...args: Args[Path]): string;
1301
-
1302
- type DecodedPayload = Promise<RSCPayload> & {
1303
- _deepestRenderedBoundaryId?: string | null;
1304
- formState: Promise<any>;
1305
- };
1306
- type SSRCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>) => Promise<unknown>;
1307
- /**
1308
- * Routes the incoming [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
1309
- * to the [RSC](https://react.dev/reference/rsc/server-components) server and
1310
- * appropriately proxies the server response for data / resource requests, or
1311
- * renders to HTML for a document request.
1312
- *
1313
- * @example
1314
- * import { createFromReadableStream } from "@vitejs/plugin-rsc/ssr";
1315
- * import * as ReactDomServer from "react-dom/server.edge";
1316
- * import {
1317
- * unstable_RSCStaticRouter as RSCStaticRouter,
1318
- * unstable_routeRSCServerRequest as routeRSCServerRequest,
1319
- * } from "react-router";
1320
- *
1321
- * routeRSCServerRequest({
1322
- * request,
1323
- * serverResponse,
1324
- * createFromReadableStream,
1325
- * async renderHTML(getPayload) {
1326
- * const payload = getPayload();
1327
- *
1328
- * return await renderHTMLToReadableStream(
1329
- * <RSCStaticRouter getPayload={getPayload} />,
1330
- * {
1331
- * bootstrapScriptContent,
1332
- * formState: await payload.formState,
1333
- * }
1334
- * );
1335
- * },
1336
- * });
1337
- *
1338
- * @name unstable_routeRSCServerRequest
1339
- * @public
1340
- * @category RSC
1341
- * @mode data
1342
- * @param opts Options
1343
- * @param opts.createFromReadableStream Your `react-server-dom-xyz/client`'s
1344
- * `createFromReadableStream` function, used to decode payloads from the server.
1345
- * @param opts.serverResponse A Response or partial response generated by the [RSC](https://react.dev/reference/rsc/server-components) handler containing a serialized {@link unstable_RSCPayload}.
1346
- * @param opts.hydrate Whether to hydrate the server response with the RSC payload.
1347
- * Defaults to `true`.
1348
- * @param opts.renderHTML A function that renders the {@link unstable_RSCPayload} to
1349
- * HTML, usually using a {@link unstable_RSCStaticRouter | `<RSCStaticRouter>`}.
1350
- * @param opts.request The request to route.
1351
- * @returns A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
1352
- * that either contains the [RSC](https://react.dev/reference/rsc/server-components)
1353
- * payload for data requests, or renders the HTML for document requests.
1354
- */
1355
- declare function routeRSCServerRequest({ request, serverResponse, createFromReadableStream, renderHTML, hydrate, }: {
1356
- request: Request;
1357
- serverResponse: Response;
1358
- createFromReadableStream: SSRCreateFromReadableStreamFunction;
1359
- renderHTML: (getPayload: () => DecodedPayload, options: {
1360
- onError(error: unknown): string | undefined;
1361
- onHeaders(headers: Headers): void;
1362
- }) => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>;
1363
- hydrate?: boolean;
1364
- }): Promise<Response>;
1365
- /**
1366
- * Props for the {@link unstable_RSCStaticRouter} component.
1367
- *
1368
- * @name unstable_RSCStaticRouterProps
1369
- * @category Types
1370
- */
1371
- interface RSCStaticRouterProps {
1372
- /**
1373
- * A function that starts decoding of the {@link unstable_RSCPayload}. Usually passed
1374
- * through from {@link unstable_routeRSCServerRequest}'s `renderHTML`.
1375
- */
1376
- getPayload: () => DecodedPayload;
1377
- }
1378
- /**
1379
- * Pre-renders an {@link unstable_RSCPayload} to HTML. Usually used in
1380
- * {@link unstable_routeRSCServerRequest}'s `renderHTML` callback.
1381
- *
1382
- * @example
1383
- * import { createFromReadableStream } from "@vitejs/plugin-rsc/ssr";
1384
- * import * as ReactDomServer from "react-dom/server.edge";
1385
- * import {
1386
- * unstable_RSCStaticRouter as RSCStaticRouter,
1387
- * unstable_routeRSCServerRequest as routeRSCServerRequest,
1388
- * } from "react-router";
1389
- *
1390
- * routeRSCServerRequest({
1391
- * request,
1392
- * serverResponse,
1393
- * createFromReadableStream,
1394
- * async renderHTML(getPayload) {
1395
- * const payload = getPayload();
1396
- *
1397
- * return await renderHTMLToReadableStream(
1398
- * <RSCStaticRouter getPayload={getPayload} />,
1399
- * {
1400
- * bootstrapScriptContent,
1401
- * formState: await payload.formState,
1402
- * }
1403
- * );
1404
- * },
1405
- * });
1406
- *
1407
- * @name unstable_RSCStaticRouter
1408
- * @public
1409
- * @category RSC
1410
- * @mode data
1411
- * @param props Props
1412
- * @param {unstable_RSCStaticRouterProps.getPayload} props.getPayload n/a
1413
- * @returns A React component that renders the {@link unstable_RSCPayload} as HTML.
1414
- */
1415
- declare function RSCStaticRouter({ getPayload }: RSCStaticRouterProps): React.JSX.Element | null;
1416
-
1417
- declare function RSCDefaultRootErrorBoundary({ hasRootLayout, }: {
1418
- hasRootLayout: boolean;
1419
- }): React__default.JSX.Element;
1420
-
1421
- declare function deserializeErrors(errors: RouterState["errors"]): RouterState["errors"];
1422
-
1423
- type RemixErrorBoundaryProps = React.PropsWithChildren<{
1424
- location: Location;
1425
- isOutsideRemixApp?: boolean;
1426
- error?: Error;
1427
- }>;
1428
- type RemixErrorBoundaryState = {
1429
- error: null | Error;
1430
- location: Location;
1431
- };
1432
- declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps, RemixErrorBoundaryState> {
1433
- constructor(props: RemixErrorBoundaryProps);
1434
- static getDerivedStateFromError(error: Error): {
1435
- error: Error;
1436
- };
1437
- static getDerivedStateFromProps(props: RemixErrorBoundaryProps, state: RemixErrorBoundaryState): {
1438
- error: Error | null;
1439
- location: Location<any>;
1440
- };
1441
- render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
1442
- }
1443
-
1444
- declare function getPatchRoutesOnNavigationFunction(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, routeDiscovery: ServerBuild["routeDiscovery"], isSpaMode: boolean, basename: string | undefined): PatchRoutesOnNavigationFunction | undefined;
1445
- declare function useFogOFWarDiscovery(router: Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, routeDiscovery: ServerBuild["routeDiscovery"], isSpaMode: boolean): void;
1446
-
1447
- declare function getHydrationData({ state, routes, getRouteInfo, location, basename, isSpaMode, }: {
1448
- state: {
1449
- loaderData?: Router["state"]["loaderData"];
1450
- actionData?: Router["state"]["actionData"];
1451
- errors?: Router["state"]["errors"];
1452
- };
1453
- routes: DataRouteObject[];
1454
- getRouteInfo: (routeId: string) => {
1455
- clientLoader: ClientLoaderFunction | undefined;
1456
- hasLoader: boolean;
1457
- hasHydrateFallback: boolean;
1458
- };
1459
- location: Path;
1460
- basename: string | undefined;
1461
- isSpaMode: boolean;
1462
- }): HydrationState;
1463
-
1464
- /**
1465
- * @module index
1466
- * @mergeModuleWith react-router
1467
- */
1468
1
 
2
+ import { Action, InitialEntry, Location, Path, To, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, invariant, parsePath } from "./lib/router/history.js";
3
+ import { ActionFunction, ActionFunctionArgs, BaseRouteObject, DataRouteMatch, DataRouteObject, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyMatch, DataStrategyResult, DataWithResponseInit, ErrorResponse, ErrorResponseImpl, FormEncType, FormMethod, HTMLFormMethod, IndexRouteObject, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, MiddlewareFunction, NonIndexRouteObject, ParamParseKey, Params, PatchRoutesOnNavigationFunction, PatchRoutesOnNavigationFunctionArgs, PathMatch, PathParam, PathPattern, RedirectFunction, RouteMatch, RouteObject, RouterContext, RouterContextProvider, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, UIMatch, createContext, data, defaultMapRouteProperties, generatePath, isRouteErrorResponse, matchPath, matchRoutes, redirect, redirectDocument, replace, resolvePath } from "./lib/router/utils.js";
4
+ import { Blocker, BlockerFunction, Fetcher, GetScrollPositionFunction, GetScrollRestorationKeyFunction, HydrationState, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, Navigation, NavigationStates, RelativeRoutingType, RevalidationState, Router, RouterFetchOptions, RouterInit, RouterNavigateOptions, RouterState, RouterSubscriber, StaticHandler, StaticHandlerContext, createRouter, createStaticHandler } from "./lib/router/router.js";
5
+ import { HtmlLinkDescriptor, LinkDescriptor, PageLinkDescriptor } from "./lib/router/links.js";
6
+ import { Await, AwaitProps, ClientOnErrorFunction, IndexRouteProps, LayoutRouteProps, MemoryRouter, MemoryRouterOpts, MemoryRouterProps, Navigate, NavigateProps, Outlet, OutletProps, PathRouteProps, Route, RouteProps, Router as Router$1, RouterProps, RouterProvider, RouterProviderProps, Routes, RoutesProps, WithComponentProps, WithErrorBoundaryProps, WithHydrateFallbackProps, createMemoryRouter, createRoutesFromChildren, createRoutesFromElements, hydrationRouteProperties, renderMatches, withComponentProps, withErrorBoundaryProps, withHydrateFallbackProps } from "./lib/components.js";
7
+ import { AwaitContextProvider, DataRouterContext, DataRouterStateContext, FetchersContext, LocationContext, NavigateOptions, NavigationContext, Navigator, RouteContext, ViewTransitionContext } from "./lib/context.js";
8
+ import { Register } from "./lib/types/register.js";
9
+ import { NavigateFunction, unstable_RouterState, unstable_RouterStateActiveVariant, unstable_RouterStatePendingVariant, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRoute, useRouteError, useRouteLoaderData, useRouterState, useRoutes } from "./lib/hooks.js";
10
+ import { FetcherSubmitOptions, ParamKeyValuePair, SubmitOptions, SubmitTarget, URLSearchParamsInit, createSearchParams } from "./lib/dom/dom.js";
11
+ import { DiscoverBehavior, FrameworkContext, Links, LinksProps, Meta, PrefetchBehavior, PrefetchPageLinks, Scripts, ScriptsProps } from "./lib/dom/ssr/components.js";
12
+ import { BrowserRouter, BrowserRouterProps, DOMRouterOpts, FetcherFormProps, FetcherSubmitFunction, FetcherWithComponents, Form, FormProps, HashRouter, HashRouterProps, HistoryRouter, HistoryRouterProps, Link, LinkProps, NavLink, NavLinkProps, NavLinkRenderProps, ScrollRestoration, ScrollRestorationProps, SetURLSearchParams, SubmitFunction, createBrowserRouter, createHashRouter, useBeforeUnload, useFetcher, useFetchers, useFormAction, useLinkClickHandler, usePrompt, useScrollRestoration, useSearchParams, useSubmit, useViewTransitionState } from "./lib/dom/lib.js";
13
+ import { StaticRouter, StaticRouterProps, StaticRouterProvider, StaticRouterProviderProps, createStaticRouter } from "./lib/dom/server.js";
14
+ import { ServerRouter, ServerRouterProps } from "./lib/dom/ssr/server.js";
15
+ import { RoutesTestStubProps, createRoutesStub } from "./lib/dom/ssr/routes-test-stub.js";
16
+ import { Cookie, CookieOptions, CookieParseOptions, CookieSerializeOptions, CookieSignatureOptions, IsCookieFunction, createCookie, isCookie } from "./lib/server-runtime/cookies.js";
17
+ import { FlashSessionData, IsSessionFunction, Session, SessionData, SessionIdStorageStrategy, SessionStorage, createSession, createSessionStorage, isSession } from "./lib/server-runtime/sessions.js";
18
+ import { createCookieSessionStorage } from "./lib/server-runtime/sessions/cookieStorage.js";
19
+ import { createMemorySessionStorage } from "./lib/server-runtime/sessions/memoryStorage.js";
20
+ import { setDevServerHooks } from "./lib/server-runtime/dev.js";
21
+ import { AppLoadContext } from "./lib/server-runtime/data.js";
22
+ import { Future } from "./lib/types/future.js";
23
+ import { unstable_SerializesTo } from "./lib/types/serializes-to.js";
24
+ import { href } from "./lib/href.js";
25
+ import { DecodeActionFunction, DecodeFormStateFunction, DecodeReplyFunction, LoadServerActionFunction, RSCManifestPayload, RSCMatch, RSCPayload, RSCRenderPayload, RSCRouteConfig, RSCRouteConfigEntry, RSCRouteManifest, RSCRouteMatch, getRequest, matchRSCServerRequest } from "./lib/rsc/server.rsc.js";
26
+ import { BrowserCreateFromReadableStreamFunction, EncodeReplyFunction, RSCHydratedRouterProps } from "./lib/rsc/browser.js";
27
+ import { RSCStaticRouter, RSCStaticRouterProps, SSRCreateFromReadableStreamFunction, routeRSCServerRequest } from "./lib/rsc/server.ssr.js";
28
+ import { RSCDefaultRootErrorBoundary } from "./lib/rsc/errorBoundaries.js";
29
+ import { deserializeErrors } from "./lib/dom/ssr/errors.js";
30
+ import { RemixErrorBoundary } from "./lib/dom/ssr/errorBoundaries.js";
31
+ import { getPatchRoutesOnNavigationFunction, useFogOFWarDiscovery } from "./lib/dom/ssr/fog-of-war.js";
32
+ import { getHydrationData } from "./lib/dom/ssr/hydration.js";
33
+ import { SingleFetchRedirectSymbol, decodeViaTurboStream, getTurboStreamSingleFetchDataStrategy } from "./lib/dom/ssr/single-fetch.js";
34
+ import { ServerMode } from "./lib/server-runtime/mode.js";
35
+ import { ClientActionFunction, ClientActionFunctionArgs, ClientLoaderFunction, ClientLoaderFunctionArgs, HeadersArgs, HeadersFunction, LinksFunction, MetaArgs, MetaDescriptor, MetaFunction, RouteModules } from "./lib/dom/ssr/routeModules.js";
36
+ import { createClientRoutes, createClientRoutesWithHMRRevalidationOptOut, shouldHydrateRouteLoader } from "./lib/dom/ssr/routes.js";
37
+ import { AssetsManifest, EntryContext } from "./lib/dom/ssr/entry.js";
38
+ import { HandleDataRequestFunction, HandleDocumentRequestFunction, HandleErrorFunction, ServerBuild, ServerEntryModule } from "./lib/server-runtime/build.js";
39
+ import { CreateRequestHandlerFunction, RequestHandler, createRequestHandler } from "./lib/server-runtime/server.js";
40
+ import { ClientInstrumentation, InstrumentRequestHandlerFunction, InstrumentRouteFunction, InstrumentRouterFunction, InstrumentationHandlerResult, ServerInstrumentation } from "./lib/router/instrumentation.js";
41
+
42
+ //#region index.d.ts
1469
43
  declare const unstable_getRequest: typeof getRequest;
1470
44
  declare const unstable_matchRSCServerRequest: typeof matchRSCServerRequest;
1471
-
1472
- export { ActionFunction, AppLoadContext, Blocker, BlockerFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, DataRouteObject, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, NavigationStates, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params, PatchRoutesOnNavigationFunction, Path, PathMatch, PathPattern, RelativeRoutingType, type RequestHandler, RouteObject, RouterContextProvider, RouterState, type RoutesTestStubProps, ServerBuild, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, MiddlewareEnabled as UNSAFE_MiddlewareEnabled, RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, href, isCookie, isSession, RSCPayload as unstable_RSCPayload, RSCStaticRouter as unstable_RSCStaticRouter, type RSCStaticRouterProps as unstable_RSCStaticRouterProps, type unstable_RouterState, type unstable_RouterStateActiveVariant, type unstable_RouterStatePendingVariant, type SSRCreateFromReadableStreamFunction as unstable_SSRCreateFromReadableStreamFunction, unstable_getRequest, unstable_matchRSCServerRequest, routeRSCServerRequest as unstable_routeRSCServerRequest, setDevServerHooks as unstable_setDevServerHooks, useRoute as unstable_useRoute, useRouterState as unstable_useRouterState, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
45
+ //#endregion
46
+ export { type ActionFunction, type ActionFunctionArgs, type AppLoadContext, Await, type AwaitProps, type BaseRouteObject, type Blocker, type BlockerFunction, BrowserRouter, type BrowserRouterProps, type ClientActionFunction, type ClientActionFunctionArgs, type ClientInstrumentation, type ClientLoaderFunction, type ClientLoaderFunctionArgs, type ClientOnErrorFunction, type Cookie, type CookieOptions, type CookieParseOptions, type CookieSerializeOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, type DOMRouterOpts, type DataRouteMatch, type DataRouteObject, type Router as DataRouter, type DataStrategyFunction, type DataStrategyFunctionArgs, type DataStrategyMatch, type DataStrategyResult, type DiscoverBehavior, type EntryContext, type ErrorResponse, type Fetcher, type FetcherFormProps, type FetcherSubmitFunction, type FetcherSubmitOptions, type FetcherWithComponents, type FlashSessionData, Form, type FormEncType, type FormMethod, type FormProps, type Future, type GetScrollPositionFunction, type GetScrollRestorationKeyFunction, type HTMLFormMethod, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HashRouter, type HashRouterProps, type HeadersArgs, type HeadersFunction, type HistoryRouterProps, type HtmlLinkDescriptor, type HydrationState, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, type IndexRouteObject, type IndexRouteProps, type InitialEntry, type InstrumentRequestHandlerFunction, type InstrumentRouteFunction, type InstrumentRouterFunction, type InstrumentationHandlerResult, type IsCookieFunction, type IsSessionFunction, type LayoutRouteProps, type LazyRouteFunction, Link, type LinkDescriptor, type LinkProps, Links, type LinksFunction, type LinksProps, type LoaderFunction, type LoaderFunctionArgs, type Location, MemoryRouter, type MemoryRouterOpts, type MemoryRouterProps, Meta, type MetaArgs, type MetaDescriptor, type MetaFunction, type MiddlewareFunction, NavLink, type NavLinkProps, type NavLinkRenderProps, Navigate, type NavigateFunction, type NavigateOptions, type NavigateProps, type Navigation, type NavigationStates, Action as NavigationType, type Navigator, type NonIndexRouteObject, Outlet, type OutletProps, type PageLinkDescriptor, type ParamKeyValuePair, type ParamParseKey, type Params, type PatchRoutesOnNavigationFunction, type PatchRoutesOnNavigationFunctionArgs, type Path, type PathMatch, type PathParam, type PathPattern, type PathRouteProps, type PrefetchBehavior, PrefetchPageLinks, type RedirectFunction, type Register, type RelativeRoutingType, type RequestHandler, type RevalidationState, Route, type RouteMatch, type RouteObject, type RouteProps, Router$1 as Router, type RouterContext, RouterContextProvider, type RouterFetchOptions, type RouterInit, type RouterNavigateOptions, type RouterProps, RouterProvider, type RouterProviderProps, type RouterState, type RouterSubscriber, Routes, type RoutesProps, type RoutesTestStubProps, Scripts, type ScriptsProps, ScrollRestoration, type ScrollRestorationProps, type ServerBuild, type ServerEntryModule, type ServerInstrumentation, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, type SetURLSearchParams, type ShouldRevalidateFunction, type ShouldRevalidateFunctionArgs, type StaticHandler, type StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, type SubmitFunction, type SubmitOptions, type SubmitTarget, type To, type UIMatch, type AssetsManifest as UNSAFE_AssetsManifest, AwaitContextProvider as UNSAFE_AwaitContextProvider, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, type DataWithResponseInit as UNSAFE_DataWithResponseInit, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, FetchersContext as UNSAFE_FetchersContext, FrameworkContext as UNSAFE_FrameworkContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteContext as UNSAFE_RouteContext, type RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, ViewTransitionContext as UNSAFE_ViewTransitionContext, WithComponentProps as UNSAFE_WithComponentProps, WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps, WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps, createBrowserHistory as UNSAFE_createBrowserHistory, createClientRoutes as UNSAFE_createClientRoutes, createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, createHashHistory as UNSAFE_createHashHistory, createMemoryHistory as UNSAFE_createMemoryHistory, createRouter as UNSAFE_createRouter, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, defaultMapRouteProperties as UNSAFE_defaultMapRouteProperties, deserializeErrors as UNSAFE_deserializeErrors, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, hydrationRouteProperties as UNSAFE_hydrationRouteProperties, invariant as UNSAFE_invariant, shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, useScrollRestoration as UNSAFE_useScrollRestoration, withComponentProps as UNSAFE_withComponentProps, withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps, withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps, type URLSearchParamsInit, createBrowserRouter, createContext, createCookie, createCookieSessionStorage, createHashRouter, createMemoryRouter, createMemorySessionStorage, createPath, createRequestHandler, createRoutesFromChildren, createRoutesFromElements, createRoutesStub, createSearchParams, createSession, createSessionStorage, createStaticHandler, createStaticRouter, data, generatePath, href, isCookie, isRouteErrorResponse, isSession, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, type BrowserCreateFromReadableStreamFunction as unstable_BrowserCreateFromReadableStreamFunction, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type EncodeReplyFunction as unstable_EncodeReplyFunction, HistoryRouter as unstable_HistoryRouter, type LoadServerActionFunction as unstable_LoadServerActionFunction, type RSCHydratedRouterProps as unstable_RSCHydratedRouterProps, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, RSCStaticRouter as unstable_RSCStaticRouter, type RSCStaticRouterProps as unstable_RSCStaticRouterProps, type unstable_RouterState, type unstable_RouterStateActiveVariant, type unstable_RouterStatePendingVariant, type SSRCreateFromReadableStreamFunction as unstable_SSRCreateFromReadableStreamFunction, type unstable_SerializesTo, unstable_getRequest, unstable_matchRSCServerRequest, routeRSCServerRequest as unstable_routeRSCServerRequest, setDevServerHooks as unstable_setDevServerHooks, usePrompt as unstable_usePrompt, useRoute as unstable_useRoute, useRouterState as unstable_useRouterState, useActionData, useAsyncError, useAsyncValue, useBeforeUnload, useBlocker, useFetcher, useFetchers, useFormAction, useHref, useInRouterContext, useLinkClickHandler, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, useSearchParams, useSubmit, useViewTransitionState };