@rangojs/router 0.5.0 → 0.5.1

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 (405) hide show
  1. package/dist/types/browser/prefetch/cache.d.ts +31 -2
  2. package/dist/types/route-definition/helpers-types.d.ts +5 -4
  3. package/dist/types/static-handler.d.ts +15 -1
  4. package/dist/types/urls/path-helper-types.d.ts +6 -7
  5. package/dist/types.backup/__internal.d.ts +127 -0
  6. package/dist/types.backup/bin/rango.d.ts +1 -0
  7. package/dist/types.backup/browser/action-coordinator.d.ts +57 -0
  8. package/dist/types.backup/browser/action-fence.d.ts +33 -0
  9. package/dist/types.backup/browser/app-shell.d.ts +34 -0
  10. package/dist/types.backup/browser/app-version.d.ts +6 -0
  11. package/dist/types.backup/browser/connection-warmup.d.ts +31 -0
  12. package/dist/types.backup/browser/cookie-name.d.ts +66 -0
  13. package/dist/types.backup/browser/event-controller.d.ts +221 -0
  14. package/dist/types.backup/browser/history-state.d.ts +26 -0
  15. package/dist/types.backup/browser/index.d.ts +1 -0
  16. package/dist/types.backup/browser/intercept-utils.d.ts +30 -0
  17. package/dist/types.backup/browser/invalidate-client-cache.d.ts +17 -0
  18. package/dist/types.backup/browser/link-interceptor.d.ts +43 -0
  19. package/dist/types.backup/browser/logging.d.ts +33 -0
  20. package/dist/types.backup/browser/merge-segment-loaders.d.ts +38 -0
  21. package/dist/types.backup/browser/navigation-bridge.d.ts +27 -0
  22. package/dist/types.backup/browser/navigation-client.d.ts +17 -0
  23. package/dist/types.backup/browser/navigation-store-handle.d.ts +25 -0
  24. package/dist/types.backup/browser/navigation-store.d.ts +95 -0
  25. package/dist/types.backup/browser/navigation-transaction.d.ts +75 -0
  26. package/dist/types.backup/browser/network-error-handler.d.ts +35 -0
  27. package/dist/types.backup/browser/partial-update.d.ts +61 -0
  28. package/dist/types.backup/browser/prefetch/cache.d.ts +183 -0
  29. package/dist/types.backup/browser/prefetch/fetch.d.ts +52 -0
  30. package/dist/types.backup/browser/prefetch/observer.d.ts +27 -0
  31. package/dist/types.backup/browser/prefetch/policy.d.ts +13 -0
  32. package/dist/types.backup/browser/prefetch/queue.d.ts +48 -0
  33. package/dist/types.backup/browser/prefetch/resource-ready.d.ts +28 -0
  34. package/dist/types.backup/browser/rango-state.d.ts +52 -0
  35. package/dist/types.backup/browser/react/Link.d.ts +140 -0
  36. package/dist/types.backup/browser/react/NavigationProvider.d.ts +88 -0
  37. package/dist/types.backup/browser/react/ScrollRestoration.d.ts +78 -0
  38. package/dist/types.backup/browser/react/context.d.ts +54 -0
  39. package/dist/types.backup/browser/react/filter-segment-order.d.ts +35 -0
  40. package/dist/types.backup/browser/react/index.d.ts +1 -0
  41. package/dist/types.backup/browser/react/location-state-shared.d.ts +162 -0
  42. package/dist/types.backup/browser/react/location-state.d.ts +29 -0
  43. package/dist/types.backup/browser/react/mount-context.d.ts +23 -0
  44. package/dist/types.backup/browser/react/nonce-context.d.ts +14 -0
  45. package/dist/types.backup/browser/react/shallow-equal.d.ts +5 -0
  46. package/dist/types.backup/browser/react/use-action.d.ts +61 -0
  47. package/dist/types.backup/browser/react/use-handle.d.ts +21 -0
  48. package/dist/types.backup/browser/react/use-href.d.ts +32 -0
  49. package/dist/types.backup/browser/react/use-link-status.d.ts +36 -0
  50. package/dist/types.backup/browser/react/use-mount.d.ts +24 -0
  51. package/dist/types.backup/browser/react/use-navigation.d.ts +15 -0
  52. package/dist/types.backup/browser/react/use-params.d.ts +21 -0
  53. package/dist/types.backup/browser/react/use-pathname.d.ts +13 -0
  54. package/dist/types.backup/browser/react/use-reverse.d.ts +40 -0
  55. package/dist/types.backup/browser/react/use-router.d.ts +23 -0
  56. package/dist/types.backup/browser/react/use-search-params.d.ts +19 -0
  57. package/dist/types.backup/browser/react/use-segments.d.ts +29 -0
  58. package/dist/types.backup/browser/response-adapter.d.ts +58 -0
  59. package/dist/types.backup/browser/rsc-router.d.ts +141 -0
  60. package/dist/types.backup/browser/scroll-restoration.d.ts +103 -0
  61. package/dist/types.backup/browser/segment-reconciler.d.ts +74 -0
  62. package/dist/types.backup/browser/segment-structure-assert.d.ts +16 -0
  63. package/dist/types.backup/browser/server-action-bridge.d.ts +29 -0
  64. package/dist/types.backup/browser/types.d.ts +530 -0
  65. package/dist/types.backup/browser/validate-redirect-origin.d.ts +28 -0
  66. package/dist/types.backup/build/collect-fallback-refs.d.ts +5 -0
  67. package/dist/types.backup/build/generate-manifest.d.ts +100 -0
  68. package/dist/types.backup/build/generate-route-types.d.ts +8 -0
  69. package/dist/types.backup/build/index.d.ts +21 -0
  70. package/dist/types.backup/build/prefix-tree-utils.d.ts +56 -0
  71. package/dist/types.backup/build/route-trie.d.ts +89 -0
  72. package/dist/types.backup/build/route-types/ast-helpers.d.ts +3 -0
  73. package/dist/types.backup/build/route-types/ast-route-extraction.d.ts +13 -0
  74. package/dist/types.backup/build/route-types/codegen.d.ts +16 -0
  75. package/dist/types.backup/build/route-types/include-resolution.d.ts +74 -0
  76. package/dist/types.backup/build/route-types/param-extraction.d.ts +13 -0
  77. package/dist/types.backup/build/route-types/per-module-writer.d.ts +18 -0
  78. package/dist/types.backup/build/route-types/router-processing.d.ts +82 -0
  79. package/dist/types.backup/build/route-types/scan-filter.d.ts +17 -0
  80. package/dist/types.backup/build/route-types/source-scan.d.ts +13 -0
  81. package/dist/types.backup/build/runtime-discovery.d.ts +24 -0
  82. package/dist/types.backup/cache/background-task.d.ts +21 -0
  83. package/dist/types.backup/cache/cache-error.d.ts +71 -0
  84. package/dist/types.backup/cache/cache-key-utils.d.ts +35 -0
  85. package/dist/types.backup/cache/cache-policy.d.ts +59 -0
  86. package/dist/types.backup/cache/cache-runtime.d.ts +51 -0
  87. package/dist/types.backup/cache/cache-scope.d.ts +134 -0
  88. package/dist/types.backup/cache/cache-tag.d.ts +79 -0
  89. package/dist/types.backup/cache/cf/cf-base64.d.ts +4 -0
  90. package/dist/types.backup/cache/cf/cf-cache-constants.d.ts +105 -0
  91. package/dist/types.backup/cache/cf/cf-cache-store.d.ts +481 -0
  92. package/dist/types.backup/cache/cf/cf-cache-types.d.ts +300 -0
  93. package/dist/types.backup/cache/cf/cf-kv-utils.d.ts +22 -0
  94. package/dist/types.backup/cache/cf/cf-tag-marker-memo.d.ts +15 -0
  95. package/dist/types.backup/cache/cf/index.d.ts +3 -0
  96. package/dist/types.backup/cache/document-cache.d.ts +69 -0
  97. package/dist/types.backup/cache/handle-capture.d.ts +23 -0
  98. package/dist/types.backup/cache/handle-snapshot.d.ts +39 -0
  99. package/dist/types.backup/cache/index.d.ts +7 -0
  100. package/dist/types.backup/cache/memory-segment-store.d.ts +163 -0
  101. package/dist/types.backup/cache/profile-registry.d.ts +40 -0
  102. package/dist/types.backup/cache/read-through-swr.d.ts +60 -0
  103. package/dist/types.backup/cache/segment-codec.d.ts +78 -0
  104. package/dist/types.backup/cache/shell-snapshot.d.ts +162 -0
  105. package/dist/types.backup/cache/tag-invalidation.d.ts +74 -0
  106. package/dist/types.backup/cache/taint.d.ts +71 -0
  107. package/dist/types.backup/cache/types.d.ts +407 -0
  108. package/dist/types.backup/cache/vercel/index.d.ts +1 -0
  109. package/dist/types.backup/cache/vercel/vercel-cache-store.d.ts +267 -0
  110. package/dist/types.backup/client.d.ts +184 -0
  111. package/dist/types.backup/client.rsc.d.ts +39 -0
  112. package/dist/types.backup/cloudflare/index.d.ts +7 -0
  113. package/dist/types.backup/cloudflare/tracing.d.ts +53 -0
  114. package/dist/types.backup/component-utils.d.ts +46 -0
  115. package/dist/types.backup/components/DefaultDocument.d.ts +13 -0
  116. package/dist/types.backup/context-var.d.ts +84 -0
  117. package/dist/types.backup/debug.d.ts +57 -0
  118. package/dist/types.backup/decode-loader-results.d.ts +5 -0
  119. package/dist/types.backup/default-error-boundary.d.ts +10 -0
  120. package/dist/types.backup/defer.d.ts +89 -0
  121. package/dist/types.backup/deps/browser.d.ts +1 -0
  122. package/dist/types.backup/deps/html-stream-client.d.ts +1 -0
  123. package/dist/types.backup/deps/html-stream-server.d.ts +1 -0
  124. package/dist/types.backup/deps/rsc.d.ts +1 -0
  125. package/dist/types.backup/deps/ssr.d.ts +1 -0
  126. package/dist/types.backup/encode-kv.d.ts +35 -0
  127. package/dist/types.backup/errors.d.ts +226 -0
  128. package/dist/types.backup/escape-script.d.ts +44 -0
  129. package/dist/types.backup/handle.d.ts +93 -0
  130. package/dist/types.backup/handles/MetaTags.d.ts +17 -0
  131. package/dist/types.backup/handles/Scripts.d.ts +38 -0
  132. package/dist/types.backup/handles/breadcrumbs.d.ts +43 -0
  133. package/dist/types.backup/handles/deferred-resolution.d.ts +53 -0
  134. package/dist/types.backup/handles/is-thenable.d.ts +12 -0
  135. package/dist/types.backup/handles/meta.d.ts +43 -0
  136. package/dist/types.backup/handles/script.d.ts +139 -0
  137. package/dist/types.backup/host/cookie-handler.d.ts +8 -0
  138. package/dist/types.backup/host/errors.d.ts +40 -0
  139. package/dist/types.backup/host/index.d.ts +33 -0
  140. package/dist/types.backup/host/pattern-matcher.d.ts +30 -0
  141. package/dist/types.backup/host/router.d.ts +12 -0
  142. package/dist/types.backup/host/testing.d.ts +41 -0
  143. package/dist/types.backup/host/types.d.ts +148 -0
  144. package/dist/types.backup/host/utils.d.ts +20 -0
  145. package/dist/types.backup/href-client.d.ts +214 -0
  146. package/dist/types.backup/index.d.ts +112 -0
  147. package/dist/types.backup/index.rsc.d.ts +51 -0
  148. package/dist/types.backup/internal-debug.d.ts +1 -0
  149. package/dist/types.backup/loader-store.d.ts +193 -0
  150. package/dist/types.backup/loader.d.ts +18 -0
  151. package/dist/types.backup/loader.rsc.d.ts +18 -0
  152. package/dist/types.backup/missing-id-error.d.ts +1 -0
  153. package/dist/types.backup/outlet-context.d.ts +12 -0
  154. package/dist/types.backup/outlet-provider.d.ts +12 -0
  155. package/dist/types.backup/prerender/build-shell-capture.d.ts +104 -0
  156. package/dist/types.backup/prerender/param-hash.d.ts +6 -0
  157. package/dist/types.backup/prerender/shell-manifest-key.d.ts +18 -0
  158. package/dist/types.backup/prerender/store.d.ts +62 -0
  159. package/dist/types.backup/prerender.d.ts +292 -0
  160. package/dist/types.backup/redirect-origin.d.ts +55 -0
  161. package/dist/types.backup/regex-escape.d.ts +6 -0
  162. package/dist/types.backup/render-error-thrower.d.ts +13 -0
  163. package/dist/types.backup/response-utils.d.ts +35 -0
  164. package/dist/types.backup/reverse.d.ts +206 -0
  165. package/dist/types.backup/root-error-boundary.d.ts +32 -0
  166. package/dist/types.backup/route-content-wrapper.d.ts +40 -0
  167. package/dist/types.backup/route-definition/dsl-helpers.d.ts +130 -0
  168. package/dist/types.backup/route-definition/helper-factories.d.ts +22 -0
  169. package/dist/types.backup/route-definition/helpers-types.d.ts +392 -0
  170. package/dist/types.backup/route-definition/index.d.ts +7 -0
  171. package/dist/types.backup/route-definition/redirect.d.ts +48 -0
  172. package/dist/types.backup/route-definition/resolve-handler-use.d.ts +19 -0
  173. package/dist/types.backup/route-definition/use-item-types.d.ts +1 -0
  174. package/dist/types.backup/route-definition.d.ts +1 -0
  175. package/dist/types.backup/route-map-builder.d.ts +127 -0
  176. package/dist/types.backup/route-name.d.ts +27 -0
  177. package/dist/types.backup/route-types.d.ts +172 -0
  178. package/dist/types.backup/router/basename.d.ts +10 -0
  179. package/dist/types.backup/router/content-negotiation.d.ts +91 -0
  180. package/dist/types.backup/router/debug-manifest.d.ts +7 -0
  181. package/dist/types.backup/router/error-handling.d.ts +76 -0
  182. package/dist/types.backup/router/find-match.d.ts +19 -0
  183. package/dist/types.backup/router/handler-context.d.ts +41 -0
  184. package/dist/types.backup/router/instrument.d.ts +161 -0
  185. package/dist/types.backup/router/intercept-resolution.d.ts +79 -0
  186. package/dist/types.backup/router/lazy-includes.d.ts +26 -0
  187. package/dist/types.backup/router/loader-resolution.d.ts +63 -0
  188. package/dist/types.backup/router/logging.d.ts +41 -0
  189. package/dist/types.backup/router/manifest.d.ts +8 -0
  190. package/dist/types.backup/router/match-api.d.ts +19 -0
  191. package/dist/types.backup/router/match-context.d.ts +184 -0
  192. package/dist/types.backup/router/match-handlers.d.ts +49 -0
  193. package/dist/types.backup/router/match-middleware/background-revalidation.d.ts +113 -0
  194. package/dist/types.backup/router/match-middleware/cache-lookup.d.ts +113 -0
  195. package/dist/types.backup/router/match-middleware/cache-store.d.ts +112 -0
  196. package/dist/types.backup/router/match-middleware/index.d.ts +80 -0
  197. package/dist/types.backup/router/match-middleware/intercept-resolution.d.ts +116 -0
  198. package/dist/types.backup/router/match-middleware/segment-resolution.d.ts +94 -0
  199. package/dist/types.backup/router/match-pipelines.d.ts +103 -0
  200. package/dist/types.backup/router/match-result.d.ts +114 -0
  201. package/dist/types.backup/router/metrics.d.ts +6 -0
  202. package/dist/types.backup/router/middleware-types.d.ts +74 -0
  203. package/dist/types.backup/router/middleware.d.ts +116 -0
  204. package/dist/types.backup/router/navigation-snapshot.d.ts +22 -0
  205. package/dist/types.backup/router/params-util.d.ts +8 -0
  206. package/dist/types.backup/router/parse-pattern.d.ts +38 -0
  207. package/dist/types.backup/router/pattern-matching.d.ts +169 -0
  208. package/dist/types.backup/router/prefetch-cache-ttl.d.ts +27 -0
  209. package/dist/types.backup/router/prefetch-limits.d.ts +20 -0
  210. package/dist/types.backup/router/prerender-match.d.ts +50 -0
  211. package/dist/types.backup/router/preview-match.d.ts +22 -0
  212. package/dist/types.backup/router/request-classification.d.ts +104 -0
  213. package/dist/types.backup/router/revalidation.d.ts +57 -0
  214. package/dist/types.backup/router/route-snapshot.d.ts +112 -0
  215. package/dist/types.backup/router/router-context.d.ts +137 -0
  216. package/dist/types.backup/router/router-interfaces.d.ts +432 -0
  217. package/dist/types.backup/router/router-options.d.ts +738 -0
  218. package/dist/types.backup/router/router-registry.d.ts +15 -0
  219. package/dist/types.backup/router/segment-resolution/fresh.d.ts +55 -0
  220. package/dist/types.backup/router/segment-resolution/helpers.d.ts +93 -0
  221. package/dist/types.backup/router/segment-resolution/loader-cache.d.ts +33 -0
  222. package/dist/types.backup/router/segment-resolution/loader-mask.d.ts +44 -0
  223. package/dist/types.backup/router/segment-resolution/loader-snapshot.d.ts +90 -0
  224. package/dist/types.backup/router/segment-resolution/mask-nested.d.ts +53 -0
  225. package/dist/types.backup/router/segment-resolution/revalidation.d.ts +85 -0
  226. package/dist/types.backup/router/segment-resolution/static-store.d.ts +17 -0
  227. package/dist/types.backup/router/segment-resolution/streamed-handler-telemetry.d.ts +16 -0
  228. package/dist/types.backup/router/segment-resolution/view-transition-default.d.ts +28 -0
  229. package/dist/types.backup/router/segment-resolution.d.ts +3 -0
  230. package/dist/types.backup/router/segment-wrappers.d.ts +53 -0
  231. package/dist/types.backup/router/state-cookie-name.d.ts +1 -0
  232. package/dist/types.backup/router/substitute-pattern-params.d.ts +23 -0
  233. package/dist/types.backup/router/telemetry-otel.d.ts +113 -0
  234. package/dist/types.backup/router/telemetry.d.ts +215 -0
  235. package/dist/types.backup/router/timeout.d.ts +68 -0
  236. package/dist/types.backup/router/tracing.d.ts +125 -0
  237. package/dist/types.backup/router/trie-matching.d.ts +32 -0
  238. package/dist/types.backup/router/types.d.ts +98 -0
  239. package/dist/types.backup/router/url-params.d.ts +26 -0
  240. package/dist/types.backup/router.d.ts +7 -0
  241. package/dist/types.backup/rsc/capture-queue.d.ts +6 -0
  242. package/dist/types.backup/rsc/full-payload.d.ts +22 -0
  243. package/dist/types.backup/rsc/handler-context.d.ts +31 -0
  244. package/dist/types.backup/rsc/handler.d.ts +9 -0
  245. package/dist/types.backup/rsc/helpers.d.ts +213 -0
  246. package/dist/types.backup/rsc/index.d.ts +17 -0
  247. package/dist/types.backup/rsc/json-route-result.d.ts +20 -0
  248. package/dist/types.backup/rsc/loader-fetch.d.ts +14 -0
  249. package/dist/types.backup/rsc/manifest-init.d.ts +18 -0
  250. package/dist/types.backup/rsc/nonce.d.ts +28 -0
  251. package/dist/types.backup/rsc/origin-guard.d.ts +50 -0
  252. package/dist/types.backup/rsc/progressive-enhancement.d.ts +19 -0
  253. package/dist/types.backup/rsc/redirect-guard.d.ts +35 -0
  254. package/dist/types.backup/rsc/response-cache-serve.d.ts +46 -0
  255. package/dist/types.backup/rsc/response-error.d.ts +19 -0
  256. package/dist/types.backup/rsc/response-route-handler.d.ts +29 -0
  257. package/dist/types.backup/rsc/rsc-rendering.d.ts +23 -0
  258. package/dist/types.backup/rsc/runtime-warnings.d.ts +22 -0
  259. package/dist/types.backup/rsc/server-action.d.ts +68 -0
  260. package/dist/types.backup/rsc/shell-build-manifest.d.ts +84 -0
  261. package/dist/types.backup/rsc/shell-capture-constants.d.ts +27 -0
  262. package/dist/types.backup/rsc/shell-capture.d.ts +374 -0
  263. package/dist/types.backup/rsc/shell-serve.d.ts +136 -0
  264. package/dist/types.backup/rsc/ssr-setup.d.ts +48 -0
  265. package/dist/types.backup/rsc/transition-gate.d.ts +27 -0
  266. package/dist/types.backup/rsc/types.d.ts +290 -0
  267. package/dist/types.backup/runtime-env.d.ts +1 -0
  268. package/dist/types.backup/search-params.d.ts +125 -0
  269. package/dist/types.backup/segment-content-promise.d.ts +13 -0
  270. package/dist/types.backup/segment-fragments.d.ts +56 -0
  271. package/dist/types.backup/segment-loader-promise.d.ts +22 -0
  272. package/dist/types.backup/segment-system.d.ts +84 -0
  273. package/dist/types.backup/serialize.d.ts +164 -0
  274. package/dist/types.backup/server/context.d.ts +494 -0
  275. package/dist/types.backup/server/cookie-parse.d.ts +10 -0
  276. package/dist/types.backup/server/cookie-store.d.ts +107 -0
  277. package/dist/types.backup/server/fetchable-loader-store.d.ts +20 -0
  278. package/dist/types.backup/server/handle-store.d.ts +100 -0
  279. package/dist/types.backup/server/loader-registry.d.ts +32 -0
  280. package/dist/types.backup/server/request-context.d.ts +596 -0
  281. package/dist/types.backup/server/root-layout.d.ts +3 -0
  282. package/dist/types.backup/server.d.ts +15 -0
  283. package/dist/types.backup/ssr/index.d.ts +233 -0
  284. package/dist/types.backup/ssr/inject-rsc-eager.d.ts +3 -0
  285. package/dist/types.backup/ssr/preinit-client-references.d.ts +71 -0
  286. package/dist/types.backup/ssr/ssr-root.d.ts +69 -0
  287. package/dist/types.backup/static-handler.d.ts +57 -0
  288. package/dist/types.backup/testing/cache-status.d.ts +63 -0
  289. package/dist/types.backup/testing/collect-handle.d.ts +20 -0
  290. package/dist/types.backup/testing/dispatch.d.ts +123 -0
  291. package/dist/types.backup/testing/dom.entry.d.ts +15 -0
  292. package/dist/types.backup/testing/e2e/fixture.d.ts +37 -0
  293. package/dist/types.backup/testing/e2e/index.d.ts +30 -0
  294. package/dist/types.backup/testing/e2e/matchers.d.ts +17 -0
  295. package/dist/types.backup/testing/e2e/page-helpers.d.ts +62 -0
  296. package/dist/types.backup/testing/e2e/parity.d.ts +111 -0
  297. package/dist/types.backup/testing/e2e/server.d.ts +35 -0
  298. package/dist/types.backup/testing/flight-matchers.d.ts +55 -0
  299. package/dist/types.backup/testing/flight-normalize.d.ts +1 -0
  300. package/dist/types.backup/testing/flight-tree.d.ts +192 -0
  301. package/dist/types.backup/testing/flight.d.ts +115 -0
  302. package/dist/types.backup/testing/flight.entry.d.ts +27 -0
  303. package/dist/types.backup/testing/generated-routes.d.ts +66 -0
  304. package/dist/types.backup/testing/index.d.ts +52 -0
  305. package/dist/types.backup/testing/internal/context.d.ts +225 -0
  306. package/dist/types.backup/testing/internal/flight-client-globals.d.ts +1 -0
  307. package/dist/types.backup/testing/internal/seed-vars.d.ts +30 -0
  308. package/dist/types.backup/testing/render-handler.d.ts +160 -0
  309. package/dist/types.backup/testing/render-route.d.ts +246 -0
  310. package/dist/types.backup/testing/run-loader.d.ts +186 -0
  311. package/dist/types.backup/testing/run-middleware.d.ts +132 -0
  312. package/dist/types.backup/testing/run-transition-when.d.ts +77 -0
  313. package/dist/types.backup/testing/vitest-stubs/cloudflare-email.d.ts +6 -0
  314. package/dist/types.backup/testing/vitest-stubs/cloudflare-workers.d.ts +13 -0
  315. package/dist/types.backup/testing/vitest-stubs/plugin-rsc.d.ts +7 -0
  316. package/dist/types.backup/testing/vitest-stubs/version.d.ts +1 -0
  317. package/dist/types.backup/testing/vitest.d.ts +205 -0
  318. package/dist/types.backup/theme/ThemeProvider.d.ts +13 -0
  319. package/dist/types.backup/theme/ThemeScript.d.ts +45 -0
  320. package/dist/types.backup/theme/constants.d.ts +39 -0
  321. package/dist/types.backup/theme/index.d.ts +29 -0
  322. package/dist/types.backup/theme/theme-context.d.ts +21 -0
  323. package/dist/types.backup/theme/theme-script.d.ts +26 -0
  324. package/dist/types.backup/theme/types.d.ts +162 -0
  325. package/dist/types.backup/theme/use-theme.d.ts +8 -0
  326. package/dist/types.backup/types/boundaries.d.ts +93 -0
  327. package/dist/types.backup/types/cache-types.d.ts +191 -0
  328. package/dist/types.backup/types/error-types.d.ts +114 -0
  329. package/dist/types.backup/types/global-namespace.d.ts +90 -0
  330. package/dist/types.backup/types/handler-context.d.ts +658 -0
  331. package/dist/types.backup/types/index.d.ts +11 -0
  332. package/dist/types.backup/types/loader-types.d.ts +182 -0
  333. package/dist/types.backup/types/request-scope.d.ts +93 -0
  334. package/dist/types.backup/types/route-config.d.ts +105 -0
  335. package/dist/types.backup/types/route-entry.d.ts +95 -0
  336. package/dist/types.backup/types/segments.d.ts +234 -0
  337. package/dist/types.backup/types.d.ts +1 -0
  338. package/dist/types.backup/urls/include-helper.d.ts +17 -0
  339. package/dist/types.backup/urls/include-provider.d.ts +27 -0
  340. package/dist/types.backup/urls/index.d.ts +6 -0
  341. package/dist/types.backup/urls/path-helper-types.d.ts +197 -0
  342. package/dist/types.backup/urls/path-helper.d.ts +12 -0
  343. package/dist/types.backup/urls/pattern-types.d.ts +166 -0
  344. package/dist/types.backup/urls/response-types.d.ts +67 -0
  345. package/dist/types.backup/urls/type-extraction.d.ts +157 -0
  346. package/dist/types.backup/urls/urls-function.d.ts +24 -0
  347. package/dist/types.backup/urls.d.ts +1 -0
  348. package/dist/types.backup/use-loader.d.ts +150 -0
  349. package/dist/types.backup/vercel/index.d.ts +10 -0
  350. package/dist/types.backup/vercel/tracing.d.ts +70 -0
  351. package/dist/types.backup/vite/debug.d.ts +80 -0
  352. package/dist/types.backup/vite/discovery/bundle-postprocess.d.ts +12 -0
  353. package/dist/types.backup/vite/discovery/dev-prerender-cache.d.ts +65 -0
  354. package/dist/types.backup/vite/discovery/discover-routers.d.ts +17 -0
  355. package/dist/types.backup/vite/discovery/discovery-errors.d.ts +113 -0
  356. package/dist/types.backup/vite/discovery/gate-state.d.ts +79 -0
  357. package/dist/types.backup/vite/discovery/prerender-collection.d.ts +24 -0
  358. package/dist/types.backup/vite/discovery/route-types-writer.d.ts +32 -0
  359. package/dist/types.backup/vite/discovery/self-gen-tracking.d.ts +22 -0
  360. package/dist/types.backup/vite/discovery/shell-prerender-phase.d.ts +40 -0
  361. package/dist/types.backup/vite/discovery/state.d.ts +162 -0
  362. package/dist/types.backup/vite/discovery/virtual-module-codegen.d.ts +15 -0
  363. package/dist/types.backup/vite/index.d.ts +11 -0
  364. package/dist/types.backup/vite/inject-client-debug.d.ts +56 -0
  365. package/dist/types.backup/vite/plugin-types.d.ts +298 -0
  366. package/dist/types.backup/vite/plugins/cjs-to-esm.d.ts +6 -0
  367. package/dist/types.backup/vite/plugins/client-ref-dedup.d.ts +40 -0
  368. package/dist/types.backup/vite/plugins/client-ref-hashing.d.ts +35 -0
  369. package/dist/types.backup/vite/plugins/cloudflare-protocol-stub.d.ts +64 -0
  370. package/dist/types.backup/vite/plugins/expose-action-id.d.ts +18 -0
  371. package/dist/types.backup/vite/plugins/expose-id-utils.d.ts +37 -0
  372. package/dist/types.backup/vite/plugins/expose-ids/export-analysis.d.ts +19 -0
  373. package/dist/types.backup/vite/plugins/expose-ids/handler-transform.d.ts +10 -0
  374. package/dist/types.backup/vite/plugins/expose-ids/loader-transform.d.ts +8 -0
  375. package/dist/types.backup/vite/plugins/expose-ids/router-transform.d.ts +13 -0
  376. package/dist/types.backup/vite/plugins/expose-ids/types.d.ts +29 -0
  377. package/dist/types.backup/vite/plugins/expose-internal-ids.d.ts +6 -0
  378. package/dist/types.backup/vite/plugins/performance-tracks.d.ts +25 -0
  379. package/dist/types.backup/vite/plugins/refresh-cmd.d.ts +20 -0
  380. package/dist/types.backup/vite/plugins/use-cache-transform.d.ts +20 -0
  381. package/dist/types.backup/vite/plugins/vercel-output.d.ts +85 -0
  382. package/dist/types.backup/vite/plugins/version-injector.d.ts +21 -0
  383. package/dist/types.backup/vite/plugins/version-plugin.d.ts +19 -0
  384. package/dist/types.backup/vite/plugins/virtual-entries.d.ts +36 -0
  385. package/dist/types.backup/vite/plugins/virtual-stub-plugin.d.ts +7 -0
  386. package/dist/types.backup/vite/rango.d.ts +29 -0
  387. package/dist/types.backup/vite/router-discovery.d.ts +23 -0
  388. package/dist/types.backup/vite/utils/ast-handler-extract.d.ts +64 -0
  389. package/dist/types.backup/vite/utils/banner.d.ts +2 -0
  390. package/dist/types.backup/vite/utils/bundle-analysis.d.ts +28 -0
  391. package/dist/types.backup/vite/utils/client-chunks.d.ts +55 -0
  392. package/dist/types.backup/vite/utils/directive-prologue.d.ts +16 -0
  393. package/dist/types.backup/vite/utils/forward-user-plugins.d.ts +37 -0
  394. package/dist/types.backup/vite/utils/manifest-utils.d.ts +7 -0
  395. package/dist/types.backup/vite/utils/package-resolution.d.ts +6 -0
  396. package/dist/types.backup/vite/utils/prerender-utils.d.ts +32 -0
  397. package/dist/types.backup/vite/utils/shared-utils.d.ts +55 -0
  398. package/dist/vite/index.js +1 -1
  399. package/package.json +1 -1
  400. package/skills/parallel/SKILL.md +1 -1
  401. package/src/browser/prefetch/cache.ts +53 -9
  402. package/src/browser/prefetch/fetch.ts +83 -2
  403. package/src/route-definition/helpers-types.ts +5 -3
  404. package/src/static-handler.ts +18 -2
  405. package/src/urls/path-helper-types.ts +9 -10
@@ -0,0 +1,51 @@
1
+ /**
2
+ * "use cache" Runtime
3
+ *
4
+ * Provides the runtime wrapper for functions marked with "use cache" directive.
5
+ * The Vite transform plugin wraps exports with registerCachedFunction().
6
+ *
7
+ * On cache miss: executes the function, serializes the result via RSC Flight
8
+ * protocol, captures handle data if tainted ctx is detected, and stores in
9
+ * the SegmentCacheStore.
10
+ *
11
+ * On cache hit: deserializes the cached result, restores handle data if present.
12
+ *
13
+ * On stale hit: returns stale data immediately, triggers background
14
+ * re-execution via waitUntil().
15
+ */
16
+ import { isCachedFunction } from "./taint.js";
17
+ export { isCachedFunction };
18
+ /**
19
+ * Convert encodeReply result to a stable string key.
20
+ *
21
+ * encodeReply may return a string or FormData. A plain string is already
22
+ * deterministic for a given arg set, so return it verbatim. FormData (emitted
23
+ * whenever a key arg is a typed array / Blob / File / a large object React
24
+ * lazily chunks) carries a per-call RANDOM multipart boundary
25
+ * (`formdata-undici-<random>`); stringifying the whole body via
26
+ * `new Response(formData).text()` would therefore produce a DIFFERENT key on
27
+ * every call, so the cached function would always miss and the store would
28
+ * accumulate one duplicate entry per call (unbounded growth).
29
+ *
30
+ * Instead derive the key from the entries themselves, independent of the
31
+ * boundary: iterate in sorted-key order and, for each value, emit a
32
+ * boundary-free token — `s:<value>` for strings, `b:<size>:<type>:<name>:<hash>`
33
+ * for Blob/File (bytes folded via djb2 so distinct payloads of equal
34
+ * size/type/name still differ). Strings carry an `s:` type tag so a string whose
35
+ * value happens to equal a blob token (e.g. the literal `b:4::a:b:<hash>`) cannot
36
+ * collide with an actual Blob/File entry under the same FormData key. The
37
+ * user-controlled `type`/`name` are percent-encoded before joining so an embedded
38
+ * `:` cannot shift the field boundaries and collide two distinct files (e.g.
39
+ * {name:"a:b",type:""} vs {name:"b",type:":a"}). The result is stable across
40
+ * identical arg sets.
41
+ */
42
+ export declare function replyToCacheKey(encoded: string | FormData): Promise<string>;
43
+ /**
44
+ * Register a function as a cached function.
45
+ * Called by the Vite transform for each "use cache" function.
46
+ *
47
+ * @param fn - The original async function
48
+ * @param id - Stable identifier (module path + export name)
49
+ * @param profileName - Cache profile name (from "use cache: profileName" or "default")
50
+ */
51
+ export declare function registerCachedFunction<T extends (...args: any[]) => any>(fn: T, id: string, profileName: string): T;
@@ -0,0 +1,134 @@
1
+ /**
2
+ * CacheScope - Runtime cache scope for iterator-based caching
3
+ *
4
+ * Each cache() boundary in the route tree creates a new CacheScope.
5
+ * The scope owns: config, key management, and storage operations.
6
+ *
7
+ * Serialization is delegated to segment-codec.ts.
8
+ * Handle data capture/restore is delegated to handle-snapshot.ts.
9
+ */
10
+ import type { PartialCacheOptions } from "../types.js";
11
+ import type { ResolvedSegment } from "../types.js";
12
+ import type { SegmentCacheStore } from "./types.js";
13
+ import type { RequestContext } from "../server/request-context.js";
14
+ export declare function resolveCacheTags(config: PartialCacheOptions | false, ctx: RequestContext | undefined): string[] | undefined;
15
+ /**
16
+ * CacheScope represents a cache boundary in the route tree.
17
+ *
18
+ * When withCache encounters an entry with cache config, it creates
19
+ * a new CacheScope. The scope owns key management, TTL resolution,
20
+ * and storage operations. Serialization is handled by segment-codec.ts.
21
+ *
22
+ * Store resolution priority:
23
+ * 1. Explicit store in cache() options
24
+ * 2. App-level store from handler config
25
+ *
26
+ * TTL resolution priority:
27
+ * 1. Explicit value in cache() options
28
+ * 2. Explicit store's defaults (if store specified)
29
+ * 3. App-level store's defaults
30
+ * 4. Hardcoded fallback (60 seconds)
31
+ */
32
+ export declare class CacheScope {
33
+ readonly config: PartialCacheOptions | false;
34
+ readonly parent: CacheScope | null;
35
+ /** Explicit store from cache() options, if specified */
36
+ private readonly explicitStore;
37
+ constructor(config: PartialCacheOptions | false, parent?: CacheScope | null);
38
+ /**
39
+ * Whether caching is enabled for this scope
40
+ */
41
+ get enabled(): boolean;
42
+ /**
43
+ * Get effective TTL from config or store defaults.
44
+ *
45
+ * Unlike profile-registry.ts (which fails fast at config time), the render
46
+ * path must DEGRADE: a non-finite/negative ttl (NaN/Infinity from a bad
47
+ * defaults config) would make computeExpiration produce NaN deadlines so the
48
+ * entry never evicts, or a guaranteed miss for a negative value. Fall back to
49
+ * DEFAULT_ROUTE_TTL instead of throwing in the foreground render.
50
+ */
51
+ get ttl(): number;
52
+ /**
53
+ * Get SWR window from config or store defaults.
54
+ *
55
+ * A non-finite/negative swr is degraded to undefined (no SWR window) rather
56
+ * than fed into expiry math; see the ttl getter for the rationale.
57
+ */
58
+ get swr(): number | undefined;
59
+ /**
60
+ * Get the cache store - resolution priority:
61
+ * 1. Explicit store from cache() options
62
+ * 2. App-level store from request context
63
+ */
64
+ getStore(): SegmentCacheStore | null;
65
+ /**
66
+ * Resolve the cache key using the shared 3-tier priority.
67
+ * @internal
68
+ */
69
+ private resolveKey;
70
+ /**
71
+ * Evaluate the cache `condition` predicate. Returns false (skip the cache
72
+ * operation) when the predicate returns false or throws; returns true when
73
+ * there is no condition or no request context to evaluate it against.
74
+ */
75
+ private conditionAllows;
76
+ /**
77
+ * Lookup cached segments for a route (single cache entry per request).
78
+ * Returns { segments, shouldRevalidate } or null if cache miss.
79
+ *
80
+ * @param pathname - URL pathname for cache key generation
81
+ * @param params - Route params for cache key generation
82
+ * @param isIntercept - Whether this is an intercept navigation (uses different cache key)
83
+ */
84
+ lookupRoute(pathname: string, params: Record<string, string>, isIntercept?: boolean): Promise<{
85
+ segments: ResolvedSegment[];
86
+ shouldRevalidate: boolean;
87
+ } | null>;
88
+ /**
89
+ * Record this scope's segment-DSL cache({ tags }) into the request tag union
90
+ * synchronously, under the same gate cacheRoute() uses for a write.
91
+ *
92
+ * cacheRoute() already records these tags, but it is invoked inside
93
+ * requestCtx.waitUntil() by the cache-store middleware (and the proactive path
94
+ * re-resolves the whole tree before calling it), so its recording is deferred
95
+ * and RACES the document cache's post-body-drain snapshot of _requestTags. On a
96
+ * first-write (segment-cache miss) the document tag union could miss these
97
+ * tags, and updateTag()/revalidateTag() would then fail to invalidate the
98
+ * cached document until a later write reseeded it. Calling this synchronously
99
+ * in the request pipeline (before the snapshot) closes that window. Idempotent
100
+ * (the tag union is a Set), so the duplicate record in cacheRoute is harmless.
101
+ */
102
+ recordTags(requestCtx: RequestContext | undefined): void;
103
+ /**
104
+ * Cache all segments for a route (non-blocking via waitUntil)
105
+ * Single cache entry per route request.
106
+ * Loaders are excluded - they're always fresh unless they have their own cache() config.
107
+ *
108
+ * @param pathname - URL pathname for cache key generation
109
+ * @param params - Route params for cache key generation
110
+ * @param segments - All resolved segments to cache
111
+ * @param isIntercept - Whether this is an intercept navigation (uses different cache key)
112
+ */
113
+ cacheRoute(pathname: string, params: Record<string, string>, segments: ResolvedSegment[], isIntercept?: boolean): Promise<void>;
114
+ }
115
+ /**
116
+ * Create a cache scope from entry's cache config
117
+ */
118
+ export declare function createCacheScope(config: {
119
+ options: PartialCacheOptions | false;
120
+ } | undefined, parent?: CacheScope | null): CacheScope | null;
121
+ /**
122
+ * Shell fast path: when the route tree derived NO cache scope and the current
123
+ * request context carries the `_shellImplicitCache` marker (a shell capture,
124
+ * or a HIT tail serving an eligible entry), substitute an implicit doc-level
125
+ * scope so withCacheLookup/withCacheStore treat the WHOLE matched route as a
126
+ * cache() boundary — the shell entry IS a cache() of the handler layer, with
127
+ * loaders as the live carve-outs (resolveFreshLoadersAndYield).
128
+ *
129
+ * An existing scope — including an explicit cache(false) opt-out — always
130
+ * wins: the consumer's cache() semantics (their ttl/swr/store/condition) are
131
+ * never overridden, and cache(false) keeps the tail on the full handler
132
+ * re-run path.
133
+ */
134
+ export declare function resolveShellImplicitCacheScope(scope: CacheScope | null): CacheScope | null;
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Cache Tag API
3
+ *
4
+ * Provides cacheTag() for tagging cached entries at runtime inside "use cache"
5
+ * functions. Tags are scoped via AsyncLocalStorage; calling cacheTag() outside
6
+ * a "use cache" execution throws.
7
+ *
8
+ * The runtime (cache-runtime.ts) wraps "use cache" execution in
9
+ * runWithCacheTagScope(), collects the runtime tags, and merges them with the
10
+ * profile/DSL tags before storing.
11
+ */
12
+ import { type RequestContext } from "../server/request-context.js";
13
+ export declare function normalizeTag(tag: string): string | null;
14
+ export declare function normalizeTags(tags: Iterable<string>): string[];
15
+ /**
16
+ * Tag content for later invalidation via updateTag() / revalidateTag().
17
+ *
18
+ * cacheTag() serves two forms depending on what is active when it runs:
19
+ *
20
+ * 1. Inside a "use cache" function — the DEFAULT. The tags go to the current
21
+ * cache entry; `revalidateTag(tag)` drops that entry. Tags are additive
22
+ * (multiple calls accumulate), and normalizeTag() is the single chokepoint so
23
+ * a padded write matches an unpadded invalidate.
24
+ *
25
+ * 2. Render-callable (#648) — no "use cache" scope active, but a request context
26
+ * is present. The tags record onto the request's DOCUMENT artifact
27
+ * (ctx._requestTags) instead of throwing. The collection layers already exist:
28
+ * PPR shell capture unions _requestTags into the shell entry, the document
29
+ * cache tags the full-page entry with it, and prerender build contexts seed
30
+ * their own set — so a server component that renders into a shell makes
31
+ * `revalidateTag("campaign:spring")` evict that shell with ZERO cache()/"use
32
+ * cache" in its tree. This is PPR's DERIVATIVE invalidation: PPR is
33
+ * execution-PRESERVING (everything still runs underneath; only document bytes
34
+ * are shortcut), so its tags ride this existing instrument rather than a
35
+ * first-class ppr key/tag API. The shell-expiry invariant holds by
36
+ * construction — baked ⇒ evicts (bake-lane loaders execute during capture and
37
+ * record here), hole ⇒ fresh (masked loaders behind a renderable loading()
38
+ * never execute during capture, so nothing under a hole can tag the shell).
39
+ *
40
+ * Inside a cache() DSL segment the render-callable form records at the DOCUMENT
41
+ * level, not the segment (only the "use cache" runtime enters the tag scope) — a
42
+ * documented semantic, not a filtered one. An empty/whitespace-only tag is
43
+ * dropped in both forms (the render-callable form silently, via normalizeTags in
44
+ * recordRequestTags; the scope form with a dev warning).
45
+ *
46
+ * With neither a scope nor a request context, cacheTag() throws.
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * // Form 1 — inside "use cache":
51
+ * async function getProduct(ctx) {
52
+ * "use cache";
53
+ * cacheTag(`product:${ctx.params.id}`, "products");
54
+ * return db.getProduct(ctx.params.id);
55
+ * }
56
+ *
57
+ * // Form 2 — render-callable, tags the shell/document from a server component:
58
+ * function CampaignBanner() {
59
+ * cacheTag("campaign:spring");
60
+ * return <aside>Spring sale</aside>;
61
+ * }
62
+ * ```
63
+ */
64
+ export declare function cacheTag(...tags: string[]): void;
65
+ export declare function recordRequestTags(tags: Iterable<string> | undefined, ctx?: RequestContext | undefined): void;
66
+ /**
67
+ * Run a function within a cache tag scope. Any cacheTag() calls inside `fn`
68
+ * accumulate into the returned Set.
69
+ *
70
+ * The returned Set is the LIVE reference - the caller must await `result`
71
+ * before reading `tags`, because an async cached function may call cacheTag()
72
+ * after an await boundary.
73
+ *
74
+ * @internal Used by cache-runtime.ts to wrap "use cache" execution.
75
+ */
76
+ export declare function runWithCacheTagScope<T>(fn: () => T): {
77
+ result: T;
78
+ tags: Set<string>;
79
+ };
@@ -0,0 +1,4 @@
1
+ /** Encode ArrayBuffer to base64 string. */
2
+ export declare function bufferToBase64(buffer: ArrayBuffer): string;
3
+ /** Decode base64 string to ArrayBuffer. */
4
+ export declare function base64ToBuffer(base64: string): ArrayBuffer;
@@ -0,0 +1,105 @@
1
+ /** Header storing timestamp when entry becomes stale */
2
+ export declare const CACHE_STALE_AT_HEADER = "x-edge-cache-stale-at";
3
+ /** Header storing cache status: HIT | REVALIDATING */
4
+ export declare const CACHE_STATUS_HEADER = "x-edge-cache-status";
5
+ /**
6
+ * Header storing this entry's cache tags as a JSON array. JSON-encoded (not the
7
+ * comma-delimited CF `Cache-Tag` format) so tags containing commas round-trip
8
+ * safely; the read paths parse this to run the tag-invalidation check.
9
+ */
10
+ export declare const CACHE_TAGS_HEADER = "x-edge-cache-tags";
11
+ /** Header storing the ms-epoch timestamp when this entry's tags were attached. */
12
+ export declare const CACHE_TAGGED_AT_HEADER = "x-edge-cache-tagged-at";
13
+ /**
14
+ * KV key prefix for tag-invalidation markers. A marker stores the ms-epoch
15
+ * timestamp of the most recent invalidation of a tag; reads treat any entry
16
+ * whose taggedAt is older than its tags' latest marker as invalidated. Markers
17
+ * live in the SAME KV namespace as the cached entries - there is no separate
18
+ * tag-invalidation store.
19
+ */
20
+ export declare const TAG_MARKER_PREFIX = "__tag__/";
21
+ /**
22
+ * Header storing the epoch-ms timestamp when an entry was marked REVALIDATING.
23
+ * The SWR thundering-herd guard reads this to decide whether the in-flight
24
+ * revalidation is still recent. It replaces a prior reliance on the HTTP `Age`
25
+ * header: CF's Cache API does not populate `Age` reliably per-colo (and our own
26
+ * unit MockCache never set it), so an absent `Age` defaulted to 0 and made every
27
+ * REVALIDATING entry look "just revalidated" forever -- a dropped/never-finished
28
+ * background revalidation could then pin an entry stale until hard expiry. An
29
+ * explicit timestamp we write ourselves (same pattern as CACHE_STALE_AT_HEADER)
30
+ * is reliable and lets the MAX_REVALIDATION_INTERVAL re-arm actually fire.
31
+ */
32
+ export declare const CACHE_REVALIDATING_AT_HEADER = "x-edge-cache-revalidating-at";
33
+ /**
34
+ * Header storing the absolute epoch-ms hard-expiry deadline (staleAt +
35
+ * swrWindow*1000) of an L1 entry. The stale-path REVALIDATING re-put reads this
36
+ * to recompute a SHRINKING Cache-Control max-age instead of copying set()'s
37
+ * original full-window max-age. Without it, every MAX_REVALIDATION_INTERVAL
38
+ * re-arm re-puts the full window and restarts CF's retention clock, pinning a
39
+ * perpetually-stale entry (one whose background revalidation keeps failing) past
40
+ * its intended hard-expiry indefinitely. Mirrors the KVSegmentEnvelope `e`
41
+ * field and the remaining-ttl math in promoteSegmentToL1/promoteItemToL1.
42
+ * @internal
43
+ */
44
+ export declare const CACHE_EXPIRES_AT_HEADER = "x-edge-cache-expires-at";
45
+ /**
46
+ * Header stashing the route author's original Cache-Control on L1 document
47
+ * entries. putResponse/promoteResponseToL1 overwrite Cache-Control with a long
48
+ * `max-age` so the CF Cache API retains the entry across the whole SWR window;
49
+ * getResponse restores this original value before serving so the client and any
50
+ * upstream CDN see the author's intended directive, not the internal edge TTL.
51
+ */
52
+ export declare const CACHE_ORIG_CC_HEADER = "x-edge-cache-orig-cc";
53
+ /**
54
+ * Maximum age in seconds for REVALIDATING status before allowing new revalidation.
55
+ * After this period, a stale entry in REVALIDATING status will trigger revalidation again.
56
+ * @internal
57
+ */
58
+ export declare const MAX_REVALIDATION_INTERVAL = 30;
59
+ /**
60
+ * Maximum time (ms) to wait for an L1 edge cache (CF Cache API) read before
61
+ * giving up and treating it as a miss. The Cache API is normally sub-millisecond
62
+ * per-colo, so a slow `match` signals a degraded colo; we don't want it adding
63
+ * latency to the request. On timeout the lookup is abandoned, a warning is
64
+ * logged, and the read falls through to its normal miss path (L2/KV or render).
65
+ *
66
+ * This is the default; override per store via
67
+ * `CFCacheStoreOptions.edgeLookupTimeoutMs` (<= 0 disables the budget).
68
+ */
69
+ export declare const EDGE_LOOKUP_TIMEOUT_MS = 10;
70
+ /**
71
+ * Maximum time (ms) to wait for the BODY of a matched L1 entry to be read
72
+ * (response.json()) before treating the read as a miss.
73
+ *
74
+ * This is separate from {@link EDGE_LOOKUP_TIMEOUT_MS} on purpose. CF's Cache
75
+ * API resolves `match()` with a lazily-streamed body, so a fast `match` can be
76
+ * followed by a multi-second stall while the body bytes are fetched -- the
77
+ * latency tail lives here, after the match budget has already passed. The
78
+ * default bounds that tail aggressively: a healthy per-colo body read (fetch +
79
+ * JSON parse) settles in low single-digit milliseconds, so 20ms clears a
80
+ * healthy read while still failing fast to L2/KV (or render) on a degraded colo
81
+ * instead of pinning the request behind a seconds-long read. Raise it per store
82
+ * if large Flight payloads legitimately need longer.
83
+ *
84
+ * Override per store via `CFCacheStoreOptions.edgeReadTimeoutMs` (<= 0 disables).
85
+ */
86
+ export declare const EDGE_READ_TIMEOUT_MS = 20;
87
+ /**
88
+ * Maximum time (ms) to wait for an L2 (KV) read (`kv.get(key, {type:"json"})`)
89
+ * before treating it as a miss. Unlike the L1 budgets, KV is a GLOBAL store: the
90
+ * file header documents ~50ms healthy reads, and a degraded namespace can tail
91
+ * to seconds. KV is the LAST cache tier before a full render, so an unbounded
92
+ * read here pins the whole request behind a degraded global lookup.
93
+ *
94
+ * The default (170ms) sits a few multiples above the documented ~50ms healthy
95
+ * read, leaving headroom for legitimate latency tails (larger payloads,
96
+ * far-from-colo regions) so a healthy-but-slow read does not false-miss into a
97
+ * render, while still abandoning a genuinely degraded namespace well before its
98
+ * multi-second tail can pin the request. A deployment with a tighter SLA can
99
+ * lower it, and one whose healthy p99 runs higher should raise it: measure the
100
+ * KV read p99 (Workers Analytics) and add margin. It is a degradation
101
+ * guard-rail, not a tuning lever for "slow KV is normal here".
102
+ *
103
+ * Override per store via `CFCacheStoreOptions.kvReadTimeoutMs` (<= 0 disables).
104
+ */
105
+ export declare const KV_READ_TIMEOUT_MS = 170;