byterover-cli 3.10.0 → 3.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (843) hide show
  1. package/dist/agent/infra/agent/service-initializer.js +8 -2
  2. package/dist/agent/infra/llm/agent-llm-service.d.ts +9 -9
  3. package/dist/agent/infra/llm/agent-llm-service.js +28 -18
  4. package/dist/agent/infra/llm/generators/ai-sdk-content-generator.d.ts +10 -1
  5. package/dist/agent/infra/llm/generators/ai-sdk-content-generator.js +21 -4
  6. package/dist/agent/infra/llm/generators/ai-sdk-message-converter.d.ts +4 -0
  7. package/dist/agent/infra/llm/generators/ai-sdk-message-converter.js +8 -1
  8. package/dist/agent/infra/map/abstract-generator.d.ts +29 -0
  9. package/dist/agent/infra/map/abstract-generator.js +161 -0
  10. package/dist/agent/infra/map/abstract-queue.d.ts +7 -0
  11. package/dist/agent/infra/map/abstract-queue.js +100 -26
  12. package/dist/agent/infra/system-prompt/contributors/file-contributor.js +6 -2
  13. package/dist/agent/infra/tools/implementations/curate-tool-task-context.d.ts +2 -0
  14. package/dist/agent/infra/tools/implementations/curate-tool-task-context.js +28 -0
  15. package/dist/agent/infra/tools/implementations/curate-tool.js +57 -16
  16. package/dist/agent/infra/tools/tool-manager.d.ts +10 -1
  17. package/dist/agent/infra/tools/tool-manager.js +10 -1
  18. package/dist/oclif/commands/review.d.ts +16 -0
  19. package/dist/oclif/commands/review.js +96 -0
  20. package/dist/server/core/domain/entities/brv-config.d.ts +6 -0
  21. package/dist/server/core/domain/entities/brv-config.js +27 -0
  22. package/dist/server/core/domain/entities/provider-registry.js +0 -1
  23. package/dist/server/core/domain/transport/schemas.d.ts +8 -0
  24. package/dist/server/core/domain/transport/schemas.js +6 -0
  25. package/dist/server/core/domain/transport/task-info.d.ts +7 -0
  26. package/dist/server/core/interfaces/i-provider-config-store.d.ts +5 -1
  27. package/dist/server/infra/context-tree/propagate-summaries.d.ts +18 -0
  28. package/dist/server/infra/context-tree/propagate-summaries.js +52 -0
  29. package/dist/server/infra/daemon/agent-process.js +78 -8
  30. package/dist/server/infra/daemon/brv-server.js +23 -0
  31. package/dist/server/infra/daemon/post-work-registry.d.ts +45 -0
  32. package/dist/server/infra/daemon/post-work-registry.js +82 -0
  33. package/dist/server/infra/dream/dream-lock-service.d.ts +3 -4
  34. package/dist/server/infra/dream/dream-lock-service.js +3 -4
  35. package/dist/server/infra/dream/dream-state-schema.d.ts +35 -0
  36. package/dist/server/infra/dream/dream-state-schema.js +15 -0
  37. package/dist/server/infra/dream/dream-state-service.d.ts +22 -0
  38. package/dist/server/infra/dream/dream-state-service.js +62 -3
  39. package/dist/server/infra/dream/dream-trigger.js +6 -2
  40. package/dist/server/infra/executor/curate-executor.d.ts +33 -0
  41. package/dist/server/infra/executor/curate-executor.js +116 -36
  42. package/dist/server/infra/executor/dream-executor.d.ts +29 -0
  43. package/dist/server/infra/executor/dream-executor.js +70 -16
  44. package/dist/server/infra/executor/folder-pack-executor.d.ts +10 -0
  45. package/dist/server/infra/executor/folder-pack-executor.js +22 -24
  46. package/dist/server/infra/git/git-error-messages.d.ts +10 -0
  47. package/dist/server/infra/git/git-error-messages.js +12 -0
  48. package/dist/server/infra/git/isomorphic-git-service.js +24 -76
  49. package/dist/server/infra/git/status-row-classifier.d.ts +32 -0
  50. package/dist/server/infra/git/status-row-classifier.js +78 -0
  51. package/dist/server/infra/process/curate-log-handler.d.ts +3 -0
  52. package/dist/server/infra/process/curate-log-handler.js +6 -2
  53. package/dist/server/infra/process/feature-handlers.js +1 -0
  54. package/dist/server/infra/process/task-router.d.ts +29 -0
  55. package/dist/server/infra/process/task-router.js +43 -1
  56. package/dist/server/infra/process/transport-handlers.d.ts +4 -2
  57. package/dist/server/infra/process/transport-handlers.js +1 -0
  58. package/dist/server/infra/storage/file-provider-config-store.d.ts +4 -1
  59. package/dist/server/infra/storage/file-provider-config-store.js +5 -2
  60. package/dist/server/infra/transport/handlers/provider-handler.d.ts +9 -0
  61. package/dist/server/infra/transport/handlers/provider-handler.js +63 -2
  62. package/dist/server/infra/transport/handlers/review-handler.d.ts +5 -0
  63. package/dist/server/infra/transport/handlers/review-handler.js +22 -0
  64. package/dist/shared/transport/events/index.d.ts +2 -0
  65. package/dist/shared/transport/events/review-events.d.ts +11 -0
  66. package/dist/shared/transport/events/review-events.js +2 -0
  67. package/dist/shared/transport/types/dto.d.ts +2 -0
  68. package/dist/tui/features/auth/api/get-auth-state.js +6 -3
  69. package/dist/tui/features/auth/components/auth-initializer.js +4 -2
  70. package/dist/tui/features/provider/components/provider-flow.js +30 -5
  71. package/node_modules/@tanstack/query-core/LICENSE +21 -0
  72. package/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js +25 -0
  73. package/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map +1 -0
  74. package/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs +108 -0
  75. package/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map +1 -0
  76. package/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts +17 -0
  77. package/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts +17 -0
  78. package/node_modules/@tanstack/query-core/build/legacy/focusManager.js +81 -0
  79. package/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map +1 -0
  80. package/node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts +1384 -0
  81. package/node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts +1384 -0
  82. package/node_modules/@tanstack/query-core/build/legacy/hydration.cjs +178 -0
  83. package/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map +1 -0
  84. package/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts +3 -0
  85. package/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts +3 -0
  86. package/node_modules/@tanstack/query-core/build/legacy/hydration.js +152 -0
  87. package/node_modules/@tanstack/query-core/build/legacy/hydration.js.map +1 -0
  88. package/node_modules/@tanstack/query-core/build/legacy/index.cjs +110 -0
  89. package/node_modules/@tanstack/query-core/build/legacy/index.cjs.map +1 -0
  90. package/node_modules/@tanstack/query-core/build/legacy/index.d.cts +10 -0
  91. package/node_modules/@tanstack/query-core/build/legacy/index.d.ts +10 -0
  92. package/node_modules/@tanstack/query-core/build/legacy/index.js +73 -0
  93. package/node_modules/@tanstack/query-core/build/legacy/index.js.map +1 -0
  94. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs +146 -0
  95. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map +1 -0
  96. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts +15 -0
  97. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts +15 -0
  98. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js +126 -0
  99. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map +1 -0
  100. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs +93 -0
  101. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map +1 -0
  102. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts +20 -0
  103. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts +20 -0
  104. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js +74 -0
  105. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map +1 -0
  106. package/node_modules/@tanstack/query-core/build/legacy/mutation.cjs +333 -0
  107. package/node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map +1 -0
  108. package/node_modules/@tanstack/query-core/build/legacy/mutation.d.cts +3 -0
  109. package/node_modules/@tanstack/query-core/build/legacy/mutation.d.ts +3 -0
  110. package/node_modules/@tanstack/query-core/build/legacy/mutation.js +306 -0
  111. package/node_modules/@tanstack/query-core/build/legacy/mutation.js.map +1 -0
  112. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs +170 -0
  113. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map +1 -0
  114. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts +3 -0
  115. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts +3 -0
  116. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.js +137 -0
  117. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map +1 -0
  118. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs +190 -0
  119. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map +1 -0
  120. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts +3 -0
  121. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts +3 -0
  122. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js +164 -0
  123. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map +1 -0
  124. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs +113 -0
  125. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map +1 -0
  126. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts +46 -0
  127. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts +46 -0
  128. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.js +88 -0
  129. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map +1 -0
  130. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs +97 -0
  131. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map +1 -0
  132. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts +16 -0
  133. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts +16 -0
  134. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.js +70 -0
  135. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map +1 -0
  136. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs +260 -0
  137. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map +1 -0
  138. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts +27 -0
  139. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts +27 -0
  140. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js +234 -0
  141. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map +1 -0
  142. package/node_modules/@tanstack/query-core/build/legacy/query.cjs +478 -0
  143. package/node_modules/@tanstack/query-core/build/legacy/query.cjs.map +1 -0
  144. package/node_modules/@tanstack/query-core/build/legacy/query.d.cts +3 -0
  145. package/node_modules/@tanstack/query-core/build/legacy/query.d.ts +3 -0
  146. package/node_modules/@tanstack/query-core/build/legacy/query.js +459 -0
  147. package/node_modules/@tanstack/query-core/build/legacy/query.js.map +1 -0
  148. package/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs +131 -0
  149. package/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map +1 -0
  150. package/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts +3 -0
  151. package/node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts +3 -0
  152. package/node_modules/@tanstack/query-core/build/legacy/queryCache.js +105 -0
  153. package/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map +1 -0
  154. package/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs +349 -0
  155. package/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map +1 -0
  156. package/node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts +3 -0
  157. package/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts +3 -0
  158. package/node_modules/@tanstack/query-core/build/legacy/queryClient.js +324 -0
  159. package/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map +1 -0
  160. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs +515 -0
  161. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map +1 -0
  162. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts +3 -0
  163. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts +3 -0
  164. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.js +498 -0
  165. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map +1 -0
  166. package/node_modules/@tanstack/query-core/build/legacy/removable.cjs +69 -0
  167. package/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map +1 -0
  168. package/node_modules/@tanstack/query-core/build/legacy/removable.d.cts +11 -0
  169. package/node_modules/@tanstack/query-core/build/legacy/removable.d.ts +11 -0
  170. package/node_modules/@tanstack/query-core/build/legacy/removable.js +43 -0
  171. package/node_modules/@tanstack/query-core/build/legacy/removable.js.map +1 -0
  172. package/node_modules/@tanstack/query-core/build/legacy/retryer.cjs +165 -0
  173. package/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map +1 -0
  174. package/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts +3 -0
  175. package/node_modules/@tanstack/query-core/build/legacy/retryer.d.ts +3 -0
  176. package/node_modules/@tanstack/query-core/build/legacy/retryer.js +139 -0
  177. package/node_modules/@tanstack/query-core/build/legacy/retryer.js.map +1 -0
  178. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs +82 -0
  179. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map +1 -0
  180. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts +34 -0
  181. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts +34 -0
  182. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js +59 -0
  183. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map +1 -0
  184. package/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs +51 -0
  185. package/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map +1 -0
  186. package/node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts +10 -0
  187. package/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts +10 -0
  188. package/node_modules/@tanstack/query-core/build/legacy/subscribable.js +28 -0
  189. package/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map +1 -0
  190. package/node_modules/@tanstack/query-core/build/legacy/thenable.cjs +76 -0
  191. package/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map +1 -0
  192. package/node_modules/@tanstack/query-core/build/legacy/thenable.d.cts +47 -0
  193. package/node_modules/@tanstack/query-core/build/legacy/thenable.d.ts +47 -0
  194. package/node_modules/@tanstack/query-core/build/legacy/thenable.js +52 -0
  195. package/node_modules/@tanstack/query-core/build/legacy/thenable.js.map +1 -0
  196. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs +110 -0
  197. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map +1 -0
  198. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts +58 -0
  199. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts +58 -0
  200. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js +81 -0
  201. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map +1 -0
  202. package/node_modules/@tanstack/query-core/build/legacy/types.cjs +37 -0
  203. package/node_modules/@tanstack/query-core/build/legacy/types.cjs.map +1 -0
  204. package/node_modules/@tanstack/query-core/build/legacy/types.d.cts +3 -0
  205. package/node_modules/@tanstack/query-core/build/legacy/types.d.ts +3 -0
  206. package/node_modules/@tanstack/query-core/build/legacy/types.js +12 -0
  207. package/node_modules/@tanstack/query-core/build/legacy/types.js.map +1 -0
  208. package/node_modules/@tanstack/query-core/build/legacy/utils.cjs +330 -0
  209. package/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map +1 -0
  210. package/node_modules/@tanstack/query-core/build/legacy/utils.d.cts +3 -0
  211. package/node_modules/@tanstack/query-core/build/legacy/utils.d.ts +3 -0
  212. package/node_modules/@tanstack/query-core/build/legacy/utils.js +283 -0
  213. package/node_modules/@tanstack/query-core/build/legacy/utils.js.map +1 -0
  214. package/node_modules/@tanstack/query-core/build/modern/focusManager.cjs +94 -0
  215. package/node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map +1 -0
  216. package/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts +17 -0
  217. package/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts +17 -0
  218. package/node_modules/@tanstack/query-core/build/modern/focusManager.js +68 -0
  219. package/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +1 -0
  220. package/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts +1384 -0
  221. package/node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts +1384 -0
  222. package/node_modules/@tanstack/query-core/build/modern/hydration.cjs +173 -0
  223. package/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map +1 -0
  224. package/node_modules/@tanstack/query-core/build/modern/hydration.d.cts +3 -0
  225. package/node_modules/@tanstack/query-core/build/modern/hydration.d.ts +3 -0
  226. package/node_modules/@tanstack/query-core/build/modern/hydration.js +145 -0
  227. package/node_modules/@tanstack/query-core/build/modern/hydration.js.map +1 -0
  228. package/node_modules/@tanstack/query-core/build/modern/index.cjs +110 -0
  229. package/node_modules/@tanstack/query-core/build/modern/index.cjs.map +1 -0
  230. package/node_modules/@tanstack/query-core/build/modern/index.d.cts +10 -0
  231. package/node_modules/@tanstack/query-core/build/modern/index.d.ts +10 -0
  232. package/node_modules/@tanstack/query-core/build/modern/index.js +71 -0
  233. package/node_modules/@tanstack/query-core/build/modern/index.js.map +1 -0
  234. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs +142 -0
  235. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map +1 -0
  236. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts +15 -0
  237. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts +15 -0
  238. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js +120 -0
  239. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map +1 -0
  240. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs +92 -0
  241. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map +1 -0
  242. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts +20 -0
  243. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts +20 -0
  244. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js +71 -0
  245. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map +1 -0
  246. package/node_modules/@tanstack/query-core/build/modern/mutation.cjs +307 -0
  247. package/node_modules/@tanstack/query-core/build/modern/mutation.cjs.map +1 -0
  248. package/node_modules/@tanstack/query-core/build/modern/mutation.d.cts +3 -0
  249. package/node_modules/@tanstack/query-core/build/modern/mutation.d.ts +3 -0
  250. package/node_modules/@tanstack/query-core/build/modern/mutation.js +281 -0
  251. package/node_modules/@tanstack/query-core/build/modern/mutation.js.map +1 -0
  252. package/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs +149 -0
  253. package/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map +1 -0
  254. package/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts +3 -0
  255. package/node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts +3 -0
  256. package/node_modules/@tanstack/query-core/build/modern/mutationCache.js +124 -0
  257. package/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map +1 -0
  258. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs +165 -0
  259. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map +1 -0
  260. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts +3 -0
  261. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts +3 -0
  262. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.js +140 -0
  263. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map +1 -0
  264. package/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs +113 -0
  265. package/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map +1 -0
  266. package/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts +46 -0
  267. package/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts +46 -0
  268. package/node_modules/@tanstack/query-core/build/modern/notifyManager.js +86 -0
  269. package/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -0
  270. package/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs +84 -0
  271. package/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map +1 -0
  272. package/node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts +16 -0
  273. package/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts +16 -0
  274. package/node_modules/@tanstack/query-core/build/modern/onlineManager.js +58 -0
  275. package/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +1 -0
  276. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs +237 -0
  277. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map +1 -0
  278. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts +27 -0
  279. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts +27 -0
  280. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.js +212 -0
  281. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map +1 -0
  282. package/node_modules/@tanstack/query-core/build/modern/query.cjs +452 -0
  283. package/node_modules/@tanstack/query-core/build/modern/query.cjs.map +1 -0
  284. package/node_modules/@tanstack/query-core/build/modern/query.d.cts +3 -0
  285. package/node_modules/@tanstack/query-core/build/modern/query.d.ts +3 -0
  286. package/node_modules/@tanstack/query-core/build/modern/query.js +434 -0
  287. package/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -0
  288. package/node_modules/@tanstack/query-core/build/modern/queryCache.cjs +122 -0
  289. package/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map +1 -0
  290. package/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts +3 -0
  291. package/node_modules/@tanstack/query-core/build/modern/queryCache.d.ts +3 -0
  292. package/node_modules/@tanstack/query-core/build/modern/queryCache.js +97 -0
  293. package/node_modules/@tanstack/query-core/build/modern/queryCache.js.map +1 -0
  294. package/node_modules/@tanstack/query-core/build/modern/queryClient.cjs +322 -0
  295. package/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map +1 -0
  296. package/node_modules/@tanstack/query-core/build/modern/queryClient.d.cts +3 -0
  297. package/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts +3 -0
  298. package/node_modules/@tanstack/query-core/build/modern/queryClient.js +305 -0
  299. package/node_modules/@tanstack/query-core/build/modern/queryClient.js.map +1 -0
  300. package/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs +488 -0
  301. package/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map +1 -0
  302. package/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts +3 -0
  303. package/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts +3 -0
  304. package/node_modules/@tanstack/query-core/build/modern/queryObserver.js +472 -0
  305. package/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -0
  306. package/node_modules/@tanstack/query-core/build/modern/removable.cjs +58 -0
  307. package/node_modules/@tanstack/query-core/build/modern/removable.cjs.map +1 -0
  308. package/node_modules/@tanstack/query-core/build/modern/removable.d.cts +11 -0
  309. package/node_modules/@tanstack/query-core/build/modern/removable.d.ts +11 -0
  310. package/node_modules/@tanstack/query-core/build/modern/removable.js +33 -0
  311. package/node_modules/@tanstack/query-core/build/modern/removable.js.map +1 -0
  312. package/node_modules/@tanstack/query-core/build/modern/retryer.cjs +161 -0
  313. package/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map +1 -0
  314. package/node_modules/@tanstack/query-core/build/modern/retryer.d.cts +3 -0
  315. package/node_modules/@tanstack/query-core/build/modern/retryer.d.ts +3 -0
  316. package/node_modules/@tanstack/query-core/build/modern/retryer.js +133 -0
  317. package/node_modules/@tanstack/query-core/build/modern/retryer.js.map +1 -0
  318. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs +82 -0
  319. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map +1 -0
  320. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts +34 -0
  321. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts +34 -0
  322. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.js +57 -0
  323. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map +1 -0
  324. package/node_modules/@tanstack/query-core/build/modern/subscribable.cjs +51 -0
  325. package/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map +1 -0
  326. package/node_modules/@tanstack/query-core/build/modern/subscribable.d.cts +10 -0
  327. package/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts +10 -0
  328. package/node_modules/@tanstack/query-core/build/modern/subscribable.js +26 -0
  329. package/node_modules/@tanstack/query-core/build/modern/subscribable.js.map +1 -0
  330. package/node_modules/@tanstack/query-core/build/modern/thenable.cjs +75 -0
  331. package/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map +1 -0
  332. package/node_modules/@tanstack/query-core/build/modern/thenable.d.cts +47 -0
  333. package/node_modules/@tanstack/query-core/build/modern/thenable.d.ts +47 -0
  334. package/node_modules/@tanstack/query-core/build/modern/thenable.js +49 -0
  335. package/node_modules/@tanstack/query-core/build/modern/thenable.js.map +1 -0
  336. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs +98 -0
  337. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map +1 -0
  338. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts +58 -0
  339. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts +58 -0
  340. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.js +70 -0
  341. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map +1 -0
  342. package/node_modules/@tanstack/query-core/build/modern/types.cjs +37 -0
  343. package/node_modules/@tanstack/query-core/build/modern/types.cjs.map +1 -0
  344. package/node_modules/@tanstack/query-core/build/modern/types.d.cts +3 -0
  345. package/node_modules/@tanstack/query-core/build/modern/types.d.ts +3 -0
  346. package/node_modules/@tanstack/query-core/build/modern/types.js +10 -0
  347. package/node_modules/@tanstack/query-core/build/modern/types.js.map +1 -0
  348. package/node_modules/@tanstack/query-core/build/modern/utils.cjs +330 -0
  349. package/node_modules/@tanstack/query-core/build/modern/utils.cjs.map +1 -0
  350. package/node_modules/@tanstack/query-core/build/modern/utils.d.cts +3 -0
  351. package/node_modules/@tanstack/query-core/build/modern/utils.d.ts +3 -0
  352. package/node_modules/@tanstack/query-core/build/modern/utils.js +281 -0
  353. package/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -0
  354. package/node_modules/@tanstack/query-core/package.json +65 -0
  355. package/node_modules/@tanstack/query-core/src/focusManager.ts +86 -0
  356. package/node_modules/@tanstack/query-core/src/hydration.ts +285 -0
  357. package/node_modules/@tanstack/query-core/src/index.ts +55 -0
  358. package/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts +176 -0
  359. package/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts +190 -0
  360. package/node_modules/@tanstack/query-core/src/mutation.ts +419 -0
  361. package/node_modules/@tanstack/query-core/src/mutationCache.ts +244 -0
  362. package/node_modules/@tanstack/query-core/src/mutationObserver.ts +227 -0
  363. package/node_modules/@tanstack/query-core/src/notifyManager.ts +99 -0
  364. package/node_modules/@tanstack/query-core/src/onlineManager.ts +71 -0
  365. package/node_modules/@tanstack/query-core/src/queriesObserver.ts +315 -0
  366. package/node_modules/@tanstack/query-core/src/query.ts +756 -0
  367. package/node_modules/@tanstack/query-core/src/queryCache.ts +223 -0
  368. package/node_modules/@tanstack/query-core/src/queryClient.ts +648 -0
  369. package/node_modules/@tanstack/query-core/src/queryObserver.ts +828 -0
  370. package/node_modules/@tanstack/query-core/src/removable.ts +39 -0
  371. package/node_modules/@tanstack/query-core/src/retryer.ts +228 -0
  372. package/node_modules/@tanstack/query-core/src/streamedQuery.ts +122 -0
  373. package/node_modules/@tanstack/query-core/src/subscribable.ts +30 -0
  374. package/node_modules/@tanstack/query-core/src/thenable.ts +111 -0
  375. package/node_modules/@tanstack/query-core/src/timeoutManager.ts +135 -0
  376. package/node_modules/@tanstack/query-core/src/types.ts +1391 -0
  377. package/node_modules/@tanstack/query-core/src/utils.ts +499 -0
  378. package/node_modules/@tanstack/react-query/LICENSE +21 -0
  379. package/node_modules/@tanstack/react-query/README.md +48 -0
  380. package/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs +208 -0
  381. package/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs +124 -0
  382. package/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs +53 -0
  383. package/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs +38 -0
  384. package/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs +181 -0
  385. package/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs +25 -0
  386. package/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs +164 -0
  387. package/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs +244 -0
  388. package/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md +32 -0
  389. package/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs +271 -0
  390. package/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs +26 -0
  391. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs +58 -0
  392. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs +271 -0
  393. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs +185 -0
  394. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs +123 -0
  395. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs +27 -0
  396. package/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs +55 -0
  397. package/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs +41 -0
  398. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs +91 -0
  399. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map +1 -0
  400. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts +14 -0
  401. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts +14 -0
  402. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js +57 -0
  403. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map +1 -0
  404. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs +47 -0
  405. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map +1 -0
  406. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts +6 -0
  407. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts +6 -0
  408. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js +12 -0
  409. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map +1 -0
  410. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs +72 -0
  411. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map +1 -0
  412. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts +12 -0
  413. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts +12 -0
  414. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js +36 -0
  415. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map +1 -0
  416. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs +67 -0
  417. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map +1 -0
  418. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts +19 -0
  419. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts +19 -0
  420. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js +32 -0
  421. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map +1 -0
  422. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs +69 -0
  423. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map +1 -0
  424. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts +16 -0
  425. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts +16 -0
  426. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js +33 -0
  427. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map +1 -0
  428. package/node_modules/@tanstack/react-query/build/legacy/index.cjs +97 -0
  429. package/node_modules/@tanstack/react-query/build/legacy/index.cjs.map +1 -0
  430. package/node_modules/@tanstack/react-query/build/legacy/index.d.cts +22 -0
  431. package/node_modules/@tanstack/react-query/build/legacy/index.d.ts +22 -0
  432. package/node_modules/@tanstack/react-query/build/legacy/index.js +54 -0
  433. package/node_modules/@tanstack/react-query/build/legacy/index.js.map +1 -0
  434. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs +33 -0
  435. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map +1 -0
  436. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts +23 -0
  437. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts +23 -0
  438. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js +8 -0
  439. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map +1 -0
  440. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs +33 -0
  441. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map +1 -0
  442. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts +7 -0
  443. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts +7 -0
  444. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js +8 -0
  445. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map +1 -0
  446. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs +33 -0
  447. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map +1 -0
  448. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts +24 -0
  449. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts +24 -0
  450. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.js +8 -0
  451. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map +1 -0
  452. package/node_modules/@tanstack/react-query/build/legacy/suspense.cjs +58 -0
  453. package/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map +1 -0
  454. package/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts +12 -0
  455. package/node_modules/@tanstack/react-query/build/legacy/suspense.d.ts +12 -0
  456. package/node_modules/@tanstack/react-query/build/legacy/suspense.js +29 -0
  457. package/node_modules/@tanstack/react-query/build/legacy/suspense.js.map +1 -0
  458. package/node_modules/@tanstack/react-query/build/legacy/types.cjs +19 -0
  459. package/node_modules/@tanstack/react-query/build/legacy/types.cjs.map +1 -0
  460. package/node_modules/@tanstack/react-query/build/legacy/types.d.cts +52 -0
  461. package/node_modules/@tanstack/react-query/build/legacy/types.d.ts +52 -0
  462. package/node_modules/@tanstack/react-query/build/legacy/types.js +1 -0
  463. package/node_modules/@tanstack/react-query/build/legacy/types.js.map +1 -0
  464. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs +133 -0
  465. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map +1 -0
  466. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts +6 -0
  467. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts +6 -0
  468. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js +108 -0
  469. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map +1 -0
  470. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs +40 -0
  471. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map +1 -0
  472. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts +9 -0
  473. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts +9 -0
  474. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js +16 -0
  475. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map +1 -0
  476. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs +56 -0
  477. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map +1 -0
  478. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts +5 -0
  479. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts +5 -0
  480. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js +22 -0
  481. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map +1 -0
  482. package/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs +74 -0
  483. package/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map +1 -0
  484. package/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts +6 -0
  485. package/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts +6 -0
  486. package/node_modules/@tanstack/react-query/build/legacy/useMutation.js +45 -0
  487. package/node_modules/@tanstack/react-query/build/legacy/useMutation.js.map +1 -0
  488. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs +86 -0
  489. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map +1 -0
  490. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts +10 -0
  491. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts +10 -0
  492. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.js +51 -0
  493. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map +1 -0
  494. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs +37 -0
  495. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map +1 -0
  496. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts +5 -0
  497. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts +5 -0
  498. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js +12 -0
  499. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map +1 -0
  500. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs +37 -0
  501. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map +1 -0
  502. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts +6 -0
  503. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts +6 -0
  504. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js +12 -0
  505. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map +1 -0
  506. package/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs +132 -0
  507. package/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map +1 -0
  508. package/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts +76 -0
  509. package/node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts +76 -0
  510. package/node_modules/@tanstack/react-query/build/legacy/useQueries.js +112 -0
  511. package/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map +1 -0
  512. package/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs +36 -0
  513. package/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map +1 -0
  514. package/node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts +9 -0
  515. package/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts +9 -0
  516. package/node_modules/@tanstack/react-query/build/legacy/useQuery.js +12 -0
  517. package/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map +1 -0
  518. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs +51 -0
  519. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map +1 -0
  520. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts +6 -0
  521. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts +6 -0
  522. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js +27 -0
  523. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map +1 -0
  524. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs +56 -0
  525. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map +1 -0
  526. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts +79 -0
  527. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts +79 -0
  528. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js +32 -0
  529. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map +1 -0
  530. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs +52 -0
  531. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map +1 -0
  532. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts +6 -0
  533. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts +6 -0
  534. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js +28 -0
  535. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map +1 -0
  536. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs +91 -0
  537. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map +1 -0
  538. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts +14 -0
  539. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts +14 -0
  540. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js +57 -0
  541. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map +1 -0
  542. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs +47 -0
  543. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map +1 -0
  544. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts +6 -0
  545. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts +6 -0
  546. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js +12 -0
  547. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map +1 -0
  548. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs +72 -0
  549. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map +1 -0
  550. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts +12 -0
  551. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts +12 -0
  552. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js +36 -0
  553. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map +1 -0
  554. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs +67 -0
  555. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map +1 -0
  556. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts +19 -0
  557. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts +19 -0
  558. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js +32 -0
  559. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map +1 -0
  560. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +69 -0
  561. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map +1 -0
  562. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts +16 -0
  563. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts +16 -0
  564. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +33 -0
  565. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -0
  566. package/node_modules/@tanstack/react-query/build/modern/index.cjs +97 -0
  567. package/node_modules/@tanstack/react-query/build/modern/index.cjs.map +1 -0
  568. package/node_modules/@tanstack/react-query/build/modern/index.d.cts +22 -0
  569. package/node_modules/@tanstack/react-query/build/modern/index.d.ts +22 -0
  570. package/node_modules/@tanstack/react-query/build/modern/index.js +54 -0
  571. package/node_modules/@tanstack/react-query/build/modern/index.js.map +1 -0
  572. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs +33 -0
  573. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map +1 -0
  574. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts +23 -0
  575. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts +23 -0
  576. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js +8 -0
  577. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map +1 -0
  578. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs +33 -0
  579. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map +1 -0
  580. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts +7 -0
  581. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts +7 -0
  582. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.js +8 -0
  583. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map +1 -0
  584. package/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs +33 -0
  585. package/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map +1 -0
  586. package/node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts +24 -0
  587. package/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts +24 -0
  588. package/node_modules/@tanstack/react-query/build/modern/queryOptions.js +8 -0
  589. package/node_modules/@tanstack/react-query/build/modern/queryOptions.js.map +1 -0
  590. package/node_modules/@tanstack/react-query/build/modern/suspense.cjs +58 -0
  591. package/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map +1 -0
  592. package/node_modules/@tanstack/react-query/build/modern/suspense.d.cts +12 -0
  593. package/node_modules/@tanstack/react-query/build/modern/suspense.d.ts +12 -0
  594. package/node_modules/@tanstack/react-query/build/modern/suspense.js +29 -0
  595. package/node_modules/@tanstack/react-query/build/modern/suspense.js.map +1 -0
  596. package/node_modules/@tanstack/react-query/build/modern/types.cjs +19 -0
  597. package/node_modules/@tanstack/react-query/build/modern/types.cjs.map +1 -0
  598. package/node_modules/@tanstack/react-query/build/modern/types.d.cts +52 -0
  599. package/node_modules/@tanstack/react-query/build/modern/types.d.ts +52 -0
  600. package/node_modules/@tanstack/react-query/build/modern/types.js +1 -0
  601. package/node_modules/@tanstack/react-query/build/modern/types.js.map +1 -0
  602. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs +130 -0
  603. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map +1 -0
  604. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts +6 -0
  605. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts +6 -0
  606. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +105 -0
  607. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -0
  608. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs +40 -0
  609. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map +1 -0
  610. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts +9 -0
  611. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts +9 -0
  612. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js +16 -0
  613. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map +1 -0
  614. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs +56 -0
  615. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map +1 -0
  616. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts +5 -0
  617. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts +5 -0
  618. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.js +22 -0
  619. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map +1 -0
  620. package/node_modules/@tanstack/react-query/build/modern/useMutation.cjs +74 -0
  621. package/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map +1 -0
  622. package/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts +6 -0
  623. package/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts +6 -0
  624. package/node_modules/@tanstack/react-query/build/modern/useMutation.js +45 -0
  625. package/node_modules/@tanstack/react-query/build/modern/useMutation.js.map +1 -0
  626. package/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs +86 -0
  627. package/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map +1 -0
  628. package/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts +10 -0
  629. package/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts +10 -0
  630. package/node_modules/@tanstack/react-query/build/modern/useMutationState.js +51 -0
  631. package/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map +1 -0
  632. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs +37 -0
  633. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map +1 -0
  634. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts +5 -0
  635. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts +5 -0
  636. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js +12 -0
  637. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map +1 -0
  638. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs +37 -0
  639. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map +1 -0
  640. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts +6 -0
  641. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts +6 -0
  642. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js +12 -0
  643. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map +1 -0
  644. package/node_modules/@tanstack/react-query/build/modern/useQueries.cjs +132 -0
  645. package/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map +1 -0
  646. package/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts +76 -0
  647. package/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts +76 -0
  648. package/node_modules/@tanstack/react-query/build/modern/useQueries.js +112 -0
  649. package/node_modules/@tanstack/react-query/build/modern/useQueries.js.map +1 -0
  650. package/node_modules/@tanstack/react-query/build/modern/useQuery.cjs +36 -0
  651. package/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map +1 -0
  652. package/node_modules/@tanstack/react-query/build/modern/useQuery.d.cts +9 -0
  653. package/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts +9 -0
  654. package/node_modules/@tanstack/react-query/build/modern/useQuery.js +12 -0
  655. package/node_modules/@tanstack/react-query/build/modern/useQuery.js.map +1 -0
  656. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs +51 -0
  657. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map +1 -0
  658. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts +6 -0
  659. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts +6 -0
  660. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js +27 -0
  661. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map +1 -0
  662. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs +56 -0
  663. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map +1 -0
  664. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts +79 -0
  665. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts +79 -0
  666. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js +32 -0
  667. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map +1 -0
  668. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs +52 -0
  669. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map +1 -0
  670. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts +6 -0
  671. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts +6 -0
  672. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js +28 -0
  673. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map +1 -0
  674. package/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js +18 -0
  675. package/node_modules/@tanstack/react-query/build/query-codemods/package.json +38 -0
  676. package/node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js +64 -0
  677. package/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json +8 -0
  678. package/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts +30 -0
  679. package/node_modules/@tanstack/react-query/package.json +87 -0
  680. package/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx +111 -0
  681. package/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts +7 -0
  682. package/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx +45 -0
  683. package/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx +56 -0
  684. package/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts +82 -0
  685. package/node_modules/@tanstack/react-query/src/index.ts +56 -0
  686. package/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts +149 -0
  687. package/node_modules/@tanstack/react-query/src/mutationOptions.ts +41 -0
  688. package/node_modules/@tanstack/react-query/src/queryOptions.ts +87 -0
  689. package/node_modules/@tanstack/react-query/src/suspense.ts +80 -0
  690. package/node_modules/@tanstack/react-query/src/types.ts +242 -0
  691. package/node_modules/@tanstack/react-query/src/useBaseQuery.ts +170 -0
  692. package/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts +81 -0
  693. package/node_modules/@tanstack/react-query/src/useIsFetching.ts +24 -0
  694. package/node_modules/@tanstack/react-query/src/useMutation.ts +69 -0
  695. package/node_modules/@tanstack/react-query/src/useMutationState.ts +75 -0
  696. package/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx +30 -0
  697. package/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx +19 -0
  698. package/node_modules/@tanstack/react-query/src/useQueries.ts +333 -0
  699. package/node_modules/@tanstack/react-query/src/useQuery.ts +52 -0
  700. package/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts +50 -0
  701. package/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts +211 -0
  702. package/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts +34 -0
  703. package/node_modules/react-router/CHANGELOG.md +2366 -0
  704. package/node_modules/react-router/LICENSE.md +23 -0
  705. package/node_modules/react-router/README.md +7 -0
  706. package/node_modules/react-router/dist/development/browser-BEPxnEBW.d.mts +313 -0
  707. package/node_modules/react-router/dist/development/browser-CJ9_du-U.d.ts +313 -0
  708. package/node_modules/react-router/dist/development/chunk-4LKRSAEJ.mjs +2508 -0
  709. package/node_modules/react-router/dist/development/chunk-7PAHGFS4.js +188 -0
  710. package/node_modules/react-router/dist/development/chunk-HMDR2CVH.js +1334 -0
  711. package/node_modules/react-router/dist/development/chunk-JZWAC4HX.mjs +11009 -0
  712. package/node_modules/react-router/dist/development/chunk-WICQJKU6.js +9736 -0
  713. package/node_modules/react-router/dist/development/dom-export.d.mts +171 -0
  714. package/node_modules/react-router/dist/development/dom-export.d.ts +172 -0
  715. package/node_modules/react-router/dist/development/dom-export.js +987 -0
  716. package/node_modules/react-router/dist/development/dom-export.mjs +979 -0
  717. package/node_modules/react-router/dist/development/index-react-server-client-1TI9M9o1.d.ts +2534 -0
  718. package/node_modules/react-router/dist/development/index-react-server-client-MKTlCGL3.d.mts +2534 -0
  719. package/node_modules/react-router/dist/development/index-react-server-client.d.mts +3 -0
  720. package/node_modules/react-router/dist/development/index-react-server-client.d.ts +3 -0
  721. package/node_modules/react-router/dist/development/index-react-server-client.js +61 -0
  722. package/node_modules/react-router/dist/development/index-react-server-client.mjs +59 -0
  723. package/node_modules/react-router/dist/development/index-react-server.d.mts +2553 -0
  724. package/node_modules/react-router/dist/development/index-react-server.d.ts +2553 -0
  725. package/node_modules/react-router/dist/development/index-react-server.js +3708 -0
  726. package/node_modules/react-router/dist/development/index-react-server.mjs +3597 -0
  727. package/node_modules/react-router/dist/development/index.d.mts +1387 -0
  728. package/node_modules/react-router/dist/development/index.d.ts +1387 -0
  729. package/node_modules/react-router/dist/development/index.js +2551 -0
  730. package/node_modules/react-router/dist/development/index.mjs +275 -0
  731. package/node_modules/react-router/dist/development/instrumentation-DvHY1sgY.d.ts +3332 -0
  732. package/node_modules/react-router/dist/development/lib/types/internal.d.mts +184 -0
  733. package/node_modules/react-router/dist/development/lib/types/internal.d.ts +184 -0
  734. package/node_modules/react-router/dist/development/lib/types/internal.js +10 -0
  735. package/node_modules/react-router/dist/development/lib/types/internal.mjs +10 -0
  736. package/node_modules/react-router/dist/development/register-Bm80E9qL.d.ts +30 -0
  737. package/node_modules/react-router/dist/development/register-CS_tiXsm.d.mts +30 -0
  738. package/node_modules/react-router/dist/development/router-5iOvts3c.d.mts +3332 -0
  739. package/node_modules/react-router/dist/production/browser-BEPxnEBW.d.mts +313 -0
  740. package/node_modules/react-router/dist/production/browser-CJ9_du-U.d.ts +313 -0
  741. package/node_modules/react-router/dist/production/chunk-GSFLVUYQ.mjs +2508 -0
  742. package/node_modules/react-router/dist/production/chunk-N2HZAAIG.js +1334 -0
  743. package/node_modules/react-router/dist/production/chunk-NGWWS4QJ.js +188 -0
  744. package/node_modules/react-router/dist/production/chunk-QSNCZFX5.js +9736 -0
  745. package/node_modules/react-router/dist/production/chunk-Y3R63HEB.mjs +11009 -0
  746. package/node_modules/react-router/dist/production/dom-export.d.mts +171 -0
  747. package/node_modules/react-router/dist/production/dom-export.d.ts +172 -0
  748. package/node_modules/react-router/dist/production/dom-export.js +987 -0
  749. package/node_modules/react-router/dist/production/dom-export.mjs +979 -0
  750. package/node_modules/react-router/dist/production/index-react-server-client-1TI9M9o1.d.ts +2534 -0
  751. package/node_modules/react-router/dist/production/index-react-server-client-MKTlCGL3.d.mts +2534 -0
  752. package/node_modules/react-router/dist/production/index-react-server-client.d.mts +3 -0
  753. package/node_modules/react-router/dist/production/index-react-server-client.d.ts +3 -0
  754. package/node_modules/react-router/dist/production/index-react-server-client.js +61 -0
  755. package/node_modules/react-router/dist/production/index-react-server-client.mjs +59 -0
  756. package/node_modules/react-router/dist/production/index-react-server.d.mts +2553 -0
  757. package/node_modules/react-router/dist/production/index-react-server.d.ts +2553 -0
  758. package/node_modules/react-router/dist/production/index-react-server.js +3708 -0
  759. package/node_modules/react-router/dist/production/index-react-server.mjs +3597 -0
  760. package/node_modules/react-router/dist/production/index.d.mts +1387 -0
  761. package/node_modules/react-router/dist/production/index.d.ts +1387 -0
  762. package/node_modules/react-router/dist/production/index.js +2551 -0
  763. package/node_modules/react-router/dist/production/index.mjs +275 -0
  764. package/node_modules/react-router/dist/production/instrumentation-DvHY1sgY.d.ts +3332 -0
  765. package/node_modules/react-router/dist/production/lib/types/internal.d.mts +184 -0
  766. package/node_modules/react-router/dist/production/lib/types/internal.d.ts +184 -0
  767. package/node_modules/react-router/dist/production/lib/types/internal.js +10 -0
  768. package/node_modules/react-router/dist/production/lib/types/internal.mjs +10 -0
  769. package/node_modules/react-router/dist/production/register-Bm80E9qL.d.ts +30 -0
  770. package/node_modules/react-router/dist/production/register-CS_tiXsm.d.mts +30 -0
  771. package/node_modules/react-router/dist/production/router-5iOvts3c.d.mts +3332 -0
  772. package/node_modules/react-router/node_modules/cookie/LICENSE +24 -0
  773. package/node_modules/react-router/node_modules/cookie/README.md +295 -0
  774. package/node_modules/react-router/node_modules/cookie/dist/index.d.ts +148 -0
  775. package/node_modules/react-router/node_modules/cookie/dist/index.js +350 -0
  776. package/node_modules/react-router/node_modules/cookie/dist/index.js.map +1 -0
  777. package/node_modules/react-router/node_modules/cookie/package.json +47 -0
  778. package/node_modules/react-router/package.json +163 -0
  779. package/node_modules/react-router-dom/LICENSE.md +23 -0
  780. package/node_modules/react-router-dom/README.md +6 -0
  781. package/node_modules/react-router-dom/dist/index.d.mts +2 -0
  782. package/node_modules/react-router-dom/dist/index.d.ts +2 -0
  783. package/node_modules/react-router-dom/dist/index.js +45 -0
  784. package/node_modules/react-router-dom/dist/index.mjs +18 -0
  785. package/node_modules/react-router-dom/package.json +83 -0
  786. package/node_modules/set-cookie-parser/LICENSE +21 -0
  787. package/node_modules/set-cookie-parser/README.md +202 -0
  788. package/node_modules/set-cookie-parser/lib/set-cookie.js +242 -0
  789. package/node_modules/set-cookie-parser/package.json +45 -0
  790. package/node_modules/zustand/LICENSE +21 -0
  791. package/node_modules/zustand/README.md +512 -0
  792. package/node_modules/zustand/esm/index.d.mts +2 -0
  793. package/node_modules/zustand/esm/index.mjs +2 -0
  794. package/node_modules/zustand/esm/middleware/combine.d.mts +4 -0
  795. package/node_modules/zustand/esm/middleware/devtools.d.mts +58 -0
  796. package/node_modules/zustand/esm/middleware/immer.d.mts +29 -0
  797. package/node_modules/zustand/esm/middleware/immer.mjs +12 -0
  798. package/node_modules/zustand/esm/middleware/persist.d.mts +99 -0
  799. package/node_modules/zustand/esm/middleware/redux.d.mts +21 -0
  800. package/node_modules/zustand/esm/middleware/ssrSafe.d.mts +2 -0
  801. package/node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts +25 -0
  802. package/node_modules/zustand/esm/middleware.d.mts +6 -0
  803. package/node_modules/zustand/esm/middleware.mjs +487 -0
  804. package/node_modules/zustand/esm/react/shallow.d.mts +1 -0
  805. package/node_modules/zustand/esm/react/shallow.mjs +12 -0
  806. package/node_modules/zustand/esm/react.d.mts +14 -0
  807. package/node_modules/zustand/esm/react.mjs +22 -0
  808. package/node_modules/zustand/esm/shallow.d.mts +2 -0
  809. package/node_modules/zustand/esm/shallow.mjs +2 -0
  810. package/node_modules/zustand/esm/traditional.d.mts +14 -0
  811. package/node_modules/zustand/esm/traditional.mjs +26 -0
  812. package/node_modules/zustand/esm/vanilla/shallow.d.mts +1 -0
  813. package/node_modules/zustand/esm/vanilla/shallow.mjs +55 -0
  814. package/node_modules/zustand/esm/vanilla.d.mts +31 -0
  815. package/node_modules/zustand/esm/vanilla.mjs +24 -0
  816. package/node_modules/zustand/index.d.ts +2 -0
  817. package/node_modules/zustand/index.js +19 -0
  818. package/node_modules/zustand/middleware/combine.d.ts +4 -0
  819. package/node_modules/zustand/middleware/devtools.d.ts +58 -0
  820. package/node_modules/zustand/middleware/immer.d.ts +29 -0
  821. package/node_modules/zustand/middleware/immer.js +14 -0
  822. package/node_modules/zustand/middleware/persist.d.ts +99 -0
  823. package/node_modules/zustand/middleware/redux.d.ts +21 -0
  824. package/node_modules/zustand/middleware/ssrSafe.d.ts +2 -0
  825. package/node_modules/zustand/middleware/subscribeWithSelector.d.ts +25 -0
  826. package/node_modules/zustand/middleware.d.ts +6 -0
  827. package/node_modules/zustand/middleware.js +495 -0
  828. package/node_modules/zustand/package.json +108 -0
  829. package/node_modules/zustand/react/shallow.d.ts +1 -0
  830. package/node_modules/zustand/react/shallow.js +14 -0
  831. package/node_modules/zustand/react.d.ts +14 -0
  832. package/node_modules/zustand/react.js +25 -0
  833. package/node_modules/zustand/shallow.d.ts +2 -0
  834. package/node_modules/zustand/shallow.js +15 -0
  835. package/node_modules/zustand/traditional.d.ts +14 -0
  836. package/node_modules/zustand/traditional.js +29 -0
  837. package/node_modules/zustand/ts_version_4.5_and_above_is_required.d.ts +0 -0
  838. package/node_modules/zustand/vanilla/shallow.d.ts +1 -0
  839. package/node_modules/zustand/vanilla/shallow.js +57 -0
  840. package/node_modules/zustand/vanilla.d.ts +31 -0
  841. package/node_modules/zustand/vanilla.js +26 -0
  842. package/oclif.manifest.json +516 -454
  843. package/package.json +5 -2
@@ -0,0 +1,3332 @@
1
+ import * as React from 'react';
2
+ import { ComponentType, ReactElement } from 'react';
3
+
4
+ /**
5
+ * Actions represent the type of change to a location value.
6
+ */
7
+ declare enum Action {
8
+ /**
9
+ * A POP indicates a change to an arbitrary index in the history stack, such
10
+ * as a back or forward navigation. It does not describe the direction of the
11
+ * navigation, only that the current index changed.
12
+ *
13
+ * Note: This is the default action for newly created history objects.
14
+ */
15
+ Pop = "POP",
16
+ /**
17
+ * A PUSH indicates a new entry being added to the history stack, such as when
18
+ * a link is clicked and a new page loads. When this happens, all subsequent
19
+ * entries in the stack are lost.
20
+ */
21
+ Push = "PUSH",
22
+ /**
23
+ * A REPLACE indicates the entry at the current index in the history stack
24
+ * being replaced by a new one.
25
+ */
26
+ Replace = "REPLACE"
27
+ }
28
+ /**
29
+ * The pathname, search, and hash values of a URL.
30
+ */
31
+ interface Path {
32
+ /**
33
+ * A URL pathname, beginning with a /.
34
+ */
35
+ pathname: string;
36
+ /**
37
+ * A URL search string, beginning with a ?.
38
+ */
39
+ search: string;
40
+ /**
41
+ * A URL fragment identifier, beginning with a #.
42
+ */
43
+ hash: string;
44
+ }
45
+ /**
46
+ * An entry in a history stack. A location contains information about the
47
+ * URL path, as well as possibly some arbitrary state and a key.
48
+ */
49
+ interface Location<State = any> extends Path {
50
+ /**
51
+ * A value of arbitrary data associated with this location.
52
+ */
53
+ state: State;
54
+ /**
55
+ * A unique string associated with this location. May be used to safely store
56
+ * and retrieve data in some other storage API, like `localStorage`.
57
+ *
58
+ * Note: This value is always "default" on the initial location.
59
+ */
60
+ key: string;
61
+ }
62
+ /**
63
+ * A change to the current location.
64
+ */
65
+ interface Update {
66
+ /**
67
+ * The action that triggered the change.
68
+ */
69
+ action: Action;
70
+ /**
71
+ * The new location.
72
+ */
73
+ location: Location;
74
+ /**
75
+ * The delta between this location and the former location in the history stack
76
+ */
77
+ delta: number | null;
78
+ }
79
+ /**
80
+ * A function that receives notifications about location changes.
81
+ */
82
+ interface Listener {
83
+ (update: Update): void;
84
+ }
85
+ /**
86
+ * Describes a location that is the destination of some navigation used in
87
+ * {@link Link}, {@link useNavigate}, etc.
88
+ */
89
+ type To = string | Partial<Path>;
90
+ /**
91
+ * A history is an interface to the navigation stack. The history serves as the
92
+ * source of truth for the current location, as well as provides a set of
93
+ * methods that may be used to change it.
94
+ *
95
+ * It is similar to the DOM's `window.history` object, but with a smaller, more
96
+ * focused API.
97
+ */
98
+ interface History {
99
+ /**
100
+ * The last action that modified the current location. This will always be
101
+ * Action.Pop when a history instance is first created. This value is mutable.
102
+ */
103
+ readonly action: Action;
104
+ /**
105
+ * The current location. This value is mutable.
106
+ */
107
+ readonly location: Location;
108
+ /**
109
+ * Returns a valid href for the given `to` value that may be used as
110
+ * the value of an <a href> attribute.
111
+ *
112
+ * @param to - The destination URL
113
+ */
114
+ createHref(to: To): string;
115
+ /**
116
+ * Returns a URL for the given `to` value
117
+ *
118
+ * @param to - The destination URL
119
+ */
120
+ createURL(to: To): URL;
121
+ /**
122
+ * Encode a location the same way window.history would do (no-op for memory
123
+ * history) so we ensure our PUSH/REPLACE navigations for data routers
124
+ * behave the same as POP
125
+ *
126
+ * @param to Unencoded path
127
+ */
128
+ encodeLocation(to: To): Path;
129
+ /**
130
+ * Pushes a new location onto the history stack, increasing its length by one.
131
+ * If there were any entries in the stack after the current one, they are
132
+ * lost.
133
+ *
134
+ * @param to - The new URL
135
+ * @param state - Data to associate with the new location
136
+ */
137
+ push(to: To, state?: any): void;
138
+ /**
139
+ * Replaces the current location in the history stack with a new one. The
140
+ * location that was replaced will no longer be available.
141
+ *
142
+ * @param to - The new URL
143
+ * @param state - Data to associate with the new location
144
+ */
145
+ replace(to: To, state?: any): void;
146
+ /**
147
+ * Navigates `n` entries backward/forward in the history stack relative to the
148
+ * current index. For example, a "back" navigation would use go(-1).
149
+ *
150
+ * @param delta - The delta in the stack index
151
+ */
152
+ go(delta: number): void;
153
+ /**
154
+ * Sets up a listener that will be called whenever the current location
155
+ * changes.
156
+ *
157
+ * @param listener - A function that will be called when the location changes
158
+ * @returns unlisten - A function that may be used to stop listening
159
+ */
160
+ listen(listener: Listener): () => void;
161
+ }
162
+ /**
163
+ * A user-supplied object that describes a location. Used when providing
164
+ * entries to `createMemoryHistory` via its `initialEntries` option.
165
+ */
166
+ type InitialEntry = string | Partial<Location>;
167
+ type MemoryHistoryOptions = {
168
+ initialEntries?: InitialEntry[];
169
+ initialIndex?: number;
170
+ v5Compat?: boolean;
171
+ };
172
+ /**
173
+ * A memory history stores locations in memory. This is useful in stateful
174
+ * environments where there is no web browser, such as node tests or React
175
+ * Native.
176
+ */
177
+ interface MemoryHistory extends History {
178
+ /**
179
+ * The current index in the history stack.
180
+ */
181
+ readonly index: number;
182
+ }
183
+ /**
184
+ * Memory history stores the current location in memory. It is designed for use
185
+ * in stateful non-browser environments like tests and React Native.
186
+ */
187
+ declare function createMemoryHistory(options?: MemoryHistoryOptions): MemoryHistory;
188
+ /**
189
+ * A browser history stores the current location in regular URLs in a web
190
+ * browser environment. This is the standard for most web apps and provides the
191
+ * cleanest URLs the browser's address bar.
192
+ *
193
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#browserhistory
194
+ */
195
+ interface BrowserHistory extends UrlHistory {
196
+ }
197
+ type BrowserHistoryOptions = UrlHistoryOptions;
198
+ /**
199
+ * Browser history stores the location in regular URLs. This is the standard for
200
+ * most web apps, but it requires some configuration on the server to ensure you
201
+ * serve the same app at multiple URLs.
202
+ *
203
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory
204
+ */
205
+ declare function createBrowserHistory(options?: BrowserHistoryOptions): BrowserHistory;
206
+ /**
207
+ * A hash history stores the current location in the fragment identifier portion
208
+ * of the URL in a web browser environment.
209
+ *
210
+ * This is ideal for apps that do not control the server for some reason
211
+ * (because the fragment identifier is never sent to the server), including some
212
+ * shared hosting environments that do not provide fine-grained controls over
213
+ * which pages are served at which URLs.
214
+ *
215
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#hashhistory
216
+ */
217
+ interface HashHistory extends UrlHistory {
218
+ }
219
+ type HashHistoryOptions = UrlHistoryOptions;
220
+ /**
221
+ * Hash history stores the location in window.location.hash. This makes it ideal
222
+ * for situations where you don't want to send the location to the server for
223
+ * some reason, either because you do cannot configure it or the URL space is
224
+ * reserved for something else.
225
+ *
226
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory
227
+ */
228
+ declare function createHashHistory(options?: HashHistoryOptions): HashHistory;
229
+ /**
230
+ * @private
231
+ */
232
+ declare function invariant(value: boolean, message?: string): asserts value;
233
+ declare function invariant<T>(value: T | null | undefined, message?: string): asserts value is T;
234
+ /**
235
+ * Creates a string URL path from the given pathname, search, and hash components.
236
+ *
237
+ * @category Utils
238
+ */
239
+ declare function createPath({ pathname, search, hash, }: Partial<Path>): string;
240
+ /**
241
+ * Parses a string URL path into its separate pathname, search, and hash components.
242
+ *
243
+ * @category Utils
244
+ */
245
+ declare function parsePath(path: string): Partial<Path>;
246
+ interface UrlHistory extends History {
247
+ }
248
+ type UrlHistoryOptions = {
249
+ window?: Window;
250
+ v5Compat?: boolean;
251
+ };
252
+
253
+ /**
254
+ * An augmentable interface users can modify in their app-code to opt into
255
+ * future-flag-specific types
256
+ */
257
+ interface Future {
258
+ }
259
+ type MiddlewareEnabled = Future extends {
260
+ v8_middleware: infer T extends boolean;
261
+ } ? T : false;
262
+
263
+ type MaybePromise<T> = T | Promise<T>;
264
+ /**
265
+ * Map of routeId -> data returned from a loader/action/error
266
+ */
267
+ interface RouteData {
268
+ [routeId: string]: any;
269
+ }
270
+ type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
271
+ type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
272
+ /**
273
+ * Users can specify either lowercase or uppercase form methods on `<Form>`,
274
+ * useSubmit(), `<fetcher.Form>`, etc.
275
+ */
276
+ type HTMLFormMethod = LowerCaseFormMethod | UpperCaseFormMethod;
277
+ /**
278
+ * Active navigation/fetcher form methods are exposed in uppercase on the
279
+ * RouterState. This is to align with the normalization done via fetch().
280
+ */
281
+ type FormMethod = UpperCaseFormMethod;
282
+ type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";
283
+ type JsonObject = {
284
+ [Key in string]: JsonValue;
285
+ } & {
286
+ [Key in string]?: JsonValue | undefined;
287
+ };
288
+ type JsonArray = JsonValue[] | readonly JsonValue[];
289
+ type JsonPrimitive = string | number | boolean | null;
290
+ type JsonValue = JsonPrimitive | JsonObject | JsonArray;
291
+ /**
292
+ * @private
293
+ * Internal interface to pass around for action submissions, not intended for
294
+ * external consumption
295
+ */
296
+ type Submission = {
297
+ formMethod: FormMethod;
298
+ formAction: string;
299
+ formEncType: FormEncType;
300
+ formData: FormData;
301
+ json: undefined;
302
+ text: undefined;
303
+ } | {
304
+ formMethod: FormMethod;
305
+ formAction: string;
306
+ formEncType: FormEncType;
307
+ formData: undefined;
308
+ json: JsonValue;
309
+ text: undefined;
310
+ } | {
311
+ formMethod: FormMethod;
312
+ formAction: string;
313
+ formEncType: FormEncType;
314
+ formData: undefined;
315
+ json: undefined;
316
+ text: string;
317
+ };
318
+ /**
319
+ * A context instance used as the key for the `get`/`set` methods of a
320
+ * {@link RouterContextProvider}. Accepts an optional default
321
+ * value to be returned if no value has been set.
322
+ */
323
+ interface RouterContext<T = unknown> {
324
+ defaultValue?: T;
325
+ }
326
+ /**
327
+ * Creates a type-safe {@link RouterContext} object that can be used to
328
+ * store and retrieve arbitrary values in [`action`](../../start/framework/route-module#action)s,
329
+ * [`loader`](../../start/framework/route-module#loader)s, and [middleware](../../how-to/middleware).
330
+ * Similar to React's [`createContext`](https://react.dev/reference/react/createContext),
331
+ * but specifically designed for React Router's request/response lifecycle.
332
+ *
333
+ * If a `defaultValue` is provided, it will be returned from `context.get()`
334
+ * when no value has been set for the context. Otherwise, reading this context
335
+ * when no value has been set will throw an error.
336
+ *
337
+ * ```tsx filename=app/context.ts
338
+ * import { createContext } from "react-router";
339
+ *
340
+ * // Create a context for user data
341
+ * export const userContext =
342
+ * createContext<User | null>(null);
343
+ * ```
344
+ *
345
+ * ```tsx filename=app/middleware/auth.ts
346
+ * import { getUserFromSession } from "~/auth.server";
347
+ * import { userContext } from "~/context";
348
+ *
349
+ * export const authMiddleware = async ({
350
+ * context,
351
+ * request,
352
+ * }) => {
353
+ * const user = await getUserFromSession(request);
354
+ * context.set(userContext, user);
355
+ * };
356
+ * ```
357
+ *
358
+ * ```tsx filename=app/routes/profile.tsx
359
+ * import { userContext } from "~/context";
360
+ *
361
+ * export async function loader({
362
+ * context,
363
+ * }: Route.LoaderArgs) {
364
+ * const user = context.get(userContext);
365
+ *
366
+ * if (!user) {
367
+ * throw new Response("Unauthorized", { status: 401 });
368
+ * }
369
+ *
370
+ * return { user };
371
+ * }
372
+ * ```
373
+ *
374
+ * @public
375
+ * @category Utils
376
+ * @mode framework
377
+ * @mode data
378
+ * @param defaultValue An optional default value for the context. This value
379
+ * will be returned if no value has been set for this context.
380
+ * @returns A {@link RouterContext} object that can be used with
381
+ * `context.get()` and `context.set()` in [`action`](../../start/framework/route-module#action)s,
382
+ * [`loader`](../../start/framework/route-module#loader)s, and [middleware](../../how-to/middleware).
383
+ */
384
+ declare function createContext<T>(defaultValue?: T): RouterContext<T>;
385
+ /**
386
+ * Provides methods for writing/reading values in application context in a
387
+ * type-safe way. Primarily for usage with [middleware](../../how-to/middleware).
388
+ *
389
+ * @example
390
+ * import {
391
+ * createContext,
392
+ * RouterContextProvider
393
+ * } from "react-router";
394
+ *
395
+ * const userContext = createContext<User | null>(null);
396
+ * const contextProvider = new RouterContextProvider();
397
+ * contextProvider.set(userContext, getUser());
398
+ * // ^ Type-safe
399
+ * const user = contextProvider.get(userContext);
400
+ * // ^ User
401
+ *
402
+ * @public
403
+ * @category Utils
404
+ * @mode framework
405
+ * @mode data
406
+ */
407
+ declare class RouterContextProvider {
408
+ #private;
409
+ /**
410
+ * Create a new `RouterContextProvider` instance
411
+ * @param init An optional initial context map to populate the provider with
412
+ */
413
+ constructor(init?: Map<RouterContext, unknown>);
414
+ /**
415
+ * Access a value from the context. If no value has been set for the context,
416
+ * it will return the context's `defaultValue` if provided, or throw an error
417
+ * if no `defaultValue` was set.
418
+ * @param context The context to get the value for
419
+ * @returns The value for the context, or the context's `defaultValue` if no
420
+ * value was set
421
+ */
422
+ get<T>(context: RouterContext<T>): T;
423
+ /**
424
+ * Set a value for the context. If the context already has a value set, this
425
+ * will overwrite it.
426
+ *
427
+ * @param context The context to set the value for
428
+ * @param value The value to set for the context
429
+ * @returns {void}
430
+ */
431
+ set<C extends RouterContext>(context: C, value: C extends RouterContext<infer T> ? T : never): void;
432
+ }
433
+ type DefaultContext = MiddlewareEnabled extends true ? Readonly<RouterContextProvider> : any;
434
+ /**
435
+ * @private
436
+ * Arguments passed to route loader/action functions. Same for now but we keep
437
+ * this as a private implementation detail in case they diverge in the future.
438
+ */
439
+ interface DataFunctionArgs<Context> {
440
+ /** A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read headers (like cookies, and {@link https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams URLSearchParams} from the request. */
441
+ request: Request;
442
+ /**
443
+ * Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
444
+ * Mostly useful as a identifier to aggregate on for logging/tracing/etc.
445
+ */
446
+ unstable_pattern: string;
447
+ /**
448
+ * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
449
+ * @example
450
+ * // app/routes.ts
451
+ * route("teams/:teamId", "./team.tsx"),
452
+ *
453
+ * // app/team.tsx
454
+ * export function loader({
455
+ * params,
456
+ * }: Route.LoaderArgs) {
457
+ * params.teamId;
458
+ * // ^ string
459
+ * }
460
+ */
461
+ params: Params;
462
+ /**
463
+ * This is the context passed in to your server adapter's getLoadContext() function.
464
+ * It's a way to bridge the gap between the adapter's request/response API with your React Router app.
465
+ * It is only applicable if you are using a custom server adapter.
466
+ */
467
+ context: Context;
468
+ }
469
+ /**
470
+ * Route middleware `next` function to call downstream handlers and then complete
471
+ * middlewares from the bottom-up
472
+ */
473
+ interface MiddlewareNextFunction<Result = unknown> {
474
+ (): Promise<Result>;
475
+ }
476
+ /**
477
+ * Route middleware function signature. Receives the same "data" arguments as a
478
+ * `loader`/`action` (`request`, `params`, `context`) as the first parameter and
479
+ * a `next` function as the second parameter which will call downstream handlers
480
+ * and then complete middlewares from the bottom-up
481
+ */
482
+ type MiddlewareFunction<Result = unknown> = (args: DataFunctionArgs<Readonly<RouterContextProvider>>, next: MiddlewareNextFunction<Result>) => MaybePromise<Result | void>;
483
+ /**
484
+ * Arguments passed to loader functions
485
+ */
486
+ interface LoaderFunctionArgs<Context = DefaultContext> extends DataFunctionArgs<Context> {
487
+ }
488
+ /**
489
+ * Arguments passed to action functions
490
+ */
491
+ interface ActionFunctionArgs<Context = DefaultContext> extends DataFunctionArgs<Context> {
492
+ }
493
+ /**
494
+ * Loaders and actions can return anything
495
+ */
496
+ type DataFunctionValue = unknown;
497
+ type DataFunctionReturnValue = MaybePromise<DataFunctionValue>;
498
+ /**
499
+ * Route loader function signature
500
+ */
501
+ type LoaderFunction<Context = DefaultContext> = {
502
+ (args: LoaderFunctionArgs<Context>, handlerCtx?: unknown): DataFunctionReturnValue;
503
+ } & {
504
+ hydrate?: boolean;
505
+ };
506
+ /**
507
+ * Route action function signature
508
+ */
509
+ interface ActionFunction<Context = DefaultContext> {
510
+ (args: ActionFunctionArgs<Context>, handlerCtx?: unknown): DataFunctionReturnValue;
511
+ }
512
+ /**
513
+ * Arguments passed to shouldRevalidate function
514
+ */
515
+ interface ShouldRevalidateFunctionArgs {
516
+ /** This is the url the navigation started from. You can compare it with `nextUrl` to decide if you need to revalidate this route's data. */
517
+ currentUrl: URL;
518
+ /** These are the {@link https://reactrouter.com/start/framework/routing#dynamic-segments dynamic route params} from the URL that can be compared to the `nextParams` to decide if you need to reload or not. Perhaps you're using only a partial piece of the param for data loading, you don't need to revalidate if a superfluous part of the param changed. */
519
+ currentParams: AgnosticDataRouteMatch["params"];
520
+ /** In the case of navigation, this the URL the user is requesting. Some revalidations are not navigation, so it will simply be the same as currentUrl. */
521
+ nextUrl: URL;
522
+ /** In the case of navigation, these are the {@link https://reactrouter.com/start/framework/routing#dynamic-segments dynamic route params} from the next location the user is requesting. Some revalidations are not navigation, so it will simply be the same as currentParams. */
523
+ nextParams: AgnosticDataRouteMatch["params"];
524
+ /** The method (probably `"GET"` or `"POST"`) used in the form submission that triggered the revalidation. */
525
+ formMethod?: Submission["formMethod"];
526
+ /** The form action (`<Form action="/somewhere">`) that triggered the revalidation. */
527
+ formAction?: Submission["formAction"];
528
+ /** The form encType (`<Form encType="application/x-www-form-urlencoded">) used in the form submission that triggered the revalidation*/
529
+ formEncType?: Submission["formEncType"];
530
+ /** The form submission data when the form's encType is `text/plain` */
531
+ text?: Submission["text"];
532
+ /** The form submission data when the form's encType is `application/x-www-form-urlencoded` or `multipart/form-data` */
533
+ formData?: Submission["formData"];
534
+ /** The form submission data when the form's encType is `application/json` */
535
+ json?: Submission["json"];
536
+ /** The status code of the action response */
537
+ actionStatus?: number;
538
+ /**
539
+ * When a submission causes the revalidation this will be the result of the action—either action data or an error if the action failed. It's common to include some information in the action result to instruct shouldRevalidate to revalidate or not.
540
+ *
541
+ * @example
542
+ * export async function action() {
543
+ * await saveSomeStuff();
544
+ * return { ok: true };
545
+ * }
546
+ *
547
+ * export function shouldRevalidate({
548
+ * actionResult,
549
+ * }) {
550
+ * if (actionResult?.ok) {
551
+ * return false;
552
+ * }
553
+ * return true;
554
+ * }
555
+ */
556
+ actionResult?: any;
557
+ /**
558
+ * By default, React Router doesn't call every loader all the time. There are reliable optimizations it can make by default. For example, only loaders with changing params are called. Consider navigating from the following URL to the one below it:
559
+ *
560
+ * /projects/123/tasks/abc
561
+ * /projects/123/tasks/def
562
+ * React Router will only call the loader for tasks/def because the param for projects/123 didn't change.
563
+ *
564
+ * It's safest to always return defaultShouldRevalidate after you've done your specific optimizations that return false, otherwise your UI might get out of sync with your data on the server.
565
+ */
566
+ defaultShouldRevalidate: boolean;
567
+ }
568
+ /**
569
+ * Route shouldRevalidate function signature. This runs after any submission
570
+ * (navigation or fetcher), so we flatten the navigation/fetcher submission
571
+ * onto the arguments. It shouldn't matter whether it came from a navigation
572
+ * or a fetcher, what really matters is the URLs and the formData since loaders
573
+ * have to re-run based on the data models that were potentially mutated.
574
+ */
575
+ interface ShouldRevalidateFunction {
576
+ (args: ShouldRevalidateFunctionArgs): boolean;
577
+ }
578
+ interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
579
+ /**
580
+ * @private
581
+ */
582
+ _lazyPromises?: {
583
+ middleware: Promise<void> | undefined;
584
+ handler: Promise<void> | undefined;
585
+ route: Promise<void> | undefined;
586
+ };
587
+ /**
588
+ * @deprecated Deprecated in favor of `shouldCallHandler`
589
+ *
590
+ * A boolean value indicating whether this route handler should be called in
591
+ * this pass.
592
+ *
593
+ * The `matches` array always includes _all_ matched routes even when only
594
+ * _some_ route handlers need to be called so that things like middleware can
595
+ * be implemented.
596
+ *
597
+ * `shouldLoad` is usually only interesting if you are skipping the route
598
+ * handler entirely and implementing custom handler logic - since it lets you
599
+ * determine if that custom logic should run for this route or not.
600
+ *
601
+ * For example:
602
+ * - If you are on `/parent/child/a` and you navigate to `/parent/child/b` -
603
+ * you'll get an array of three matches (`[parent, child, b]`), but only `b`
604
+ * will have `shouldLoad=true` because the data for `parent` and `child` is
605
+ * already loaded
606
+ * - If you are on `/parent/child/a` and you submit to `a`'s [`action`](https://reactrouter.com/docs/start/data/route-object#action),
607
+ * then only `a` will have `shouldLoad=true` for the action execution of
608
+ * `dataStrategy`
609
+ * - After the [`action`](https://reactrouter.com/docs/start/data/route-object#action),
610
+ * `dataStrategy` will be called again for the [`loader`](https://reactrouter.com/docs/start/data/route-object#loader)
611
+ * revalidation, and all matches will have `shouldLoad=true` (assuming no
612
+ * custom `shouldRevalidate` implementations)
613
+ */
614
+ shouldLoad: boolean;
615
+ /**
616
+ * Arguments passed to the `shouldRevalidate` function for this `loader` execution.
617
+ * Will be `null` if this is not a revalidating loader {@link DataStrategyMatch}.
618
+ */
619
+ shouldRevalidateArgs: ShouldRevalidateFunctionArgs | null;
620
+ /**
621
+ * Determine if this route's handler should be called during this `dataStrategy`
622
+ * execution. Calling it with no arguments will leverage the default revalidation
623
+ * behavior. You can pass your own `defaultShouldRevalidate` value if you wish
624
+ * to change the default revalidation behavior with your `dataStrategy`.
625
+ *
626
+ * @param defaultShouldRevalidate `defaultShouldRevalidate` override value (optional)
627
+ */
628
+ shouldCallHandler(defaultShouldRevalidate?: boolean): boolean;
629
+ /**
630
+ * An async function that will resolve any `route.lazy` implementations and
631
+ * execute the route's handler (if necessary), returning a {@link DataStrategyResult}
632
+ *
633
+ * - Calling `match.resolve` does not mean you're calling the
634
+ * [`action`](https://reactrouter.com/docs/start/data/route-object#action)/[`loader`](https://reactrouter.com/docs/start/data/route-object#loader)
635
+ * (the "handler") - `resolve` will only call the `handler` internally if
636
+ * needed _and_ if you don't pass your own `handlerOverride` function parameter
637
+ * - It is safe to call `match.resolve` for all matches, even if they have
638
+ * `shouldLoad=false`, and it will no-op if no loading is required
639
+ * - You should generally always call `match.resolve()` for `shouldLoad:true`
640
+ * routes to ensure that any `route.lazy` implementations are processed
641
+ * - See the examples below for how to implement custom handler execution via
642
+ * `match.resolve`
643
+ */
644
+ resolve: (handlerOverride?: (handler: (ctx?: unknown) => DataFunctionReturnValue) => DataFunctionReturnValue) => Promise<DataStrategyResult>;
645
+ }
646
+ interface DataStrategyFunctionArgs<Context = DefaultContext> extends DataFunctionArgs<Context> {
647
+ /**
648
+ * Matches for this route extended with Data strategy APIs
649
+ */
650
+ matches: DataStrategyMatch[];
651
+ runClientMiddleware: (cb: DataStrategyFunction<Context>) => Promise<Record<string, DataStrategyResult>>;
652
+ /**
653
+ * The key of the fetcher we are calling `dataStrategy` for, otherwise `null`
654
+ * for navigational executions
655
+ */
656
+ fetcherKey: string | null;
657
+ }
658
+ /**
659
+ * Result from a loader or action called via dataStrategy
660
+ */
661
+ interface DataStrategyResult {
662
+ type: "data" | "error";
663
+ result: unknown;
664
+ }
665
+ interface DataStrategyFunction<Context = DefaultContext> {
666
+ (args: DataStrategyFunctionArgs<Context>): Promise<Record<string, DataStrategyResult>>;
667
+ }
668
+ type AgnosticPatchRoutesOnNavigationFunctionArgs<O extends AgnosticRouteObject = AgnosticRouteObject, M extends AgnosticRouteMatch = AgnosticRouteMatch> = {
669
+ signal: AbortSignal;
670
+ path: string;
671
+ matches: M[];
672
+ fetcherKey: string | undefined;
673
+ patch: (routeId: string | null, children: O[]) => void;
674
+ };
675
+ type AgnosticPatchRoutesOnNavigationFunction<O extends AgnosticRouteObject = AgnosticRouteObject, M extends AgnosticRouteMatch = AgnosticRouteMatch> = (opts: AgnosticPatchRoutesOnNavigationFunctionArgs<O, M>) => MaybePromise<void>;
676
+ /**
677
+ * Function provided by the framework-aware layers to set any framework-specific
678
+ * properties from framework-agnostic properties
679
+ */
680
+ interface MapRoutePropertiesFunction {
681
+ (route: AgnosticDataRouteObject): {
682
+ hasErrorBoundary: boolean;
683
+ } & Record<string, any>;
684
+ }
685
+ /**
686
+ * Keys we cannot change from within a lazy object. We spread all other keys
687
+ * onto the route. Either they're meaningful to the router, or they'll get
688
+ * ignored.
689
+ */
690
+ type UnsupportedLazyRouteObjectKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children";
691
+ /**
692
+ * Keys we cannot change from within a lazy() function. We spread all other keys
693
+ * onto the route. Either they're meaningful to the router, or they'll get
694
+ * ignored.
695
+ */
696
+ type UnsupportedLazyRouteFunctionKey = UnsupportedLazyRouteObjectKey | "middleware";
697
+ /**
698
+ * lazy object to load route properties, which can add non-matching
699
+ * related properties to a route
700
+ */
701
+ type LazyRouteObject<R extends AgnosticRouteObject> = {
702
+ [K in keyof R as K extends UnsupportedLazyRouteObjectKey ? never : K]?: () => Promise<R[K] | null | undefined>;
703
+ };
704
+ /**
705
+ * lazy() function to load a route definition, which can add non-matching
706
+ * related properties to a route
707
+ */
708
+ interface LazyRouteFunction<R extends AgnosticRouteObject> {
709
+ (): Promise<Omit<R, UnsupportedLazyRouteFunctionKey> & Partial<Record<UnsupportedLazyRouteFunctionKey, never>>>;
710
+ }
711
+ type LazyRouteDefinition<R extends AgnosticRouteObject> = LazyRouteObject<R> | LazyRouteFunction<R>;
712
+ /**
713
+ * Base RouteObject with common props shared by all types of routes
714
+ */
715
+ type AgnosticBaseRouteObject = {
716
+ caseSensitive?: boolean;
717
+ path?: string;
718
+ id?: string;
719
+ middleware?: MiddlewareFunction[];
720
+ loader?: LoaderFunction | boolean;
721
+ action?: ActionFunction | boolean;
722
+ hasErrorBoundary?: boolean;
723
+ shouldRevalidate?: ShouldRevalidateFunction;
724
+ handle?: any;
725
+ lazy?: LazyRouteDefinition<AgnosticBaseRouteObject>;
726
+ };
727
+ /**
728
+ * Index routes must not have children
729
+ */
730
+ type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {
731
+ children?: undefined;
732
+ index: true;
733
+ };
734
+ /**
735
+ * Non-index routes may have children, but cannot have index
736
+ */
737
+ type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {
738
+ children?: AgnosticRouteObject[];
739
+ index?: false;
740
+ };
741
+ /**
742
+ * A route object represents a logical route, with (optionally) its child
743
+ * routes organized in a tree-like structure.
744
+ */
745
+ type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
746
+ type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
747
+ id: string;
748
+ };
749
+ type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
750
+ children?: AgnosticDataRouteObject[];
751
+ id: string;
752
+ };
753
+ /**
754
+ * A data route object, which is just a RouteObject with a required unique ID
755
+ */
756
+ type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
757
+ type RouteManifest<R = AgnosticDataRouteObject> = Record<string, R | undefined>;
758
+ type Regex_az = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
759
+ type Regez_AZ = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z";
760
+ type Regex_09 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
761
+ type Regex_w = Regex_az | Regez_AZ | Regex_09 | "_";
762
+ type ParamChar = Regex_w | "-";
763
+ type RegexMatchPlus<CharPattern extends string, T extends string> = T extends `${infer First}${infer Rest}` ? First extends CharPattern ? RegexMatchPlus<CharPattern, Rest> extends never ? First : `${First}${RegexMatchPlus<CharPattern, Rest>}` : never : never;
764
+ type _PathParam<Path extends string> = Path extends `${infer L}/${infer R}` ? _PathParam<L> | _PathParam<R> : Path extends `:${infer Param}` ? Param extends `${infer Optional}?${string}` ? RegexMatchPlus<ParamChar, Optional> : RegexMatchPlus<ParamChar, Param> : never;
765
+ type PathParam<Path extends string> = Path extends "*" | "/*" ? "*" : Path extends `${infer Rest}/*` ? "*" | _PathParam<Rest> : _PathParam<Path>;
766
+ type ParamParseKey<Segment extends string> = [
767
+ PathParam<Segment>
768
+ ] extends [never] ? string : PathParam<Segment>;
769
+ /**
770
+ * The parameters that were parsed from the URL path.
771
+ */
772
+ type Params<Key extends string = string> = {
773
+ readonly [key in Key]: string | undefined;
774
+ };
775
+ /**
776
+ * A RouteMatch contains info about how a route matched a URL.
777
+ */
778
+ interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
779
+ /**
780
+ * The names and values of dynamic parameters in the URL.
781
+ */
782
+ params: Params<ParamKey>;
783
+ /**
784
+ * The portion of the URL pathname that was matched.
785
+ */
786
+ pathname: string;
787
+ /**
788
+ * The portion of the URL pathname that was matched before child routes.
789
+ */
790
+ pathnameBase: string;
791
+ /**
792
+ * The route object that was used to match.
793
+ */
794
+ route: RouteObjectType;
795
+ }
796
+ interface AgnosticDataRouteMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
797
+ }
798
+ /**
799
+ * Matches the given routes to a location and returns the match data.
800
+ *
801
+ * @example
802
+ * import { matchRoutes } from "react-router";
803
+ *
804
+ * let routes = [{
805
+ * path: "/",
806
+ * Component: Root,
807
+ * children: [{
808
+ * path: "dashboard",
809
+ * Component: Dashboard,
810
+ * }]
811
+ * }];
812
+ *
813
+ * matchRoutes(routes, "/dashboard"); // [rootMatch, dashboardMatch]
814
+ *
815
+ * @public
816
+ * @category Utils
817
+ * @param routes The array of route objects to match against.
818
+ * @param locationArg The location to match against, either a string path or a
819
+ * partial {@link Location} object
820
+ * @param basename Optional base path to strip from the location before matching.
821
+ * Defaults to `/`.
822
+ * @returns An array of matched routes, or `null` if no matches were found.
823
+ */
824
+ declare function matchRoutes<RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject>(routes: RouteObjectType[], locationArg: Partial<Location> | string, basename?: string): AgnosticRouteMatch<string, RouteObjectType>[] | null;
825
+ interface UIMatch<Data = unknown, Handle = unknown> {
826
+ id: string;
827
+ pathname: string;
828
+ /**
829
+ * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the matched route.
830
+ */
831
+ params: AgnosticRouteMatch["params"];
832
+ /**
833
+ * The return value from the matched route's loader or clientLoader. This might
834
+ * be `undefined` if this route's `loader` (or a deeper route's `loader`) threw
835
+ * an error and we're currently displaying an `ErrorBoundary`.
836
+ *
837
+ * @deprecated Use `UIMatch.loaderData` instead
838
+ */
839
+ data: Data | undefined;
840
+ /**
841
+ * The return value from the matched route's loader or clientLoader. This might
842
+ * be `undefined` if this route's `loader` (or a deeper route's `loader`) threw
843
+ * an error and we're currently displaying an `ErrorBoundary`.
844
+ */
845
+ loaderData: Data | undefined;
846
+ /**
847
+ * The {@link https://reactrouter.com/start/framework/route-module#handle handle object}
848
+ * exported from the matched route module
849
+ */
850
+ handle: Handle;
851
+ }
852
+ /**
853
+ * Returns a path with params interpolated.
854
+ *
855
+ * @example
856
+ * import { generatePath } from "react-router";
857
+ *
858
+ * generatePath("/users/:id", { id: "123" }); // "/users/123"
859
+ *
860
+ * @public
861
+ * @category Utils
862
+ * @param originalPath The original path to generate.
863
+ * @param params The parameters to interpolate into the path.
864
+ * @returns The generated path with parameters interpolated.
865
+ */
866
+ declare function generatePath<Path extends string>(originalPath: Path, params?: {
867
+ [key in PathParam<Path>]: string | null;
868
+ }): string;
869
+ /**
870
+ * Used to match on some portion of a URL pathname.
871
+ */
872
+ interface PathPattern<Path extends string = string> {
873
+ /**
874
+ * A string to match against a URL pathname. May contain `:id`-style segments
875
+ * to indicate placeholders for dynamic parameters. It May also end with `/*`
876
+ * to indicate matching the rest of the URL pathname.
877
+ */
878
+ path: Path;
879
+ /**
880
+ * Should be `true` if the static portions of the `path` should be matched in
881
+ * the same case.
882
+ */
883
+ caseSensitive?: boolean;
884
+ /**
885
+ * Should be `true` if this pattern should match the entire URL pathname.
886
+ */
887
+ end?: boolean;
888
+ }
889
+ /**
890
+ * Contains info about how a {@link PathPattern} matched on a URL pathname.
891
+ */
892
+ interface PathMatch<ParamKey extends string = string> {
893
+ /**
894
+ * The names and values of dynamic parameters in the URL.
895
+ */
896
+ params: Params<ParamKey>;
897
+ /**
898
+ * The portion of the URL pathname that was matched.
899
+ */
900
+ pathname: string;
901
+ /**
902
+ * The portion of the URL pathname that was matched before child routes.
903
+ */
904
+ pathnameBase: string;
905
+ /**
906
+ * The pattern that was used to match.
907
+ */
908
+ pattern: PathPattern;
909
+ }
910
+ /**
911
+ * Performs pattern matching on a URL pathname and returns information about
912
+ * the match.
913
+ *
914
+ * @public
915
+ * @category Utils
916
+ * @param pattern The pattern to match against the URL pathname. This can be a
917
+ * string or a {@link PathPattern} object. If a string is provided, it will be
918
+ * treated as a pattern with `caseSensitive` set to `false` and `end` set to
919
+ * `true`.
920
+ * @param pathname The URL pathname to match against the pattern.
921
+ * @returns A path match object if the pattern matches the pathname,
922
+ * or `null` if it does not match.
923
+ */
924
+ declare function matchPath<ParamKey extends ParamParseKey<Path>, Path extends string>(pattern: PathPattern<Path> | Path, pathname: string): PathMatch<ParamKey> | null;
925
+ /**
926
+ * Returns a resolved {@link Path} object relative to the given pathname.
927
+ *
928
+ * @public
929
+ * @category Utils
930
+ * @param to The path to resolve, either a string or a partial {@link Path}
931
+ * object.
932
+ * @param fromPathname The pathname to resolve the path from. Defaults to `/`.
933
+ * @returns A {@link Path} object with the resolved pathname, search, and hash.
934
+ */
935
+ declare function resolvePath(to: To, fromPathname?: string): Path;
936
+ declare class DataWithResponseInit<D> {
937
+ type: string;
938
+ data: D;
939
+ init: ResponseInit | null;
940
+ constructor(data: D, init?: ResponseInit);
941
+ }
942
+ /**
943
+ * Create "responses" that contain `headers`/`status` without forcing
944
+ * serialization into an actual [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
945
+ *
946
+ * @example
947
+ * import { data } from "react-router";
948
+ *
949
+ * export async function action({ request }: Route.ActionArgs) {
950
+ * let formData = await request.formData();
951
+ * let item = await createItem(formData);
952
+ * return data(item, {
953
+ * headers: { "X-Custom-Header": "value" }
954
+ * status: 201,
955
+ * });
956
+ * }
957
+ *
958
+ * @public
959
+ * @category Utils
960
+ * @mode framework
961
+ * @mode data
962
+ * @param data The data to be included in the response.
963
+ * @param init The status code or a `ResponseInit` object to be included in the
964
+ * response.
965
+ * @returns A {@link DataWithResponseInit} instance containing the data and
966
+ * response init.
967
+ */
968
+ declare function data<D>(data: D, init?: number | ResponseInit): DataWithResponseInit<D>;
969
+ interface TrackedPromise extends Promise<any> {
970
+ _tracked?: boolean;
971
+ _data?: any;
972
+ _error?: any;
973
+ }
974
+ type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
975
+ /**
976
+ * A redirect [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response).
977
+ * Sets the status code and the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
978
+ * header. Defaults to [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302).
979
+ *
980
+ * @example
981
+ * import { redirect } from "react-router";
982
+ *
983
+ * export async function loader({ request }: Route.LoaderArgs) {
984
+ * if (!isLoggedIn(request))
985
+ * throw redirect("/login");
986
+ * }
987
+ *
988
+ * // ...
989
+ * }
990
+ *
991
+ * @public
992
+ * @category Utils
993
+ * @mode framework
994
+ * @mode data
995
+ * @param url The URL to redirect to.
996
+ * @param init The status code or a `ResponseInit` object to be included in the
997
+ * response.
998
+ * @returns A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
999
+ * object with the redirect status and [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
1000
+ * header.
1001
+ */
1002
+ declare const redirect: RedirectFunction;
1003
+ /**
1004
+ * A redirect [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
1005
+ * that will force a document reload to the new location. Sets the status code
1006
+ * and the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
1007
+ * header. Defaults to [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302).
1008
+ *
1009
+ * ```tsx filename=routes/logout.tsx
1010
+ * import { redirectDocument } from "react-router";
1011
+ *
1012
+ * import { destroySession } from "../sessions.server";
1013
+ *
1014
+ * export async function action({ request }: Route.ActionArgs) {
1015
+ * let session = await getSession(request.headers.get("Cookie"));
1016
+ * return redirectDocument("/", {
1017
+ * headers: { "Set-Cookie": await destroySession(session) }
1018
+ * });
1019
+ * }
1020
+ * ```
1021
+ *
1022
+ * @public
1023
+ * @category Utils
1024
+ * @mode framework
1025
+ * @mode data
1026
+ * @param url The URL to redirect to.
1027
+ * @param init The status code or a `ResponseInit` object to be included in the
1028
+ * response.
1029
+ * @returns A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
1030
+ * object with the redirect status and [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
1031
+ * header.
1032
+ */
1033
+ declare const redirectDocument: RedirectFunction;
1034
+ /**
1035
+ * A redirect [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
1036
+ * that will perform a [`history.replaceState`](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState)
1037
+ * instead of a [`history.pushState`](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState)
1038
+ * for client-side navigation redirects. Sets the status code and the [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
1039
+ * header. Defaults to [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302).
1040
+ *
1041
+ * @example
1042
+ * import { replace } from "react-router";
1043
+ *
1044
+ * export async function loader() {
1045
+ * return replace("/new-location");
1046
+ * }
1047
+ *
1048
+ * @public
1049
+ * @category Utils
1050
+ * @mode framework
1051
+ * @mode data
1052
+ * @param url The URL to redirect to.
1053
+ * @param init The status code or a `ResponseInit` object to be included in the
1054
+ * response.
1055
+ * @returns A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
1056
+ * object with the redirect status and [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
1057
+ * header.
1058
+ */
1059
+ declare const replace: RedirectFunction;
1060
+ type ErrorResponse = {
1061
+ status: number;
1062
+ statusText: string;
1063
+ data: any;
1064
+ };
1065
+ declare class ErrorResponseImpl implements ErrorResponse {
1066
+ status: number;
1067
+ statusText: string;
1068
+ data: any;
1069
+ private error?;
1070
+ private internal;
1071
+ constructor(status: number, statusText: string | undefined, data: any, internal?: boolean);
1072
+ }
1073
+ /**
1074
+ * Check if the given error is an {@link ErrorResponse} generated from a 4xx/5xx
1075
+ * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
1076
+ * thrown from an [`action`](../../start/framework/route-module#action) or
1077
+ * [`loader`](../../start/framework/route-module#loader) function.
1078
+ *
1079
+ * @example
1080
+ * import { isRouteErrorResponse } from "react-router";
1081
+ *
1082
+ * export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
1083
+ * if (isRouteErrorResponse(error)) {
1084
+ * return (
1085
+ * <>
1086
+ * <p>Error: `${error.status}: ${error.statusText}`</p>
1087
+ * <p>{error.data}</p>
1088
+ * </>
1089
+ * );
1090
+ * }
1091
+ *
1092
+ * return (
1093
+ * <p>Error: {error instanceof Error ? error.message : "Unknown Error"}</p>
1094
+ * );
1095
+ * }
1096
+ *
1097
+ * @public
1098
+ * @category Utils
1099
+ * @mode framework
1100
+ * @mode data
1101
+ * @param error The error to check.
1102
+ * @returns `true` if the error is an {@link ErrorResponse}, `false` otherwise.
1103
+ */
1104
+ declare function isRouteErrorResponse(error: any): error is ErrorResponse;
1105
+
1106
+ /**
1107
+ * An object of unknown type for route loaders and actions provided by the
1108
+ * server's `getLoadContext()` function. This is defined as an empty interface
1109
+ * specifically so apps can leverage declaration merging to augment this type
1110
+ * globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
1111
+ */
1112
+ interface AppLoadContext {
1113
+ [key: string]: unknown;
1114
+ }
1115
+
1116
+ declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {
1117
+ hasErrorBoundary: boolean;
1118
+ };
1119
+ declare const hydrationRouteProperties: (keyof RouteObject)[];
1120
+ /**
1121
+ * @category Data Routers
1122
+ */
1123
+ interface MemoryRouterOpts {
1124
+ /**
1125
+ * Basename path for the application.
1126
+ */
1127
+ basename?: string;
1128
+ /**
1129
+ * A function that returns an {@link RouterContextProvider} instance
1130
+ * which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
1131
+ * [`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
1132
+ * This function is called to generate a fresh `context` instance on each
1133
+ * navigation or fetcher call.
1134
+ */
1135
+ getContext?: RouterInit["getContext"];
1136
+ /**
1137
+ * Future flags to enable for the router.
1138
+ */
1139
+ future?: Partial<FutureConfig>;
1140
+ /**
1141
+ * Hydration data to initialize the router with if you have already performed
1142
+ * data loading on the server.
1143
+ */
1144
+ hydrationData?: HydrationState;
1145
+ /**
1146
+ * Initial entries in the in-memory history stack
1147
+ */
1148
+ initialEntries?: InitialEntry[];
1149
+ /**
1150
+ * Index of `initialEntries` the application should initialize to
1151
+ */
1152
+ initialIndex?: number;
1153
+ /**
1154
+ * Array of instrumentation objects allowing you to instrument the router and
1155
+ * individual routes prior to router initialization (and on any subsequently
1156
+ * added routes via `route.lazy` or `patchRoutesOnNavigation`). This is
1157
+ * mostly useful for observability such as wrapping navigations, fetches,
1158
+ * as well as route loaders/actions/middlewares with logging and/or performance
1159
+ * tracing. See the [docs](../../how-to/instrumentation) for more information.
1160
+ *
1161
+ * ```tsx
1162
+ * let router = createBrowserRouter(routes, {
1163
+ * unstable_instrumentations: [logging]
1164
+ * });
1165
+ *
1166
+ *
1167
+ * let logging = {
1168
+ * router({ instrument }) {
1169
+ * instrument({
1170
+ * navigate: (impl, info) => logExecution(`navigate ${info.to}`, impl),
1171
+ * fetch: (impl, info) => logExecution(`fetch ${info.to}`, impl)
1172
+ * });
1173
+ * },
1174
+ * route({ instrument, id }) {
1175
+ * instrument({
1176
+ * middleware: (impl, info) => logExecution(
1177
+ * `middleware ${info.request.url} (route ${id})`,
1178
+ * impl
1179
+ * ),
1180
+ * loader: (impl, info) => logExecution(
1181
+ * `loader ${info.request.url} (route ${id})`,
1182
+ * impl
1183
+ * ),
1184
+ * action: (impl, info) => logExecution(
1185
+ * `action ${info.request.url} (route ${id})`,
1186
+ * impl
1187
+ * ),
1188
+ * })
1189
+ * }
1190
+ * };
1191
+ *
1192
+ * async function logExecution(label: string, impl: () => Promise<void>) {
1193
+ * let start = performance.now();
1194
+ * console.log(`start ${label}`);
1195
+ * await impl();
1196
+ * let duration = Math.round(performance.now() - start);
1197
+ * console.log(`end ${label} (${duration}ms)`);
1198
+ * }
1199
+ * ```
1200
+ */
1201
+ unstable_instrumentations?: unstable_ClientInstrumentation[];
1202
+ /**
1203
+ * Override the default data strategy of running loaders in parallel -
1204
+ * see the [docs](../../how-to/data-strategy) for more information.
1205
+ *
1206
+ * ```tsx
1207
+ * let router = createBrowserRouter(routes, {
1208
+ * async dataStrategy({
1209
+ * matches,
1210
+ * request,
1211
+ * runClientMiddleware,
1212
+ * }) {
1213
+ * const matchesToLoad = matches.filter((m) =>
1214
+ * m.shouldCallHandler(),
1215
+ * );
1216
+ *
1217
+ * const results: Record<string, DataStrategyResult> = {};
1218
+ * await runClientMiddleware(() =>
1219
+ * Promise.all(
1220
+ * matchesToLoad.map(async (match) => {
1221
+ * results[match.route.id] = await match.resolve();
1222
+ * }),
1223
+ * ),
1224
+ * );
1225
+ * return results;
1226
+ * },
1227
+ * });
1228
+ * ```
1229
+ */
1230
+ dataStrategy?: DataStrategyFunction;
1231
+ /**
1232
+ * Lazily define portions of the route tree on navigations.
1233
+ */
1234
+ patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
1235
+ }
1236
+ /**
1237
+ * Create a new {@link DataRouter} that manages the application path using an
1238
+ * in-memory [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
1239
+ * stack. Useful for non-browser environments without a DOM API.
1240
+ *
1241
+ * @public
1242
+ * @category Data Routers
1243
+ * @mode data
1244
+ * @param routes Application routes
1245
+ * @param opts Options
1246
+ * @param {MemoryRouterOpts.basename} opts.basename n/a
1247
+ * @param {MemoryRouterOpts.dataStrategy} opts.dataStrategy n/a
1248
+ * @param {MemoryRouterOpts.future} opts.future n/a
1249
+ * @param {MemoryRouterOpts.getContext} opts.getContext n/a
1250
+ * @param {MemoryRouterOpts.hydrationData} opts.hydrationData n/a
1251
+ * @param {MemoryRouterOpts.initialEntries} opts.initialEntries n/a
1252
+ * @param {MemoryRouterOpts.initialIndex} opts.initialIndex n/a
1253
+ * @param {MemoryRouterOpts.unstable_instrumentations} opts.unstable_instrumentations n/a
1254
+ * @param {MemoryRouterOpts.patchRoutesOnNavigation} opts.patchRoutesOnNavigation n/a
1255
+ * @returns An initialized {@link DataRouter} to pass to {@link RouterProvider | `<RouterProvider>`}
1256
+ */
1257
+ declare function createMemoryRouter(routes: RouteObject[], opts?: MemoryRouterOpts): Router;
1258
+ /**
1259
+ * Function signature for client side error handling for loader/actions errors
1260
+ * and rendering errors via `componentDidCatch`
1261
+ */
1262
+ interface ClientOnErrorFunction {
1263
+ (error: unknown, info: {
1264
+ location: Location;
1265
+ params: Params;
1266
+ unstable_pattern: string;
1267
+ errorInfo?: React.ErrorInfo;
1268
+ }): void;
1269
+ }
1270
+ /**
1271
+ * @category Types
1272
+ */
1273
+ interface RouterProviderProps {
1274
+ /**
1275
+ * The {@link DataRouter} instance to use for navigation and data fetching.
1276
+ */
1277
+ router: Router;
1278
+ /**
1279
+ * The [`ReactDOM.flushSync`](https://react.dev/reference/react-dom/flushSync)
1280
+ * implementation to use for flushing updates.
1281
+ *
1282
+ * You usually don't have to worry about this:
1283
+ * - The `RouterProvider` exported from `react-router/dom` handles this internally for you
1284
+ * - If you are rendering in a non-DOM environment, you can import
1285
+ * `RouterProvider` from `react-router` and ignore this prop
1286
+ */
1287
+ flushSync?: (fn: () => unknown) => undefined;
1288
+ /**
1289
+ * An error handler function that will be called for any middleware, loader, action,
1290
+ * or render errors that are encountered in your application. This is useful for
1291
+ * logging or reporting errors instead of in the {@link ErrorBoundary} because it's not
1292
+ * subject to re-rendering and will only run one time per error.
1293
+ *
1294
+ * The `errorInfo` parameter is passed along from
1295
+ * [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
1296
+ * and is only present for render errors.
1297
+ *
1298
+ * ```tsx
1299
+ * <RouterProvider onError=(error, info) => {
1300
+ * let { location, params, unstable_pattern, errorInfo } = info;
1301
+ * console.error(error, location, errorInfo);
1302
+ * reportToErrorService(error, location, errorInfo);
1303
+ * }} />
1304
+ * ```
1305
+ */
1306
+ onError?: ClientOnErrorFunction;
1307
+ /**
1308
+ * Control whether router state updates are internally wrapped in
1309
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1310
+ *
1311
+ * - When left `undefined`, all state updates are wrapped in
1312
+ * `React.startTransition`
1313
+ * - This can lead to buggy behaviors if you are wrapping your own
1314
+ * navigations/fetchers in `startTransition`.
1315
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1316
+ * in `React.startTransition` and router state changes will be wrapped in
1317
+ * `React.startTransition` and also sent through
1318
+ * [`useOptimistic`](https://react.dev/reference/react/useOptimistic) to
1319
+ * surface mid-navigation router state changes to the UI.
1320
+ * - When set to `false`, the router will not leverage `React.startTransition` or
1321
+ * `React.useOptimistic` on any navigations or state changes.
1322
+ *
1323
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1324
+ */
1325
+ unstable_useTransitions?: boolean;
1326
+ }
1327
+ /**
1328
+ * Render the UI for the given {@link DataRouter}. This component should
1329
+ * typically be at the top of an app's element tree.
1330
+ *
1331
+ * ```tsx
1332
+ * import { createBrowserRouter } from "react-router";
1333
+ * import { RouterProvider } from "react-router/dom";
1334
+ * import { createRoot } from "react-dom/client";
1335
+ *
1336
+ * const router = createBrowserRouter(routes);
1337
+ * createRoot(document.getElementById("root")).render(
1338
+ * <RouterProvider router={router} />
1339
+ * );
1340
+ * ```
1341
+ *
1342
+ * <docs-info>Please note that this component is exported both from
1343
+ * `react-router` and `react-router/dom` with the only difference being that the
1344
+ * latter automatically wires up `react-dom`'s [`flushSync`](https://react.dev/reference/react-dom/flushSync)
1345
+ * implementation. You _almost always_ want to use the version from
1346
+ * `react-router/dom` unless you're running in a non-DOM environment.</docs-info>
1347
+ *
1348
+ *
1349
+ * @public
1350
+ * @category Data Routers
1351
+ * @mode data
1352
+ * @param props Props
1353
+ * @param {RouterProviderProps.flushSync} props.flushSync n/a
1354
+ * @param {RouterProviderProps.onError} props.onError n/a
1355
+ * @param {RouterProviderProps.router} props.router n/a
1356
+ * @param {RouterProviderProps.unstable_useTransitions} props.unstable_useTransitions n/a
1357
+ * @returns React element for the rendered router
1358
+ */
1359
+ declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl, onError, unstable_useTransitions, }: RouterProviderProps): React.ReactElement;
1360
+ /**
1361
+ * @category Types
1362
+ */
1363
+ interface MemoryRouterProps {
1364
+ /**
1365
+ * Application basename
1366
+ */
1367
+ basename?: string;
1368
+ /**
1369
+ * Nested {@link Route} elements describing the route tree
1370
+ */
1371
+ children?: React.ReactNode;
1372
+ /**
1373
+ * Initial entries in the in-memory history stack
1374
+ */
1375
+ initialEntries?: InitialEntry[];
1376
+ /**
1377
+ * Index of `initialEntries` the application should initialize to
1378
+ */
1379
+ initialIndex?: number;
1380
+ /**
1381
+ * Control whether router state updates are internally wrapped in
1382
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1383
+ *
1384
+ * - When left `undefined`, all router state updates are wrapped in
1385
+ * `React.startTransition`
1386
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1387
+ * in `React.startTransition` and all router state updates are wrapped in
1388
+ * `React.startTransition`
1389
+ * - When set to `false`, the router will not leverage `React.startTransition`
1390
+ * on any navigations or state changes.
1391
+ *
1392
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1393
+ */
1394
+ unstable_useTransitions?: boolean;
1395
+ }
1396
+ /**
1397
+ * A declarative {@link Router | `<Router>`} that stores all entries in memory.
1398
+ *
1399
+ * @public
1400
+ * @category Declarative Routers
1401
+ * @mode declarative
1402
+ * @param props Props
1403
+ * @param {MemoryRouterProps.basename} props.basename n/a
1404
+ * @param {MemoryRouterProps.children} props.children n/a
1405
+ * @param {MemoryRouterProps.initialEntries} props.initialEntries n/a
1406
+ * @param {MemoryRouterProps.initialIndex} props.initialIndex n/a
1407
+ * @param {MemoryRouterProps.unstable_useTransitions} props.unstable_useTransitions n/a
1408
+ * @returns A declarative in-memory {@link Router | `<Router>`} for client-side
1409
+ * routing.
1410
+ */
1411
+ declare function MemoryRouter({ basename, children, initialEntries, initialIndex, unstable_useTransitions, }: MemoryRouterProps): React.ReactElement;
1412
+ /**
1413
+ * @category Types
1414
+ */
1415
+ interface NavigateProps {
1416
+ /**
1417
+ * The path to navigate to. This can be a string or a {@link Path} object
1418
+ */
1419
+ to: To;
1420
+ /**
1421
+ * Whether to replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
1422
+ * stack
1423
+ */
1424
+ replace?: boolean;
1425
+ /**
1426
+ * State to pass to the new {@link Location} to store in [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state).
1427
+ */
1428
+ state?: any;
1429
+ /**
1430
+ * How to interpret relative routing in the `to` prop.
1431
+ * See {@link RelativeRoutingType}.
1432
+ */
1433
+ relative?: RelativeRoutingType;
1434
+ }
1435
+ /**
1436
+ * A component-based version of {@link useNavigate} to use in a
1437
+ * [`React.Component` class](https://react.dev/reference/react/Component) where
1438
+ * hooks cannot be used.
1439
+ *
1440
+ * It's recommended to avoid using this component in favor of {@link useNavigate}.
1441
+ *
1442
+ * @example
1443
+ * <Navigate to="/tasks" />
1444
+ *
1445
+ * @public
1446
+ * @category Components
1447
+ * @param props Props
1448
+ * @param {NavigateProps.relative} props.relative n/a
1449
+ * @param {NavigateProps.replace} props.replace n/a
1450
+ * @param {NavigateProps.state} props.state n/a
1451
+ * @param {NavigateProps.to} props.to n/a
1452
+ * @returns {void}
1453
+ *
1454
+ */
1455
+ declare function Navigate({ to, replace, state, relative, }: NavigateProps): null;
1456
+ /**
1457
+ * @category Types
1458
+ */
1459
+ interface OutletProps {
1460
+ /**
1461
+ * Provides a context value to the element tree below the outlet. Use when
1462
+ * the parent route needs to provide values to child routes.
1463
+ *
1464
+ * ```tsx
1465
+ * <Outlet context={myContextValue} />
1466
+ * ```
1467
+ *
1468
+ * Access the context with {@link useOutletContext}.
1469
+ */
1470
+ context?: unknown;
1471
+ }
1472
+ /**
1473
+ * Renders the matching child route of a parent route or nothing if no child
1474
+ * route matches.
1475
+ *
1476
+ * @example
1477
+ * import { Outlet } from "react-router";
1478
+ *
1479
+ * export default function SomeParent() {
1480
+ * return (
1481
+ * <div>
1482
+ * <h1>Parent Content</h1>
1483
+ * <Outlet />
1484
+ * </div>
1485
+ * );
1486
+ * }
1487
+ *
1488
+ * @public
1489
+ * @category Components
1490
+ * @param props Props
1491
+ * @param {OutletProps.context} props.context n/a
1492
+ * @returns React element for the rendered outlet or `null` if no child route matches.
1493
+ */
1494
+ declare function Outlet(props: OutletProps): React.ReactElement | null;
1495
+ /**
1496
+ * @category Types
1497
+ */
1498
+ interface PathRouteProps {
1499
+ /**
1500
+ * Whether the path should be case-sensitive. Defaults to `false`.
1501
+ */
1502
+ caseSensitive?: NonIndexRouteObject["caseSensitive"];
1503
+ /**
1504
+ * The path pattern to match. If unspecified or empty, then this becomes a
1505
+ * layout route.
1506
+ */
1507
+ path?: NonIndexRouteObject["path"];
1508
+ /**
1509
+ * The unique identifier for this route (for use with {@link DataRouter}s)
1510
+ */
1511
+ id?: NonIndexRouteObject["id"];
1512
+ /**
1513
+ * A function that returns a promise that resolves to the route object.
1514
+ * Used for code-splitting routes.
1515
+ * See [`lazy`](../../start/data/route-object#lazy).
1516
+ */
1517
+ lazy?: LazyRouteFunction<NonIndexRouteObject>;
1518
+ /**
1519
+ * The route middleware.
1520
+ * See [`middleware`](../../start/data/route-object#middleware).
1521
+ */
1522
+ middleware?: NonIndexRouteObject["middleware"];
1523
+ /**
1524
+ * The route loader.
1525
+ * See [`loader`](../../start/data/route-object#loader).
1526
+ */
1527
+ loader?: NonIndexRouteObject["loader"];
1528
+ /**
1529
+ * The route action.
1530
+ * See [`action`](../../start/data/route-object#action).
1531
+ */
1532
+ action?: NonIndexRouteObject["action"];
1533
+ hasErrorBoundary?: NonIndexRouteObject["hasErrorBoundary"];
1534
+ /**
1535
+ * The route shouldRevalidate function.
1536
+ * See [`shouldRevalidate`](../../start/data/route-object#shouldRevalidate).
1537
+ */
1538
+ shouldRevalidate?: NonIndexRouteObject["shouldRevalidate"];
1539
+ /**
1540
+ * The route handle.
1541
+ */
1542
+ handle?: NonIndexRouteObject["handle"];
1543
+ /**
1544
+ * Whether this is an index route.
1545
+ */
1546
+ index?: false;
1547
+ /**
1548
+ * Child Route components
1549
+ */
1550
+ children?: React.ReactNode;
1551
+ /**
1552
+ * The React element to render when this Route matches.
1553
+ * Mutually exclusive with `Component`.
1554
+ */
1555
+ element?: React.ReactNode | null;
1556
+ /**
1557
+ * The React element to render while this router is loading data.
1558
+ * Mutually exclusive with `HydrateFallback`.
1559
+ */
1560
+ hydrateFallbackElement?: React.ReactNode | null;
1561
+ /**
1562
+ * The React element to render at this route if an error occurs.
1563
+ * Mutually exclusive with `ErrorBoundary`.
1564
+ */
1565
+ errorElement?: React.ReactNode | null;
1566
+ /**
1567
+ * The React Component to render when this route matches.
1568
+ * Mutually exclusive with `element`.
1569
+ */
1570
+ Component?: React.ComponentType | null;
1571
+ /**
1572
+ * The React Component to render while this router is loading data.
1573
+ * Mutually exclusive with `hydrateFallbackElement`.
1574
+ */
1575
+ HydrateFallback?: React.ComponentType | null;
1576
+ /**
1577
+ * The React Component to render at this route if an error occurs.
1578
+ * Mutually exclusive with `errorElement`.
1579
+ */
1580
+ ErrorBoundary?: React.ComponentType | null;
1581
+ }
1582
+ /**
1583
+ * @category Types
1584
+ */
1585
+ interface LayoutRouteProps extends PathRouteProps {
1586
+ }
1587
+ /**
1588
+ * @category Types
1589
+ */
1590
+ interface IndexRouteProps {
1591
+ /**
1592
+ * Whether the path should be case-sensitive. Defaults to `false`.
1593
+ */
1594
+ caseSensitive?: IndexRouteObject["caseSensitive"];
1595
+ /**
1596
+ * The path pattern to match. If unspecified or empty, then this becomes a
1597
+ * layout route.
1598
+ */
1599
+ path?: IndexRouteObject["path"];
1600
+ /**
1601
+ * The unique identifier for this route (for use with {@link DataRouter}s)
1602
+ */
1603
+ id?: IndexRouteObject["id"];
1604
+ /**
1605
+ * A function that returns a promise that resolves to the route object.
1606
+ * Used for code-splitting routes.
1607
+ * See [`lazy`](../../start/data/route-object#lazy).
1608
+ */
1609
+ lazy?: LazyRouteFunction<IndexRouteObject>;
1610
+ /**
1611
+ * The route middleware.
1612
+ * See [`middleware`](../../start/data/route-object#middleware).
1613
+ */
1614
+ middleware?: IndexRouteObject["middleware"];
1615
+ /**
1616
+ * The route loader.
1617
+ * See [`loader`](../../start/data/route-object#loader).
1618
+ */
1619
+ loader?: IndexRouteObject["loader"];
1620
+ /**
1621
+ * The route action.
1622
+ * See [`action`](../../start/data/route-object#action).
1623
+ */
1624
+ action?: IndexRouteObject["action"];
1625
+ hasErrorBoundary?: IndexRouteObject["hasErrorBoundary"];
1626
+ /**
1627
+ * The route shouldRevalidate function.
1628
+ * See [`shouldRevalidate`](../../start/data/route-object#shouldRevalidate).
1629
+ */
1630
+ shouldRevalidate?: IndexRouteObject["shouldRevalidate"];
1631
+ /**
1632
+ * The route handle.
1633
+ */
1634
+ handle?: IndexRouteObject["handle"];
1635
+ /**
1636
+ * Whether this is an index route.
1637
+ */
1638
+ index: true;
1639
+ /**
1640
+ * Child Route components
1641
+ */
1642
+ children?: undefined;
1643
+ /**
1644
+ * The React element to render when this Route matches.
1645
+ * Mutually exclusive with `Component`.
1646
+ */
1647
+ element?: React.ReactNode | null;
1648
+ /**
1649
+ * The React element to render while this router is loading data.
1650
+ * Mutually exclusive with `HydrateFallback`.
1651
+ */
1652
+ hydrateFallbackElement?: React.ReactNode | null;
1653
+ /**
1654
+ * The React element to render at this route if an error occurs.
1655
+ * Mutually exclusive with `ErrorBoundary`.
1656
+ */
1657
+ errorElement?: React.ReactNode | null;
1658
+ /**
1659
+ * The React Component to render when this route matches.
1660
+ * Mutually exclusive with `element`.
1661
+ */
1662
+ Component?: React.ComponentType | null;
1663
+ /**
1664
+ * The React Component to render while this router is loading data.
1665
+ * Mutually exclusive with `hydrateFallbackElement`.
1666
+ */
1667
+ HydrateFallback?: React.ComponentType | null;
1668
+ /**
1669
+ * The React Component to render at this route if an error occurs.
1670
+ * Mutually exclusive with `errorElement`.
1671
+ */
1672
+ ErrorBoundary?: React.ComponentType | null;
1673
+ }
1674
+ type RouteProps = PathRouteProps | LayoutRouteProps | IndexRouteProps;
1675
+ /**
1676
+ * Configures an element to render when a pattern matches the current location.
1677
+ * It must be rendered within a {@link Routes} element. Note that these routes
1678
+ * do not participate in data loading, actions, code splitting, or any other
1679
+ * route module features.
1680
+ *
1681
+ * @example
1682
+ * // Usually used in a declarative router
1683
+ * function App() {
1684
+ * return (
1685
+ * <BrowserRouter>
1686
+ * <Routes>
1687
+ * <Route index element={<StepOne />} />
1688
+ * <Route path="step-2" element={<StepTwo />} />
1689
+ * <Route path="step-3" element={<StepThree />} />
1690
+ * </Routes>
1691
+ * </BrowserRouter>
1692
+ * );
1693
+ * }
1694
+ *
1695
+ * // But can be used with a data router as well if you prefer the JSX notation
1696
+ * const routes = createRoutesFromElements(
1697
+ * <>
1698
+ * <Route index loader={step1Loader} Component={StepOne} />
1699
+ * <Route path="step-2" loader={step2Loader} Component={StepTwo} />
1700
+ * <Route path="step-3" loader={step3Loader} Component={StepThree} />
1701
+ * </>
1702
+ * );
1703
+ *
1704
+ * const router = createBrowserRouter(routes);
1705
+ *
1706
+ * function App() {
1707
+ * return <RouterProvider router={router} />;
1708
+ * }
1709
+ *
1710
+ * @public
1711
+ * @category Components
1712
+ * @param props Props
1713
+ * @param {PathRouteProps.action} props.action n/a
1714
+ * @param {PathRouteProps.caseSensitive} props.caseSensitive n/a
1715
+ * @param {PathRouteProps.Component} props.Component n/a
1716
+ * @param {PathRouteProps.children} props.children n/a
1717
+ * @param {PathRouteProps.element} props.element n/a
1718
+ * @param {PathRouteProps.ErrorBoundary} props.ErrorBoundary n/a
1719
+ * @param {PathRouteProps.errorElement} props.errorElement n/a
1720
+ * @param {PathRouteProps.handle} props.handle n/a
1721
+ * @param {PathRouteProps.HydrateFallback} props.HydrateFallback n/a
1722
+ * @param {PathRouteProps.hydrateFallbackElement} props.hydrateFallbackElement n/a
1723
+ * @param {PathRouteProps.id} props.id n/a
1724
+ * @param {PathRouteProps.index} props.index n/a
1725
+ * @param {PathRouteProps.lazy} props.lazy n/a
1726
+ * @param {PathRouteProps.loader} props.loader n/a
1727
+ * @param {PathRouteProps.path} props.path n/a
1728
+ * @param {PathRouteProps.shouldRevalidate} props.shouldRevalidate n/a
1729
+ * @returns {void}
1730
+ */
1731
+ declare function Route(props: RouteProps): React.ReactElement | null;
1732
+ /**
1733
+ * @category Types
1734
+ */
1735
+ interface RouterProps {
1736
+ /**
1737
+ * The base path for the application. This is prepended to all locations
1738
+ */
1739
+ basename?: string;
1740
+ /**
1741
+ * Nested {@link Route} elements describing the route tree
1742
+ */
1743
+ children?: React.ReactNode;
1744
+ /**
1745
+ * The location to match against. Defaults to the current location.
1746
+ * This can be a string or a {@link Location} object.
1747
+ */
1748
+ location: Partial<Location> | string;
1749
+ /**
1750
+ * The type of navigation that triggered this `location` change.
1751
+ * Defaults to {@link NavigationType.Pop}.
1752
+ */
1753
+ navigationType?: Action;
1754
+ /**
1755
+ * The navigator to use for navigation. This is usually a history object
1756
+ * or a custom navigator that implements the {@link Navigator} interface.
1757
+ */
1758
+ navigator: Navigator;
1759
+ /**
1760
+ * Whether this router is static or not (used for SSR). If `true`, the router
1761
+ * will not be reactive to location changes.
1762
+ */
1763
+ static?: boolean;
1764
+ /**
1765
+ * Control whether router state updates are internally wrapped in
1766
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1767
+ *
1768
+ * - When left `undefined`, all router state updates are wrapped in
1769
+ * `React.startTransition`
1770
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1771
+ * in `React.startTransition` and all router state updates are wrapped in
1772
+ * `React.startTransition`
1773
+ * - When set to `false`, the router will not leverage `React.startTransition`
1774
+ * on any navigations or state changes.
1775
+ *
1776
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1777
+ */
1778
+ unstable_useTransitions?: boolean;
1779
+ }
1780
+ /**
1781
+ * Provides location context for the rest of the app.
1782
+ *
1783
+ * Note: You usually won't render a `<Router>` directly. Instead, you'll render a
1784
+ * router that is more specific to your environment such as a {@link BrowserRouter}
1785
+ * in web browsers or a {@link ServerRouter} for server rendering.
1786
+ *
1787
+ * @public
1788
+ * @category Declarative Routers
1789
+ * @mode declarative
1790
+ * @param props Props
1791
+ * @param {RouterProps.basename} props.basename n/a
1792
+ * @param {RouterProps.children} props.children n/a
1793
+ * @param {RouterProps.location} props.location n/a
1794
+ * @param {RouterProps.navigationType} props.navigationType n/a
1795
+ * @param {RouterProps.navigator} props.navigator n/a
1796
+ * @param {RouterProps.static} props.static n/a
1797
+ * @param {RouterProps.unstable_useTransitions} props.unstable_useTransitions n/a
1798
+ * @returns React element for the rendered router or `null` if the location does
1799
+ * not match the {@link props.basename}
1800
+ */
1801
+ declare function Router$1({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, unstable_useTransitions, }: RouterProps): React.ReactElement | null;
1802
+ /**
1803
+ * @category Types
1804
+ */
1805
+ interface RoutesProps {
1806
+ /**
1807
+ * Nested {@link Route} elements
1808
+ */
1809
+ children?: React.ReactNode;
1810
+ /**
1811
+ * The {@link Location} to match against. Defaults to the current location.
1812
+ */
1813
+ location?: Partial<Location> | string;
1814
+ }
1815
+ /**
1816
+ * Renders a branch of {@link Route | `<Route>`s} that best matches the current
1817
+ * location. Note that these routes do not participate in [data loading](../../start/framework/route-module#loader),
1818
+ * [`action`](../../start/framework/route-module#action), code splitting, or
1819
+ * any other [route module](../../start/framework/route-module) features.
1820
+ *
1821
+ * @example
1822
+ * import { Route, Routes } from "react-router";
1823
+ *
1824
+ * <Routes>
1825
+ * <Route index element={<StepOne />} />
1826
+ * <Route path="step-2" element={<StepTwo />} />
1827
+ * <Route path="step-3" element={<StepThree />} />
1828
+ * </Routes>
1829
+ *
1830
+ * @public
1831
+ * @category Components
1832
+ * @param props Props
1833
+ * @param {RoutesProps.children} props.children n/a
1834
+ * @param {RoutesProps.location} props.location n/a
1835
+ * @returns React element for the rendered routes or `null` if no route matches
1836
+ */
1837
+ declare function Routes({ children, location, }: RoutesProps): React.ReactElement | null;
1838
+ interface AwaitResolveRenderFunction<Resolve = any> {
1839
+ (data: Awaited<Resolve>): React.ReactNode;
1840
+ }
1841
+ /**
1842
+ * @category Types
1843
+ */
1844
+ interface AwaitProps<Resolve> {
1845
+ /**
1846
+ * When using a function, the resolved value is provided as the parameter.
1847
+ *
1848
+ * ```tsx [2]
1849
+ * <Await resolve={reviewsPromise}>
1850
+ * {(resolvedReviews) => <Reviews items={resolvedReviews} />}
1851
+ * </Await>
1852
+ * ```
1853
+ *
1854
+ * When using React elements, {@link useAsyncValue} will provide the
1855
+ * resolved value:
1856
+ *
1857
+ * ```tsx [2]
1858
+ * <Await resolve={reviewsPromise}>
1859
+ * <Reviews />
1860
+ * </Await>
1861
+ *
1862
+ * function Reviews() {
1863
+ * const resolvedReviews = useAsyncValue();
1864
+ * return <div>...</div>;
1865
+ * }
1866
+ * ```
1867
+ */
1868
+ children: React.ReactNode | AwaitResolveRenderFunction<Resolve>;
1869
+ /**
1870
+ * The error element renders instead of the `children` when the [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
1871
+ * rejects.
1872
+ *
1873
+ * ```tsx
1874
+ * <Await
1875
+ * errorElement={<div>Oops</div>}
1876
+ * resolve={reviewsPromise}
1877
+ * >
1878
+ * <Reviews />
1879
+ * </Await>
1880
+ * ```
1881
+ *
1882
+ * To provide a more contextual error, you can use the {@link useAsyncError} in a
1883
+ * child component
1884
+ *
1885
+ * ```tsx
1886
+ * <Await
1887
+ * errorElement={<ReviewsError />}
1888
+ * resolve={reviewsPromise}
1889
+ * >
1890
+ * <Reviews />
1891
+ * </Await>
1892
+ *
1893
+ * function ReviewsError() {
1894
+ * const error = useAsyncError();
1895
+ * return <div>Error loading reviews: {error.message}</div>;
1896
+ * }
1897
+ * ```
1898
+ *
1899
+ * If you do not provide an `errorElement`, the rejected value will bubble up
1900
+ * to the nearest route-level [`ErrorBoundary`](../../start/framework/route-module#errorboundary)
1901
+ * and be accessible via the {@link useRouteError} hook.
1902
+ */
1903
+ errorElement?: React.ReactNode;
1904
+ /**
1905
+ * Takes a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
1906
+ * returned from a [`loader`](../../start/framework/route-module#loader) to be
1907
+ * resolved and rendered.
1908
+ *
1909
+ * ```tsx
1910
+ * import { Await, useLoaderData } from "react-router";
1911
+ *
1912
+ * export async function loader() {
1913
+ * let reviews = getReviews(); // not awaited
1914
+ * let book = await getBook();
1915
+ * return {
1916
+ * book,
1917
+ * reviews, // this is a promise
1918
+ * };
1919
+ * }
1920
+ *
1921
+ * export default function Book() {
1922
+ * const {
1923
+ * book,
1924
+ * reviews, // this is the same promise
1925
+ * } = useLoaderData();
1926
+ *
1927
+ * return (
1928
+ * <div>
1929
+ * <h1>{book.title}</h1>
1930
+ * <p>{book.description}</p>
1931
+ * <React.Suspense fallback={<ReviewsSkeleton />}>
1932
+ * <Await
1933
+ * // and is the promise we pass to Await
1934
+ * resolve={reviews}
1935
+ * >
1936
+ * <Reviews />
1937
+ * </Await>
1938
+ * </React.Suspense>
1939
+ * </div>
1940
+ * );
1941
+ * }
1942
+ * ```
1943
+ */
1944
+ resolve: Resolve;
1945
+ }
1946
+ /**
1947
+ * Used to render promise values with automatic error handling.
1948
+ *
1949
+ * **Note:** `<Await>` expects to be rendered inside a [`<React.Suspense>`](https://react.dev/reference/react/Suspense)
1950
+ *
1951
+ * @example
1952
+ * import { Await, useLoaderData } from "react-router";
1953
+ *
1954
+ * export async function loader() {
1955
+ * // not awaited
1956
+ * const reviews = getReviews();
1957
+ * // awaited (blocks the transition)
1958
+ * const book = await fetch("/api/book").then((res) => res.json());
1959
+ * return { book, reviews };
1960
+ * }
1961
+ *
1962
+ * function Book() {
1963
+ * const { book, reviews } = useLoaderData();
1964
+ * return (
1965
+ * <div>
1966
+ * <h1>{book.title}</h1>
1967
+ * <p>{book.description}</p>
1968
+ * <React.Suspense fallback={<ReviewsSkeleton />}>
1969
+ * <Await
1970
+ * resolve={reviews}
1971
+ * errorElement={
1972
+ * <div>Could not load reviews 😬</div>
1973
+ * }
1974
+ * children={(resolvedReviews) => (
1975
+ * <Reviews items={resolvedReviews} />
1976
+ * )}
1977
+ * />
1978
+ * </React.Suspense>
1979
+ * </div>
1980
+ * );
1981
+ * }
1982
+ *
1983
+ * @public
1984
+ * @category Components
1985
+ * @mode framework
1986
+ * @mode data
1987
+ * @param props Props
1988
+ * @param {AwaitProps.children} props.children n/a
1989
+ * @param {AwaitProps.errorElement} props.errorElement n/a
1990
+ * @param {AwaitProps.resolve} props.resolve n/a
1991
+ * @returns React element for the rendered awaited value
1992
+ */
1993
+ declare function Await<Resolve>({ children, errorElement, resolve, }: AwaitProps<Resolve>): React.JSX.Element;
1994
+ /**
1995
+ * Creates a route config from a React "children" object, which is usually
1996
+ * either a `<Route>` element or an array of them. Used internally by
1997
+ * `<Routes>` to create a route config from its children.
1998
+ *
1999
+ * @category Utils
2000
+ * @mode data
2001
+ * @param children The React children to convert into a route config
2002
+ * @param parentPath The path of the parent route, used to generate unique IDs.
2003
+ * @returns An array of {@link RouteObject}s that can be used with a {@link DataRouter}
2004
+ */
2005
+ declare function createRoutesFromChildren(children: React.ReactNode, parentPath?: number[]): RouteObject[];
2006
+ /**
2007
+ * Create route objects from JSX elements instead of arrays of objects.
2008
+ *
2009
+ * @example
2010
+ * const routes = createRoutesFromElements(
2011
+ * <>
2012
+ * <Route index loader={step1Loader} Component={StepOne} />
2013
+ * <Route path="step-2" loader={step2Loader} Component={StepTwo} />
2014
+ * <Route path="step-3" loader={step3Loader} Component={StepThree} />
2015
+ * </>
2016
+ * );
2017
+ *
2018
+ * const router = createBrowserRouter(routes);
2019
+ *
2020
+ * function App() {
2021
+ * return <RouterProvider router={router} />;
2022
+ * }
2023
+ *
2024
+ * @name createRoutesFromElements
2025
+ * @public
2026
+ * @category Utils
2027
+ * @mode data
2028
+ * @param children The React children to convert into a route config
2029
+ * @param parentPath The path of the parent route, used to generate unique IDs.
2030
+ * This is used for internal recursion and is not intended to be used by the
2031
+ * application developer.
2032
+ * @returns An array of {@link RouteObject}s that can be used with a {@link DataRouter}
2033
+ */
2034
+ declare const createRoutesFromElements: typeof createRoutesFromChildren;
2035
+ /**
2036
+ * Renders the result of {@link matchRoutes} into a React element.
2037
+ *
2038
+ * @public
2039
+ * @category Utils
2040
+ * @param matches The array of {@link RouteMatch | route matches} to render
2041
+ * @returns A React element that renders the matched routes or `null` if no matches
2042
+ */
2043
+ declare function renderMatches(matches: RouteMatch[] | null): React.ReactElement | null;
2044
+ declare function useRouteComponentProps(): {
2045
+ params: Readonly<Params<string>>;
2046
+ loaderData: any;
2047
+ actionData: any;
2048
+ matches: UIMatch<unknown, unknown>[];
2049
+ };
2050
+ type RouteComponentProps = ReturnType<typeof useRouteComponentProps>;
2051
+ type RouteComponentType = React.ComponentType<RouteComponentProps>;
2052
+ declare function WithComponentProps({ children, }: {
2053
+ children: React.ReactElement;
2054
+ }): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
2055
+ declare function withComponentProps(Component: RouteComponentType): () => React.ReactElement<{
2056
+ params: Readonly<Params<string>>;
2057
+ loaderData: any;
2058
+ actionData: any;
2059
+ matches: UIMatch<unknown, unknown>[];
2060
+ }, string | React.JSXElementConstructor<any>>;
2061
+ declare function useHydrateFallbackProps(): {
2062
+ params: Readonly<Params<string>>;
2063
+ loaderData: any;
2064
+ actionData: any;
2065
+ };
2066
+ type HydrateFallbackProps = ReturnType<typeof useHydrateFallbackProps>;
2067
+ type HydrateFallbackType = React.ComponentType<HydrateFallbackProps>;
2068
+ declare function WithHydrateFallbackProps({ children, }: {
2069
+ children: React.ReactElement;
2070
+ }): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
2071
+ declare function withHydrateFallbackProps(HydrateFallback: HydrateFallbackType): () => React.ReactElement<{
2072
+ params: Readonly<Params<string>>;
2073
+ loaderData: any;
2074
+ actionData: any;
2075
+ }, string | React.JSXElementConstructor<any>>;
2076
+ declare function useErrorBoundaryProps(): {
2077
+ params: Readonly<Params<string>>;
2078
+ loaderData: any;
2079
+ actionData: any;
2080
+ error: unknown;
2081
+ };
2082
+ type ErrorBoundaryProps = ReturnType<typeof useErrorBoundaryProps>;
2083
+ type ErrorBoundaryType = React.ComponentType<ErrorBoundaryProps>;
2084
+ declare function WithErrorBoundaryProps({ children, }: {
2085
+ children: React.ReactElement;
2086
+ }): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
2087
+ declare function withErrorBoundaryProps(ErrorBoundary: ErrorBoundaryType): () => React.ReactElement<{
2088
+ params: Readonly<Params<string>>;
2089
+ loaderData: any;
2090
+ actionData: any;
2091
+ error: unknown;
2092
+ }, string | React.JSXElementConstructor<any>>;
2093
+
2094
+ interface IndexRouteObject {
2095
+ caseSensitive?: AgnosticIndexRouteObject["caseSensitive"];
2096
+ path?: AgnosticIndexRouteObject["path"];
2097
+ id?: AgnosticIndexRouteObject["id"];
2098
+ middleware?: AgnosticIndexRouteObject["middleware"];
2099
+ loader?: AgnosticIndexRouteObject["loader"];
2100
+ action?: AgnosticIndexRouteObject["action"];
2101
+ hasErrorBoundary?: AgnosticIndexRouteObject["hasErrorBoundary"];
2102
+ shouldRevalidate?: AgnosticIndexRouteObject["shouldRevalidate"];
2103
+ handle?: AgnosticIndexRouteObject["handle"];
2104
+ index: true;
2105
+ children?: undefined;
2106
+ element?: React.ReactNode | null;
2107
+ hydrateFallbackElement?: React.ReactNode | null;
2108
+ errorElement?: React.ReactNode | null;
2109
+ Component?: React.ComponentType | null;
2110
+ HydrateFallback?: React.ComponentType | null;
2111
+ ErrorBoundary?: React.ComponentType | null;
2112
+ lazy?: LazyRouteDefinition<RouteObject>;
2113
+ }
2114
+ interface NonIndexRouteObject {
2115
+ caseSensitive?: AgnosticNonIndexRouteObject["caseSensitive"];
2116
+ path?: AgnosticNonIndexRouteObject["path"];
2117
+ id?: AgnosticNonIndexRouteObject["id"];
2118
+ middleware?: AgnosticNonIndexRouteObject["middleware"];
2119
+ loader?: AgnosticNonIndexRouteObject["loader"];
2120
+ action?: AgnosticNonIndexRouteObject["action"];
2121
+ hasErrorBoundary?: AgnosticNonIndexRouteObject["hasErrorBoundary"];
2122
+ shouldRevalidate?: AgnosticNonIndexRouteObject["shouldRevalidate"];
2123
+ handle?: AgnosticNonIndexRouteObject["handle"];
2124
+ index?: false;
2125
+ children?: RouteObject[];
2126
+ element?: React.ReactNode | null;
2127
+ hydrateFallbackElement?: React.ReactNode | null;
2128
+ errorElement?: React.ReactNode | null;
2129
+ Component?: React.ComponentType | null;
2130
+ HydrateFallback?: React.ComponentType | null;
2131
+ ErrorBoundary?: React.ComponentType | null;
2132
+ lazy?: LazyRouteDefinition<RouteObject>;
2133
+ }
2134
+ type RouteObject = IndexRouteObject | NonIndexRouteObject;
2135
+ type DataRouteObject = RouteObject & {
2136
+ children?: DataRouteObject[];
2137
+ id: string;
2138
+ };
2139
+ interface RouteMatch<ParamKey extends string = string, RouteObjectType extends RouteObject = RouteObject> extends AgnosticRouteMatch<ParamKey, RouteObjectType> {
2140
+ }
2141
+ interface DataRouteMatch extends RouteMatch<string, DataRouteObject> {
2142
+ }
2143
+ type PatchRoutesOnNavigationFunctionArgs = AgnosticPatchRoutesOnNavigationFunctionArgs<RouteObject, RouteMatch>;
2144
+ type PatchRoutesOnNavigationFunction = AgnosticPatchRoutesOnNavigationFunction<RouteObject, RouteMatch>;
2145
+ interface DataRouterContextObject extends Omit<NavigationContextObject, "future" | "unstable_useTransitions"> {
2146
+ router: Router;
2147
+ staticContext?: StaticHandlerContext;
2148
+ onError?: ClientOnErrorFunction;
2149
+ }
2150
+ declare const DataRouterContext: React.Context<DataRouterContextObject | null>;
2151
+ declare const DataRouterStateContext: React.Context<RouterState | null>;
2152
+ type ViewTransitionContextObject = {
2153
+ isTransitioning: false;
2154
+ } | {
2155
+ isTransitioning: true;
2156
+ flushSync: boolean;
2157
+ currentLocation: Location;
2158
+ nextLocation: Location;
2159
+ };
2160
+ declare const ViewTransitionContext: React.Context<ViewTransitionContextObject>;
2161
+ type FetchersContextObject = Map<string, any>;
2162
+ declare const FetchersContext: React.Context<FetchersContextObject>;
2163
+ declare const AwaitContext: React.Context<TrackedPromise | null>;
2164
+ declare const AwaitContextProvider: (props: React.ComponentProps<typeof AwaitContext.Provider>) => React.FunctionComponentElement<React.ProviderProps<TrackedPromise | null>>;
2165
+ interface NavigateOptions {
2166
+ /** Replace the current entry in the history stack instead of pushing a new one */
2167
+ replace?: boolean;
2168
+ /** Adds persistent client side routing state to the next location */
2169
+ state?: any;
2170
+ /** If you are using {@link https://api.reactrouter.com/v7/functions/react_router.ScrollRestoration.html <ScrollRestoration>}, prevent the scroll position from being reset to the top of the window when navigating */
2171
+ preventScrollReset?: boolean;
2172
+ /** Defines the relative path behavior for the link. "route" will use the route hierarchy so ".." will remove all URL segments of the current route pattern while "path" will use the URL path so ".." will remove one URL segment. */
2173
+ relative?: RelativeRoutingType;
2174
+ /** Wraps the initial state update for this navigation in a {@link https://react.dev/reference/react-dom/flushSync ReactDOM.flushSync} call instead of the default {@link https://react.dev/reference/react/startTransition React.startTransition} */
2175
+ flushSync?: boolean;
2176
+ /** Enables a {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API View Transition} for this navigation by wrapping the final state update in `document.startViewTransition()`. If you need to apply specific styles for this view transition, you will also need to leverage the {@link https://api.reactrouter.com/v7/functions/react_router.useViewTransitionState.html useViewTransitionState()} hook. */
2177
+ viewTransition?: boolean;
2178
+ /** Specifies the default revalidation behavior after this submission */
2179
+ unstable_defaultShouldRevalidate?: boolean;
2180
+ }
2181
+ /**
2182
+ * A Navigator is a "location changer"; it's how you get to different locations.
2183
+ *
2184
+ * Every history instance conforms to the Navigator interface, but the
2185
+ * distinction is useful primarily when it comes to the low-level `<Router>` API
2186
+ * where both the location and a navigator must be provided separately in order
2187
+ * to avoid "tearing" that may occur in a suspense-enabled app if the action
2188
+ * and/or location were to be read directly from the history instance.
2189
+ */
2190
+ interface Navigator {
2191
+ createHref: History["createHref"];
2192
+ encodeLocation?: History["encodeLocation"];
2193
+ go: History["go"];
2194
+ push(to: To, state?: any, opts?: NavigateOptions): void;
2195
+ replace(to: To, state?: any, opts?: NavigateOptions): void;
2196
+ }
2197
+ interface NavigationContextObject {
2198
+ basename: string;
2199
+ navigator: Navigator;
2200
+ static: boolean;
2201
+ unstable_useTransitions: boolean | undefined;
2202
+ future: {};
2203
+ }
2204
+ declare const NavigationContext: React.Context<NavigationContextObject>;
2205
+ interface LocationContextObject {
2206
+ location: Location;
2207
+ navigationType: Action;
2208
+ }
2209
+ declare const LocationContext: React.Context<LocationContextObject>;
2210
+ interface RouteContextObject {
2211
+ outlet: React.ReactElement | null;
2212
+ matches: RouteMatch[];
2213
+ isDataRoute: boolean;
2214
+ }
2215
+ declare const RouteContext: React.Context<RouteContextObject>;
2216
+
2217
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
2218
+ type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
2219
+ interface HtmlLinkProps {
2220
+ /**
2221
+ * Address of the hyperlink
2222
+ */
2223
+ href?: string;
2224
+ /**
2225
+ * How the element handles crossorigin requests
2226
+ */
2227
+ crossOrigin?: "anonymous" | "use-credentials";
2228
+ /**
2229
+ * Relationship between the document containing the hyperlink and the destination resource
2230
+ */
2231
+ rel: LiteralUnion<"alternate" | "dns-prefetch" | "icon" | "manifest" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "search" | "stylesheet", string>;
2232
+ /**
2233
+ * Applicable media: "screen", "print", "(max-width: 764px)"
2234
+ */
2235
+ media?: string;
2236
+ /**
2237
+ * Integrity metadata used in Subresource Integrity checks
2238
+ */
2239
+ integrity?: string;
2240
+ /**
2241
+ * Language of the linked resource
2242
+ */
2243
+ hrefLang?: string;
2244
+ /**
2245
+ * Hint for the type of the referenced resource
2246
+ */
2247
+ type?: string;
2248
+ /**
2249
+ * Referrer policy for fetches initiated by the element
2250
+ */
2251
+ referrerPolicy?: "" | "no-referrer" | "no-referrer-when-downgrade" | "same-origin" | "origin" | "strict-origin" | "origin-when-cross-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
2252
+ /**
2253
+ * Sizes of the icons (for rel="icon")
2254
+ */
2255
+ sizes?: string;
2256
+ /**
2257
+ * Potential destination for a preload request (for rel="preload" and rel="modulepreload")
2258
+ */
2259
+ as?: LiteralUnion<"audio" | "audioworklet" | "document" | "embed" | "fetch" | "font" | "frame" | "iframe" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "serviceworker" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt", string>;
2260
+ /**
2261
+ * Color to use when customizing a site's icon (for rel="mask-icon")
2262
+ */
2263
+ color?: string;
2264
+ /**
2265
+ * Whether the link is disabled
2266
+ */
2267
+ disabled?: boolean;
2268
+ /**
2269
+ * The title attribute has special semantics on this element: Title of the link; CSS style sheet set name.
2270
+ */
2271
+ title?: string;
2272
+ /**
2273
+ * Images to use in different situations, e.g., high-resolution displays,
2274
+ * small monitors, etc. (for rel="preload")
2275
+ */
2276
+ imageSrcSet?: string;
2277
+ /**
2278
+ * Image sizes for different page layouts (for rel="preload")
2279
+ */
2280
+ imageSizes?: string;
2281
+ }
2282
+ interface HtmlLinkPreloadImage extends HtmlLinkProps {
2283
+ /**
2284
+ * Relationship between the document containing the hyperlink and the destination resource
2285
+ */
2286
+ rel: "preload";
2287
+ /**
2288
+ * Potential destination for a preload request (for rel="preload" and rel="modulepreload")
2289
+ */
2290
+ as: "image";
2291
+ /**
2292
+ * Address of the hyperlink
2293
+ */
2294
+ href?: string;
2295
+ /**
2296
+ * Images to use in different situations, e.g., high-resolution displays,
2297
+ * small monitors, etc. (for rel="preload")
2298
+ */
2299
+ imageSrcSet: string;
2300
+ /**
2301
+ * Image sizes for different page layouts (for rel="preload")
2302
+ */
2303
+ imageSizes?: string;
2304
+ }
2305
+ /**
2306
+ * Represents a `<link>` element.
2307
+ *
2308
+ * WHATWG Specification: https://html.spec.whatwg.org/multipage/semantics.html#the-link-element
2309
+ */
2310
+ type HtmlLinkDescriptor = (HtmlLinkProps & Pick<Required<HtmlLinkProps>, "href">) | (HtmlLinkPreloadImage & Pick<Required<HtmlLinkPreloadImage>, "imageSizes">) | (HtmlLinkPreloadImage & Pick<Required<HtmlLinkPreloadImage>, "href"> & {
2311
+ imageSizes?: never;
2312
+ });
2313
+ interface PageLinkDescriptor extends Omit<HtmlLinkDescriptor, "href" | "rel" | "type" | "sizes" | "imageSrcSet" | "imageSizes" | "as" | "color" | "title"> {
2314
+ /**
2315
+ * A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
2316
+ * attribute to render on the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
2317
+ * element
2318
+ */
2319
+ nonce?: string | undefined;
2320
+ /**
2321
+ * The absolute path of the page to prefetch, e.g. `/absolute/path`.
2322
+ */
2323
+ page: string;
2324
+ }
2325
+ type LinkDescriptor = HtmlLinkDescriptor | PageLinkDescriptor;
2326
+
2327
+ type Serializable = undefined | null | boolean | string | symbol | number | Array<Serializable> | {
2328
+ [key: PropertyKey]: Serializable;
2329
+ } | bigint | Date | URL | RegExp | Error | Map<Serializable, Serializable> | Set<Serializable> | Promise<Serializable>;
2330
+
2331
+ type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
2332
+ type IsAny<T> = 0 extends 1 & T ? true : false;
2333
+ type Func = (...args: any[]) => unknown;
2334
+ type Pretty<T> = {
2335
+ [K in keyof T]: T[K];
2336
+ } & {};
2337
+ type Normalize<T> = _Normalize<UnionKeys<T>, T>;
2338
+ type _Normalize<Key extends keyof any, T> = T extends infer U ? Pretty<{
2339
+ [K in Key as K extends keyof U ? undefined extends U[K] ? never : K : never]: K extends keyof U ? U[K] : never;
2340
+ } & {
2341
+ [K in Key as K extends keyof U ? undefined extends U[K] ? K : never : never]?: K extends keyof U ? U[K] : never;
2342
+ } & {
2343
+ [K in Key as K extends keyof U ? never : K]?: undefined;
2344
+ }> : never;
2345
+ type UnionKeys<T> = T extends any ? keyof T : never;
2346
+
2347
+ type RouteModule$1 = {
2348
+ meta?: Func;
2349
+ links?: Func;
2350
+ headers?: Func;
2351
+ loader?: Func;
2352
+ clientLoader?: Func;
2353
+ action?: Func;
2354
+ clientAction?: Func;
2355
+ HydrateFallback?: Func;
2356
+ default?: Func;
2357
+ ErrorBoundary?: Func;
2358
+ [key: string]: unknown;
2359
+ };
2360
+
2361
+ /**
2362
+ * A brand that can be applied to a type to indicate that it will serialize
2363
+ * to a specific type when transported to the client from a loader.
2364
+ * Only use this if you have additional serialization/deserialization logic
2365
+ * in your application.
2366
+ */
2367
+ type unstable_SerializesTo<T> = {
2368
+ unstable__ReactRouter_SerializesTo: [T];
2369
+ };
2370
+
2371
+ type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
2372
+ [K in keyof T]: Serialize<T[K]>;
2373
+ } : undefined;
2374
+ type VoidToUndefined<T> = Equal<T, void> extends true ? undefined : T;
2375
+ type DataFrom<T> = IsAny<T> extends true ? undefined : T extends Func ? VoidToUndefined<Awaited<ReturnType<T>>> : undefined;
2376
+ type ClientData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? U : T;
2377
+ type ServerData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? Serialize<U> : Serialize<T>;
2378
+ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
2379
+ type ClientDataFrom<T> = ClientData<DataFrom<T>>;
2380
+ type ClientDataFunctionArgs<Params> = {
2381
+ /**
2382
+ * A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the URL, the method, the "content-type" header, and the request body from the request.
2383
+ *
2384
+ * @note Because client data functions are called before a network request is made, the Request object does not include the headers which the browser automatically adds. React Router infers the "content-type" header from the enc-type of the form that performed the submission.
2385
+ **/
2386
+ request: Request;
2387
+ /**
2388
+ * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
2389
+ * @example
2390
+ * // app/routes.ts
2391
+ * route("teams/:teamId", "./team.tsx"),
2392
+ *
2393
+ * // app/team.tsx
2394
+ * export function clientLoader({
2395
+ * params,
2396
+ * }: Route.ClientLoaderArgs) {
2397
+ * params.teamId;
2398
+ * // ^ string
2399
+ * }
2400
+ **/
2401
+ params: Params;
2402
+ /**
2403
+ * Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
2404
+ * Mostly useful as a identifier to aggregate on for logging/tracing/etc.
2405
+ */
2406
+ unstable_pattern: string;
2407
+ /**
2408
+ * When `future.v8_middleware` is not enabled, this is undefined.
2409
+ *
2410
+ * When `future.v8_middleware` is enabled, this is an instance of
2411
+ * `RouterContextProvider` and can be used to access context values
2412
+ * from your route middlewares. You may pass in initial context values in your
2413
+ * `<HydratedRouter getContext>` prop
2414
+ */
2415
+ context: Readonly<RouterContextProvider>;
2416
+ };
2417
+ type ServerDataFunctionArgs<Params> = {
2418
+ /** A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read the url, method, headers (such as cookies), and request body from the request. */
2419
+ request: Request;
2420
+ /**
2421
+ * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
2422
+ * @example
2423
+ * // app/routes.ts
2424
+ * route("teams/:teamId", "./team.tsx"),
2425
+ *
2426
+ * // app/team.tsx
2427
+ * export function loader({
2428
+ * params,
2429
+ * }: Route.LoaderArgs) {
2430
+ * params.teamId;
2431
+ * // ^ string
2432
+ * }
2433
+ **/
2434
+ params: Params;
2435
+ /**
2436
+ * Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
2437
+ * Mostly useful as a identifier to aggregate on for logging/tracing/etc.
2438
+ */
2439
+ unstable_pattern: string;
2440
+ /**
2441
+ * Without `future.v8_middleware` enabled, this is the context passed in
2442
+ * to your server adapter's `getLoadContext` function. It's a way to bridge the
2443
+ * gap between the adapter's request/response API with your React Router app.
2444
+ * It is only applicable if you are using a custom server adapter.
2445
+ *
2446
+ * With `future.v8_middleware` enabled, this is an instance of
2447
+ * `RouterContextProvider` and can be used for type-safe access to
2448
+ * context value set in your route middlewares. If you are using a custom
2449
+ * server adapter, you may provide an initial set of context values from your
2450
+ * `getLoadContext` function.
2451
+ */
2452
+ context: MiddlewareEnabled extends true ? Readonly<RouterContextProvider> : AppLoadContext;
2453
+ };
2454
+ type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [
2455
+ ClientLoaderFunctionArgs | ClientActionFunctionArgs | ClientDataFunctionArgs<unknown>
2456
+ ] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
2457
+ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
2458
+ type IsHydrate<ClientLoader> = ClientLoader extends {
2459
+ hydrate: true;
2460
+ } ? true : ClientLoader extends {
2461
+ hydrate: false;
2462
+ } ? false : false;
2463
+ type GetLoaderData<T extends RouteModule$1> = _DataLoaderData<ServerDataFrom<T["loader"]>, ClientDataFrom<T["clientLoader"]>, IsHydrate<T["clientLoader"]>, T extends {
2464
+ HydrateFallback: Func;
2465
+ } ? true : false>;
2466
+ type _DataLoaderData<ServerLoaderData, ClientLoaderData, ClientLoaderHydrate extends boolean, HasHydrateFallback> = [
2467
+ HasHydrateFallback,
2468
+ ClientLoaderHydrate
2469
+ ] extends [true, true] ? IsDefined<ClientLoaderData> extends true ? ClientLoaderData : undefined : [
2470
+ IsDefined<ClientLoaderData>,
2471
+ IsDefined<ServerLoaderData>
2472
+ ] extends [true, true] ? ServerLoaderData | ClientLoaderData : IsDefined<ClientLoaderData> extends true ? ClientLoaderData : IsDefined<ServerLoaderData> extends true ? ServerLoaderData : undefined;
2473
+ type GetActionData<T extends RouteModule$1> = _DataActionData<ServerDataFrom<T["action"]>, ClientDataFrom<T["clientAction"]>>;
2474
+ type _DataActionData<ServerActionData, ClientActionData> = Awaited<[
2475
+ IsDefined<ServerActionData>,
2476
+ IsDefined<ClientActionData>
2477
+ ] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
2478
+
2479
+ interface RouteModules {
2480
+ [routeId: string]: RouteModule | undefined;
2481
+ }
2482
+ /**
2483
+ * The shape of a route module shipped to the client
2484
+ */
2485
+ interface RouteModule {
2486
+ clientAction?: ClientActionFunction;
2487
+ clientLoader?: ClientLoaderFunction;
2488
+ clientMiddleware?: MiddlewareFunction<Record<string, DataStrategyResult>>[];
2489
+ ErrorBoundary?: ErrorBoundaryComponent;
2490
+ HydrateFallback?: HydrateFallbackComponent;
2491
+ Layout?: LayoutComponent;
2492
+ default: RouteComponent;
2493
+ handle?: RouteHandle;
2494
+ links?: LinksFunction;
2495
+ meta?: MetaFunction;
2496
+ shouldRevalidate?: ShouldRevalidateFunction;
2497
+ }
2498
+ /**
2499
+ * The shape of a route module on the server
2500
+ */
2501
+ interface ServerRouteModule extends RouteModule {
2502
+ action?: ActionFunction;
2503
+ headers?: HeadersFunction | {
2504
+ [name: string]: string;
2505
+ };
2506
+ loader?: LoaderFunction;
2507
+ middleware?: MiddlewareFunction<Response>[];
2508
+ }
2509
+ /**
2510
+ * A function that handles data mutations for a route on the client
2511
+ */
2512
+ type ClientActionFunction = (args: ClientActionFunctionArgs) => ReturnType<ActionFunction>;
2513
+ /**
2514
+ * Arguments passed to a route `clientAction` function
2515
+ */
2516
+ type ClientActionFunctionArgs = ActionFunctionArgs & {
2517
+ serverAction: <T = unknown>() => Promise<SerializeFrom<T>>;
2518
+ };
2519
+ /**
2520
+ * A function that loads data for a route on the client
2521
+ */
2522
+ type ClientLoaderFunction = ((args: ClientLoaderFunctionArgs) => ReturnType<LoaderFunction>) & {
2523
+ hydrate?: boolean;
2524
+ };
2525
+ /**
2526
+ * Arguments passed to a route `clientLoader` function
2527
+ */
2528
+ type ClientLoaderFunctionArgs = LoaderFunctionArgs & {
2529
+ serverLoader: <T = unknown>() => Promise<SerializeFrom<T>>;
2530
+ };
2531
+ /**
2532
+ * ErrorBoundary to display for this route
2533
+ */
2534
+ type ErrorBoundaryComponent = ComponentType;
2535
+ type HeadersArgs = {
2536
+ loaderHeaders: Headers;
2537
+ parentHeaders: Headers;
2538
+ actionHeaders: Headers;
2539
+ errorHeaders: Headers | undefined;
2540
+ };
2541
+ /**
2542
+ * A function that returns HTTP headers to be used for a route. These headers
2543
+ * will be merged with (and take precedence over) headers from parent routes.
2544
+ */
2545
+ interface HeadersFunction {
2546
+ (args: HeadersArgs): Headers | HeadersInit;
2547
+ }
2548
+ /**
2549
+ * `<Route HydrateFallback>` component to render on initial loads
2550
+ * when client loaders are present
2551
+ */
2552
+ type HydrateFallbackComponent = ComponentType;
2553
+ /**
2554
+ * Optional, root-only `<Route Layout>` component to wrap the root content in.
2555
+ * Useful for defining the <html>/<head>/<body> document shell shared by the
2556
+ * Component, HydrateFallback, and ErrorBoundary
2557
+ */
2558
+ type LayoutComponent = ComponentType<{
2559
+ children: ReactElement<unknown, ErrorBoundaryComponent | HydrateFallbackComponent | RouteComponent>;
2560
+ }>;
2561
+ /**
2562
+ * A function that defines `<link>` tags to be inserted into the `<head>` of
2563
+ * the document on route transitions.
2564
+ *
2565
+ * @see https://reactrouter.com/start/framework/route-module#meta
2566
+ */
2567
+ interface LinksFunction {
2568
+ (): LinkDescriptor[];
2569
+ }
2570
+ interface MetaMatch<RouteId extends string = string, Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown> {
2571
+ id: RouteId;
2572
+ pathname: DataRouteMatch["pathname"];
2573
+ /** @deprecated Use `MetaMatch.loaderData` instead */
2574
+ data: Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown;
2575
+ loaderData: Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown;
2576
+ handle?: RouteHandle;
2577
+ params: DataRouteMatch["params"];
2578
+ meta: MetaDescriptor[];
2579
+ error?: unknown;
2580
+ }
2581
+ type MetaMatches<MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> = Array<{
2582
+ [K in keyof MatchLoaders]: MetaMatch<Exclude<K, number | symbol>, MatchLoaders[K]>;
2583
+ }[keyof MatchLoaders]>;
2584
+ interface MetaArgs<Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown, MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> {
2585
+ /** @deprecated Use `MetaArgs.loaderData` instead */
2586
+ data: (Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown) | undefined;
2587
+ loaderData: (Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown) | undefined;
2588
+ params: Params;
2589
+ location: Location;
2590
+ matches: MetaMatches<MatchLoaders>;
2591
+ error?: unknown;
2592
+ }
2593
+ /**
2594
+ * A function that returns an array of data objects to use for rendering
2595
+ * metadata HTML tags in a route. These tags are not rendered on descendant
2596
+ * routes in the route hierarchy. In other words, they will only be rendered on
2597
+ * the route in which they are exported.
2598
+ *
2599
+ * @param Loader - The type of the current route's loader function
2600
+ * @param MatchLoaders - Mapping from a parent route's filepath to its loader
2601
+ * function type
2602
+ *
2603
+ * Note that parent route filepaths are relative to the `app/` directory.
2604
+ *
2605
+ * For example, if this meta function is for `/sales/customers/$customerId`:
2606
+ *
2607
+ * ```ts
2608
+ * // app/root.tsx
2609
+ * const loader = () => ({ hello: "world" })
2610
+ * export type Loader = typeof loader
2611
+ *
2612
+ * // app/routes/sales.tsx
2613
+ * const loader = () => ({ salesCount: 1074 })
2614
+ * export type Loader = typeof loader
2615
+ *
2616
+ * // app/routes/sales/customers.tsx
2617
+ * const loader = () => ({ customerCount: 74 })
2618
+ * export type Loader = typeof loader
2619
+ *
2620
+ * // app/routes/sales/customers/$customersId.tsx
2621
+ * import type { Loader as RootLoader } from "../../../root"
2622
+ * import type { Loader as SalesLoader } from "../../sales"
2623
+ * import type { Loader as CustomersLoader } from "../../sales/customers"
2624
+ *
2625
+ * const loader = () => ({ name: "Customer name" })
2626
+ *
2627
+ * const meta: MetaFunction<typeof loader, {
2628
+ * "root": RootLoader,
2629
+ * "routes/sales": SalesLoader,
2630
+ * "routes/sales/customers": CustomersLoader,
2631
+ * }> = ({ data, matches }) => {
2632
+ * const { name } = data
2633
+ * // ^? string
2634
+ * const { customerCount } = matches.find((match) => match.id === "routes/sales/customers").data
2635
+ * // ^? number
2636
+ * const { salesCount } = matches.find((match) => match.id === "routes/sales").data
2637
+ * // ^? number
2638
+ * const { hello } = matches.find((match) => match.id === "root").data
2639
+ * // ^? "world"
2640
+ * }
2641
+ * ```
2642
+ */
2643
+ interface MetaFunction<Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown, MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> {
2644
+ (args: MetaArgs<Loader, MatchLoaders>): MetaDescriptor[] | undefined;
2645
+ }
2646
+ type MetaDescriptor = {
2647
+ charSet: "utf-8";
2648
+ } | {
2649
+ title: string;
2650
+ } | {
2651
+ name: string;
2652
+ content: string;
2653
+ } | {
2654
+ property: string;
2655
+ content: string;
2656
+ } | {
2657
+ httpEquiv: string;
2658
+ content: string;
2659
+ } | {
2660
+ "script:ld+json": LdJsonObject;
2661
+ } | {
2662
+ tagName: "meta" | "link";
2663
+ [name: string]: string;
2664
+ } | {
2665
+ [name: string]: unknown;
2666
+ };
2667
+ type LdJsonObject = {
2668
+ [Key in string]: LdJsonValue;
2669
+ } & {
2670
+ [Key in string]?: LdJsonValue | undefined;
2671
+ };
2672
+ type LdJsonArray = LdJsonValue[] | readonly LdJsonValue[];
2673
+ type LdJsonPrimitive = string | number | boolean | null;
2674
+ type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
2675
+ /**
2676
+ * A React component that is rendered for a route.
2677
+ */
2678
+ type RouteComponent = ComponentType<{}>;
2679
+ /**
2680
+ * An arbitrary object that is associated with a route.
2681
+ *
2682
+ * @see https://reactrouter.com/how-to/using-handle
2683
+ */
2684
+ type RouteHandle = unknown;
2685
+
2686
+ type unstable_ServerInstrumentation = {
2687
+ handler?: unstable_InstrumentRequestHandlerFunction;
2688
+ route?: unstable_InstrumentRouteFunction;
2689
+ };
2690
+ type unstable_ClientInstrumentation = {
2691
+ router?: unstable_InstrumentRouterFunction;
2692
+ route?: unstable_InstrumentRouteFunction;
2693
+ };
2694
+ type unstable_InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
2695
+ type unstable_InstrumentRouterFunction = (router: InstrumentableRouter) => void;
2696
+ type unstable_InstrumentRouteFunction = (route: InstrumentableRoute) => void;
2697
+ type unstable_InstrumentationHandlerResult = {
2698
+ status: "success";
2699
+ error: undefined;
2700
+ } | {
2701
+ status: "error";
2702
+ error: Error;
2703
+ };
2704
+ type InstrumentFunction<T> = (handler: () => Promise<unstable_InstrumentationHandlerResult>, info: T) => Promise<void>;
2705
+ type ReadonlyRequest = {
2706
+ method: string;
2707
+ url: string;
2708
+ headers: Pick<Headers, "get">;
2709
+ };
2710
+ type ReadonlyContext = MiddlewareEnabled extends true ? Pick<RouterContextProvider, "get"> : Readonly<AppLoadContext>;
2711
+ type InstrumentableRoute = {
2712
+ id: string;
2713
+ index: boolean | undefined;
2714
+ path: string | undefined;
2715
+ instrument(instrumentations: RouteInstrumentations): void;
2716
+ };
2717
+ type RouteInstrumentations = {
2718
+ lazy?: InstrumentFunction<RouteLazyInstrumentationInfo>;
2719
+ "lazy.loader"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
2720
+ "lazy.action"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
2721
+ "lazy.middleware"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
2722
+ middleware?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
2723
+ loader?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
2724
+ action?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
2725
+ };
2726
+ type RouteLazyInstrumentationInfo = undefined;
2727
+ type RouteHandlerInstrumentationInfo = Readonly<{
2728
+ request: ReadonlyRequest;
2729
+ params: LoaderFunctionArgs["params"];
2730
+ unstable_pattern: string;
2731
+ context: ReadonlyContext;
2732
+ }>;
2733
+ type InstrumentableRouter = {
2734
+ instrument(instrumentations: RouterInstrumentations): void;
2735
+ };
2736
+ type RouterInstrumentations = {
2737
+ navigate?: InstrumentFunction<RouterNavigationInstrumentationInfo>;
2738
+ fetch?: InstrumentFunction<RouterFetchInstrumentationInfo>;
2739
+ };
2740
+ type RouterNavigationInstrumentationInfo = Readonly<{
2741
+ to: string | number;
2742
+ currentUrl: string;
2743
+ formMethod?: HTMLFormMethod;
2744
+ formEncType?: FormEncType;
2745
+ formData?: FormData;
2746
+ body?: any;
2747
+ }>;
2748
+ type RouterFetchInstrumentationInfo = Readonly<{
2749
+ href: string;
2750
+ currentUrl: string;
2751
+ fetcherKey: string;
2752
+ formMethod?: HTMLFormMethod;
2753
+ formEncType?: FormEncType;
2754
+ formData?: FormData;
2755
+ body?: any;
2756
+ }>;
2757
+ type InstrumentableRequestHandler = {
2758
+ instrument(instrumentations: RequestHandlerInstrumentations): void;
2759
+ };
2760
+ type RequestHandlerInstrumentations = {
2761
+ request?: InstrumentFunction<RequestHandlerInstrumentationInfo>;
2762
+ };
2763
+ type RequestHandlerInstrumentationInfo = Readonly<{
2764
+ request: ReadonlyRequest;
2765
+ context: ReadonlyContext | undefined;
2766
+ }>;
2767
+
2768
+ /**
2769
+ * A Router instance manages all navigation and data loading/mutations
2770
+ */
2771
+ interface Router {
2772
+ /**
2773
+ * @private
2774
+ * PRIVATE - DO NOT USE
2775
+ *
2776
+ * Return the basename for the router
2777
+ */
2778
+ get basename(): RouterInit["basename"];
2779
+ /**
2780
+ * @private
2781
+ * PRIVATE - DO NOT USE
2782
+ *
2783
+ * Return the future config for the router
2784
+ */
2785
+ get future(): FutureConfig;
2786
+ /**
2787
+ * @private
2788
+ * PRIVATE - DO NOT USE
2789
+ *
2790
+ * Return the current state of the router
2791
+ */
2792
+ get state(): RouterState;
2793
+ /**
2794
+ * @private
2795
+ * PRIVATE - DO NOT USE
2796
+ *
2797
+ * Return the routes for this router instance
2798
+ */
2799
+ get routes(): AgnosticDataRouteObject[];
2800
+ /**
2801
+ * @private
2802
+ * PRIVATE - DO NOT USE
2803
+ *
2804
+ * Return the window associated with the router
2805
+ */
2806
+ get window(): RouterInit["window"];
2807
+ /**
2808
+ * @private
2809
+ * PRIVATE - DO NOT USE
2810
+ *
2811
+ * Initialize the router, including adding history listeners and kicking off
2812
+ * initial data fetches. Returns a function to cleanup listeners and abort
2813
+ * any in-progress loads
2814
+ */
2815
+ initialize(): Router;
2816
+ /**
2817
+ * @private
2818
+ * PRIVATE - DO NOT USE
2819
+ *
2820
+ * Subscribe to router.state updates
2821
+ *
2822
+ * @param fn function to call with the new state
2823
+ */
2824
+ subscribe(fn: RouterSubscriber): () => void;
2825
+ /**
2826
+ * @private
2827
+ * PRIVATE - DO NOT USE
2828
+ *
2829
+ * Enable scroll restoration behavior in the router
2830
+ *
2831
+ * @param savedScrollPositions Object that will manage positions, in case
2832
+ * it's being restored from sessionStorage
2833
+ * @param getScrollPosition Function to get the active Y scroll position
2834
+ * @param getKey Function to get the key to use for restoration
2835
+ */
2836
+ enableScrollRestoration(savedScrollPositions: Record<string, number>, getScrollPosition: GetScrollPositionFunction, getKey?: GetScrollRestorationKeyFunction): () => void;
2837
+ /**
2838
+ * @private
2839
+ * PRIVATE - DO NOT USE
2840
+ *
2841
+ * Navigate forward/backward in the history stack
2842
+ * @param to Delta to move in the history stack
2843
+ */
2844
+ navigate(to: number): Promise<void>;
2845
+ /**
2846
+ * Navigate to the given path
2847
+ * @param to Path to navigate to
2848
+ * @param opts Navigation options (method, submission, etc.)
2849
+ */
2850
+ navigate(to: To | null, opts?: RouterNavigateOptions): Promise<void>;
2851
+ /**
2852
+ * @private
2853
+ * PRIVATE - DO NOT USE
2854
+ *
2855
+ * Trigger a fetcher load/submission
2856
+ *
2857
+ * @param key Fetcher key
2858
+ * @param routeId Route that owns the fetcher
2859
+ * @param href href to fetch
2860
+ * @param opts Fetcher options, (method, submission, etc.)
2861
+ */
2862
+ fetch(key: string, routeId: string, href: string | null, opts?: RouterFetchOptions): Promise<void>;
2863
+ /**
2864
+ * @private
2865
+ * PRIVATE - DO NOT USE
2866
+ *
2867
+ * Trigger a revalidation of all current route loaders and fetcher loads
2868
+ */
2869
+ revalidate(): Promise<void>;
2870
+ /**
2871
+ * @private
2872
+ * PRIVATE - DO NOT USE
2873
+ *
2874
+ * Utility function to create an href for the given location
2875
+ * @param location
2876
+ */
2877
+ createHref(location: Location | URL): string;
2878
+ /**
2879
+ * @private
2880
+ * PRIVATE - DO NOT USE
2881
+ *
2882
+ * Utility function to URL encode a destination path according to the internal
2883
+ * history implementation
2884
+ * @param to
2885
+ */
2886
+ encodeLocation(to: To): Path;
2887
+ /**
2888
+ * @private
2889
+ * PRIVATE - DO NOT USE
2890
+ *
2891
+ * Get/create a fetcher for the given key
2892
+ * @param key
2893
+ */
2894
+ getFetcher<TData = any>(key: string): Fetcher<TData>;
2895
+ /**
2896
+ * @internal
2897
+ * PRIVATE - DO NOT USE
2898
+ *
2899
+ * Reset the fetcher for a given key
2900
+ * @param key
2901
+ */
2902
+ resetFetcher(key: string, opts?: {
2903
+ reason?: unknown;
2904
+ }): void;
2905
+ /**
2906
+ * @private
2907
+ * PRIVATE - DO NOT USE
2908
+ *
2909
+ * Delete the fetcher for a given key
2910
+ * @param key
2911
+ */
2912
+ deleteFetcher(key: string): void;
2913
+ /**
2914
+ * @private
2915
+ * PRIVATE - DO NOT USE
2916
+ *
2917
+ * Cleanup listeners and abort any in-progress loads
2918
+ */
2919
+ dispose(): void;
2920
+ /**
2921
+ * @private
2922
+ * PRIVATE - DO NOT USE
2923
+ *
2924
+ * Get a navigation blocker
2925
+ * @param key The identifier for the blocker
2926
+ * @param fn The blocker function implementation
2927
+ */
2928
+ getBlocker(key: string, fn: BlockerFunction): Blocker;
2929
+ /**
2930
+ * @private
2931
+ * PRIVATE - DO NOT USE
2932
+ *
2933
+ * Delete a navigation blocker
2934
+ * @param key The identifier for the blocker
2935
+ */
2936
+ deleteBlocker(key: string): void;
2937
+ /**
2938
+ * @private
2939
+ * PRIVATE DO NOT USE
2940
+ *
2941
+ * Patch additional children routes into an existing parent route
2942
+ * @param routeId The parent route id or a callback function accepting `patch`
2943
+ * to perform batch patching
2944
+ * @param children The additional children routes
2945
+ * @param unstable_allowElementMutations Allow mutation or route elements on
2946
+ * existing routes. Intended for RSC-usage
2947
+ * only.
2948
+ */
2949
+ patchRoutes(routeId: string | null, children: AgnosticRouteObject[], unstable_allowElementMutations?: boolean): void;
2950
+ /**
2951
+ * @private
2952
+ * PRIVATE - DO NOT USE
2953
+ *
2954
+ * HMR needs to pass in-flight route updates to React Router
2955
+ * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
2956
+ */
2957
+ _internalSetRoutes(routes: AgnosticRouteObject[]): void;
2958
+ /**
2959
+ * @private
2960
+ * PRIVATE - DO NOT USE
2961
+ *
2962
+ * Cause subscribers to re-render. This is used to force a re-render.
2963
+ */
2964
+ _internalSetStateDoNotUseOrYouWillBreakYourApp(state: Partial<RouterState>): void;
2965
+ /**
2966
+ * @private
2967
+ * PRIVATE - DO NOT USE
2968
+ *
2969
+ * Internal fetch AbortControllers accessed by unit tests
2970
+ */
2971
+ _internalFetchControllers: Map<string, AbortController>;
2972
+ }
2973
+ /**
2974
+ * State maintained internally by the router. During a navigation, all states
2975
+ * reflect the "old" location unless otherwise noted.
2976
+ */
2977
+ interface RouterState {
2978
+ /**
2979
+ * The action of the most recent navigation
2980
+ */
2981
+ historyAction: Action;
2982
+ /**
2983
+ * The current location reflected by the router
2984
+ */
2985
+ location: Location;
2986
+ /**
2987
+ * The current set of route matches
2988
+ */
2989
+ matches: AgnosticDataRouteMatch[];
2990
+ /**
2991
+ * Tracks whether we've completed our initial data load
2992
+ */
2993
+ initialized: boolean;
2994
+ /**
2995
+ * Current scroll position we should start at for a new view
2996
+ * - number -> scroll position to restore to
2997
+ * - false -> do not restore scroll at all (used during submissions/revalidations)
2998
+ * - null -> don't have a saved position, scroll to hash or top of page
2999
+ */
3000
+ restoreScrollPosition: number | false | null;
3001
+ /**
3002
+ * Indicate whether this navigation should skip resetting the scroll position
3003
+ * if we are unable to restore the scroll position
3004
+ */
3005
+ preventScrollReset: boolean;
3006
+ /**
3007
+ * Tracks the state of the current navigation
3008
+ */
3009
+ navigation: Navigation;
3010
+ /**
3011
+ * Tracks any in-progress revalidations
3012
+ */
3013
+ revalidation: RevalidationState;
3014
+ /**
3015
+ * Data from the loaders for the current matches
3016
+ */
3017
+ loaderData: RouteData;
3018
+ /**
3019
+ * Data from the action for the current matches
3020
+ */
3021
+ actionData: RouteData | null;
3022
+ /**
3023
+ * Errors caught from loaders for the current matches
3024
+ */
3025
+ errors: RouteData | null;
3026
+ /**
3027
+ * Map of current fetchers
3028
+ */
3029
+ fetchers: Map<string, Fetcher>;
3030
+ /**
3031
+ * Map of current blockers
3032
+ */
3033
+ blockers: Map<string, Blocker>;
3034
+ }
3035
+ /**
3036
+ * Data that can be passed into hydrate a Router from SSR
3037
+ */
3038
+ type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
3039
+ /**
3040
+ * Future flags to toggle new feature behavior
3041
+ */
3042
+ interface FutureConfig {
3043
+ }
3044
+ /**
3045
+ * Initialization options for createRouter
3046
+ */
3047
+ interface RouterInit {
3048
+ routes: AgnosticRouteObject[];
3049
+ history: History;
3050
+ basename?: string;
3051
+ getContext?: () => MaybePromise<RouterContextProvider>;
3052
+ unstable_instrumentations?: unstable_ClientInstrumentation[];
3053
+ mapRouteProperties?: MapRoutePropertiesFunction;
3054
+ future?: Partial<FutureConfig>;
3055
+ hydrationRouteProperties?: string[];
3056
+ hydrationData?: HydrationState;
3057
+ window?: Window;
3058
+ dataStrategy?: DataStrategyFunction;
3059
+ patchRoutesOnNavigation?: AgnosticPatchRoutesOnNavigationFunction;
3060
+ }
3061
+ /**
3062
+ * State returned from a server-side query() call
3063
+ */
3064
+ interface StaticHandlerContext {
3065
+ basename: Router["basename"];
3066
+ location: RouterState["location"];
3067
+ matches: RouterState["matches"];
3068
+ loaderData: RouterState["loaderData"];
3069
+ actionData: RouterState["actionData"];
3070
+ errors: RouterState["errors"];
3071
+ statusCode: number;
3072
+ loaderHeaders: Record<string, Headers>;
3073
+ actionHeaders: Record<string, Headers>;
3074
+ _deepestRenderedBoundaryId?: string | null;
3075
+ }
3076
+ /**
3077
+ * A StaticHandler instance manages a singular SSR navigation/fetch event
3078
+ */
3079
+ interface StaticHandler {
3080
+ dataRoutes: AgnosticDataRouteObject[];
3081
+ query(request: Request, opts?: {
3082
+ requestContext?: unknown;
3083
+ filterMatchesToLoad?: (match: AgnosticDataRouteMatch) => boolean;
3084
+ skipLoaderErrorBubbling?: boolean;
3085
+ skipRevalidation?: boolean;
3086
+ dataStrategy?: DataStrategyFunction<unknown>;
3087
+ generateMiddlewareResponse?: (query: (r: Request, args?: {
3088
+ filterMatchesToLoad?: (match: AgnosticDataRouteMatch) => boolean;
3089
+ }) => Promise<StaticHandlerContext | Response>) => MaybePromise<Response>;
3090
+ }): Promise<StaticHandlerContext | Response>;
3091
+ queryRoute(request: Request, opts?: {
3092
+ routeId?: string;
3093
+ requestContext?: unknown;
3094
+ dataStrategy?: DataStrategyFunction<unknown>;
3095
+ generateMiddlewareResponse?: (queryRoute: (r: Request) => Promise<Response>) => MaybePromise<Response>;
3096
+ }): Promise<any>;
3097
+ }
3098
+ type ViewTransitionOpts = {
3099
+ currentLocation: Location;
3100
+ nextLocation: Location;
3101
+ };
3102
+ /**
3103
+ * Subscriber function signature for changes to router state
3104
+ */
3105
+ interface RouterSubscriber {
3106
+ (state: RouterState, opts: {
3107
+ deletedFetchers: string[];
3108
+ newErrors: RouteData | null;
3109
+ viewTransitionOpts?: ViewTransitionOpts;
3110
+ flushSync: boolean;
3111
+ }): void;
3112
+ }
3113
+ /**
3114
+ * Function signature for determining the key to be used in scroll restoration
3115
+ * for a given location
3116
+ */
3117
+ interface GetScrollRestorationKeyFunction {
3118
+ (location: Location, matches: UIMatch[]): string | null;
3119
+ }
3120
+ /**
3121
+ * Function signature for determining the current scroll position
3122
+ */
3123
+ interface GetScrollPositionFunction {
3124
+ (): number;
3125
+ }
3126
+ /**
3127
+ * - "route": relative to the route hierarchy so `..` means remove all segments
3128
+ * of the current route even if it has many. For example, a `route("posts/:id")`
3129
+ * would have both `:id` and `posts` removed from the url.
3130
+ * - "path": relative to the pathname so `..` means remove one segment of the
3131
+ * pathname. For example, a `route("posts/:id")` would have only `:id` removed
3132
+ * from the url.
3133
+ */
3134
+ type RelativeRoutingType = "route" | "path";
3135
+ type BaseNavigateOrFetchOptions = {
3136
+ preventScrollReset?: boolean;
3137
+ relative?: RelativeRoutingType;
3138
+ flushSync?: boolean;
3139
+ unstable_defaultShouldRevalidate?: boolean;
3140
+ };
3141
+ type BaseNavigateOptions = BaseNavigateOrFetchOptions & {
3142
+ replace?: boolean;
3143
+ state?: any;
3144
+ fromRouteId?: string;
3145
+ viewTransition?: boolean;
3146
+ };
3147
+ type BaseSubmissionOptions = {
3148
+ formMethod?: HTMLFormMethod;
3149
+ formEncType?: FormEncType;
3150
+ } & ({
3151
+ formData: FormData;
3152
+ body?: undefined;
3153
+ } | {
3154
+ formData?: undefined;
3155
+ body: any;
3156
+ });
3157
+ /**
3158
+ * Options for a navigate() call for a normal (non-submission) navigation
3159
+ */
3160
+ type LinkNavigateOptions = BaseNavigateOptions;
3161
+ /**
3162
+ * Options for a navigate() call for a submission navigation
3163
+ */
3164
+ type SubmissionNavigateOptions = BaseNavigateOptions & BaseSubmissionOptions;
3165
+ /**
3166
+ * Options to pass to navigate() for a navigation
3167
+ */
3168
+ type RouterNavigateOptions = LinkNavigateOptions | SubmissionNavigateOptions;
3169
+ /**
3170
+ * Options for a fetch() load
3171
+ */
3172
+ type LoadFetchOptions = BaseNavigateOrFetchOptions;
3173
+ /**
3174
+ * Options for a fetch() submission
3175
+ */
3176
+ type SubmitFetchOptions = BaseNavigateOrFetchOptions & BaseSubmissionOptions;
3177
+ /**
3178
+ * Options to pass to fetch()
3179
+ */
3180
+ type RouterFetchOptions = LoadFetchOptions | SubmitFetchOptions;
3181
+ /**
3182
+ * Potential states for state.navigation
3183
+ */
3184
+ type NavigationStates = {
3185
+ Idle: {
3186
+ state: "idle";
3187
+ location: undefined;
3188
+ formMethod: undefined;
3189
+ formAction: undefined;
3190
+ formEncType: undefined;
3191
+ formData: undefined;
3192
+ json: undefined;
3193
+ text: undefined;
3194
+ };
3195
+ Loading: {
3196
+ state: "loading";
3197
+ location: Location;
3198
+ formMethod: Submission["formMethod"] | undefined;
3199
+ formAction: Submission["formAction"] | undefined;
3200
+ formEncType: Submission["formEncType"] | undefined;
3201
+ formData: Submission["formData"] | undefined;
3202
+ json: Submission["json"] | undefined;
3203
+ text: Submission["text"] | undefined;
3204
+ };
3205
+ Submitting: {
3206
+ state: "submitting";
3207
+ location: Location;
3208
+ formMethod: Submission["formMethod"];
3209
+ formAction: Submission["formAction"];
3210
+ formEncType: Submission["formEncType"];
3211
+ formData: Submission["formData"];
3212
+ json: Submission["json"];
3213
+ text: Submission["text"];
3214
+ };
3215
+ };
3216
+ type Navigation = NavigationStates[keyof NavigationStates];
3217
+ type RevalidationState = "idle" | "loading";
3218
+ /**
3219
+ * Potential states for fetchers
3220
+ */
3221
+ type FetcherStates<TData = any> = {
3222
+ /**
3223
+ * The fetcher is not calling a loader or action
3224
+ *
3225
+ * ```tsx
3226
+ * fetcher.state === "idle"
3227
+ * ```
3228
+ */
3229
+ Idle: {
3230
+ state: "idle";
3231
+ formMethod: undefined;
3232
+ formAction: undefined;
3233
+ formEncType: undefined;
3234
+ text: undefined;
3235
+ formData: undefined;
3236
+ json: undefined;
3237
+ /**
3238
+ * If the fetcher has never been called, this will be undefined.
3239
+ */
3240
+ data: TData | undefined;
3241
+ };
3242
+ /**
3243
+ * The fetcher is loading data from a {@link LoaderFunction | loader} from a
3244
+ * call to {@link FetcherWithComponents.load | `fetcher.load`}.
3245
+ *
3246
+ * ```tsx
3247
+ * // somewhere
3248
+ * <button onClick={() => fetcher.load("/some/route") }>Load</button>
3249
+ *
3250
+ * // the state will update
3251
+ * fetcher.state === "loading"
3252
+ * ```
3253
+ */
3254
+ Loading: {
3255
+ state: "loading";
3256
+ formMethod: Submission["formMethod"] | undefined;
3257
+ formAction: Submission["formAction"] | undefined;
3258
+ formEncType: Submission["formEncType"] | undefined;
3259
+ text: Submission["text"] | undefined;
3260
+ formData: Submission["formData"] | undefined;
3261
+ json: Submission["json"] | undefined;
3262
+ data: TData | undefined;
3263
+ };
3264
+ /**
3265
+ The fetcher is submitting to a {@link LoaderFunction} (GET) or {@link ActionFunction} (POST) from a {@link FetcherWithComponents.Form | `fetcher.Form`} or {@link FetcherWithComponents.submit | `fetcher.submit`}.
3266
+
3267
+ ```tsx
3268
+ // somewhere
3269
+ <input
3270
+ onChange={e => {
3271
+ fetcher.submit(event.currentTarget.form, { method: "post" });
3272
+ }}
3273
+ />
3274
+
3275
+ // the state will update
3276
+ fetcher.state === "submitting"
3277
+
3278
+ // and formData will be available
3279
+ fetcher.formData
3280
+ ```
3281
+ */
3282
+ Submitting: {
3283
+ state: "submitting";
3284
+ formMethod: Submission["formMethod"];
3285
+ formAction: Submission["formAction"];
3286
+ formEncType: Submission["formEncType"];
3287
+ text: Submission["text"];
3288
+ formData: Submission["formData"];
3289
+ json: Submission["json"];
3290
+ data: TData | undefined;
3291
+ };
3292
+ };
3293
+ type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
3294
+ interface BlockerBlocked {
3295
+ state: "blocked";
3296
+ reset: () => void;
3297
+ proceed: () => void;
3298
+ location: Location;
3299
+ }
3300
+ interface BlockerUnblocked {
3301
+ state: "unblocked";
3302
+ reset: undefined;
3303
+ proceed: undefined;
3304
+ location: undefined;
3305
+ }
3306
+ interface BlockerProceeding {
3307
+ state: "proceeding";
3308
+ reset: undefined;
3309
+ proceed: undefined;
3310
+ location: Location;
3311
+ }
3312
+ type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
3313
+ type BlockerFunction = (args: {
3314
+ currentLocation: Location;
3315
+ nextLocation: Location;
3316
+ historyAction: Action;
3317
+ }) => boolean;
3318
+ declare const IDLE_NAVIGATION: NavigationStates["Idle"];
3319
+ declare const IDLE_FETCHER: FetcherStates["Idle"];
3320
+ declare const IDLE_BLOCKER: BlockerUnblocked;
3321
+ /**
3322
+ * Create a router and listen to history POP navigations
3323
+ */
3324
+ declare function createRouter(init: RouterInit): Router;
3325
+ interface CreateStaticHandlerOptions {
3326
+ basename?: string;
3327
+ mapRouteProperties?: MapRoutePropertiesFunction;
3328
+ unstable_instrumentations?: Pick<unstable_ServerInstrumentation, "route">[];
3329
+ future?: {};
3330
+ }
3331
+
3332
+ export { type NonIndexRouteObject as $, type ActionFunction as A, type BlockerFunction as B, type ClientActionFunction as C, type DataStrategyResult as D, type Path as E, type Func as F, type GetLoaderData as G, type HeadersFunction as H, type PathPattern as I, type PathMatch as J, type Navigation as K, type Location as L, type MetaFunction as M, type Normalize as N, Action as O, type Params as P, type RouteObject as Q, type RouteModule$1 as R, type ShouldRevalidateFunction as S, type To as T, type UIMatch as U, type InitialEntry as V, type HydrationState as W, type IndexRouteObject as X, type RouteComponentType as Y, type HydrateFallbackType as Z, type ErrorBoundaryType as _, type ClientLoaderFunction as a, type RouterProps as a$, type Equal as a0, type RouterState as a1, type PatchRoutesOnNavigationFunction as a2, type DataRouteObject as a3, type StaticHandler as a4, type GetScrollPositionFunction as a5, type GetScrollRestorationKeyFunction as a6, type StaticHandlerContext as a7, type Fetcher as a8, type NavigationStates as a9, type unstable_InstrumentationHandlerResult as aA, IDLE_NAVIGATION as aB, IDLE_FETCHER as aC, IDLE_BLOCKER as aD, data as aE, generatePath as aF, isRouteErrorResponse as aG, matchPath as aH, matchRoutes as aI, redirect as aJ, redirectDocument as aK, replace as aL, resolvePath as aM, type DataRouteMatch as aN, type Navigator as aO, type PatchRoutesOnNavigationFunctionArgs as aP, type RouteMatch as aQ, AwaitContextProvider as aR, type AwaitProps as aS, type IndexRouteProps as aT, type LayoutRouteProps as aU, type MemoryRouterOpts as aV, type MemoryRouterProps as aW, type NavigateProps as aX, type OutletProps as aY, type PathRouteProps as aZ, type RouteProps as a_, type RouterSubscriber as aa, type RouterNavigateOptions as ab, type RouterFetchOptions as ac, type RevalidationState as ad, type ActionFunctionArgs as ae, type DataStrategyFunctionArgs as af, type DataStrategyMatch as ag, DataWithResponseInit as ah, type ErrorResponse as ai, type FormEncType as aj, type FormMethod as ak, type HTMLFormMethod as al, type LazyRouteFunction as am, type LoaderFunctionArgs as an, type MiddlewareFunction as ao, type PathParam as ap, type RedirectFunction as aq, type RouterContext as ar, type ShouldRevalidateFunctionArgs as as, createContext as at, createPath as au, parsePath as av, type unstable_ServerInstrumentation as aw, type unstable_InstrumentRequestHandlerFunction as ax, type unstable_InstrumentRouterFunction as ay, type unstable_InstrumentRouteFunction as az, type LinksFunction as b, type RoutesProps as b0, Await as b1, MemoryRouter as b2, Navigate as b3, Outlet as b4, Route as b5, Router$1 as b6, RouterProvider as b7, Routes as b8, createMemoryRouter as b9, WithComponentProps as bA, withComponentProps as bB, WithHydrateFallbackProps as bC, withHydrateFallbackProps as bD, WithErrorBoundaryProps as bE, withErrorBoundaryProps as bF, type RouteManifest as bG, type ServerRouteModule as bH, type History as bI, type FutureConfig as bJ, type CreateStaticHandlerOptions as bK, createRoutesFromChildren as ba, createRoutesFromElements as bb, renderMatches as bc, type ClientActionFunctionArgs as bd, type ClientLoaderFunctionArgs as be, type HeadersArgs as bf, type MetaArgs as bg, type PageLinkDescriptor as bh, type HtmlLinkDescriptor as bi, type Future as bj, type unstable_SerializesTo as bk, createMemoryHistory as bl, createBrowserHistory as bm, createHashHistory as bn, invariant as bo, createRouter as bp, ErrorResponseImpl as bq, DataRouterContext as br, DataRouterStateContext as bs, FetchersContext as bt, LocationContext as bu, NavigationContext as bv, RouteContext as bw, ViewTransitionContext as bx, hydrationRouteProperties as by, mapRouteProperties as bz, RouterContextProvider as c, type LoaderFunction as d, type RouterInit as e, type RouterProviderProps as f, type ClientOnErrorFunction as g, type LinkDescriptor as h, type Pretty as i, type MetaDescriptor as j, type ServerDataFunctionArgs as k, type MiddlewareNextFunction as l, type ClientDataFunctionArgs as m, type ServerDataFrom as n, type GetActionData as o, type Router as p, type RouteModules as q, type DataStrategyFunction as r, type MiddlewareEnabled as s, type AppLoadContext as t, type unstable_ClientInstrumentation as u, type NavigateOptions as v, type Blocker as w, type SerializeFrom as x, type RelativeRoutingType as y, type ParamParseKey as z };