@rangojs/router 0.1.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) hide show
  1. package/README.md +2 -1
  2. package/dist/types/browser/prefetch/default-strategy.d.ts +22 -0
  3. package/dist/types/browser/prefetch/runtime.d.ts +0 -1
  4. package/dist/types/browser/react/Link.d.ts +8 -11
  5. package/dist/types/browser/types.d.ts +5 -0
  6. package/dist/types/cache/document-cache.d.ts +3 -1
  7. package/dist/types/cache/types.d.ts +10 -3
  8. package/dist/types/route-definition/helpers-types.d.ts +6 -6
  9. package/dist/types/router/match-handlers.d.ts +2 -3
  10. package/dist/types/router/prefetch-default.d.ts +28 -0
  11. package/dist/types/router/router-interfaces.d.ts +7 -0
  12. package/dist/types/router/router-options.d.ts +30 -0
  13. package/dist/types/router/segment-resolution/view-transition-default.d.ts +3 -4
  14. package/dist/types/router/transition-when.d.ts +13 -0
  15. package/dist/types/rsc/capture-queue.d.ts +6 -0
  16. package/dist/types/rsc/shell-capture.d.ts +15 -7
  17. package/dist/types/rsc/shell-serve.d.ts +6 -3
  18. package/dist/types/rsc/transition-gate.d.ts +10 -14
  19. package/dist/types/rsc/types.d.ts +2 -0
  20. package/dist/types/server/request-context.d.ts +5 -1
  21. package/dist/types/testing/e2e/index.d.ts +3 -3
  22. package/dist/types/testing/e2e/page-helpers.d.ts +24 -0
  23. package/dist/types/testing/index.d.ts +2 -2
  24. package/dist/types/testing/run-transition-when.d.ts +6 -5
  25. package/dist/types/testing/shell-status.d.ts +23 -3
  26. package/dist/types/types/segments.d.ts +27 -22
  27. package/dist/types/urls/path-helper-types.d.ts +4 -3
  28. package/dist/types.backup/__internal.d.ts +127 -0
  29. package/dist/types.backup/bin/rango.d.ts +1 -0
  30. package/dist/types.backup/browser/action-coordinator.d.ts +57 -0
  31. package/dist/types.backup/browser/action-fence.d.ts +33 -0
  32. package/dist/types.backup/browser/app-shell.d.ts +34 -0
  33. package/dist/types.backup/browser/app-version.d.ts +6 -0
  34. package/dist/types.backup/browser/connection-warmup.d.ts +31 -0
  35. package/dist/types.backup/browser/cookie-name.d.ts +66 -0
  36. package/dist/types.backup/browser/event-controller.d.ts +221 -0
  37. package/dist/types.backup/browser/history-state.d.ts +26 -0
  38. package/dist/types.backup/browser/index.d.ts +1 -0
  39. package/dist/types.backup/browser/intercept-utils.d.ts +30 -0
  40. package/dist/types.backup/browser/invalidate-client-cache.d.ts +17 -0
  41. package/dist/types.backup/browser/link-interceptor.d.ts +43 -0
  42. package/dist/types.backup/browser/logging.d.ts +33 -0
  43. package/dist/types.backup/browser/merge-segment-loaders.d.ts +38 -0
  44. package/dist/types.backup/browser/navigation-bridge.d.ts +27 -0
  45. package/dist/types.backup/browser/navigation-client.d.ts +17 -0
  46. package/dist/types.backup/browser/navigation-store-handle.d.ts +25 -0
  47. package/dist/types.backup/browser/navigation-store.d.ts +95 -0
  48. package/dist/types.backup/browser/navigation-transaction.d.ts +75 -0
  49. package/dist/types.backup/browser/network-error-handler.d.ts +35 -0
  50. package/dist/types.backup/browser/partial-update.d.ts +61 -0
  51. package/dist/types.backup/browser/prefetch/cache.d.ts +183 -0
  52. package/dist/types.backup/browser/prefetch/fetch.d.ts +52 -0
  53. package/dist/types.backup/browser/prefetch/observer.d.ts +27 -0
  54. package/dist/types.backup/browser/prefetch/policy.d.ts +13 -0
  55. package/dist/types.backup/browser/prefetch/queue.d.ts +48 -0
  56. package/dist/types.backup/browser/prefetch/resource-ready.d.ts +28 -0
  57. package/dist/types.backup/browser/rango-state.d.ts +52 -0
  58. package/dist/types.backup/browser/react/Link.d.ts +140 -0
  59. package/dist/types.backup/browser/react/NavigationProvider.d.ts +88 -0
  60. package/dist/types.backup/browser/react/ScrollRestoration.d.ts +78 -0
  61. package/dist/types.backup/browser/react/context.d.ts +54 -0
  62. package/dist/types.backup/browser/react/filter-segment-order.d.ts +35 -0
  63. package/dist/types.backup/browser/react/index.d.ts +1 -0
  64. package/dist/types.backup/browser/react/location-state-shared.d.ts +162 -0
  65. package/dist/types.backup/browser/react/location-state.d.ts +29 -0
  66. package/dist/types.backup/browser/react/mount-context.d.ts +23 -0
  67. package/dist/types.backup/browser/react/nonce-context.d.ts +14 -0
  68. package/dist/types.backup/browser/react/shallow-equal.d.ts +5 -0
  69. package/dist/types.backup/browser/react/use-action.d.ts +61 -0
  70. package/dist/types.backup/browser/react/use-handle.d.ts +21 -0
  71. package/dist/types.backup/browser/react/use-href.d.ts +32 -0
  72. package/dist/types.backup/browser/react/use-link-status.d.ts +36 -0
  73. package/dist/types.backup/browser/react/use-mount.d.ts +24 -0
  74. package/dist/types.backup/browser/react/use-navigation.d.ts +15 -0
  75. package/dist/types.backup/browser/react/use-params.d.ts +21 -0
  76. package/dist/types.backup/browser/react/use-pathname.d.ts +13 -0
  77. package/dist/types.backup/browser/react/use-reverse.d.ts +40 -0
  78. package/dist/types.backup/browser/react/use-router.d.ts +23 -0
  79. package/dist/types.backup/browser/react/use-search-params.d.ts +19 -0
  80. package/dist/types.backup/browser/react/use-segments.d.ts +29 -0
  81. package/dist/types.backup/browser/response-adapter.d.ts +58 -0
  82. package/dist/types.backup/browser/rsc-router.d.ts +141 -0
  83. package/dist/types.backup/browser/scroll-restoration.d.ts +103 -0
  84. package/dist/types.backup/browser/segment-reconciler.d.ts +74 -0
  85. package/dist/types.backup/browser/segment-structure-assert.d.ts +16 -0
  86. package/dist/types.backup/browser/server-action-bridge.d.ts +29 -0
  87. package/dist/types.backup/browser/types.d.ts +530 -0
  88. package/dist/types.backup/browser/validate-redirect-origin.d.ts +28 -0
  89. package/dist/types.backup/build/collect-fallback-refs.d.ts +5 -0
  90. package/dist/types.backup/build/generate-manifest.d.ts +100 -0
  91. package/dist/types.backup/build/generate-route-types.d.ts +8 -0
  92. package/dist/types.backup/build/index.d.ts +21 -0
  93. package/dist/types.backup/build/prefix-tree-utils.d.ts +56 -0
  94. package/dist/types.backup/build/route-trie.d.ts +89 -0
  95. package/dist/types.backup/build/route-types/ast-helpers.d.ts +3 -0
  96. package/dist/types.backup/build/route-types/ast-route-extraction.d.ts +13 -0
  97. package/dist/types.backup/build/route-types/codegen.d.ts +16 -0
  98. package/dist/types.backup/build/route-types/include-resolution.d.ts +74 -0
  99. package/dist/types.backup/build/route-types/param-extraction.d.ts +13 -0
  100. package/dist/types.backup/build/route-types/per-module-writer.d.ts +18 -0
  101. package/dist/types.backup/build/route-types/router-processing.d.ts +82 -0
  102. package/dist/types.backup/build/route-types/scan-filter.d.ts +17 -0
  103. package/dist/types.backup/build/route-types/source-scan.d.ts +13 -0
  104. package/dist/types.backup/build/runtime-discovery.d.ts +24 -0
  105. package/dist/types.backup/cache/background-task.d.ts +21 -0
  106. package/dist/types.backup/cache/cache-error.d.ts +71 -0
  107. package/dist/types.backup/cache/cache-key-utils.d.ts +35 -0
  108. package/dist/types.backup/cache/cache-policy.d.ts +59 -0
  109. package/dist/types.backup/cache/cache-runtime.d.ts +51 -0
  110. package/dist/types.backup/cache/cache-scope.d.ts +134 -0
  111. package/dist/types.backup/cache/cache-tag.d.ts +79 -0
  112. package/dist/types.backup/cache/cf/cf-base64.d.ts +4 -0
  113. package/dist/types.backup/cache/cf/cf-cache-constants.d.ts +105 -0
  114. package/dist/types.backup/cache/cf/cf-cache-store.d.ts +481 -0
  115. package/dist/types.backup/cache/cf/cf-cache-types.d.ts +300 -0
  116. package/dist/types.backup/cache/cf/cf-kv-utils.d.ts +22 -0
  117. package/dist/types.backup/cache/cf/cf-tag-marker-memo.d.ts +15 -0
  118. package/dist/types.backup/cache/cf/index.d.ts +3 -0
  119. package/dist/types.backup/cache/document-cache.d.ts +69 -0
  120. package/dist/types.backup/cache/handle-capture.d.ts +23 -0
  121. package/dist/types.backup/cache/handle-snapshot.d.ts +39 -0
  122. package/dist/types.backup/cache/index.d.ts +7 -0
  123. package/dist/types.backup/cache/memory-segment-store.d.ts +163 -0
  124. package/dist/types.backup/cache/profile-registry.d.ts +40 -0
  125. package/dist/types.backup/cache/read-through-swr.d.ts +60 -0
  126. package/dist/types.backup/cache/segment-codec.d.ts +78 -0
  127. package/dist/types.backup/cache/shell-snapshot.d.ts +162 -0
  128. package/dist/types.backup/cache/tag-invalidation.d.ts +74 -0
  129. package/dist/types.backup/cache/taint.d.ts +71 -0
  130. package/dist/types.backup/cache/types.d.ts +407 -0
  131. package/dist/types.backup/cache/vercel/index.d.ts +1 -0
  132. package/dist/types.backup/cache/vercel/vercel-cache-store.d.ts +267 -0
  133. package/dist/types.backup/client.d.ts +184 -0
  134. package/dist/types.backup/client.rsc.d.ts +39 -0
  135. package/dist/types.backup/cloudflare/index.d.ts +7 -0
  136. package/dist/types.backup/cloudflare/tracing.d.ts +53 -0
  137. package/dist/types.backup/component-utils.d.ts +46 -0
  138. package/dist/types.backup/components/DefaultDocument.d.ts +13 -0
  139. package/dist/types.backup/context-var.d.ts +84 -0
  140. package/dist/types.backup/debug.d.ts +57 -0
  141. package/dist/types.backup/decode-loader-results.d.ts +5 -0
  142. package/dist/types.backup/default-error-boundary.d.ts +10 -0
  143. package/dist/types.backup/defer.d.ts +89 -0
  144. package/dist/types.backup/deps/browser.d.ts +1 -0
  145. package/dist/types.backup/deps/html-stream-client.d.ts +1 -0
  146. package/dist/types.backup/deps/html-stream-server.d.ts +1 -0
  147. package/dist/types.backup/deps/rsc.d.ts +1 -0
  148. package/dist/types.backup/deps/ssr.d.ts +1 -0
  149. package/dist/types.backup/encode-kv.d.ts +35 -0
  150. package/dist/types.backup/errors.d.ts +226 -0
  151. package/dist/types.backup/escape-script.d.ts +44 -0
  152. package/dist/types.backup/handle.d.ts +93 -0
  153. package/dist/types.backup/handles/MetaTags.d.ts +17 -0
  154. package/dist/types.backup/handles/Scripts.d.ts +38 -0
  155. package/dist/types.backup/handles/breadcrumbs.d.ts +43 -0
  156. package/dist/types.backup/handles/deferred-resolution.d.ts +53 -0
  157. package/dist/types.backup/handles/is-thenable.d.ts +12 -0
  158. package/dist/types.backup/handles/meta.d.ts +43 -0
  159. package/dist/types.backup/handles/script.d.ts +139 -0
  160. package/dist/types.backup/host/cookie-handler.d.ts +8 -0
  161. package/dist/types.backup/host/errors.d.ts +40 -0
  162. package/dist/types.backup/host/index.d.ts +33 -0
  163. package/dist/types.backup/host/pattern-matcher.d.ts +30 -0
  164. package/dist/types.backup/host/router.d.ts +12 -0
  165. package/dist/types.backup/host/testing.d.ts +41 -0
  166. package/dist/types.backup/host/types.d.ts +148 -0
  167. package/dist/types.backup/host/utils.d.ts +20 -0
  168. package/dist/types.backup/href-client.d.ts +214 -0
  169. package/dist/types.backup/index.d.ts +112 -0
  170. package/dist/types.backup/index.rsc.d.ts +51 -0
  171. package/dist/types.backup/internal-debug.d.ts +1 -0
  172. package/dist/types.backup/loader-store.d.ts +193 -0
  173. package/dist/types.backup/loader.d.ts +18 -0
  174. package/dist/types.backup/loader.rsc.d.ts +18 -0
  175. package/dist/types.backup/missing-id-error.d.ts +1 -0
  176. package/dist/types.backup/outlet-context.d.ts +12 -0
  177. package/dist/types.backup/outlet-provider.d.ts +12 -0
  178. package/dist/types.backup/prerender/build-shell-capture.d.ts +104 -0
  179. package/dist/types.backup/prerender/param-hash.d.ts +6 -0
  180. package/dist/types.backup/prerender/shell-manifest-key.d.ts +18 -0
  181. package/dist/types.backup/prerender/store.d.ts +62 -0
  182. package/dist/types.backup/prerender.d.ts +292 -0
  183. package/dist/types.backup/redirect-origin.d.ts +55 -0
  184. package/dist/types.backup/regex-escape.d.ts +6 -0
  185. package/dist/types.backup/render-error-thrower.d.ts +13 -0
  186. package/dist/types.backup/response-utils.d.ts +35 -0
  187. package/dist/types.backup/reverse.d.ts +206 -0
  188. package/dist/types.backup/root-error-boundary.d.ts +32 -0
  189. package/dist/types.backup/route-content-wrapper.d.ts +40 -0
  190. package/dist/types.backup/route-definition/dsl-helpers.d.ts +130 -0
  191. package/dist/types.backup/route-definition/helper-factories.d.ts +22 -0
  192. package/dist/types.backup/route-definition/helpers-types.d.ts +392 -0
  193. package/dist/types.backup/route-definition/index.d.ts +7 -0
  194. package/dist/types.backup/route-definition/redirect.d.ts +48 -0
  195. package/dist/types.backup/route-definition/resolve-handler-use.d.ts +19 -0
  196. package/dist/types.backup/route-definition/use-item-types.d.ts +1 -0
  197. package/dist/types.backup/route-definition.d.ts +1 -0
  198. package/dist/types.backup/route-map-builder.d.ts +127 -0
  199. package/dist/types.backup/route-name.d.ts +27 -0
  200. package/dist/types.backup/route-types.d.ts +172 -0
  201. package/dist/types.backup/router/basename.d.ts +10 -0
  202. package/dist/types.backup/router/content-negotiation.d.ts +91 -0
  203. package/dist/types.backup/router/debug-manifest.d.ts +7 -0
  204. package/dist/types.backup/router/error-handling.d.ts +76 -0
  205. package/dist/types.backup/router/find-match.d.ts +19 -0
  206. package/dist/types.backup/router/handler-context.d.ts +41 -0
  207. package/dist/types.backup/router/instrument.d.ts +161 -0
  208. package/dist/types.backup/router/intercept-resolution.d.ts +79 -0
  209. package/dist/types.backup/router/lazy-includes.d.ts +26 -0
  210. package/dist/types.backup/router/loader-resolution.d.ts +63 -0
  211. package/dist/types.backup/router/logging.d.ts +41 -0
  212. package/dist/types.backup/router/manifest.d.ts +8 -0
  213. package/dist/types.backup/router/match-api.d.ts +19 -0
  214. package/dist/types.backup/router/match-context.d.ts +184 -0
  215. package/dist/types.backup/router/match-handlers.d.ts +49 -0
  216. package/dist/types.backup/router/match-middleware/background-revalidation.d.ts +113 -0
  217. package/dist/types.backup/router/match-middleware/cache-lookup.d.ts +113 -0
  218. package/dist/types.backup/router/match-middleware/cache-store.d.ts +112 -0
  219. package/dist/types.backup/router/match-middleware/index.d.ts +80 -0
  220. package/dist/types.backup/router/match-middleware/intercept-resolution.d.ts +116 -0
  221. package/dist/types.backup/router/match-middleware/segment-resolution.d.ts +94 -0
  222. package/dist/types.backup/router/match-pipelines.d.ts +103 -0
  223. package/dist/types.backup/router/match-result.d.ts +114 -0
  224. package/dist/types.backup/router/metrics.d.ts +6 -0
  225. package/dist/types.backup/router/middleware-types.d.ts +74 -0
  226. package/dist/types.backup/router/middleware.d.ts +116 -0
  227. package/dist/types.backup/router/navigation-snapshot.d.ts +22 -0
  228. package/dist/types.backup/router/params-util.d.ts +8 -0
  229. package/dist/types.backup/router/parse-pattern.d.ts +38 -0
  230. package/dist/types.backup/router/pattern-matching.d.ts +169 -0
  231. package/dist/types.backup/router/prefetch-cache-ttl.d.ts +27 -0
  232. package/dist/types.backup/router/prefetch-limits.d.ts +20 -0
  233. package/dist/types.backup/router/prerender-match.d.ts +50 -0
  234. package/dist/types.backup/router/preview-match.d.ts +22 -0
  235. package/dist/types.backup/router/request-classification.d.ts +104 -0
  236. package/dist/types.backup/router/revalidation.d.ts +57 -0
  237. package/dist/types.backup/router/route-snapshot.d.ts +112 -0
  238. package/dist/types.backup/router/router-context.d.ts +137 -0
  239. package/dist/types.backup/router/router-interfaces.d.ts +432 -0
  240. package/dist/types.backup/router/router-options.d.ts +738 -0
  241. package/dist/types.backup/router/router-registry.d.ts +15 -0
  242. package/dist/types.backup/router/segment-resolution/fresh.d.ts +55 -0
  243. package/dist/types.backup/router/segment-resolution/helpers.d.ts +93 -0
  244. package/dist/types.backup/router/segment-resolution/loader-cache.d.ts +33 -0
  245. package/dist/types.backup/router/segment-resolution/loader-mask.d.ts +44 -0
  246. package/dist/types.backup/router/segment-resolution/loader-snapshot.d.ts +90 -0
  247. package/dist/types.backup/router/segment-resolution/mask-nested.d.ts +53 -0
  248. package/dist/types.backup/router/segment-resolution/revalidation.d.ts +85 -0
  249. package/dist/types.backup/router/segment-resolution/static-store.d.ts +17 -0
  250. package/dist/types.backup/router/segment-resolution/streamed-handler-telemetry.d.ts +16 -0
  251. package/dist/types.backup/router/segment-resolution/view-transition-default.d.ts +28 -0
  252. package/dist/types.backup/router/segment-resolution.d.ts +3 -0
  253. package/dist/types.backup/router/segment-wrappers.d.ts +53 -0
  254. package/dist/types.backup/router/state-cookie-name.d.ts +1 -0
  255. package/dist/types.backup/router/substitute-pattern-params.d.ts +23 -0
  256. package/dist/types.backup/router/telemetry-otel.d.ts +113 -0
  257. package/dist/types.backup/router/telemetry.d.ts +215 -0
  258. package/dist/types.backup/router/timeout.d.ts +68 -0
  259. package/dist/types.backup/router/tracing.d.ts +125 -0
  260. package/dist/types.backup/router/trie-matching.d.ts +32 -0
  261. package/dist/types.backup/router/types.d.ts +98 -0
  262. package/dist/types.backup/router/url-params.d.ts +26 -0
  263. package/dist/types.backup/router.d.ts +7 -0
  264. package/dist/types.backup/rsc/capture-queue.d.ts +6 -0
  265. package/dist/types.backup/rsc/full-payload.d.ts +22 -0
  266. package/dist/types.backup/rsc/handler-context.d.ts +31 -0
  267. package/dist/types.backup/rsc/handler.d.ts +9 -0
  268. package/dist/types.backup/rsc/helpers.d.ts +213 -0
  269. package/dist/types.backup/rsc/index.d.ts +17 -0
  270. package/dist/types.backup/rsc/json-route-result.d.ts +20 -0
  271. package/dist/types.backup/rsc/loader-fetch.d.ts +14 -0
  272. package/dist/types.backup/rsc/manifest-init.d.ts +18 -0
  273. package/dist/types.backup/rsc/nonce.d.ts +28 -0
  274. package/dist/types.backup/rsc/origin-guard.d.ts +50 -0
  275. package/dist/types.backup/rsc/progressive-enhancement.d.ts +19 -0
  276. package/dist/types.backup/rsc/redirect-guard.d.ts +35 -0
  277. package/dist/types.backup/rsc/response-cache-serve.d.ts +46 -0
  278. package/dist/types.backup/rsc/response-error.d.ts +19 -0
  279. package/dist/types.backup/rsc/response-route-handler.d.ts +29 -0
  280. package/dist/types.backup/rsc/rsc-rendering.d.ts +23 -0
  281. package/dist/types.backup/rsc/runtime-warnings.d.ts +22 -0
  282. package/dist/types.backup/rsc/server-action.d.ts +68 -0
  283. package/dist/types.backup/rsc/shell-build-manifest.d.ts +84 -0
  284. package/dist/types.backup/rsc/shell-capture-constants.d.ts +27 -0
  285. package/dist/types.backup/rsc/shell-capture.d.ts +374 -0
  286. package/dist/types.backup/rsc/shell-serve.d.ts +136 -0
  287. package/dist/types.backup/rsc/ssr-setup.d.ts +48 -0
  288. package/dist/types.backup/rsc/transition-gate.d.ts +27 -0
  289. package/dist/types.backup/rsc/types.d.ts +290 -0
  290. package/dist/types.backup/runtime-env.d.ts +1 -0
  291. package/dist/types.backup/search-params.d.ts +125 -0
  292. package/dist/types.backup/segment-content-promise.d.ts +13 -0
  293. package/dist/types.backup/segment-fragments.d.ts +56 -0
  294. package/dist/types.backup/segment-loader-promise.d.ts +22 -0
  295. package/dist/types.backup/segment-system.d.ts +84 -0
  296. package/dist/types.backup/serialize.d.ts +164 -0
  297. package/dist/types.backup/server/context.d.ts +494 -0
  298. package/dist/types.backup/server/cookie-parse.d.ts +10 -0
  299. package/dist/types.backup/server/cookie-store.d.ts +107 -0
  300. package/dist/types.backup/server/fetchable-loader-store.d.ts +20 -0
  301. package/dist/types.backup/server/handle-store.d.ts +100 -0
  302. package/dist/types.backup/server/loader-registry.d.ts +32 -0
  303. package/dist/types.backup/server/request-context.d.ts +596 -0
  304. package/dist/types.backup/server/root-layout.d.ts +3 -0
  305. package/dist/types.backup/server.d.ts +15 -0
  306. package/dist/types.backup/ssr/index.d.ts +233 -0
  307. package/dist/types.backup/ssr/inject-rsc-eager.d.ts +3 -0
  308. package/dist/types.backup/ssr/preinit-client-references.d.ts +71 -0
  309. package/dist/types.backup/ssr/ssr-root.d.ts +69 -0
  310. package/dist/types.backup/static-handler.d.ts +57 -0
  311. package/dist/types.backup/testing/cache-status.d.ts +63 -0
  312. package/dist/types.backup/testing/collect-handle.d.ts +20 -0
  313. package/dist/types.backup/testing/dispatch.d.ts +123 -0
  314. package/dist/types.backup/testing/dom.entry.d.ts +15 -0
  315. package/dist/types.backup/testing/e2e/fixture.d.ts +37 -0
  316. package/dist/types.backup/testing/e2e/index.d.ts +30 -0
  317. package/dist/types.backup/testing/e2e/matchers.d.ts +17 -0
  318. package/dist/types.backup/testing/e2e/page-helpers.d.ts +62 -0
  319. package/dist/types.backup/testing/e2e/parity.d.ts +111 -0
  320. package/dist/types.backup/testing/e2e/server.d.ts +35 -0
  321. package/dist/types.backup/testing/flight-matchers.d.ts +55 -0
  322. package/dist/types.backup/testing/flight-normalize.d.ts +1 -0
  323. package/dist/types.backup/testing/flight-tree.d.ts +192 -0
  324. package/dist/types.backup/testing/flight.d.ts +115 -0
  325. package/dist/types.backup/testing/flight.entry.d.ts +27 -0
  326. package/dist/types.backup/testing/generated-routes.d.ts +66 -0
  327. package/dist/types.backup/testing/index.d.ts +52 -0
  328. package/dist/types.backup/testing/internal/context.d.ts +225 -0
  329. package/dist/types.backup/testing/internal/flight-client-globals.d.ts +1 -0
  330. package/dist/types.backup/testing/internal/seed-vars.d.ts +30 -0
  331. package/dist/types.backup/testing/render-handler.d.ts +160 -0
  332. package/dist/types.backup/testing/render-route.d.ts +246 -0
  333. package/dist/types.backup/testing/run-loader.d.ts +186 -0
  334. package/dist/types.backup/testing/run-middleware.d.ts +132 -0
  335. package/dist/types.backup/testing/run-transition-when.d.ts +77 -0
  336. package/dist/types.backup/testing/vitest-stubs/cloudflare-email.d.ts +6 -0
  337. package/dist/types.backup/testing/vitest-stubs/cloudflare-workers.d.ts +13 -0
  338. package/dist/types.backup/testing/vitest-stubs/plugin-rsc.d.ts +7 -0
  339. package/dist/types.backup/testing/vitest-stubs/version.d.ts +1 -0
  340. package/dist/types.backup/testing/vitest.d.ts +205 -0
  341. package/dist/types.backup/theme/ThemeProvider.d.ts +13 -0
  342. package/dist/types.backup/theme/ThemeScript.d.ts +45 -0
  343. package/dist/types.backup/theme/constants.d.ts +39 -0
  344. package/dist/types.backup/theme/index.d.ts +29 -0
  345. package/dist/types.backup/theme/theme-context.d.ts +21 -0
  346. package/dist/types.backup/theme/theme-script.d.ts +26 -0
  347. package/dist/types.backup/theme/types.d.ts +162 -0
  348. package/dist/types.backup/theme/use-theme.d.ts +8 -0
  349. package/dist/types.backup/types/boundaries.d.ts +93 -0
  350. package/dist/types.backup/types/cache-types.d.ts +191 -0
  351. package/dist/types.backup/types/error-types.d.ts +114 -0
  352. package/dist/types.backup/types/global-namespace.d.ts +90 -0
  353. package/dist/types.backup/types/handler-context.d.ts +658 -0
  354. package/dist/types.backup/types/index.d.ts +11 -0
  355. package/dist/types.backup/types/loader-types.d.ts +182 -0
  356. package/dist/types.backup/types/request-scope.d.ts +93 -0
  357. package/dist/types.backup/types/route-config.d.ts +105 -0
  358. package/dist/types.backup/types/route-entry.d.ts +95 -0
  359. package/dist/types.backup/types/segments.d.ts +234 -0
  360. package/dist/types.backup/types.d.ts +1 -0
  361. package/dist/types.backup/urls/include-helper.d.ts +17 -0
  362. package/dist/types.backup/urls/include-provider.d.ts +27 -0
  363. package/dist/types.backup/urls/index.d.ts +6 -0
  364. package/dist/types.backup/urls/path-helper-types.d.ts +197 -0
  365. package/dist/types.backup/urls/path-helper.d.ts +12 -0
  366. package/dist/types.backup/urls/pattern-types.d.ts +166 -0
  367. package/dist/types.backup/urls/response-types.d.ts +67 -0
  368. package/dist/types.backup/urls/type-extraction.d.ts +157 -0
  369. package/dist/types.backup/urls/urls-function.d.ts +24 -0
  370. package/dist/types.backup/urls.d.ts +1 -0
  371. package/dist/types.backup/use-loader.d.ts +150 -0
  372. package/dist/types.backup/vercel/index.d.ts +10 -0
  373. package/dist/types.backup/vercel/tracing.d.ts +70 -0
  374. package/dist/types.backup/vite/debug.d.ts +80 -0
  375. package/dist/types.backup/vite/discovery/bundle-postprocess.d.ts +12 -0
  376. package/dist/types.backup/vite/discovery/dev-prerender-cache.d.ts +65 -0
  377. package/dist/types.backup/vite/discovery/discover-routers.d.ts +17 -0
  378. package/dist/types.backup/vite/discovery/discovery-errors.d.ts +113 -0
  379. package/dist/types.backup/vite/discovery/gate-state.d.ts +79 -0
  380. package/dist/types.backup/vite/discovery/prerender-collection.d.ts +24 -0
  381. package/dist/types.backup/vite/discovery/route-types-writer.d.ts +32 -0
  382. package/dist/types.backup/vite/discovery/self-gen-tracking.d.ts +22 -0
  383. package/dist/types.backup/vite/discovery/shell-prerender-phase.d.ts +40 -0
  384. package/dist/types.backup/vite/discovery/state.d.ts +162 -0
  385. package/dist/types.backup/vite/discovery/virtual-module-codegen.d.ts +15 -0
  386. package/dist/types.backup/vite/index.d.ts +11 -0
  387. package/dist/types.backup/vite/inject-client-debug.d.ts +56 -0
  388. package/dist/types.backup/vite/plugin-types.d.ts +298 -0
  389. package/dist/types.backup/vite/plugins/cjs-to-esm.d.ts +6 -0
  390. package/dist/types.backup/vite/plugins/client-ref-dedup.d.ts +40 -0
  391. package/dist/types.backup/vite/plugins/client-ref-hashing.d.ts +35 -0
  392. package/dist/types.backup/vite/plugins/cloudflare-protocol-stub.d.ts +64 -0
  393. package/dist/types.backup/vite/plugins/expose-action-id.d.ts +18 -0
  394. package/dist/types.backup/vite/plugins/expose-id-utils.d.ts +37 -0
  395. package/dist/types.backup/vite/plugins/expose-ids/export-analysis.d.ts +19 -0
  396. package/dist/types.backup/vite/plugins/expose-ids/handler-transform.d.ts +10 -0
  397. package/dist/types.backup/vite/plugins/expose-ids/loader-transform.d.ts +8 -0
  398. package/dist/types.backup/vite/plugins/expose-ids/router-transform.d.ts +13 -0
  399. package/dist/types.backup/vite/plugins/expose-ids/types.d.ts +29 -0
  400. package/dist/types.backup/vite/plugins/expose-internal-ids.d.ts +6 -0
  401. package/dist/types.backup/vite/plugins/performance-tracks.d.ts +25 -0
  402. package/dist/types.backup/vite/plugins/refresh-cmd.d.ts +20 -0
  403. package/dist/types.backup/vite/plugins/use-cache-transform.d.ts +20 -0
  404. package/dist/types.backup/vite/plugins/vercel-output.d.ts +85 -0
  405. package/dist/types.backup/vite/plugins/version-injector.d.ts +21 -0
  406. package/dist/types.backup/vite/plugins/version-plugin.d.ts +19 -0
  407. package/dist/types.backup/vite/plugins/virtual-entries.d.ts +36 -0
  408. package/dist/types.backup/vite/plugins/virtual-stub-plugin.d.ts +7 -0
  409. package/dist/types.backup/vite/rango.d.ts +29 -0
  410. package/dist/types.backup/vite/router-discovery.d.ts +23 -0
  411. package/dist/types.backup/vite/utils/ast-handler-extract.d.ts +64 -0
  412. package/dist/types.backup/vite/utils/banner.d.ts +2 -0
  413. package/dist/types.backup/vite/utils/bundle-analysis.d.ts +28 -0
  414. package/dist/types.backup/vite/utils/client-chunks.d.ts +55 -0
  415. package/dist/types.backup/vite/utils/directive-prologue.d.ts +16 -0
  416. package/dist/types.backup/vite/utils/forward-user-plugins.d.ts +37 -0
  417. package/dist/types.backup/vite/utils/manifest-utils.d.ts +7 -0
  418. package/dist/types.backup/vite/utils/package-resolution.d.ts +6 -0
  419. package/dist/types.backup/vite/utils/prerender-utils.d.ts +32 -0
  420. package/dist/types.backup/vite/utils/shared-utils.d.ts +55 -0
  421. package/dist/vite/index.js +5 -2
  422. package/package.json +20 -21
  423. package/skills/cache-guide/SKILL.md +6 -3
  424. package/skills/catalog.json +7 -1
  425. package/skills/comparison/references/framework-comparison.md +2 -1
  426. package/skills/deployment-caching/SKILL.md +176 -0
  427. package/skills/document-cache/SKILL.md +30 -3
  428. package/skills/ppr/SKILL.md +81 -34
  429. package/skills/prerender/SKILL.md +15 -8
  430. package/skills/rango/SKILL.md +20 -17
  431. package/skills/router-setup/SKILL.md +4 -0
  432. package/skills/testing/SKILL.md +1 -1
  433. package/skills/testing/cache-prerender.md +5 -1
  434. package/skills/vercel/SKILL.md +22 -1
  435. package/skills/view-transitions/SKILL.md +12 -8
  436. package/src/browser/prefetch/default-strategy.ts +34 -0
  437. package/src/browser/prefetch/loader.ts +6 -12
  438. package/src/browser/prefetch/runtime.ts +0 -1
  439. package/src/browser/react/Link.tsx +22 -21
  440. package/src/browser/rsc-router.tsx +8 -0
  441. package/src/browser/types.ts +5 -0
  442. package/src/cache/cache-scope.ts +6 -1
  443. package/src/cache/cf/cf-cache-store.ts +4 -0
  444. package/src/cache/document-cache.ts +4 -2
  445. package/src/cache/types.ts +10 -3
  446. package/src/cache/vercel/vercel-cache-store.ts +6 -1
  447. package/src/route-definition/helpers-types.ts +6 -6
  448. package/src/router/match-handlers.ts +44 -6
  449. package/src/router/match-middleware/cache-lookup.ts +10 -3
  450. package/src/router/prefetch-default.ts +59 -0
  451. package/src/router/router-interfaces.ts +8 -0
  452. package/src/router/router-options.ts +31 -0
  453. package/src/router/segment-resolution/view-transition-default.ts +9 -5
  454. package/src/router/transition-when.ts +76 -0
  455. package/src/router.ts +7 -0
  456. package/src/rsc/capture-queue.ts +24 -1
  457. package/src/rsc/full-payload.ts +1 -0
  458. package/src/rsc/handler.ts +1 -0
  459. package/src/rsc/progressive-enhancement.ts +9 -14
  460. package/src/rsc/rsc-rendering.ts +261 -48
  461. package/src/rsc/shell-capture.ts +94 -50
  462. package/src/rsc/shell-serve.ts +9 -4
  463. package/src/rsc/transition-gate.ts +37 -40
  464. package/src/rsc/types.ts +2 -0
  465. package/src/server/request-context.ts +6 -0
  466. package/src/testing/e2e/index.ts +11 -0
  467. package/src/testing/e2e/page-helpers.ts +47 -0
  468. package/src/testing/e2e/parity.ts +13 -0
  469. package/src/testing/index.ts +9 -1
  470. package/src/testing/run-transition-when.ts +42 -9
  471. package/src/testing/shell-status.ts +92 -3
  472. package/src/types/segments.ts +27 -22
  473. package/src/urls/path-helper-types.ts +4 -3
@@ -2,7 +2,8 @@
2
2
  * PPR shell-status testing primitives for @rangojs/router consumers.
3
3
  *
4
4
  * Companion to `cache-status.ts` (segment/document cache): this module covers
5
- * the **shell axis** (`ppr` path option → `x-rango-shell: HIT | MISS`).
5
+ * the **shell axis** (`ppr` path option → `x-rango-shell: HIT | MISS`) and
6
+ * partial-navigation segment replay (`x-rango-ppr-replay: HIT`).
6
7
  *
7
8
  * ## Spike conclusions (plan 009)
8
9
  *
@@ -11,8 +12,9 @@
11
12
  * + `ppr: true` on a response route is a no-op for shell serve/capture. The
12
13
  * production path lives in `rsc/rsc-rendering.ts` + `rsc/shell-capture.ts`.
13
14
  *
14
- * 2. **Smallest HIT signal:** response header `x-rango-shell` (`HIT` | `MISS`),
15
- * always on document GETs to a ppr route that the serve path considered.
15
+ * 2. **Smallest status signals:** `x-rango-shell` (`HIT` | `MISS`) on document
16
+ * GETs, and `x-rango-ppr-replay` on partial requests to ppr routes. A replay
17
+ * HIT is reported only when matching consumes the captured segment record.
16
18
  * Secondary unit signal: `store.getShell(shellCacheKey(url))` after a real
17
19
  * capture flush (background `putShell`). There is no Flight flag for shell HIT.
18
20
  *
@@ -27,8 +29,21 @@
27
29
  */
28
30
  /** Production header name (`rsc/shell-serve.ts` `SHELL_STATUS_HEADER`). */
29
31
  export declare const SHELL_STATUS_HEADER: string;
32
+ /** Partial-navigation replay decision header from `rsc/rsc-rendering.ts`. */
33
+ export declare const PPR_REPLAY_STATUS_HEADER: string;
30
34
  /** Values the serve path writes on `x-rango-shell`. */
31
35
  export type ShellStatus = "HIT" | "MISS";
36
+ declare const PPR_REPLAY_BYPASS_REASONS: readonly ["method", "dynamic", "nonce", "store-unavailable", "passive-read-unsupported", "read-error", "no-entry", "invalid-version", "corrupt-entry", "handler-live-holes", "transition-when", "no-segment-snapshot", "snapshot-miss", "stale-build-entry"];
37
+ /** Bounded reasons a PPR partial request can fall open to ordinary matching. */
38
+ export type PprReplayBypassReason = (typeof PPR_REPLAY_BYPASS_REASONS)[number];
39
+ /** Parsed `x-rango-ppr-replay` value. */
40
+ export type PprReplayStatus = {
41
+ outcome: "HIT";
42
+ freshness: "fresh" | "stale";
43
+ } | {
44
+ outcome: "BYPASS";
45
+ reason: PprReplayBypassReason;
46
+ };
32
47
  /** A target carrying response headers (a Response or a `{ headers }` object). */
33
48
  export type ShellStatusTarget = Response | {
34
49
  headers: Headers;
@@ -56,3 +71,8 @@ export declare function parseShellStatus(target: ShellStatusTarget): ShellStatus
56
71
  * invent a HIT Response in unit tests — that fakes the serve path.
57
72
  */
58
73
  export declare function assertShellStatus(target: ShellStatusTarget, expected: ShellStatus): void;
74
+ /** Parse the dedicated PPR partial-navigation replay decision header. */
75
+ export declare function parsePprReplayStatus(target: ShellStatusTarget): PprReplayStatus | null;
76
+ /** Assert a partial response's PPR replay outcome and freshness/reason. */
77
+ export declare function assertPprReplayStatus(target: ShellStatusTarget, expected: PprReplayStatus): void;
78
+ export {};
@@ -12,11 +12,12 @@ export type ViewTransitionClass = Record<string, string> | string;
12
12
  *
13
13
  * It mirrors the {@link ShouldRevalidateFn} args a `revalidate()` predicate
14
14
  * gets — the same navigation/action metadata — so the two read the same shape,
15
- * plus `get`/`env` for post-handler reads. There is no full `HandlerContext`
15
+ * plus `get`/`env` for request-context reads. There is no full `HandlerContext`
16
16
  * here: the gate runs at the RSC-payload layer with the request context, not a
17
17
  * handler context, so handler-only sugar (`search`/`build`/`dev`/`headers`) is
18
- * absent by design. `get` is the way to read what the handler/middleware set
19
- * via `ctx.set(...)` this request.
18
+ * absent by design. On ordinary routes, `get` can read what handlers or
19
+ * middleware set via `ctx.set(...)`. On `ppr` routes the gate runs before route
20
+ * handlers, so only middleware-established values are available.
20
21
  *
21
22
  * Field availability (all source fields are optional — never fabricated):
22
23
  * - `currentUrl` / `currentParams` / `fromRouteName` (the navigation SOURCE) are
@@ -41,27 +42,30 @@ export type ViewTransitionClass = Record<string, string> | string;
41
42
  * time, so `currentUrl`/`currentParams`/`fromRouteName` reflect the page the
42
43
  * prefetch fired from, NOT necessarily the page the user actually navigates from
43
44
  * — the decision is baked into the stored Flight payload and replayed verbatim.
44
- * A `cache()`/prerender hit replays the stored transition with the predicate NOT
45
- * re-run at all. So a source-sensitive predicate can be frozen to prefetch-time
46
- * or store-time state. This is accepted (~99% of navigations match), but if your
47
- * gate must reflect the exact click-time source, source-scope the prefetch
48
- * (`<Link prefetchKey=":source">`) and do not `cache()` that segment.
45
+ * A non-PPR `cache()`/prerender hit replays the stored transition with the
46
+ * predicate NOT re-run. A `ppr` route instead evaluates the predicate before
47
+ * handlers on every match, including cache, prerender, and PPR replay. Prefetch
48
+ * still freezes the server decision into its Flight payload. If the gate must
49
+ * reflect the exact click-time source, source-scope the prefetch
50
+ * (`<Link prefetchKey=":source">`).
49
51
  */
50
52
  export type TransitionWhenContext<TParams = Record<string, string>, TEnv = unknown> = Partial<Pick<RevalidateParams<TParams, TEnv>, "currentUrl" | "currentParams" | "fromRouteName">> & Pick<RevalidateParams<TParams, TEnv>, "nextUrl" | "nextParams" | "toRouteName" | "actionId" | "actionUrl" | "actionResult" | "formData" | "method"> & Pick<HandlerContext<any, TEnv>, "get" | "env">;
51
53
  /**
52
54
  * Predicate that gates whether a transition() applies for the current request.
53
55
  *
54
- * Evaluated server-side AFTER the route's handler runs (so `get(...)` can read
55
- * handler/middleware-set state) and outside any cache scope. Return false to
56
- * drop this segment's transition for the request; return true to apply it. The
56
+ * Evaluated server-side outside any cache scope. On ordinary routes it runs
57
+ * AFTER the route's handler, so `get(...)` can read handler/middleware state. A
58
+ * route with `ppr` automatically hoists it before route handlers and reevaluates
59
+ * it on every cache/prerender/PPR replay; there `get(...)` can read middleware
60
+ * state, but not values set by route handlers. Return false to drop this
61
+ * segment's transition for the request; return true to apply it. The
57
62
  * context ({@link TransitionWhenContext}) carries the same navigation/action
58
63
  * metadata a `revalidate()` predicate sees plus `get`/`env`. If it throws, the
59
64
  * error is reported to the router's onError (phase "rendering") and the
60
65
  * transition is dropped (the navigation does not hold).
61
66
  *
62
67
  * Distinct from intercept()'s `when` config selector, which runs at MATCH time
63
- * over `{ from, to, params, segments, … }`; a transition `when` runs
64
- * post-handler over the resolved payload.
68
+ * over `{ from, to, params, segments, … }`.
65
69
  *
66
70
  * Scope: dropping a transition removes only THIS segment's contribution to the
67
71
  * navigation's hold. The startTransition hold is navigation-wide — it engages if
@@ -69,10 +73,10 @@ export type TransitionWhenContext<TParams = Record<string, string>, TEnv = unkno
69
73
  * navigation stream its loading fallback only when no other matched segment
70
74
  * keeps a transition (the common case: a single transition on the route).
71
75
  *
72
- * Evaluated on every fresh (cache-miss) resolution; it is NOT re-run when a
73
- * segment is replayed from the runtime cache or a build-time prerender, and a
74
- * prefetched navigation freezes it to prefetch-time state see the caveat on
75
- * {@link TransitionWhenContext}.
76
+ * On non-PPR routes it runs only during fresh resolution. On PPR routes it runs
77
+ * before handlers for every match, including runtime cache, build-time
78
+ * prerender, and PPR segment replay. A prefetched navigation still freezes the
79
+ * result to prefetch time; see {@link TransitionWhenContext}.
76
80
  */
77
81
  export type TransitionWhenFn = (ctx: TransitionWhenContext) => boolean;
78
82
  /**
@@ -105,11 +109,12 @@ export interface TransitionConfig {
105
109
  viewTransition?: "auto" | false;
106
110
  /**
107
111
  * Optional server-side predicate that gates this transition per request. When
108
- * present and it returns false (evaluated post-handler), the router drops this
109
- * segment's transition for the request, so the navigation streams its loading
110
- * fallback instead of holding. The predicate is server-only and never
111
- * serialized to the client; only its resolved effect (transition kept or
112
- * dropped) crosses. See {@link TransitionWhenFn}.
112
+ * present and it returns false, the router drops this segment's transition for
113
+ * the request, so the navigation streams its loading fallback instead of
114
+ * holding. PPR routes evaluate it before route handlers and on every replay;
115
+ * other routes evaluate it after handlers on fresh resolution. The predicate
116
+ * is server-only and never serialized to the client; only its resolved effect
117
+ * crosses. See {@link TransitionWhenFn}.
113
118
  */
114
119
  when?: TransitionWhenFn;
115
120
  }
@@ -183,9 +183,10 @@ export type PathHelpers<TEnv> = {
183
183
  * transition cannot fire without a startTransition. See
184
184
  * skills/view-transitions for the startTransition x ViewTransition matrix.
185
185
  *
186
- * Pass `when: (ctx) => boolean` to gate the transition per request: it runs
187
- * server-side after the route handler (can read `ctx.get(...)`), and returning
188
- * false drops the transition so the navigation streams its loading() skeleton.
186
+ * Pass `when: (ctx) => boolean` to gate the transition per request. It normally
187
+ * runs after the route handler; `ppr` routes automatically run it before route
188
+ * handlers and on every replay, where `ctx.get(...)` sees middleware state but
189
+ * not handler-set values.
189
190
  */
190
191
  transition: {
191
192
  (): TransitionItem;
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Internal Types - Implementation Details
3
+ *
4
+ * @internal
5
+ * These types are for internal use only and should not be relied upon by consumers.
6
+ * They may change without notice between versions.
7
+ *
8
+ * If you find yourself needing these types, please open an issue to discuss
9
+ * adding them to the public API.
10
+ */
11
+ /**
12
+ * @internal
13
+ * Internal representation of a resolved route segment.
14
+ * Used during route matching and rendering pipeline.
15
+ */
16
+ export type { ResolvedSegment, SegmentMetadata } from "./types.js";
17
+ /**
18
+ * @internal
19
+ * Internal match result from route resolution.
20
+ */
21
+ export type { MatchResult, SlotState } from "./types.js";
22
+ /**
23
+ * @internal
24
+ * Context for intercept route selection.
25
+ */
26
+ export type { InterceptSelectorContext, InterceptSegmentsState, InterceptWhenFn, } from "./server/context.js";
27
+ /**
28
+ * @internal
29
+ * RSC protocol payload structure.
30
+ */
31
+ export type { RscPayload, ReactFormState } from "./rsc/types.js";
32
+ /**
33
+ * @internal
34
+ * Internal navigation store interface.
35
+ */
36
+ export type { NavigationStore, NavigationBridge, RscMetadata, ActionResult, InflightAction, NavigationState, TrackedActionState, ActionStateListener, SegmentCache, SegmentState, NavigationUpdate, } from "./browser/types.js";
37
+ /**
38
+ * @internal
39
+ * Internal handle storage mechanism.
40
+ */
41
+ export type { HandleStore, HandleData } from "./server/handle-store.js";
42
+ /**
43
+ * @internal
44
+ * Segment handle data in cache.
45
+ */
46
+ export type { SegmentHandleData } from "./cache/types.js";
47
+ /**
48
+ * @internal
49
+ * Internal cache entry data structure.
50
+ */
51
+ export type { CachedEntryData, CacheGetResult, SerializedSegmentData, CacheDefaults, } from "./cache/types.js";
52
+ /**
53
+ * @internal
54
+ * Router context for AsyncLocalStorage.
55
+ */
56
+ export type { RouterContext, RevalidationContext, InterceptResult, } from "./router/router-context.js";
57
+ /**
58
+ * @internal
59
+ * Route match context during pipeline processing.
60
+ */
61
+ export type { MatchContext, MatchPipelineState, } from "./router/match-context.js";
62
+ /**
63
+ * @internal
64
+ * Pattern matching result.
65
+ */
66
+ export type { RouteMatchResult } from "./router/pattern-matching.js";
67
+ /**
68
+ * @internal
69
+ * Entry data during route traversal.
70
+ */
71
+ export type { EntryData, InterceptEntry, MetricsStore, PerformanceMetric, EntryCacheConfig, EntryPropCommon, EntryPropDatas, LoaderEntry, EntryPropSegments, } from "./server/context.js";
72
+ /**
73
+ * @internal
74
+ * Internal handler context with additional props for router internals.
75
+ * Includes `_currentSegmentId` and `_responseType`.
76
+ */
77
+ export type { InternalHandlerContext } from "./types.js";
78
+ /**
79
+ * @internal
80
+ * Builds React element trees from route segments.
81
+ */
82
+ export { renderSegments } from "./segment-system.js";
83
+ /**
84
+ * @internal
85
+ * Error sanitization and network error utilities.
86
+ */
87
+ export { sanitizeError, NetworkError, isNetworkError } from "./errors.js";
88
+ /**
89
+ * @internal
90
+ * Scoped view of GeneratedRouteMap for Handler<"localName", ScopedRouteMap<"prefix">>.
91
+ */
92
+ export type { ScopedRouteMap } from "./types.js";
93
+ /**
94
+ * @internal
95
+ * Type-level utilities for reverse URL generation.
96
+ */
97
+ export type { MergeRoutes, SanitizePrefix } from "./reverse.js";
98
+ /**
99
+ * @internal
100
+ * Individual telemetry event types.
101
+ */
102
+ export type { RequestStartEvent, RequestEndEvent, RequestErrorEvent, RequestTimeoutEvent, LoaderStartEvent, LoaderEndEvent, LoaderErrorEvent, HandlerErrorEvent, CacheDecisionEvent, RevalidationDecisionEvent, } from "./router/telemetry.js";
103
+ /**
104
+ * @internal
105
+ * Type guard for prerender handler definitions.
106
+ */
107
+ export { isPrerenderHandler, isPassthroughHandler } from "./prerender.js";
108
+ /**
109
+ * @internal
110
+ * Type guard for static handler definitions.
111
+ */
112
+ export { isStaticHandler } from "./static-handler.js";
113
+ /**
114
+ * @internal
115
+ * Sentinel used to tag response-type route entries.
116
+ */
117
+ export { RESPONSE_TYPE } from "./urls.js";
118
+ /**
119
+ * @internal
120
+ * Debug utilities for route matching performance analysis.
121
+ */
122
+ export { enableMatchDebug, getMatchDebugStats, } from "./router/pattern-matching.js";
123
+ /**
124
+ * @internal
125
+ * Debug utilities for manifest inspection and comparison.
126
+ */
127
+ export { serializeManifest, compareManifests, formatManifestDiff, type SerializedEntry, type SerializedManifest, } from "./debug.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,57 @@
1
+ import type { ActionEntry } from "./event-controller.js";
2
+ /**
3
+ * Post-reconciliation action outcome (discriminated union). Error and
4
+ * full-update-unsupported cases are handled inline in the bridge before
5
+ * reconciliation; this only covers successfully-reconciled partial responses.
6
+ */
7
+ type ActionScenario = {
8
+ type: "navigated-away";
9
+ historyKeyChanged: boolean;
10
+ onInterceptRoute: boolean;
11
+ } | {
12
+ type: "hmr-missing";
13
+ } | {
14
+ type: "consolidation-needed";
15
+ segmentIds: string[];
16
+ } | {
17
+ type: "concurrent-skip";
18
+ otherFetchingCount: number;
19
+ } | {
20
+ type: "normal";
21
+ };
22
+ /**
23
+ * Plain data inputs for classifying a post-reconciliation action outcome.
24
+ * No browser objects or controller references — all values are snapshots.
25
+ */
26
+ export interface ActionOutcomeInput {
27
+ /** This action's unique instance ID */
28
+ handleId: string;
29
+ /** All in-flight action entries (snapshot from event controller) */
30
+ inflightActions: Map<string, ActionEntry>;
31
+ /** Whether any concurrent actions occurred (controller-level shared flag) */
32
+ hadAnyConcurrentActions: boolean;
33
+ /** Segments revalidated by concurrent actions (from tracking set) */
34
+ revalidatedSegments: Set<string>;
35
+ /** window.location.pathname captured at action start */
36
+ actionStartPathname: string;
37
+ /** window.location.pathname at classification time */
38
+ currentPathname: string;
39
+ /** window.history.state?.key captured at action start */
40
+ actionStartLocationKey: string | undefined;
41
+ /** window.history.state?.key at classification time */
42
+ currentLocationKey: string | undefined;
43
+ /** Number of segments after reconciliation */
44
+ reconciledSegmentCount: number;
45
+ /** Number of matched segment IDs from server */
46
+ matchedCount: number;
47
+ /** Current intercept source URL (null when not on intercept route) */
48
+ currentInterceptSource: string | null;
49
+ }
50
+ /**
51
+ * Classify a post-reconciliation action outcome. Ordered priority chain: each
52
+ * case assumes the earlier ones are false (e.g. concurrent-skip only applies on
53
+ * the still-current route, consolidation only once no action is still fetching).
54
+ * The bridge calls this to decide whether to render, skip, consolidate, or refetch.
55
+ */
56
+ export declare function classifyActionOutcome(input: ActionOutcomeInput): ActionScenario;
57
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Action fence: a refcounted flag that is raised while a server action is in
3
+ * flight and lowered when it resolves.
4
+ *
5
+ * It replaces the eager cache clear the action bridge used to do at action
6
+ * start. While the fence is up, the decision of whether the action invalidated
7
+ * anything is deferred to the response:
8
+ *
9
+ * - prefetch consumption is suspended (a queued prefetch result is not served),
10
+ * - a genuine navigation during the flight fetches with `cache: "no-store"` so
11
+ * it cannot be served stale bytes from the browser's Vary-keyed HTTP cache,
12
+ * - popstate reads are treated as stale-while-revalidate.
13
+ *
14
+ * Nothing is wiped, rotated, or broadcast while the fence is up — that is what
15
+ * keeps a sibling tab from seeing a pre-commit signal. Refcounted so concurrent
16
+ * actions compose: each action raises and lowers its own reference, and the
17
+ * fence is down only when the count reaches zero.
18
+ *
19
+ * The refcount is a single module-level counter, not keyed by routerId.
20
+ * Consumers (navigation-client.ts, prefetch/fetch.ts, navigation-bridge.ts)
21
+ * read it unscoped, so an action in one router would suppress another router's
22
+ * navigation/prefetch caches. This is correct only because two routers cannot
23
+ * coexist in one live document: an SPA navigation crossing a host-router
24
+ * boundary forces a full document reload (src/router/request-classification.ts
25
+ * app-switch terminal), so there is always exactly one live router per
26
+ * document. A future multi-router-in-one-document feature must not silently
27
+ * inherit this global, cross-router cache suppression.
28
+ */
29
+ export declare function enterActionFence(): void;
30
+ export declare function exitActionFence(): void;
31
+ export declare function isActionFenceActive(): boolean;
32
+ /** Test-only: reset the refcount between cases. */
33
+ export declare function __resetActionFence(): void;
@@ -0,0 +1,34 @@
1
+ import type { ComponentType, ReactNode } from "react";
2
+ /**
3
+ * App-shell metadata: the per-router fields describing the "envelope" around
4
+ * the current app's segment tree — the rootLayout (Document), basename,
5
+ * version, and router identity. Set once from the initial RSC payload and read
6
+ * through the AppShellRef when rendering segments.
7
+ *
8
+ * This is a per-document value. A navigation that crosses a host-router app
9
+ * boundary is a full document load (the server returns X-RSC-Reload for it;
10
+ * see request-classification.ts, mode "app-switch"), so the target app's shell
11
+ * — along with everything else document-level (theme, warmup, prefetch-TTL) —
12
+ * is established fresh by the target app's own load. The shell is never swapped
13
+ * in place within a session.
14
+ */
15
+ export interface AppShell {
16
+ /** Router identity. Used to namespace per-app client state (e.g. the
17
+ * rango-state localStorage key) so sibling apps on the same origin
18
+ * cannot observe each other's cache invalidations. */
19
+ routerId?: string;
20
+ rootLayout?: ComponentType<{
21
+ children: ReactNode;
22
+ }>;
23
+ basename?: string;
24
+ version?: string;
25
+ }
26
+ /**
27
+ * Container for the active app shell. Read-through via `get()` so closures
28
+ * (e.g. the segment renderer) capture the ref and read the shell at call time
29
+ * rather than closing over a stale snapshot.
30
+ */
31
+ export interface AppShellRef {
32
+ get(): AppShell;
33
+ }
34
+ export declare function createAppShellRef(initial: AppShell): AppShellRef;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Mutable app version — updated after HMR revalidation.
3
+ * Read by prefetch, navigation, and context code.
4
+ */
5
+ export declare function getAppVersion(): string | undefined;
6
+ export declare function setAppVersion(version: string | undefined): void;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Connection warmup: keep TLS alive after idle periods.
3
+ *
4
+ * After IDLE_TIMEOUT of no user interaction the connection is marked "cold".
5
+ * On the next pointer/touch interaction or a visibility change, a HEAD request
6
+ * warms the TLS connection before the user actually clicks a link.
7
+ *
8
+ * Extracted from NavigationProvider so the idle/cold/warmup state machine is
9
+ * unit-testable with an injected environment (document, fetch, timers).
10
+ *
11
+ * Ordering bug this guards against: the warmup listeners (mousemove/touchstart)
12
+ * share events with the idle-reset listeners, and the idle-reset listener is
13
+ * registered first, so it clears the live "cold" flag before the warmup
14
+ * listener reads it on the same event. A separate coldLatch — set when the
15
+ * connection goes cold and cleared only when warmup fires or listeners detach,
16
+ * never by the idle reset — lets the warmup decision see the pre-reset cold
17
+ * state regardless of listener ordering.
18
+ */
19
+ type TimerHandle = ReturnType<typeof setTimeout>;
20
+ export interface WarmupEnv {
21
+ doc: Pick<Document, "addEventListener" | "removeEventListener" | "visibilityState">;
22
+ fetch: typeof fetch;
23
+ setTimeout: (fn: () => void, ms: number) => TimerHandle;
24
+ clearTimeout: (handle: TimerHandle | undefined) => void;
25
+ }
26
+ /**
27
+ * Start the connection-warmup state machine. Returns a cleanup function that
28
+ * cancels timers and removes all listeners.
29
+ */
30
+ export declare function startConnectionWarmup(env?: WarmupEnv): () => void;
31
+ export {};
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Rango state cookie: value codec and attribute serialization.
3
+ *
4
+ * Shared by the client (the document.cookie writer in rango-state.ts) and the
5
+ * server (the Set-Cookie writer in invalidateClientCache). Environment-agnostic:
6
+ * no window/document access and no name composition.
7
+ *
8
+ * Name RESOLUTION deliberately lives elsewhere (router init, see
9
+ * router/state-cookie-name.ts). Keeping composition out of this shared module
10
+ * is what lets the client read the server-resolved name verbatim and compose
11
+ * nothing.
12
+ */
13
+ /** Default prefix when `stateCookiePrefix` is unset or empty after sanitization. */
14
+ export declare const DEFAULT_STATE_COOKIE_PREFIX = "rango-state";
15
+ /** Internal response header carrying the keepClientCache() directive. */
16
+ export declare const KEEP_CACHE_HEADER = "x-rango-keep-cache";
17
+ /** True for a per-client signal header. */
18
+ export declare function isPerClientSignalHeader(name: string): boolean;
19
+ /** True if `headers` carries any per-client signal. */
20
+ export declare function hasPerClientSignal(headers: Headers): boolean;
21
+ /** Remove every per-client signal header from `headers` in place. */
22
+ export declare function stripPerClientSignals(headers: Headers): void;
23
+ /**
24
+ * Read the raw, UNDECODED value of a single cookie from a cookie string (a
25
+ * `document.cookie` jar or a request `Cookie` header). Shared by both seats so
26
+ * the client mirror and the server monotonic-guard read the SAME jar entry —
27
+ * their agreement is the guard's contract. First match wins (the entry the
28
+ * client's mirror holds); exact name boundary via the `=`; an empty value
29
+ * (`name=`) returns null (treated as absent, not a usable prior value).
30
+ */
31
+ export declare function getRawCookieValue(cookieString: string | null, name: string): string | null;
32
+ /**
33
+ * Encode a state value for the wire: `encodeURIComponent(version):timestamp`.
34
+ * Only the build-derived version is encoded (it is arbitrary); the `:`
35
+ * separator and numeric timestamp stay raw, so the `{version}:{timestamp}`
36
+ * shape survives and `:` is a legal cookie-value octet.
37
+ */
38
+ export declare function encodeStateValue(version: string, timestamp: number): string;
39
+ /** Parsed state value. `version` is decoded; `timestamp` is the raw integer. */
40
+ export interface StateValue {
41
+ version: string;
42
+ timestamp: number;
43
+ }
44
+ /**
45
+ * Decode a wire value back into `{version, timestamp}`. Returns null for a
46
+ * malformed value (no `:`, empty version, or non-numeric timestamp) so callers
47
+ * mint fresh instead of trusting garbage.
48
+ */
49
+ export declare function decodeStateValue(raw: string): StateValue | null;
50
+ /**
51
+ * Mint a fresh state value whose timestamp is strictly greater than the previous
52
+ * one, so a re-mint inside the same millisecond (or a backward clock step) still
53
+ * differs from the current value. `prevRaw` is the current wire value (the
54
+ * client's in-memory mirror, or the server's inbound header/cookie) or null; its
55
+ * timestamp is the floor. Shared by both seats so the monotonic guard lives once.
56
+ */
57
+ export declare function mintStateValue(version: string, prevRaw: string | null): string;
58
+ /**
59
+ * Attribute string for the state cookie. Session cookie (no Max-Age/Expires),
60
+ * Path=/ (whole app), SameSite=Lax (sent on top-level navigations), and Secure
61
+ * only on https so the document.cookie write does not silently fail on plain
62
+ * http dev. Never HttpOnly (the client reads and writes it).
63
+ */
64
+ export declare function stateCookieAttributes(secure: boolean): string;
65
+ /** Serialize a full `name=value` cookie string with the state attributes. */
66
+ export declare function serializeStateCookie(name: string, value: string, secure: boolean): string;