@rangojs/router 0.24.3 → 0.25.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 (274) hide show
  1. package/README.md +1 -0
  2. package/dist/bin/rango.js +363 -39
  3. package/dist/testing/vitest.js +37 -4
  4. package/dist/types/browser/event-controller.d.ts +24 -5
  5. package/dist/types/browser/intercept-utils.d.ts +5 -2
  6. package/dist/types/browser/merge-segment-loaders.d.ts +0 -23
  7. package/dist/types/browser/navigation-transaction.d.ts +5 -5
  8. package/dist/types/browser/partial-update.d.ts +21 -13
  9. package/dist/types/browser/prefetch/cache.d.ts +8 -0
  10. package/dist/types/browser/rango-marker.d.ts +7 -0
  11. package/dist/types/browser/react/filter-segment-order.d.ts +10 -0
  12. package/dist/types/browser/react/use-handle.d.ts +20 -0
  13. package/dist/types/browser/react/use-href.d.ts +6 -0
  14. package/dist/types/browser/react/use-router.d.ts +6 -1
  15. package/dist/types/browser/response-adapter.d.ts +5 -3
  16. package/dist/types/browser/scroll-restoration.d.ts +9 -3
  17. package/dist/types/browser/segment-reconciler.d.ts +10 -13
  18. package/dist/types/browser/types.d.ts +38 -8
  19. package/dist/types/build/route-types/per-module-writer.d.ts +12 -0
  20. package/dist/types/cache/cf/cf-shell-frame.d.ts +2 -0
  21. package/dist/types/cache/types.d.ts +8 -0
  22. package/dist/types/client-urls/client-root.d.ts +4 -1
  23. package/dist/types/client-urls/client-urls.d.ts +28 -2
  24. package/dist/types/client-urls/navigation.d.ts +6 -8
  25. package/dist/types/client-urls/revalidate-registry.d.ts +1 -1
  26. package/dist/types/client-urls/server-projection.d.ts +20 -5
  27. package/dist/types/client-urls/types.d.ts +35 -17
  28. package/dist/types/client.d.ts +2 -2
  29. package/dist/types/client.rsc.d.ts +2 -2
  30. package/dist/types/decode-loader-results.d.ts +28 -7
  31. package/dist/types/href-client.d.ts +3 -1
  32. package/dist/types/index.rsc.d.ts +1 -1
  33. package/dist/types/loader-redirect.d.ts +2 -3
  34. package/dist/types/outlet-context.d.ts +7 -6
  35. package/dist/types/prefetch-markers.d.ts +14 -5
  36. package/dist/types/route-content-wrapper.d.ts +17 -14
  37. package/dist/types/route-definition/helpers-types.d.ts +7 -2
  38. package/dist/types/route-definition/resolve-handler-use.d.ts +6 -1
  39. package/dist/types/route-definition/rewrite.d.ts +48 -5
  40. package/dist/types/route-types.d.ts +2 -2
  41. package/dist/types/router/handler-context.d.ts +14 -2
  42. package/dist/types/router/intercept-resolution.d.ts +19 -46
  43. package/dist/types/router/lazy-includes.d.ts +7 -0
  44. package/dist/types/router/match-middleware/intercept-resolution.d.ts +2 -2
  45. package/dist/types/router/middleware.d.ts +0 -16
  46. package/dist/types/router/navigation-snapshot.d.ts +2 -0
  47. package/dist/types/router/prefetch-cache-ttl.d.ts +8 -11
  48. package/dist/types/router/revalidation.d.ts +8 -1
  49. package/dist/types/router/router-context.d.ts +4 -16
  50. package/dist/types/router/router-interfaces.d.ts +0 -6
  51. package/dist/types/router/router-options.d.ts +4 -7
  52. package/dist/types/router/segment-resolution/prefetch-deferral.d.ts +31 -8
  53. package/dist/types/router/segment-resolution/revalidation.d.ts +38 -4
  54. package/dist/types/router/segment-resolution.d.ts +1 -1
  55. package/dist/types/router/segment-wrappers.d.ts +3 -5
  56. package/dist/types/router/substitute-pattern-params.d.ts +19 -2
  57. package/dist/types/router/tracing.d.ts +2 -2
  58. package/dist/types/rsc/full-payload.d.ts +14 -2
  59. package/dist/types/rsc/helpers.d.ts +8 -0
  60. package/dist/types/rsc/manifest-init.d.ts +20 -0
  61. package/dist/types/rsc/prefetch-render-error.d.ts +22 -0
  62. package/dist/types/rsc/progressive-enhancement.d.ts +20 -0
  63. package/dist/types/rsc/rewrite-passes.d.ts +12 -2
  64. package/dist/types/rsc/server-action.d.ts +6 -0
  65. package/dist/types/rsc/shell-capture-constants.d.ts +10 -1
  66. package/dist/types/rsc/shell-capture.d.ts +7 -0
  67. package/dist/types/rsc/types.d.ts +5 -0
  68. package/dist/types/segment-system.d.ts +15 -0
  69. package/dist/types/server/context.d.ts +64 -4
  70. package/dist/types/server/request-context.d.ts +41 -4
  71. package/dist/types/server/request-headers.d.ts +12 -0
  72. package/dist/types/server/rewrite-trail.d.ts +8 -1
  73. package/dist/types/testing/e2e/index.d.ts +1 -1
  74. package/dist/types/testing/flight.entry.d.ts +1 -1
  75. package/dist/types/testing/index.d.ts +1 -1
  76. package/dist/types/testing/internal/client-urls-projection.d.ts +4 -3
  77. package/dist/types/testing/render-route.d.ts +21 -11
  78. package/dist/types/testing/run-loader.d.ts +7 -0
  79. package/dist/types/testing/run-middleware.d.ts +7 -0
  80. package/dist/types/testing/run-revalidate.d.ts +5 -4
  81. package/dist/types/testing/serve-shell-request.d.ts +41 -4
  82. package/dist/types/testing/shell-status.d.ts +17 -0
  83. package/dist/types/testing/vitest-stubs/version.d.ts +1 -0
  84. package/dist/types/testing/vitest.d.ts +10 -1
  85. package/dist/types/thenable-status.d.ts +0 -6
  86. package/dist/types/types/handler-context.d.ts +12 -1
  87. package/dist/types/types/loader-types.d.ts +4 -3
  88. package/dist/types/types/route-entry.d.ts +2 -1
  89. package/dist/types/urls/path-helper-types.d.ts +4 -2
  90. package/dist/types/urls/path-helper.d.ts +5 -0
  91. package/dist/types/vite/discovery/client-urls-projection.d.ts +55 -5
  92. package/dist/types/vite/discovery/state.d.ts +20 -0
  93. package/dist/types/vite/plugins/client-urls-revalidate-hoist.d.ts +28 -16
  94. package/dist/types/vite/plugins/hoist/source.d.ts +8 -7
  95. package/dist/types/vite/plugins/virtual-entries.d.ts +6 -0
  96. package/dist/types/vite/utils/prerender-utils.d.ts +7 -0
  97. package/dist/vite/index.js +6816 -6547
  98. package/package.json +1 -1
  99. package/skills/app-structure/SKILL.md +255 -0
  100. package/skills/app-structure/content-site.md +333 -0
  101. package/skills/app-structure/e-commerce.md +435 -0
  102. package/skills/app-structure/large-app.md +885 -0
  103. package/skills/app-structure/multi-app.md +280 -0
  104. package/skills/breadcrumbs/SKILL.md +6 -1
  105. package/skills/caching/SKILL.md +3 -1
  106. package/skills/catalog.json +12 -0
  107. package/skills/client-urls/SKILL.md +195 -32
  108. package/skills/composability/SKILL.md +10 -8
  109. package/skills/handler-use/SKILL.md +48 -9
  110. package/skills/hooks/handle-and-actions.md +104 -0
  111. package/skills/hooks/navigation.md +24 -10
  112. package/skills/hooks/urls.md +1 -1
  113. package/skills/i18n/SKILL.md +2 -1
  114. package/skills/intercept/SKILL.md +60 -29
  115. package/skills/layout/SKILL.md +6 -3
  116. package/skills/links/SKILL.md +151 -17
  117. package/skills/loader/SKILL.md +32 -10
  118. package/skills/middleware/SKILL.md +111 -15
  119. package/skills/observability/SKILL.md +11 -0
  120. package/skills/parallel/SKILL.md +5 -5
  121. package/skills/ppr/SKILL.md +43 -8
  122. package/skills/prerender/SKILL.md +1 -2
  123. package/skills/rango/SKILL.md +3 -0
  124. package/skills/response-routes/SKILL.md +4 -1
  125. package/skills/scripts/SKILL.md +12 -1
  126. package/skills/server-actions/SKILL.md +60 -20
  127. package/skills/testing/SKILL.md +1 -0
  128. package/skills/testing/client-components.md +13 -10
  129. package/skills/testing/loader.md +25 -24
  130. package/skills/testing/middleware.md +11 -11
  131. package/skills/testing/response-routes.md +4 -1
  132. package/skills/testing/serve-shell-request.md +85 -21
  133. package/skills/ux-architecture/SKILL.md +980 -0
  134. package/skills/view-transitions/SKILL.md +43 -10
  135. package/src/__augment-tests__/augmented.check.ts +28 -0
  136. package/src/browser/event-controller.ts +44 -18
  137. package/src/browser/intercept-utils.ts +3 -2
  138. package/src/browser/merge-segment-loaders.ts +0 -85
  139. package/src/browser/navigation-bridge.ts +119 -98
  140. package/src/browser/navigation-client.ts +20 -15
  141. package/src/browser/navigation-store.ts +4 -2
  142. package/src/browser/navigation-transaction.ts +9 -8
  143. package/src/browser/partial-update.ts +90 -32
  144. package/src/browser/prefetch/cache.ts +8 -0
  145. package/src/browser/prefetch/fetch.ts +13 -3
  146. package/src/browser/rango-marker.ts +13 -0
  147. package/src/browser/react/NavigationProvider.tsx +25 -7
  148. package/src/browser/react/filter-segment-order.ts +13 -0
  149. package/src/browser/react/use-action.ts +9 -15
  150. package/src/browser/react/use-handle.ts +63 -71
  151. package/src/browser/react/use-href.tsx +24 -5
  152. package/src/browser/react/use-link-status.ts +1 -1
  153. package/src/browser/react/use-navigation.ts +30 -40
  154. package/src/browser/react/use-reverse.ts +4 -17
  155. package/src/browser/react/use-router.ts +37 -6
  156. package/src/browser/react/use-segments.ts +8 -12
  157. package/src/browser/response-adapter.ts +11 -5
  158. package/src/browser/rsc-router.tsx +3 -1
  159. package/src/browser/scroll-restoration.ts +34 -20
  160. package/src/browser/segment-reconciler.ts +11 -29
  161. package/src/browser/server-action-bridge.ts +52 -16
  162. package/src/browser/types.ts +40 -8
  163. package/src/build/generate-manifest.ts +12 -1
  164. package/src/build/route-types/codegen.ts +6 -2
  165. package/src/build/route-types/per-module-writer.ts +94 -61
  166. package/src/cache/cache-runtime.ts +9 -0
  167. package/src/cache/cache-scope.ts +2 -1
  168. package/src/cache/cf/cf-cache-store.ts +2 -0
  169. package/src/cache/cf/cf-shell-frame.ts +3 -0
  170. package/src/cache/types.ts +8 -0
  171. package/src/cache/vercel/vercel-cache-store.ts +6 -1
  172. package/src/client-urls/client-root.tsx +10 -5
  173. package/src/client-urls/client-urls.ts +246 -166
  174. package/src/client-urls/navigation.ts +45 -38
  175. package/src/client-urls/revalidate-registry.ts +12 -3
  176. package/src/client-urls/server-projection.ts +286 -75
  177. package/src/client-urls/types.ts +40 -16
  178. package/src/client.rsc.tsx +11 -1
  179. package/src/client.tsx +9 -1
  180. package/src/decode-loader-results.ts +64 -31
  181. package/src/href-client.ts +3 -1
  182. package/src/index.rsc.ts +1 -0
  183. package/src/index.ts +12 -4
  184. package/src/loader-redirect.tsx +2 -3
  185. package/src/outlet-context.ts +7 -6
  186. package/src/prefetch-markers.ts +15 -5
  187. package/src/reverse.ts +3 -3
  188. package/src/route-content-wrapper.tsx +19 -17
  189. package/src/route-definition/dsl-helpers.ts +27 -7
  190. package/src/route-definition/helpers-types.ts +7 -2
  191. package/src/route-definition/resolve-handler-use.ts +23 -10
  192. package/src/route-definition/rewrite.ts +86 -19
  193. package/src/route-types.ts +1 -2
  194. package/src/router/find-match.ts +37 -1
  195. package/src/router/handler-context.ts +85 -40
  196. package/src/router/intercept-resolution.ts +161 -307
  197. package/src/router/lazy-includes.ts +43 -27
  198. package/src/router/loader-resolution.ts +21 -1
  199. package/src/router/manifest.ts +6 -8
  200. package/src/router/match-api.ts +11 -1
  201. package/src/router/match-middleware/background-revalidation.ts +2 -4
  202. package/src/router/match-middleware/cache-lookup.ts +16 -20
  203. package/src/router/match-middleware/intercept-resolution.ts +41 -60
  204. package/src/router/match-result.ts +31 -2
  205. package/src/router/middleware.ts +6 -147
  206. package/src/router/navigation-snapshot.ts +38 -2
  207. package/src/router/prefetch-cache-ttl.ts +10 -18
  208. package/src/router/prerender-match.ts +2 -1
  209. package/src/router/revalidation.ts +24 -3
  210. package/src/router/router-context.ts +5 -18
  211. package/src/router/router-interfaces.ts +0 -7
  212. package/src/router/router-options.ts +4 -7
  213. package/src/router/segment-resolution/fresh.ts +6 -2
  214. package/src/router/segment-resolution/helpers.ts +7 -1
  215. package/src/router/segment-resolution/prefetch-deferral.ts +62 -12
  216. package/src/router/segment-resolution/revalidation.ts +75 -35
  217. package/src/router/segment-resolution.ts +0 -1
  218. package/src/router/segment-wrappers.ts +8 -13
  219. package/src/router/substitute-pattern-params.ts +37 -2
  220. package/src/router/tracing.ts +2 -2
  221. package/src/router.ts +2 -9
  222. package/src/rsc/full-payload.ts +26 -4
  223. package/src/rsc/handler.ts +83 -41
  224. package/src/rsc/helpers.ts +13 -0
  225. package/src/rsc/manifest-init.ts +56 -3
  226. package/src/rsc/prefetch-render-error.ts +38 -0
  227. package/src/rsc/progressive-enhancement.ts +161 -211
  228. package/src/rsc/rewrite-passes.ts +56 -9
  229. package/src/rsc/rsc-rendering.ts +79 -23
  230. package/src/rsc/server-action.ts +25 -2
  231. package/src/rsc/shell-capture-constants.ts +22 -0
  232. package/src/rsc/shell-capture.ts +11 -0
  233. package/src/rsc/types.ts +5 -0
  234. package/src/segment-system.tsx +125 -119
  235. package/src/server/context.ts +96 -5
  236. package/src/server/handle-store.ts +3 -2
  237. package/src/server/request-context.ts +42 -3
  238. package/src/server/request-headers.ts +32 -0
  239. package/src/server/rewrite-trail.ts +55 -9
  240. package/src/ssr/ssr-root.tsx +6 -10
  241. package/src/testing/dispatch.ts +4 -5
  242. package/src/testing/e2e/index.ts +1 -0
  243. package/src/testing/flight.entry.ts +1 -0
  244. package/src/testing/index.ts +1 -0
  245. package/src/testing/internal/client-urls-projection.ts +31 -11
  246. package/src/testing/render-route.tsx +83 -40
  247. package/src/testing/run-loader.ts +26 -2
  248. package/src/testing/run-middleware.ts +10 -0
  249. package/src/testing/run-revalidate.ts +13 -6
  250. package/src/testing/serve-shell-request.ts +77 -4
  251. package/src/testing/shell-status.ts +40 -0
  252. package/src/testing/vitest-stubs/version.ts +1 -0
  253. package/src/testing/vitest.ts +74 -7
  254. package/src/thenable-status.ts +0 -11
  255. package/src/types/handler-context.ts +12 -1
  256. package/src/types/loader-types.ts +4 -3
  257. package/src/types/route-entry.ts +2 -1
  258. package/src/urls/include-helper.ts +38 -11
  259. package/src/urls/path-helper-types.ts +4 -2
  260. package/src/urls/path-helper.ts +16 -3
  261. package/src/vite/discovery/client-urls-projection.ts +205 -16
  262. package/src/vite/discovery/discover-routers.ts +2 -2
  263. package/src/vite/discovery/prerender-collection.ts +2 -6
  264. package/src/vite/discovery/state.ts +26 -0
  265. package/src/vite/plugins/client-urls-revalidate-hoist.ts +190 -77
  266. package/src/vite/plugins/expose-internal-ids.ts +46 -40
  267. package/src/vite/plugins/hoist/source.ts +8 -7
  268. package/src/vite/plugins/transition-when-hoist.ts +1 -0
  269. package/src/vite/plugins/version-plugin.ts +7 -0
  270. package/src/vite/plugins/version.d.ts +7 -0
  271. package/src/vite/plugins/virtual-entries.ts +20 -0
  272. package/src/vite/rango.ts +4 -1
  273. package/src/vite/router-discovery.ts +39 -7
  274. package/src/vite/utils/prerender-utils.ts +17 -0
@@ -1,10 +1,12 @@
1
1
  import type { NavigationStore, NavigationClient, UpdateSubscriber, ResolvedSegment } from "./types.js";
2
2
  import type { ReactNode } from "react";
3
+ export declare const addTransitionType: ((type: string) => void) | undefined;
3
4
  import type { RenderSegmentsOptions } from "../segment-system.js";
4
5
  import type { BoundTransaction } from "./navigation-transaction.js";
5
- import type { HandleData, NavigationUpdate, RscMetadata } from "./types.js";
6
+ import type { HandleData, NavigationUpdate, RscMetadata, ShownEntry } from "./types.js";
6
7
  import type { LoaderStore } from "../loader-store.js";
7
8
  import { type TransitionWhenActionInput } from "./transition-when.js";
9
+ import { type TransitionWhenKind } from "../types/segments.js";
8
10
  /**
9
11
  * Hold/animate decision for a commit: a non-intercept segment carries a
10
12
  * transition, no intercept is presented, and this navigation's
@@ -18,8 +20,10 @@ export declare function shouldStartViewTransition(segments: readonly ResolvedSeg
18
20
  * settled/cached segments make it a no-op. Urgent commits call onUpdate
19
21
  * directly: nothing is held there, a reader of a pending stream suspends to
20
22
  * its fallback. Also used by renderRoute's navigate() (testing/render-route.tsx).
23
+ * Every commit is tagged with its transition({ when }) `kind` (#1165), then
24
+ * `transitionTypes`.
21
25
  */
22
- export declare function commitInTransition(loaders: LoaderStore, onUpdate: UpdateSubscriber, segments: readonly ResolvedSegment[], update: NavigationUpdate, transitionTypes: readonly string[]): void;
26
+ export declare function commitInTransition(loaders: LoaderStore, onUpdate: UpdateSubscriber, segments: readonly ResolvedSegment[], update: NavigationUpdate, kind: TransitionWhenKind, transitionTypes: readonly string[]): void;
23
27
  /**
24
28
  * Configuration for creating a partial updater
25
29
  */
@@ -45,13 +49,15 @@ export interface PartialUpdateConfig {
45
49
  /** What the response's handlers pushed, to the handle store. */
46
50
  handles(metadata: RscMetadata): void;
47
51
  /**
48
- * Deliver the navigation state to its readers now. A page built with
49
- * holes commits in the task of its click, before the notification of the
50
- * click has gone out (event-controller.ts makeDebouncedNotifier), and
51
- * React holds that commit where a hole is read with no boundary: without
52
- * this useNavigation() reads idle, on the page being left, for the whole
53
- * wait. Delivered first, `loading` is on screen when the commit is
54
- * handed over, and stays while React holds it, as for a plain click.
52
+ * Deliver the navigation state to its readers now, and commit it. A page
53
+ * built with holes commits in the task of its click, before the
54
+ * notification of the click has gone out (event-controller.ts
55
+ * makeDebouncedNotifier), and React holds that commit where a hole is
56
+ * read with no boundary: without this useNavigation() reads idle, on the
57
+ * page being left, for the whole wait. Committed first, `loading` is on
58
+ * screen when the commit is handed over, and stays while React holds it,
59
+ * as for a plain click. Delivered at default priority it joins the
60
+ * commit's urgent batch, which brings idle with the URL, and never shows.
55
61
  */
56
62
  flush(): void;
57
63
  };
@@ -70,8 +76,8 @@ export interface CommitOverrides {
70
76
  interceptSourceUrl?: string;
71
77
  /** Server-set location state to merge into history.pushState */
72
78
  serverState?: Record<string, unknown>;
73
- /** The committed route's name (payload metadata), remembered per history entry. */
74
- routeName?: string;
79
+ /** The payload's metadata: its route name and rewrite target, remembered per history entry. */
80
+ metadata?: ShownEntry;
75
81
  }
76
82
  /**
77
83
  * Discriminated update mode for partial updates.
@@ -120,8 +126,10 @@ export type UpdateMode = {
120
126
  action?: TransitionWhenActionInput;
121
127
  };
122
128
  /**
123
- * Type for the fetchPartialUpdate function
129
+ * Type for the fetchPartialUpdate function. In `action` mode it resolves with
130
+ * the error of a loader that threw while it re-ran (revalidationErrorOf);
131
+ * the loader throws at its read.
124
132
  */
125
- export type PartialUpdater = (targetUrl: string, segmentIds: string[] | undefined, isRetry: boolean, signal: AbortSignal | undefined, tx: BoundTransaction, mode?: UpdateMode) => Promise<void>;
133
+ export type PartialUpdater = (targetUrl: string, segmentIds: string[] | undefined, isRetry: boolean, signal: AbortSignal | undefined, tx: BoundTransaction, mode?: UpdateMode) => Promise<Error | undefined>;
126
134
  export declare function createPartialUpdater(config: PartialUpdateConfig): PartialUpdater;
127
135
  export { createPartialUpdater as default };
@@ -86,6 +86,14 @@ export interface DecodedPrefetch {
86
86
  * one prefetch serves unlimited adoptions within TTL/state validity.
87
87
  */
88
88
  respawn?: () => DecodedPrefetch;
89
+ /**
90
+ * The prefetch's stall timer (executePrefetchFetch). Navigation clears it on
91
+ * the entry it serves: from then on the click owns the stream, which runs to
92
+ * its end (a Flight response that arrived is never aborted mid-stream). A
93
+ * prefetch nobody adopted keeps it, so a stalled one is still aborted.
94
+ * Absent on a respawned entry, which has no timer.
95
+ */
96
+ stallTimer?: ReturnType<typeof setTimeout>;
89
97
  /**
90
98
  * Release the buffered reserve bytes. Called when the entry is evicted
91
99
  * without being consumed (expiry, FIFO, sweep, cache clear) so the tee
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Publishes `window.__rango = { version }` so outside tools can tell a page is
3
+ * a Rango app and which router release serves it. Write-only and informational:
4
+ * nothing in the router reads it (rango-marker.test.ts greps src/ for reads),
5
+ * and only the npm semver is exposed, no build hash, router id or config.
6
+ */
7
+ export declare function publishRangoMarker(): void;
@@ -5,6 +5,16 @@
5
5
  export declare const LOADER_SEGMENT_ID: RegExp;
6
6
  /** True for a loader sub-id ("M0L0D1.user"), false for a layout/route/slot id. */
7
7
  export declare function isLoaderSegmentId(id: string): boolean;
8
+ /**
9
+ * The parent of a loader sub-id (`${parentId}D${index}.${loaderId}`); any
10
+ * other id unchanged. parentId is a shortCode (never "D"), or
11
+ * `${shortCode}.${slotName}` for an intercept slot's loaders, where the
12
+ * user-chosen name may hold an uppercase "D" ("@Detail"). Strip from the first
13
+ * `D<index>.`: splitting on a bare "D" mis-cut "@Detail" to "@" and silently
14
+ * dropped the loader's data. Correct only because slot names cannot contain
15
+ * "." (assertValidSlotName, route-definition/dsl-helpers.ts).
16
+ */
17
+ export declare function loaderParentId(id: string): string;
8
18
  /**
9
19
  * Build the handle-collection segment order from a raw `matched` list.
10
20
  *
@@ -1,4 +1,5 @@
1
1
  import type { Handle } from "../../handle.js";
2
+ import type { RouteStateSignal } from "../event-controller.js";
2
3
  /**
3
4
  * Hook to access collected handle data.
4
5
  *
@@ -19,3 +20,22 @@ import type { Handle } from "../../handle.js";
19
20
  */
20
21
  export declare function useHandle<T, A>(handle: Handle<T, A>): Rango.FlightSerialize<A>;
21
22
  export declare function useHandle<T, A, S>(handle: Handle<T, A>, selector: (data: Rango.FlightSerialize<A>) => S): S;
23
+ /**
24
+ * Route state the controller's handle notifications drive (useHandle,
25
+ * useSegments) commits with the page it belongs to. NavigationProvider
26
+ * flushes the controller inside every payload update, so a value known then
27
+ * is set in the page's lane. A page handed over urgently (signal "release")
28
+ * takes a value that arrives before it commits the same way: set at default
29
+ * priority, it renders in the page's lane, and the page's effects read it.
30
+ * A page in a transition (signal "anchor") does not: until it commits
31
+ * (releaseRouteState() from the provider's layout effect, signal "release"),
32
+ * a new value waits, and is applied in the commit's task, right after the
33
+ * page's own commit. In the page's lane, a value that suspends in a revealed
34
+ * <Suspense> (a crumb's content) would hold the page; in a lane of its own,
35
+ * it commits over the page being left and takes the page's transition types
36
+ * (#1165); and a transition entangled with the page misses its commit when it
37
+ * is set after React rendered the page, before its view transition's
38
+ * mutation, and starts a view transition of its own. A value shallow-equal to
39
+ * the last one sets nothing, so a reader renders only when its value moves.
40
+ */
41
+ export declare function useCommitAnchoredState<T>(init: () => T): [T, (value: T, signal?: RouteStateSignal) => void];
@@ -5,6 +5,12 @@
5
5
  * include() mount prefix. Inside an include("/shop", ...) scope,
6
6
  * the returned function resolves local paths relative to /shop.
7
7
  *
8
+ * Under a parameterized mount (`include("/:accountId", ...)`) the mount's
9
+ * params are filled from the current route params, as `useReverse` does:
10
+ * `href("/issues")` at `/acme/board` returns `/acme/issues`. A mount param
11
+ * missing from the current match throws `Missing param` when the returned
12
+ * function is called.
13
+ *
8
14
  * For absolute paths (outside the current mount), use the bare
9
15
  * href() function directly instead.
10
16
  *
@@ -13,7 +13,12 @@ import type { RouterInstance } from "../types.js";
13
13
  *
14
14
  * RELATIVE paths (no leading `/`, no scheme/query/hash) resolve against the
15
15
  * current include() mount: `router.push("cart")` inside `include("/shop")`
16
- * navigates to `/shop/cart`. Absolute paths stay APP-absolute — unlike
16
+ * navigates to `/shop/cart`. Under a parameterized mount
17
+ * (`include("/:accountId", ...)`) the mount's params are filled from the
18
+ * current route params: `router.push("issues")` at `/acme/board` navigates
19
+ * to `/acme/issues`, and a missing mount param rejects the push/replace
20
+ * promise with `Missing param` (a prefetch skips the target).
21
+ * Absolute paths stay APP-absolute — unlike
17
22
  * basename, the mount is scoped, and absolute pushes legitimately target
18
23
  * outside it, so they are never auto-prefixed.
19
24
  *
@@ -48,9 +48,11 @@ export declare function handleReloadHeader(response: Response, opts: {
48
48
  * end-of-stream, calling onComplete when done.
49
49
  *
50
50
  * `onComplete` receives `endedCleanly`: true only on a normal EOF drain, false
51
- * on a read error or an abort (the signal cancelled the reader). Callers that
52
- * gate a "fully complete" fast path (e.g. prefetch's `entry.complete`) must
53
- * treat a non-clean end as incomplete — a broken stream is not complete data.
51
+ * on a read error, an abort (the signal cancelled the reader), or a body that
52
+ * ends with PREFETCH_FAILED_ROW (a prefetch whose render reported an error,
53
+ * rsc/prefetch-render-error.ts). Callers that gate a "fully complete" fast
54
+ * path (e.g. prefetch's `entry.complete`) must treat a non-clean end as
55
+ * incomplete — a broken stream is not complete data.
54
56
  *
55
57
  * If the response has no body, onComplete fires synchronously with `true`
56
58
  * (an empty body is a clean, complete stream).
@@ -63,10 +63,12 @@ export declare function cancelScrollRestorationPolling(): void;
63
63
  *
64
64
  * @param options.retryIfStreaming - If true, poll while streaming until we can scroll to target
65
65
  * @param options.isStreaming - Function to check if streaming is in progress
66
+ * @param options.committed - React has committed the restored tree (a layout effect)
66
67
  */
67
68
  export declare function restoreScrollPosition(options?: {
68
69
  retryIfStreaming?: boolean;
69
70
  isStreaming?: () => boolean;
71
+ committed?: boolean;
70
72
  }): boolean;
71
73
  /**
72
74
  * Handle hash link scrolling.
@@ -86,9 +88,11 @@ export declare function scrollToTop(): void;
86
88
  export declare function handleNavigationStart(): void;
87
89
  /**
88
90
  * Handle scroll for a back/forward traversal, at popstate before anything
89
- * renders: save the page being left under ITS key (history has already moved,
90
- * so saveCurrentScrollPosition would use the destination's key) and track the
91
- * destination as the displayed entry.
91
+ * renders: save the page on screen under ITS key (history has already moved,
92
+ * so saveCurrentScrollPosition would use the destination's key). A second
93
+ * traversal before the first one's restore commits (a rapid double Back, a
94
+ * deferred animated restore) saves the page still on screen, never an entry
95
+ * it did not show.
92
96
  */
93
97
  export declare function handleTraversalStart(): void;
94
98
  /**
@@ -96,11 +100,13 @@ export declare function handleTraversalStart(): void;
96
100
  * @param options.restore - If true, restore saved position (for popstate)
97
101
  * @param options.scroll - If false, don't scroll at all
98
102
  * @param options.isStreaming - Function to check if streaming is in progress (for retry logic)
103
+ * @param options.committed - Called after React committed the new tree
99
104
  */
100
105
  export declare function handleNavigationEnd(options: {
101
106
  restore?: boolean;
102
107
  scroll?: boolean;
103
108
  isStreaming?: () => boolean;
109
+ committed?: boolean;
104
110
  }): void;
105
111
  /**
106
112
  * Update the history state key after pushState/replaceState.
@@ -2,15 +2,17 @@ import type { ResolvedSegment } from "./types.js";
2
2
  /**
3
3
  * Determines the merging behavior for segment reconciliation.
4
4
  *
5
- * - 'action': From server-action-bridge's own merge. Always merges loaders,
6
- * always preserves cached loading (even undefined), never clears cached
7
- * segment loading.
8
- * - 'navigation': From partial-update during normal navigation. Does NOT merge
9
- * loaders, preserves cached loading only when defined, clears truthy loading
10
- * on cached segments not in server diff.
5
+ * - 'action': From server-action-bridge's own merge. Always preserves cached
6
+ * loading (even undefined), never clears cached segment loading.
7
+ * - 'navigation': From partial-update during normal navigation. Preserves
8
+ * cached loading only when defined, clears truthy loading on cached
9
+ * segments not in server diff.
11
10
  * - 'stale-revalidation': From partial-update during stale revalidation or
12
- * action-triggered refetch. Merges loaders, always preserves cached loading
13
- * (same as action), clears truthy loading on cached segments not in server diff.
11
+ * action-triggered refetch. Always preserves cached loading (same as
12
+ * action), clears truthy loading on cached segments not in server diff.
13
+ *
14
+ * No actor merges loader data: a loader the server skipped, an intercept's
15
+ * included, is its own cached segment in `matched`.
14
16
  */
15
17
  export type ReconcileActor = "navigation" | "action" | "stale-revalidation";
16
18
  export interface ReconcileInput {
@@ -52,11 +54,6 @@ export interface ReconcileResult {
52
54
  * (not undefined). When cached is undefined, lets server value through
53
55
  * because we're building a new tree.
54
56
  *
55
- * Loader merging:
56
- * - action/stale-revalidation: Merges partial loader data when server returns
57
- * fewer loaders than cached (revalidation only updated some loaders).
58
- * - navigation: Does not merge (full navigation fetches complete data).
59
- *
60
57
  * Cached segment handling (segments in matched but not in server response):
61
58
  * - action: Returns cached segment as-is (preserve tree structure).
62
59
  * - navigation/stale-revalidation: Clears truthy loading to undefined
@@ -29,6 +29,11 @@ export type HandleData = Record<string, Record<string, unknown[]>>;
29
29
  */
30
30
  export interface RscMetadata {
31
31
  pathname: string;
32
+ /**
33
+ * Path and search of the URL the route rendered, when middleware rewrote
34
+ * the request there. Kept per history entry and sent back as `_rsc_rt`.
35
+ */
36
+ rewriteTarget?: string;
32
37
  segments: ResolvedSegment[];
33
38
  /** Router instance ID — the current app's identity. A mismatch with the
34
39
  * client's id (sent as _rsc_rid) is detected server-side and answered with
@@ -223,6 +228,12 @@ export interface TrackedActionState {
223
228
  error: unknown | null;
224
229
  /** Result data from the action (preserved after completion) */
225
230
  result: unknown | null;
231
+ /**
232
+ * The error of a loader that threw while it re-ran after this successful
233
+ * action (the first, when several did). The loader also throws at its
234
+ * useLoader read, where the nearest error boundary catches it.
235
+ */
236
+ revalidationError: unknown | null;
226
237
  }
227
238
  /**
228
239
  * The value returned by {@link useAction} when called without a selector.
@@ -262,13 +273,23 @@ export interface SegmentState {
262
273
  currentUrl: string;
263
274
  currentSegmentIds: string[];
264
275
  }
276
+ /**
277
+ * What a committed payload says about the page it shows, remembered per
278
+ * history entry (NavigationStore.rememberDisplayedEntry).
279
+ *
280
+ * @internal This type is an implementation detail and may change without notice.
281
+ */
282
+ export interface ShownEntry {
283
+ readonly routeName?: string;
284
+ readonly rewriteTarget?: string;
285
+ }
265
286
  /**
266
287
  * What the router remembers about one history entry for transition({ when })
267
- * (NavigationStore.rememberDisplayedEntry).
288
+ * and the requests made from it (NavigationStore.rememberDisplayedEntry).
268
289
  *
269
290
  * @internal This type is an implementation detail and may change without notice.
270
291
  */
271
- export interface HistoryEntryMemory {
292
+ export interface HistoryEntryMemory extends ShownEntry {
272
293
  readonly routeName: string | undefined;
273
294
  /** The entry's `history.state` as last recorded. */
274
295
  readonly state: unknown;
@@ -295,6 +316,12 @@ export interface NavigationUpdate {
295
316
  /** Function to check if streaming is in progress */
296
317
  isStreaming?: () => boolean;
297
318
  };
319
+ /**
320
+ * Handed to React inside startTransition (commitInTransition, an action's
321
+ * commit, a cached back/forward's): NavigationProvider joins the route
322
+ * state that arrives while React holds it to its commit.
323
+ */
324
+ inTransition?: true;
298
325
  }
299
326
  /**
300
327
  * Plain object accepted as {@link PlainHistoryState}. The `any` string index
@@ -504,12 +531,12 @@ export interface NavigationStore {
504
531
  /**
505
532
  * Per-history-entry memory for transition({ when }) sources: record the
506
533
  * entry on screen (keyed by its `history.state.key`) with its current
507
- * `history.state` and, when given, its route name (kept from the last
508
- * record otherwise; every push/replace creates a new key, so a stale name
509
- * never carries to another entry). Called after every commit, restore and
510
- * state merge.
534
+ * `history.state` and, when `shown` is given, its route name and rewrite
535
+ * target (both kept from the last record otherwise; every push/replace
536
+ * creates a new key, so a stale record never carries to another entry).
537
+ * Called after every commit, restore and state merge.
511
538
  */
512
- rememberDisplayedEntry(routeName?: string): void;
539
+ rememberDisplayedEntry(shown?: ShownEntry): void;
513
540
  /**
514
541
  * The memory of the entry on screen, or of `entryKey`. At popstate
515
542
  * history.state already belongs to the destination, so back/forward reads
@@ -570,6 +597,8 @@ export interface FetchPartialOptions {
570
597
  targetUrl: string;
571
598
  segmentIds: string[];
572
599
  previousUrl: string;
600
+ /** The page's RscMetadata.rewriteTarget, sent as `_rsc_rt`. */
601
+ rewriteTarget?: string;
573
602
  signal?: AbortSignal;
574
603
  /** If true, this is a stale cache revalidation request - server should force revalidators */
575
604
  staleRevalidation?: boolean;
@@ -638,7 +667,8 @@ export interface ServerActionBridgeConfig {
638
667
  export interface NavigationBridge {
639
668
  navigate(url: string, options?: NavigateOptionsInternal): Promise<void>;
640
669
  refresh(): Promise<void>;
641
- handlePopstate(): Promise<void>;
670
+ /** `event`: the popstate event; a traversal the browser animated itself (hasUAVisualTransition) is not animated again. */
671
+ handlePopstate(event?: PopStateEvent): Promise<void>;
642
672
  registerLinkInterception(): () => void;
643
673
  registerDelegatedPrefetch(): () => void;
644
674
  /** Current RSC version (live, reflects the latest updateVersion). */
@@ -11,6 +11,18 @@ export declare function writePerModuleRouteTypes(root: string, filter?: ScanFilt
11
11
  * e.g. `export const patterns = urls(...)` -> ["patterns"]
12
12
  */
13
13
  export declare function findUrlsVariableNames(code: string): string[];
14
+ export interface PerModuleRouteTypesPlan {
15
+ genPath: string;
16
+ /** A urls()/clientUrls() variable resolved to zero routes; content is empty. */
17
+ isPlaceholder: boolean;
18
+ content: string;
19
+ }
20
+ /**
21
+ * Pure half of the per-module writer: reads sources, never writes. Returns
22
+ * null when the file has no `urls(`/`clientUrls(` or no named routes and no
23
+ * urls() variable. Throws on failure.
24
+ */
25
+ export declare function planPerModuleRouteTypesForFile(filePath: string): PerModuleRouteTypesPlan | null;
14
26
  /**
15
27
  * Generate per-module route types for a single url module file.
16
28
  * Follows include() calls recursively to produce the full route tree.
@@ -37,6 +37,8 @@ export interface ShellFrameHead {
37
37
  ta?: number;
38
38
  /** ShellCacheEntry.initialTheme */
39
39
  i?: string;
40
+ /** ShellCacheEntry.pathname (a visitor-keyed shell's rendered location). */
41
+ lp?: string;
40
42
  /** ShellCacheEntry.docKey; navigation replay needs it after any round trip. */
41
43
  dk?: string;
42
44
  /** ShellCacheEntry.prunedRecords (diagnostic). */
@@ -412,6 +412,14 @@ export interface ShellCacheEntry {
412
412
  * ThemeProvider.
413
413
  */
414
414
  initialTheme?: string;
415
+ /**
416
+ * The payload pathname of a shell keyed by the visitor's URL
417
+ * (`rewrite(...).shell("visitor")`, visitorShellKey); absent when the
418
+ * capture rendered its key's own URL. The serve tail replays it as it does
419
+ * `initialTheme`, and the serve gate serves the entry only to a request
420
+ * that renders this location.
421
+ */
422
+ pathname?: string;
415
423
  /**
416
424
  * The CAPTURE DATA SNAPSHOT, in stored/serialized form: the doc segment
417
425
  * record every HIT replays the handler layer from (`docKey`) and the
@@ -25,12 +25,15 @@ export declare function ClientUrlsInterceptLoading({ definition, interceptIndex,
25
25
  definition: ClientUrlPatterns;
26
26
  interceptIndex: number;
27
27
  }): ReactNode;
28
- export declare function ClientUrlsRoot({ definition, routeId, namePrefix, }: {
28
+ export declare function ClientUrlsRoot({ definition, routeId, namePrefix, foreign, }: {
29
29
  definition: ClientUrlPatterns;
30
30
  routeId: string;
31
31
  /** include() route-name prefix, injected at materialization for canonical
32
32
  * name composition (intercept-target coordination). */
33
33
  namePrefix?: string;
34
+ /** The server's routes that compete with the group's for a URL
35
+ * (competingPatterns in server-projection.ts). */
36
+ foreign?: readonly string[];
34
37
  }): ReactNode;
35
38
  export declare function ClientUrlsLoading({ definition, routeId, }: {
36
39
  definition: ClientUrlPatterns;
@@ -1,5 +1,31 @@
1
- import type { ClientUrlBuilder, ClientUrlPatterns } from "./types.js";
1
+ import { type TrieNode } from "../router/route-trie-builder.js";
2
+ import type { ClientUrlBuilder, ClientUrlHelpers, ClientUrlPatterns } from "./types.js";
2
3
  import type { ExtractRoutes } from "../urls/type-extraction.js";
3
4
  import type { ClientUrlItems } from "./types.js";
5
+ export declare const loader: ClientUrlHelpers["loader"];
6
+ export declare const revalidate: ClientUrlHelpers["revalidate"];
7
+ export declare const loading: ClientUrlHelpers["loading"];
8
+ export declare const transition: ClientUrlHelpers["transition"];
4
9
  export declare function clientUrls<const TItems extends ClientUrlItems>(builder: ClientUrlBuilder<TItems>): ClientUrlPatterns<ExtractRoutes<TItems>>;
5
- export type { ClientTransitionConfig, ClientUrlBuilder, ClientUrlHelpers, ClientUrlInterceptRecord, ClientUrlItem, ClientUrlItemInput, ClientUrlItems, ClientLayoutFn, ClientPathOptions, ClientUrlLoaderRecord, ClientPathFn, ClientUrlPatterns, ClientUrlRouteRecord, ClientUrlUse, } from "./types.js";
10
+ /**
11
+ * The router's trie over a group's routes, each pattern joined to the
12
+ * include() mount PATTERN (`/:locale?`, `/:accountId/:projectId`): an
13
+ * absolute pathname matches with the mount's params bound next to the
14
+ * route's, by the server's own precedence (an optional mount param expands
15
+ * like any other). Comparing the pathname with the mount as a literal prefix
16
+ * never matched a parameterized mount.
17
+ *
18
+ * `foreign` are the server's routes outside the group that compete with its
19
+ * routes for a URL (competingPatterns in server-projection.ts): a `/:slug`
20
+ * route under `/:locale?` matches a root `/login` too. Each is a leaf keyed by
21
+ * its own pattern, inserted last so an exact tie goes to it; a match on one is
22
+ * not the group's.
23
+ */
24
+ export declare function buildClientUrlsTrie(routes: readonly {
25
+ readonly id: string;
26
+ readonly pattern: string;
27
+ readonly options?: {
28
+ readonly trailingSlash?: string;
29
+ };
30
+ }[], mount: string, foreign?: readonly string[]): TrieNode;
31
+ export type { ClientTransitionConfig, ClientUrlBuilder, ClientUrlComponent, ClientUrlHelpers, ClientUrlInterceptRecord, ClientUrlItem, ClientUrlItemInput, ClientUrlItems, ClientLayoutFn, ClientPathOptions, ClientUrlLoaderRecord, ClientPathFn, ClientUrlPatterns, ClientUrlRouteRecord, ClientUrlUse, } from "./types.js";
@@ -9,7 +9,10 @@ export interface ClientUrlNavigationIntent {
9
9
  * screen.
10
10
  */
11
11
  readonly fromFrame: boolean;
12
- /** Destination params from the local trie match (definition-local). */
12
+ /**
13
+ * Destination params: the route's and its include() mount's, the params
14
+ * useParams() reads after the commit.
15
+ */
13
16
  readonly params: Readonly<Record<string, string>>;
14
17
  /** Absolute destination pathname (mount included) and search ("?..." or ""). */
15
18
  readonly pathname: string;
@@ -24,17 +27,12 @@ export interface ClientUrlNavigationIntent {
24
27
  }
25
28
  /** What the bridge needs to decide transition({ when }) at the swap. */
26
29
  export interface ClientUrlDestination {
27
- /** Definition-local params of the destination match. */
30
+ /** Destination params, the include() mount's included. */
28
31
  readonly params: Readonly<Record<string, string>>;
29
32
  /** Canonical route name (include prefix applied); undefined when unnamed. */
30
33
  readonly routeName: string | undefined;
31
34
  /** The destination route's own `when`, from its "use client" definition. */
32
35
  readonly when: TransitionWhenFn | undefined;
33
- /**
34
- * Param names the ORIGIN route matched inside the group: the committed
35
- * params minus these are the mount's (include prefix) params.
36
- */
37
- readonly originLocalParamNames: readonly string[];
38
36
  /** `history.state` the navigation will push (ClientUrlNavigationIntent.state). */
39
37
  readonly state: unknown;
40
38
  }
@@ -49,7 +47,7 @@ export interface ClientUrlNavigationPresentation {
49
47
  readonly transitionGatedOff?: boolean;
50
48
  clear(): void;
51
49
  }
52
- export declare function registerClientUrlGroup(definition: ClientUrlPatterns, mount: string, namePrefix: string, setIntent: (intent: ClientUrlNavigationIntent | null) => void, routeId?: string): () => void;
50
+ export declare function registerClientUrlGroup(definition: ClientUrlPatterns, mount: string, namePrefix: string, setIntent: (intent: ClientUrlNavigationIntent | null) => void, routeId?: string, foreign?: readonly string[]): () => void;
53
51
  export declare function beginClientUrlNavigation(targetUrl: URL, signal: AbortSignal,
54
52
  /** Builds the entry state; called only when the group presents the target. */
55
53
  buildState?: () => unknown, decideTransition?: (destination: ClientUrlDestination) => boolean): ClientUrlNavigationPresentation | null;
@@ -1,4 +1,4 @@
1
1
  import type { ShouldRevalidateFn } from "../types.js";
2
- export declare function registerClientUrlRevalidators(fns: Readonly<Record<string, ShouldRevalidateFn<any, any>>>): void;
2
+ export declare function registerClientUrlRevalidators(fns: Readonly<Record<string, ShouldRevalidateFn<any, any> | boolean>>): void;
3
3
  export declare function getClientUrlRevalidator(key: string): ShouldRevalidateFn<any, any> | undefined;
4
4
  export declare function clearClientUrlRevalidators(): void;
@@ -1,6 +1,7 @@
1
1
  import type { SearchSchemaValue } from "../search-params.js";
2
2
  import type { TrailingSlashMode } from "../types.js";
3
3
  import type { PartialPrerenderProps, UrlPatterns } from "../urls/pattern-types.js";
4
+ import type { TrieNode } from "../router/route-trie-builder.js";
4
5
  import type { ClientTransitionConfig, ClientUrlPatterns } from "./types.js";
5
6
  export interface ClientUrlReference {
6
7
  readonly $$typeof: symbol;
@@ -37,11 +38,11 @@ export interface ClientUrlProjectionRoute {
37
38
  * loader(), so a prefetch of the route defers them. Absent (= none) in
38
39
  * projections serialized before the option existed. */
39
40
  readonly deferrableLoaderIndices?: readonly number[];
40
- /** Per loader (aligned with loaderIds), the keys of its hoisted
41
- * revalidate() predicates in declaration order; materialization attaches
42
- * the registered predicates (revalidate-registry.ts). Absent when no
43
- * loader declares one. */
44
- readonly loaderRevalidate?: readonly (readonly string[])[];
41
+ /** Per loader (aligned with loaderIds), its revalidate() arguments in
42
+ * declaration order: a hoisted predicate's key, whose registration
43
+ * materialization attaches (revalidate-registry.ts), or a boolean
44
+ * literal. Absent when no loader declares one. */
45
+ readonly loaderRevalidate?: readonly (readonly (string | boolean)[])[];
45
46
  /** One per leading loader its layout()s declare
46
47
  * (ClientUrlRouteRecord.layoutLoaders): the record's ordinal in the
47
48
  * definition. Two routes whose loader at an index carries the same ordinal
@@ -61,6 +62,10 @@ export interface ClientUrlProjectionIntercept {
61
62
  readonly targetName: string;
62
63
  readonly loaderIds: readonly string[];
63
64
  readonly hasLoading: boolean;
65
+ /** As on a route (ClientUrlProjectionRoute.deferrableLoaderIndices). */
66
+ readonly deferrableLoaderIndices?: readonly number[];
67
+ /** As on a route (ClientUrlProjectionRoute.loaderRevalidate). */
68
+ readonly loaderRevalidate?: readonly (readonly (string | boolean)[])[];
64
69
  }
65
70
  export interface ClientUrlProjection {
66
71
  readonly version: 1;
@@ -101,6 +106,16 @@ export declare function isClientUrlSource(value: unknown): value is ClientUrlDef
101
106
  export declare function setClientUrlProjection(reference: string | ClientUrlReference, projection: ClientUrlProjection): void;
102
107
  export declare function getClientUrlProjection(reference: string | ClientUrlReference): ClientUrlProjection | undefined;
103
108
  export declare function clearClientUrlProjections(): void;
109
+ /**
110
+ * The patterns of the router's routes, outside the group, that a URL of the
111
+ * group matches too: the trie walked in step with the group's (its patterns
112
+ * joined to the mount), static against static, a param against either, a
113
+ * catch-all against everything below. Constraints are not compared, so the
114
+ * list may hold a route no URL of the group reaches: the client trie, which
115
+ * gets the patterns as they are, never lets one win a URL it does not match.
116
+ * `own` are the group's route keys in the router's trie.
117
+ */
118
+ export declare function competingPatterns(router: TrieNode, group: TrieNode, own: ReadonlySet<string>): string[];
104
119
  export declare function materializeClientUrlPatterns(reference: ClientUrlDefinitionSource, projection: ClientUrlProjection): UrlPatterns;
105
120
  /**
106
121
  * Adapt a clientUrls() source for `include()` mounting inside the canonical