portograph 0.0.0-stage → 0.2.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 (446) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +233 -2
  3. package/bin/cli.mjs +256 -0
  4. package/bin/compute.mjs +177 -0
  5. package/bin/font-check.d.mts +4 -0
  6. package/bin/font-check.mjs +58 -0
  7. package/bin/portograph.mjs +23 -0
  8. package/dist/cli.d.cts +109 -0
  9. package/dist/cli.d.ts +109 -0
  10. package/dist/geometry/index.d.cts +14 -0
  11. package/dist/geometry/index.d.ts +14 -0
  12. package/dist/geometry/oriented.d.cts +34 -0
  13. package/dist/geometry/oriented.d.ts +34 -0
  14. package/dist/geometry/planar.d.cts +69 -0
  15. package/dist/geometry/planar.d.ts +69 -0
  16. package/dist/index.cjs +20 -0
  17. package/dist/index.d.cts +24 -0
  18. package/dist/index.d.ts +24 -0
  19. package/dist/index.js +1 -0
  20. package/dist/internal.d.cts +73 -0
  21. package/dist/internal.d.ts +73 -0
  22. package/dist/layout/alignment-targets.d.cts +76 -0
  23. package/dist/layout/alignment-targets.d.ts +76 -0
  24. package/dist/layout/approach.d.cts +13 -0
  25. package/dist/layout/approach.d.ts +13 -0
  26. package/dist/layout/attempt-counters.d.cts +117 -0
  27. package/dist/layout/attempt-counters.d.ts +117 -0
  28. package/dist/layout/attempt-ledger.d.cts +31 -0
  29. package/dist/layout/attempt-ledger.d.ts +31 -0
  30. package/dist/layout/attempt-timings.d.cts +41 -0
  31. package/dist/layout/attempt-timings.d.ts +41 -0
  32. package/dist/layout/bands.d.cts +348 -0
  33. package/dist/layout/bands.d.ts +348 -0
  34. package/dist/layout/bar-width.d.cts +9 -0
  35. package/dist/layout/bar-width.d.ts +9 -0
  36. package/dist/layout/bars.d.cts +26 -0
  37. package/dist/layout/bars.d.ts +26 -0
  38. package/dist/layout/block-checks.d.cts +5 -0
  39. package/dist/layout/block-checks.d.ts +5 -0
  40. package/dist/layout/box-writers.d.cts +53 -0
  41. package/dist/layout/box-writers.d.ts +53 -0
  42. package/dist/layout/bundle-channel.d.cts +8 -0
  43. package/dist/layout/bundle-channel.d.ts +8 -0
  44. package/dist/layout/bundle-geometry.d.cts +163 -0
  45. package/dist/layout/bundle-geometry.d.ts +163 -0
  46. package/dist/layout/bundle-junctions.d.cts +41 -0
  47. package/dist/layout/bundle-junctions.d.ts +41 -0
  48. package/dist/layout/bundle-merge.d.cts +4 -0
  49. package/dist/layout/bundle-merge.d.ts +4 -0
  50. package/dist/layout/bundle-need.d.cts +23 -0
  51. package/dist/layout/bundle-need.d.ts +23 -0
  52. package/dist/layout/bundle-order.d.cts +10 -0
  53. package/dist/layout/bundle-order.d.ts +10 -0
  54. package/dist/layout/bundle-paths.d.cts +33 -0
  55. package/dist/layout/bundle-paths.d.ts +33 -0
  56. package/dist/layout/bundles.d.cts +5 -0
  57. package/dist/layout/bundles.d.ts +5 -0
  58. package/dist/layout/bus-room.d.cts +48 -0
  59. package/dist/layout/bus-room.d.ts +48 -0
  60. package/dist/layout/bus.d.cts +100 -0
  61. package/dist/layout/bus.d.ts +100 -0
  62. package/dist/layout/centre.d.cts +108 -0
  63. package/dist/layout/centre.d.ts +108 -0
  64. package/dist/layout/chord-boxes.d.cts +9 -0
  65. package/dist/layout/chord-boxes.d.ts +9 -0
  66. package/dist/layout/chord-clear.d.cts +32 -0
  67. package/dist/layout/chord-clear.d.ts +32 -0
  68. package/dist/layout/close-up.d.cts +37 -0
  69. package/dist/layout/close-up.d.ts +37 -0
  70. package/dist/layout/column-arrangement.d.cts +37 -0
  71. package/dist/layout/column-arrangement.d.ts +37 -0
  72. package/dist/layout/columns.d.cts +240 -0
  73. package/dist/layout/columns.d.ts +240 -0
  74. package/dist/layout/constraints/catalogue.d.cts +25 -0
  75. package/dist/layout/constraints/catalogue.d.ts +25 -0
  76. package/dist/layout/constraints/evaluate.d.cts +24 -0
  77. package/dist/layout/constraints/evaluate.d.ts +24 -0
  78. package/dist/layout/constraints/index.d.cts +8 -0
  79. package/dist/layout/constraints/index.d.ts +8 -0
  80. package/dist/layout/constraints/separation.d.cts +33 -0
  81. package/dist/layout/constraints/separation.d.ts +33 -0
  82. package/dist/layout/constraints/types.d.cts +65 -0
  83. package/dist/layout/constraints/types.d.ts +65 -0
  84. package/dist/layout/corridor-order.d.cts +61 -0
  85. package/dist/layout/corridor-order.d.ts +61 -0
  86. package/dist/layout/course-bypass.d.cts +63 -0
  87. package/dist/layout/course-bypass.d.ts +63 -0
  88. package/dist/layout/course-gap.d.cts +54 -0
  89. package/dist/layout/course-gap.d.ts +54 -0
  90. package/dist/layout/course-lanes.d.cts +79 -0
  91. package/dist/layout/course-lanes.d.ts +79 -0
  92. package/dist/layout/course-measure.d.cts +114 -0
  93. package/dist/layout/course-measure.d.ts +114 -0
  94. package/dist/layout/course-plan.d.cts +22 -0
  95. package/dist/layout/course-plan.d.ts +22 -0
  96. package/dist/layout/course-rows.d.cts +51 -0
  97. package/dist/layout/course-rows.d.ts +51 -0
  98. package/dist/layout/courses.d.cts +31 -0
  99. package/dist/layout/courses.d.ts +31 -0
  100. package/dist/layout/decide.d.cts +123 -0
  101. package/dist/layout/decide.d.ts +123 -0
  102. package/dist/layout/diagonal-text.d.cts +49 -0
  103. package/dist/layout/diagonal-text.d.ts +49 -0
  104. package/dist/layout/direct-families.d.cts +91 -0
  105. package/dist/layout/direct-families.d.ts +91 -0
  106. package/dist/layout/elk-graph.d.cts +36 -0
  107. package/dist/layout/elk-graph.d.ts +36 -0
  108. package/dist/layout/elk-worker.d.cts +34 -0
  109. package/dist/layout/elk-worker.d.ts +34 -0
  110. package/dist/layout/end-trim.d.cts +41 -0
  111. package/dist/layout/end-trim.d.ts +41 -0
  112. package/dist/layout/face-centre.d.cts +25 -0
  113. package/dist/layout/face-centre.d.ts +25 -0
  114. package/dist/layout/fan-admission.d.cts +47 -0
  115. package/dist/layout/fan-admission.d.ts +47 -0
  116. package/dist/layout/fan-spread.d.cts +43 -0
  117. package/dist/layout/fan-spread.d.ts +43 -0
  118. package/dist/layout/feed-order.d.cts +53 -0
  119. package/dist/layout/feed-order.d.ts +53 -0
  120. package/dist/layout/feed-split.d.cts +34 -0
  121. package/dist/layout/feed-split.d.ts +34 -0
  122. package/dist/layout/flanks.d.cts +21 -0
  123. package/dist/layout/flanks.d.ts +21 -0
  124. package/dist/layout/frame-paths.d.cts +209 -0
  125. package/dist/layout/frame-paths.d.ts +209 -0
  126. package/dist/layout/frames.d.cts +112 -0
  127. package/dist/layout/frames.d.ts +112 -0
  128. package/dist/layout/gap-band.d.cts +10 -0
  129. package/dist/layout/gap-band.d.ts +10 -0
  130. package/dist/layout/gap-plan.d.cts +229 -0
  131. package/dist/layout/gap-plan.d.ts +229 -0
  132. package/dist/layout/gap-room.d.cts +71 -0
  133. package/dist/layout/gap-room.d.ts +71 -0
  134. package/dist/layout/gap-runs.d.cts +95 -0
  135. package/dist/layout/gap-runs.d.ts +95 -0
  136. package/dist/layout/given-back.d.cts +23 -0
  137. package/dist/layout/given-back.d.ts +23 -0
  138. package/dist/layout/grid-chains.d.cts +84 -0
  139. package/dist/layout/grid-chains.d.ts +84 -0
  140. package/dist/layout/grid.d.cts +314 -0
  141. package/dist/layout/grid.d.ts +314 -0
  142. package/dist/layout/group-exit-check.d.cts +36 -0
  143. package/dist/layout/group-exit-check.d.ts +36 -0
  144. package/dist/layout/group-exits.d.cts +53 -0
  145. package/dist/layout/group-exits.d.ts +53 -0
  146. package/dist/layout/group-padding.d.cts +6 -0
  147. package/dist/layout/group-padding.d.ts +6 -0
  148. package/dist/layout/growth-guard.d.cts +25 -0
  149. package/dist/layout/growth-guard.d.ts +25 -0
  150. package/dist/layout/joint-order.d.cts +149 -0
  151. package/dist/layout/joint-order.d.ts +149 -0
  152. package/dist/layout/label-room-guard.d.cts +8 -0
  153. package/dist/layout/label-room-guard.d.ts +8 -0
  154. package/dist/layout/lane-kind.d.cts +11 -0
  155. package/dist/layout/lane-kind.d.ts +11 -0
  156. package/dist/layout/lanes.d.cts +278 -0
  157. package/dist/layout/lanes.d.ts +278 -0
  158. package/dist/layout/legend.d.cts +88 -0
  159. package/dist/layout/legend.d.ts +88 -0
  160. package/dist/layout/lift-judge.d.cts +28 -0
  161. package/dist/layout/lift-judge.d.ts +28 -0
  162. package/dist/layout/lift.d.cts +164 -0
  163. package/dist/layout/lift.d.ts +164 -0
  164. package/dist/layout/link-label-geometry.d.cts +32 -0
  165. package/dist/layout/link-label-geometry.d.ts +32 -0
  166. package/dist/layout/link-labels.d.cts +129 -0
  167. package/dist/layout/link-labels.d.ts +129 -0
  168. package/dist/layout/link-layer.d.cts +6 -0
  169. package/dist/layout/link-layer.d.ts +6 -0
  170. package/dist/layout/move-reservations.d.cts +49 -0
  171. package/dist/layout/move-reservations.d.ts +49 -0
  172. package/dist/layout/mutation.d.cts +32 -0
  173. package/dist/layout/mutation.d.ts +32 -0
  174. package/dist/layout/node-geometry.d.cts +3 -0
  175. package/dist/layout/node-geometry.d.ts +3 -0
  176. package/dist/layout/objective.d.cts +232 -0
  177. package/dist/layout/objective.d.ts +232 -0
  178. package/dist/layout/overlay-nest.d.cts +27 -0
  179. package/dist/layout/overlay-nest.d.ts +27 -0
  180. package/dist/layout/overlay-order.d.cts +140 -0
  181. package/dist/layout/overlay-order.d.ts +140 -0
  182. package/dist/layout/overlay-paths.d.cts +303 -0
  183. package/dist/layout/overlay-paths.d.ts +303 -0
  184. package/dist/layout/overlay-place.d.cts +99 -0
  185. package/dist/layout/overlay-place.d.ts +99 -0
  186. package/dist/layout/overlay-tracks.d.cts +93 -0
  187. package/dist/layout/overlay-tracks.d.ts +93 -0
  188. package/dist/layout/overlay-window.d.cts +83 -0
  189. package/dist/layout/overlay-window.d.ts +83 -0
  190. package/dist/layout/parallel-sets.d.cts +51 -0
  191. package/dist/layout/parallel-sets.d.ts +51 -0
  192. package/dist/layout/parent-stand.d.cts +40 -0
  193. package/dist/layout/parent-stand.d.ts +40 -0
  194. package/dist/layout/path-end.d.cts +34 -0
  195. package/dist/layout/path-end.d.ts +34 -0
  196. package/dist/layout/peers.d.cts +28 -0
  197. package/dist/layout/peers.d.ts +28 -0
  198. package/dist/layout/pill-reach.d.cts +14 -0
  199. package/dist/layout/pill-reach.d.ts +14 -0
  200. package/dist/layout/placement-attempt.d.cts +58 -0
  201. package/dist/layout/placement-attempt.d.ts +58 -0
  202. package/dist/layout/placement-refusal.d.cts +67 -0
  203. package/dist/layout/placement-refusal.d.ts +67 -0
  204. package/dist/layout/port-insets.d.cts +15 -0
  205. package/dist/layout/port-insets.d.ts +15 -0
  206. package/dist/layout/port-side.d.cts +8 -0
  207. package/dist/layout/port-side.d.ts +8 -0
  208. package/dist/layout/postconditions.d.cts +40 -0
  209. package/dist/layout/postconditions.d.ts +40 -0
  210. package/dist/layout/rank-cells.d.cts +24 -0
  211. package/dist/layout/rank-cells.d.ts +24 -0
  212. package/dist/layout/rank-input.d.cts +8 -0
  213. package/dist/layout/rank-input.d.ts +8 -0
  214. package/dist/layout/ranks.d.cts +36 -0
  215. package/dist/layout/ranks.d.ts +36 -0
  216. package/dist/layout/read/arrangement.d.cts +3 -0
  217. package/dist/layout/read/arrangement.d.ts +3 -0
  218. package/dist/layout/read/canton.d.cts +48 -0
  219. package/dist/layout/read/canton.d.ts +48 -0
  220. package/dist/layout/read/chain.d.cts +11 -0
  221. package/dist/layout/read/chain.d.ts +11 -0
  222. package/dist/layout/read/courses.d.cts +67 -0
  223. package/dist/layout/read/courses.d.ts +67 -0
  224. package/dist/layout/read/crossings.d.cts +79 -0
  225. package/dist/layout/read/crossings.d.ts +79 -0
  226. package/dist/layout/read/feeds.d.cts +53 -0
  227. package/dist/layout/read/feeds.d.ts +53 -0
  228. package/dist/layout/read/overlay-straight.d.cts +33 -0
  229. package/dist/layout/read/overlay-straight.d.ts +33 -0
  230. package/dist/layout/read/parent-spread.d.cts +13 -0
  231. package/dist/layout/read/parent-spread.d.ts +13 -0
  232. package/dist/layout/read/tier.d.cts +19 -0
  233. package/dist/layout/read/tier.d.ts +19 -0
  234. package/dist/layout/read/title-edge.d.cts +19 -0
  235. package/dist/layout/read/title-edge.d.ts +19 -0
  236. package/dist/layout/rectangle-index.d.cts +33 -0
  237. package/dist/layout/rectangle-index.d.ts +33 -0
  238. package/dist/layout/region-rebuild.d.cts +9 -0
  239. package/dist/layout/region-rebuild.d.ts +9 -0
  240. package/dist/layout/regions.d.cts +37 -0
  241. package/dist/layout/regions.d.ts +37 -0
  242. package/dist/layout/reservation-checks.d.cts +16 -0
  243. package/dist/layout/reservation-checks.d.ts +16 -0
  244. package/dist/layout/reservations.d.cts +267 -0
  245. package/dist/layout/reservations.d.ts +267 -0
  246. package/dist/layout/row-paths.d.cts +62 -0
  247. package/dist/layout/row-paths.d.ts +62 -0
  248. package/dist/layout/rows.d.cts +5 -0
  249. package/dist/layout/rows.d.ts +5 -0
  250. package/dist/layout/rule-geometry-hook.d.cts +5 -0
  251. package/dist/layout/rule-geometry-hook.d.ts +5 -0
  252. package/dist/layout/run-label-box.d.cts +139 -0
  253. package/dist/layout/run-label-box.d.ts +139 -0
  254. package/dist/layout/side-chords.d.cts +55 -0
  255. package/dist/layout/side-chords.d.ts +55 -0
  256. package/dist/layout/side-hints.d.cts +34 -0
  257. package/dist/layout/side-hints.d.ts +34 -0
  258. package/dist/layout/side-judge.d.cts +65 -0
  259. package/dist/layout/side-judge.d.ts +65 -0
  260. package/dist/layout/side-lanes.d.cts +27 -0
  261. package/dist/layout/side-lanes.d.ts +27 -0
  262. package/dist/layout/side-measure.d.cts +55 -0
  263. package/dist/layout/side-measure.d.ts +55 -0
  264. package/dist/layout/sides-one.d.cts +24 -0
  265. package/dist/layout/sides-one.d.ts +24 -0
  266. package/dist/layout/sides-two.d.cts +159 -0
  267. package/dist/layout/sides-two.d.ts +159 -0
  268. package/dist/layout/size.d.cts +114 -0
  269. package/dist/layout/size.d.ts +114 -0
  270. package/dist/layout/skeleton-geometry.d.cts +38 -0
  271. package/dist/layout/skeleton-geometry.d.ts +38 -0
  272. package/dist/layout/skeleton-graph.d.cts +33 -0
  273. package/dist/layout/skeleton-graph.d.ts +33 -0
  274. package/dist/layout/skeleton.d.cts +21 -0
  275. package/dist/layout/skeleton.d.ts +21 -0
  276. package/dist/layout/solid-blocks.d.cts +24 -0
  277. package/dist/layout/solid-blocks.d.ts +24 -0
  278. package/dist/layout/span-judge.d.cts +13 -0
  279. package/dist/layout/span-judge.d.ts +13 -0
  280. package/dist/layout/span-lanes.d.cts +37 -0
  281. package/dist/layout/span-lanes.d.ts +37 -0
  282. package/dist/layout/span-measure.d.cts +35 -0
  283. package/dist/layout/span-measure.d.ts +35 -0
  284. package/dist/layout/stagger.d.cts +40 -0
  285. package/dist/layout/stagger.d.ts +40 -0
  286. package/dist/layout/title-room.d.cts +50 -0
  287. package/dist/layout/title-room.d.ts +50 -0
  288. package/dist/layout/tolerance.d.cts +60 -0
  289. package/dist/layout/tolerance.d.ts +60 -0
  290. package/dist/layout/trial-copy.d.cts +9 -0
  291. package/dist/layout/trial-copy.d.ts +9 -0
  292. package/dist/layout/trial-findings.d.cts +25 -0
  293. package/dist/layout/trial-findings.d.ts +25 -0
  294. package/dist/layout/trunk.d.cts +69 -0
  295. package/dist/layout/trunk.d.ts +69 -0
  296. package/dist/layout/turn-measure.d.cts +42 -0
  297. package/dist/layout/turn-measure.d.ts +42 -0
  298. package/dist/layout/turn-order.d.cts +83 -0
  299. package/dist/layout/turn-order.d.ts +83 -0
  300. package/dist/migrate/index.d.cts +13 -0
  301. package/dist/migrate/index.d.ts +13 -0
  302. package/dist/model/classes.d.cts +21 -0
  303. package/dist/model/classes.d.ts +21 -0
  304. package/dist/model/document.d.cts +174 -0
  305. package/dist/model/document.d.ts +174 -0
  306. package/dist/model/geometry.d.cts +12 -0
  307. package/dist/model/geometry.d.ts +12 -0
  308. package/dist/model/index.d.cts +5 -0
  309. package/dist/model/index.d.ts +5 -0
  310. package/dist/model/json-equality.d.cts +2 -0
  311. package/dist/model/json-equality.d.ts +2 -0
  312. package/dist/model/layout.d.cts +1142 -0
  313. package/dist/model/layout.d.ts +1142 -0
  314. package/dist/model/link-ids.d.cts +16 -0
  315. package/dist/model/link-ids.d.ts +16 -0
  316. package/dist/model/model.d.cts +26 -0
  317. package/dist/model/model.d.ts +26 -0
  318. package/dist/model/read-cache.d.cts +20 -0
  319. package/dist/model/read-cache.d.ts +20 -0
  320. package/dist/node.cjs +43 -0
  321. package/dist/node.d.cts +6 -0
  322. package/dist/parse/css.d.cts +2 -0
  323. package/dist/parse/css.d.ts +2 -0
  324. package/dist/parse/index.d.cts +23 -0
  325. package/dist/parse/index.d.ts +23 -0
  326. package/dist/parse/link-order.d.cts +24 -0
  327. package/dist/parse/link-order.d.ts +24 -0
  328. package/dist/parse/validation.d.cts +39 -0
  329. package/dist/parse/validation.d.ts +39 -0
  330. package/dist/pipeline/budget.d.cts +28 -0
  331. package/dist/pipeline/budget.d.ts +28 -0
  332. package/dist/pipeline/deadline.d.cts +1 -0
  333. package/dist/pipeline/deadline.d.ts +1 -0
  334. package/dist/pipeline/driver.d.cts +14 -0
  335. package/dist/pipeline/driver.d.ts +14 -0
  336. package/dist/pipeline/env.d.cts +54 -0
  337. package/dist/pipeline/env.d.ts +54 -0
  338. package/dist/pipeline/index.d.cts +17 -0
  339. package/dist/pipeline/index.d.ts +17 -0
  340. package/dist/pipeline/initial.d.cts +3 -0
  341. package/dist/pipeline/initial.d.ts +3 -0
  342. package/dist/pipeline/lift-round.d.cts +9 -0
  343. package/dist/pipeline/lift-round.d.ts +9 -0
  344. package/dist/pipeline/limits.d.cts +16 -0
  345. package/dist/pipeline/limits.d.ts +16 -0
  346. package/dist/pipeline/options.d.cts +85 -0
  347. package/dist/pipeline/options.d.ts +85 -0
  348. package/dist/pipeline/place.d.cts +9 -0
  349. package/dist/pipeline/place.d.ts +9 -0
  350. package/dist/pipeline/publish.d.cts +4 -0
  351. package/dist/pipeline/publish.d.ts +4 -0
  352. package/dist/pipeline/round.d.cts +86 -0
  353. package/dist/pipeline/round.d.ts +86 -0
  354. package/dist/pipeline/rounds.d.cts +85 -0
  355. package/dist/pipeline/rounds.d.ts +85 -0
  356. package/dist/pipeline/state.d.cts +46 -0
  357. package/dist/pipeline/state.d.ts +46 -0
  358. package/dist/pipeline/width-budget.d.cts +6 -0
  359. package/dist/pipeline/width-budget.d.ts +6 -0
  360. package/dist/portograph-avoid-worker.mjs +260 -0
  361. package/dist/portograph.js +43369 -0
  362. package/dist/portograph.umd.cjs +154 -0
  363. package/dist/profiles/network/content.d.cts +29 -0
  364. package/dist/profiles/network/content.d.ts +29 -0
  365. package/dist/profiles/network/icons.d.cts +27 -0
  366. package/dist/profiles/network/icons.d.ts +27 -0
  367. package/dist/profiles/network/snack.d.cts +50 -0
  368. package/dist/profiles/network/snack.d.ts +50 -0
  369. package/dist/profiles/network/theme.d.cts +246 -0
  370. package/dist/profiles/network/theme.d.ts +246 -0
  371. package/dist/profiles/network/themes.d.cts +60 -0
  372. package/dist/profiles/network/themes.d.ts +60 -0
  373. package/dist/profiles/network/tiers.d.cts +8 -0
  374. package/dist/profiles/network/tiers.d.ts +8 -0
  375. package/dist/render/anonymous-end.d.cts +8 -0
  376. package/dist/render/anonymous-end.d.ts +8 -0
  377. package/dist/render/author-css.d.cts +9 -0
  378. package/dist/render/author-css.d.ts +9 -0
  379. package/dist/render/check-options.d.cts +8 -0
  380. package/dist/render/check-options.d.ts +8 -0
  381. package/dist/render/drawio.d.cts +35 -0
  382. package/dist/render/drawio.d.ts +35 -0
  383. package/dist/render/frame-order.d.cts +36 -0
  384. package/dist/render/frame-order.d.ts +36 -0
  385. package/dist/render/index.d.cts +19 -0
  386. package/dist/render/index.d.ts +19 -0
  387. package/dist/render/shared.d.cts +137 -0
  388. package/dist/render/shared.d.ts +137 -0
  389. package/dist/render/svg.d.cts +22 -0
  390. package/dist/render/svg.d.ts +22 -0
  391. package/dist/render/theme.d.cts +81 -0
  392. package/dist/render/theme.d.ts +81 -0
  393. package/dist/render/tooltips.d.cts +11 -0
  394. package/dist/render/tooltips.d.ts +11 -0
  395. package/dist/resolve/fan-family.d.cts +19 -0
  396. package/dist/resolve/fan-family.d.ts +19 -0
  397. package/dist/resolve/index.d.cts +30 -0
  398. package/dist/resolve/index.d.ts +30 -0
  399. package/dist/resolve/mesh-bus.d.cts +19 -0
  400. package/dist/resolve/mesh-bus.d.ts +19 -0
  401. package/dist/resolve/solid-blocks.d.cts +2 -0
  402. package/dist/resolve/solid-blocks.d.ts +2 -0
  403. package/dist/route/containment.d.cts +8 -0
  404. package/dist/route/containment.d.ts +8 -0
  405. package/dist/route/index.d.cts +48 -0
  406. package/dist/route/index.d.ts +48 -0
  407. package/dist/route/obstacles.d.cts +59 -0
  408. package/dist/route/obstacles.d.ts +59 -0
  409. package/dist/route/paths.d.cts +100 -0
  410. package/dist/route/paths.d.ts +100 -0
  411. package/dist/route/plan.d.cts +182 -0
  412. package/dist/route/plan.d.ts +182 -0
  413. package/dist/route/reservations.d.cts +15 -0
  414. package/dist/route/reservations.d.ts +15 -0
  415. package/dist/route/types.d.cts +59 -0
  416. package/dist/route/types.d.ts +59 -0
  417. package/dist/route/validate.d.cts +41 -0
  418. package/dist/route/validate.d.ts +41 -0
  419. package/dist/route/worker.d.cts +73 -0
  420. package/dist/route/worker.d.ts +73 -0
  421. package/dist/score/counts.d.cts +12 -0
  422. package/dist/score/counts.d.ts +12 -0
  423. package/dist/score/gates.d.cts +16 -0
  424. package/dist/score/gates.d.ts +16 -0
  425. package/dist/score/geometry.d.cts +2 -0
  426. package/dist/score/geometry.d.ts +2 -0
  427. package/dist/score/index.d.cts +5 -0
  428. package/dist/score/index.d.ts +5 -0
  429. package/dist/score/metrics.d.cts +7 -0
  430. package/dist/score/metrics.d.ts +7 -0
  431. package/dist/score/model.d.cts +76 -0
  432. package/dist/score/model.d.ts +76 -0
  433. package/dist/score/types.d.cts +135 -0
  434. package/dist/score/types.d.ts +135 -0
  435. package/dist/text/font-metrics.d.cts +9 -0
  436. package/dist/text/font-metrics.d.ts +9 -0
  437. package/dist/text/index.d.cts +32 -0
  438. package/dist/text/index.d.ts +32 -0
  439. package/dist/theme/content.d.cts +33 -0
  440. package/dist/theme/content.d.ts +33 -0
  441. package/dist/theme/geometry.d.cts +81 -0
  442. package/dist/theme/geometry.d.ts +81 -0
  443. package/dist/theme/legend.d.cts +26 -0
  444. package/dist/theme/legend.d.ts +26 -0
  445. package/dist/warm-elk.cjs +43 -0
  446. package/package.json +109 -4
@@ -0,0 +1,163 @@
1
+ import { Bundle, LayoutLink, LayoutModel, LayoutNode, LayoutPort, PathSegment, Point, Side } from '../model/index.cjs';
2
+ export declare const MEMBER_GAP = 16;
3
+ export declare const MIN_STEM = 15;
4
+ export declare const clone: <T>(value: T) => T;
5
+ export interface Member {
6
+ link: LayoutLink;
7
+ a: LayoutPort;
8
+ b: LayoutPort;
9
+ reversed: boolean;
10
+ }
11
+ export declare function members(model: LayoutModel, bundle: Bundle): Member[];
12
+ export declare function axis(side: Side): 'x' | 'y';
13
+ /** A group box as a closed interval along one depth axis; `toDepth` maps a corner to that axis. */
14
+ export type DepthPair = [number, number];
15
+ export declare function groupDepthPairs(model: LayoutModel, groupIds: Iterable<string>, toDepth: (p: Point) => number): DepthPair[];
16
+ /** The stroke-aware edge margin: centreline distance a link of this stroke keeps from a group edge. */
17
+ export declare function edgeMargin(strokeWidth: number): number;
18
+ /**
19
+ * A coordinate on or outside a group box, closer to its edge than the margin, moves `direction`-ward
20
+ * to margin distance from that edge (ADR-0013). Strictly inside a box it is the group's own routing
21
+ * space and stays. Bounded, so a chain of boxes cannot loop.
22
+ */
23
+ export declare function clearOfGroupEdges(value: number, pairs: DepthPair[], direction: 1 | -1, margin?: number): number;
24
+ export declare function coordinate(port: LayoutPort): number;
25
+ export declare function normal(side: Side): Point;
26
+ export declare function outward(port: LayoutPort, length?: number): Point;
27
+ export declare function pitch(model: LayoutModel, bundle: Bundle): number;
28
+ export declare function inversionPairs(list: Member[]): [string, string][];
29
+ export declare function facing(list: Member[]): boolean;
30
+ /** The stable id of the junction at `depth` on a shared port; 7d names it before 7e builds it (ADR-0016). */
31
+ export declare const junctionId: (port: LayoutPort, depth: number) => string;
32
+ /**
33
+ * Fan pitch: the bundle member gap plus the widest member stroke — the same formula `pitch()` uses
34
+ * for a bundle, and never below the default-stroke value (17.5 px), so reserved capacity and the
35
+ * emitted rows cannot drift apart.
36
+ */
37
+ export declare function fanPitch(links: readonly LayoutLink[]): number;
38
+ /**
39
+ * Row depths of a fan tree at `port` for `links` members: at least 15 px out and beyond the face's pill bodies, then one pitch apart, each row
40
+ * moved off a group edge it would run along (ADR-0013). `rows[i]` for `i < links.length` is the
41
+ * depth of junction `i`; `rows[links.length]` is where the straight continuation ends.
42
+ */
43
+ export declare function fanRows(model: LayoutModel, port: LayoutPort, links: readonly LayoutLink[]): number[];
44
+ /**
45
+ * Row depths of a bundle's own fan at `port` (`bundleFans`): `count` rows a pitch apart from at least 15 px
46
+ * out and beyond the face's pill bodies, each moved off a group edge it would run along (ADR-0013), and the `distance` one further
47
+ * pitch out where the members join the channel. The reservation in 7e and the producer read this
48
+ * one function, so the room reserved is the room the fan takes.
49
+ */
50
+ export declare function bundleFanRows(model: LayoutModel, port: LayoutPort, fanLinks: readonly LayoutLink[], count: number, q: number): {
51
+ rows: number[];
52
+ distance: number;
53
+ };
54
+ /**
55
+ * How many rows the fans before `port` on its own node side have taken. A port with one link draws
56
+ * no fan and takes none; a port with `k` takes `k`, which is what `fanRows` hands its own tree.
57
+ * Ordered by coordinate along the side, so the sequence is a property of the side, not of the call.
58
+ */
59
+ export declare function priorSideRows(model: LayoutModel, port: LayoutPort): number;
60
+ /** Every row the fans on one side of `node` take together; what that side must have room for. */
61
+ export declare function sideRowBudget(model: LayoutModel, node: string, side: Side): number;
62
+ /**
63
+ * How far the fan at one end of a bundle pushes the anchors its paths are measured from, the figure
64
+ * stage 7e reserves before any path exists (ticket 39). `trees` is the stage's one index of junction
65
+ * cohorts by port.
66
+ */
67
+ export declare function fanDepth(model: LayoutModel, trees: Map<string, {
68
+ port: LayoutPort;
69
+ links: LayoutLink[];
70
+ }>, bundle: Bundle, list: Member[], end: 'a' | 'b', q: number): number;
71
+ /** The point `depth` px out from the port along its normal, at the port's own coordinate. */
72
+ export declare function alongNormal(port: LayoutPort, depth: number): Point;
73
+ /**
74
+ * How far a fixed path runs straight out of `port` along its normal before it turns or meets a
75
+ * reserved lane segment: the length of its leading plain collinear run at that end. Zero when the
76
+ * path does not start or end at the port's anchor.
77
+ */
78
+ export declare function leadingRun(port: LayoutPort, segments: readonly PathSegment[]): number;
79
+ /**
80
+ * Paths a stage is still building, by link id, with the ports each one may be split at. A bar drop
81
+ * names one port; a path a rule pinned between two ports names both, because either end may be a
82
+ * fan root and a port where one path starts and another ends has to see the cohort 7e will see.
83
+ */
84
+ export type PendingFixed = ReadonlyMap<string, {
85
+ ports: readonly string[];
86
+ segments: readonly PathSegment[];
87
+ }>;
88
+ /**
89
+ * The ports stage 7e gives a junction tree, with the links that join it: two or more routed links
90
+ * on one port, none a self-link (ticket 20). A cohort with a bundle keeps every link. In a
91
+ * bundle-less cohort at most one rule-fixed member joins, as the tree's straight-through leaf
92
+ * (ADR-0016): in 7d, a bar drop whose traversal is pending at this port and whose plain straight
93
+ * run reaches the last junction row; in 7e and on restore, a path whose segment at the port already
94
+ * carries the root junction id — which 7d wrote exactly when that fit held. Row and flank paths, and
95
+ * a drop at its bar end, are never split and stay outside. Dropping a member shrinks the rows, so
96
+ * the fit is settled by iteration. Shared with the capacity loop below and with 7d.
97
+ */
98
+ export declare function treeCohorts(model: LayoutModel, pending?: PendingFixed): {
99
+ port: LayoutPort;
100
+ links: LayoutLink[];
101
+ }[];
102
+ /**
103
+ * The cohorts, and the fixed members excluded from one. An excluded member keeps its own stem out of
104
+ * the port, which coincides with the tree's root: G4 reports that overlap, and stage 7e warns
105
+ * `FAN_MEMBER_UNRESERVED` so the reason is in the model. Adopting such a member — by letting 7d turn
106
+ * it at a junction row — is ticket 37.
107
+ */
108
+ export declare function fanCohorts(model: LayoutModel, pending?: PendingFixed): {
109
+ cohorts: {
110
+ port: LayoutPort;
111
+ links: LayoutLink[];
112
+ }[];
113
+ excluded: {
114
+ port: LayoutPort;
115
+ link: LayoutLink;
116
+ }[];
117
+ };
118
+ /**
119
+ * Where the tree's straight continuation ends: `rows[n]`, or earlier when the fixed member that is
120
+ * the straight leaf turns before that — never before the last junction row.
121
+ */
122
+ export declare function fanEnd(model: LayoutModel, port: LayoutPort, links: readonly LayoutLink[], pending?: PendingFixed): number;
123
+ /**
124
+ * Join every straight path a rule pinned at a shared port to that port's fan tree (ticket 37,
125
+ * ADR-0016). Without this a pinned path keeps its own stem out of the port, which is exactly where
126
+ * the tree's root runs, and G4 reports the overlap that no rule reserved.
127
+ *
128
+ * Both of a path's ports are offered, because a path runs between two of them and either end may be
129
+ * a fan root. The cohorts are computed once, from the pending map, so the decision every member sees
130
+ * is the same one — a member adopted at one end changes the rows at the other.
131
+ */
132
+ export declare function joinFanTrees(model: LayoutModel, candidates: readonly LayoutLink[]): void;
133
+ /**
134
+ * Split a fixed path's leading run out of `port` into the fan tree's stems — one per junction, owned
135
+ * by that junction's id — and the remainder owned by the link (ADR-0016). `segments` must run
136
+ * either from the port or into it. Returns the original when the run is too short to hold them.
137
+ */
138
+ export declare function splitUnderJunctions(model: LayoutModel, port: LayoutPort, cohort: readonly LayoutLink[], link: LayoutLink, segments: PathSegment[], pending?: PendingFixed): PathSegment[];
139
+ /**
140
+ * A bundle of a grid chain (architecture ticket 23) stands between two rows of one group, where no tier gap grows. The
141
+ * packer reserved the channel (`bundleChannelNeed`, the function that sizes a tier gap too); 7e must find it there. If the
142
+ * faces stand closer than the channel needs, the reservation was wrong: say so as an error, once, and grow nothing.
143
+ */
144
+ export declare function checkStackedChannel(model: LayoutModel, bundle: Bundle, upper: LayoutNode, lower: LayoutNode): void;
145
+ /**
146
+ * The channel a chain bundle needs between its two faces, from the ports as they stand: the members' coordinates give
147
+ * the alignment and the inversions, and the junction trees the fan depth, exactly as 7e reads them. Before the ports are
148
+ * allocated (no anchor yet) the two widths stand in for the alignment, and the inversions and the fan are zero. The one
149
+ * function the packer reserves with (`gridRowGaps`) and the guard checks with.
150
+ */
151
+ export declare function stackedChannelNeed(model: LayoutModel, bundle: Bundle): number;
152
+ /**
153
+ * What a grid chain pair must keep for its bundle to run straight between two rows: the members face each other
154
+ * (the upper end on `bottom`, the lower on `top`, the lower body below the upper) and the two port blocks stand at one
155
+ * coordinate. Centring may widen a body and split a column without breaking this, so the column is not tested, the
156
+ * ports are. Planned geometry only reaches here through the planner, which aligns the blocks; a pair that still fails
157
+ * was lost by a step that should have refused its move, so it is an error, once per bundle (a backstop, a bug if seen).
158
+ */
159
+ export declare function checkChainPair(model: LayoutModel, bundle: Bundle): void;
160
+ /** Order only (architecture ticket 12): the common order of every bundle's ports, with no capacity, pitch, path or envelope. Centring reads it before it seats a port. */
161
+ export declare function orderBundles(model: LayoutModel): void;
162
+ /** Geometry-only plan. No path, lane owner, bar reservation or envelope is written here. */
163
+ export declare function prepareBundleGeometry(model: LayoutModel): void;
@@ -0,0 +1,163 @@
1
+ import { Bundle, LayoutLink, LayoutModel, LayoutNode, LayoutPort, PathSegment, Point, Side } from '../model/index.js';
2
+ export declare const MEMBER_GAP = 16;
3
+ export declare const MIN_STEM = 15;
4
+ export declare const clone: <T>(value: T) => T;
5
+ export interface Member {
6
+ link: LayoutLink;
7
+ a: LayoutPort;
8
+ b: LayoutPort;
9
+ reversed: boolean;
10
+ }
11
+ export declare function members(model: LayoutModel, bundle: Bundle): Member[];
12
+ export declare function axis(side: Side): 'x' | 'y';
13
+ /** A group box as a closed interval along one depth axis; `toDepth` maps a corner to that axis. */
14
+ export type DepthPair = [number, number];
15
+ export declare function groupDepthPairs(model: LayoutModel, groupIds: Iterable<string>, toDepth: (p: Point) => number): DepthPair[];
16
+ /** The stroke-aware edge margin: centreline distance a link of this stroke keeps from a group edge. */
17
+ export declare function edgeMargin(strokeWidth: number): number;
18
+ /**
19
+ * A coordinate on or outside a group box, closer to its edge than the margin, moves `direction`-ward
20
+ * to margin distance from that edge (ADR-0013). Strictly inside a box it is the group's own routing
21
+ * space and stays. Bounded, so a chain of boxes cannot loop.
22
+ */
23
+ export declare function clearOfGroupEdges(value: number, pairs: DepthPair[], direction: 1 | -1, margin?: number): number;
24
+ export declare function coordinate(port: LayoutPort): number;
25
+ export declare function normal(side: Side): Point;
26
+ export declare function outward(port: LayoutPort, length?: number): Point;
27
+ export declare function pitch(model: LayoutModel, bundle: Bundle): number;
28
+ export declare function inversionPairs(list: Member[]): [string, string][];
29
+ export declare function facing(list: Member[]): boolean;
30
+ /** The stable id of the junction at `depth` on a shared port; 7d names it before 7e builds it (ADR-0016). */
31
+ export declare const junctionId: (port: LayoutPort, depth: number) => string;
32
+ /**
33
+ * Fan pitch: the bundle member gap plus the widest member stroke — the same formula `pitch()` uses
34
+ * for a bundle, and never below the default-stroke value (17.5 px), so reserved capacity and the
35
+ * emitted rows cannot drift apart.
36
+ */
37
+ export declare function fanPitch(links: readonly LayoutLink[]): number;
38
+ /**
39
+ * Row depths of a fan tree at `port` for `links` members: at least 15 px out and beyond the face's pill bodies, then one pitch apart, each row
40
+ * moved off a group edge it would run along (ADR-0013). `rows[i]` for `i < links.length` is the
41
+ * depth of junction `i`; `rows[links.length]` is where the straight continuation ends.
42
+ */
43
+ export declare function fanRows(model: LayoutModel, port: LayoutPort, links: readonly LayoutLink[]): number[];
44
+ /**
45
+ * Row depths of a bundle's own fan at `port` (`bundleFans`): `count` rows a pitch apart from at least 15 px
46
+ * out and beyond the face's pill bodies, each moved off a group edge it would run along (ADR-0013), and the `distance` one further
47
+ * pitch out where the members join the channel. The reservation in 7e and the producer read this
48
+ * one function, so the room reserved is the room the fan takes.
49
+ */
50
+ export declare function bundleFanRows(model: LayoutModel, port: LayoutPort, fanLinks: readonly LayoutLink[], count: number, q: number): {
51
+ rows: number[];
52
+ distance: number;
53
+ };
54
+ /**
55
+ * How many rows the fans before `port` on its own node side have taken. A port with one link draws
56
+ * no fan and takes none; a port with `k` takes `k`, which is what `fanRows` hands its own tree.
57
+ * Ordered by coordinate along the side, so the sequence is a property of the side, not of the call.
58
+ */
59
+ export declare function priorSideRows(model: LayoutModel, port: LayoutPort): number;
60
+ /** Every row the fans on one side of `node` take together; what that side must have room for. */
61
+ export declare function sideRowBudget(model: LayoutModel, node: string, side: Side): number;
62
+ /**
63
+ * How far the fan at one end of a bundle pushes the anchors its paths are measured from, the figure
64
+ * stage 7e reserves before any path exists (ticket 39). `trees` is the stage's one index of junction
65
+ * cohorts by port.
66
+ */
67
+ export declare function fanDepth(model: LayoutModel, trees: Map<string, {
68
+ port: LayoutPort;
69
+ links: LayoutLink[];
70
+ }>, bundle: Bundle, list: Member[], end: 'a' | 'b', q: number): number;
71
+ /** The point `depth` px out from the port along its normal, at the port's own coordinate. */
72
+ export declare function alongNormal(port: LayoutPort, depth: number): Point;
73
+ /**
74
+ * How far a fixed path runs straight out of `port` along its normal before it turns or meets a
75
+ * reserved lane segment: the length of its leading plain collinear run at that end. Zero when the
76
+ * path does not start or end at the port's anchor.
77
+ */
78
+ export declare function leadingRun(port: LayoutPort, segments: readonly PathSegment[]): number;
79
+ /**
80
+ * Paths a stage is still building, by link id, with the ports each one may be split at. A bar drop
81
+ * names one port; a path a rule pinned between two ports names both, because either end may be a
82
+ * fan root and a port where one path starts and another ends has to see the cohort 7e will see.
83
+ */
84
+ export type PendingFixed = ReadonlyMap<string, {
85
+ ports: readonly string[];
86
+ segments: readonly PathSegment[];
87
+ }>;
88
+ /**
89
+ * The ports stage 7e gives a junction tree, with the links that join it: two or more routed links
90
+ * on one port, none a self-link (ticket 20). A cohort with a bundle keeps every link. In a
91
+ * bundle-less cohort at most one rule-fixed member joins, as the tree's straight-through leaf
92
+ * (ADR-0016): in 7d, a bar drop whose traversal is pending at this port and whose plain straight
93
+ * run reaches the last junction row; in 7e and on restore, a path whose segment at the port already
94
+ * carries the root junction id — which 7d wrote exactly when that fit held. Row and flank paths, and
95
+ * a drop at its bar end, are never split and stay outside. Dropping a member shrinks the rows, so
96
+ * the fit is settled by iteration. Shared with the capacity loop below and with 7d.
97
+ */
98
+ export declare function treeCohorts(model: LayoutModel, pending?: PendingFixed): {
99
+ port: LayoutPort;
100
+ links: LayoutLink[];
101
+ }[];
102
+ /**
103
+ * The cohorts, and the fixed members excluded from one. An excluded member keeps its own stem out of
104
+ * the port, which coincides with the tree's root: G4 reports that overlap, and stage 7e warns
105
+ * `FAN_MEMBER_UNRESERVED` so the reason is in the model. Adopting such a member — by letting 7d turn
106
+ * it at a junction row — is ticket 37.
107
+ */
108
+ export declare function fanCohorts(model: LayoutModel, pending?: PendingFixed): {
109
+ cohorts: {
110
+ port: LayoutPort;
111
+ links: LayoutLink[];
112
+ }[];
113
+ excluded: {
114
+ port: LayoutPort;
115
+ link: LayoutLink;
116
+ }[];
117
+ };
118
+ /**
119
+ * Where the tree's straight continuation ends: `rows[n]`, or earlier when the fixed member that is
120
+ * the straight leaf turns before that — never before the last junction row.
121
+ */
122
+ export declare function fanEnd(model: LayoutModel, port: LayoutPort, links: readonly LayoutLink[], pending?: PendingFixed): number;
123
+ /**
124
+ * Join every straight path a rule pinned at a shared port to that port's fan tree (ticket 37,
125
+ * ADR-0016). Without this a pinned path keeps its own stem out of the port, which is exactly where
126
+ * the tree's root runs, and G4 reports the overlap that no rule reserved.
127
+ *
128
+ * Both of a path's ports are offered, because a path runs between two of them and either end may be
129
+ * a fan root. The cohorts are computed once, from the pending map, so the decision every member sees
130
+ * is the same one — a member adopted at one end changes the rows at the other.
131
+ */
132
+ export declare function joinFanTrees(model: LayoutModel, candidates: readonly LayoutLink[]): void;
133
+ /**
134
+ * Split a fixed path's leading run out of `port` into the fan tree's stems — one per junction, owned
135
+ * by that junction's id — and the remainder owned by the link (ADR-0016). `segments` must run
136
+ * either from the port or into it. Returns the original when the run is too short to hold them.
137
+ */
138
+ export declare function splitUnderJunctions(model: LayoutModel, port: LayoutPort, cohort: readonly LayoutLink[], link: LayoutLink, segments: PathSegment[], pending?: PendingFixed): PathSegment[];
139
+ /**
140
+ * A bundle of a grid chain (architecture ticket 23) stands between two rows of one group, where no tier gap grows. The
141
+ * packer reserved the channel (`bundleChannelNeed`, the function that sizes a tier gap too); 7e must find it there. If the
142
+ * faces stand closer than the channel needs, the reservation was wrong: say so as an error, once, and grow nothing.
143
+ */
144
+ export declare function checkStackedChannel(model: LayoutModel, bundle: Bundle, upper: LayoutNode, lower: LayoutNode): void;
145
+ /**
146
+ * The channel a chain bundle needs between its two faces, from the ports as they stand: the members' coordinates give
147
+ * the alignment and the inversions, and the junction trees the fan depth, exactly as 7e reads them. Before the ports are
148
+ * allocated (no anchor yet) the two widths stand in for the alignment, and the inversions and the fan are zero. The one
149
+ * function the packer reserves with (`gridRowGaps`) and the guard checks with.
150
+ */
151
+ export declare function stackedChannelNeed(model: LayoutModel, bundle: Bundle): number;
152
+ /**
153
+ * What a grid chain pair must keep for its bundle to run straight between two rows: the members face each other
154
+ * (the upper end on `bottom`, the lower on `top`, the lower body below the upper) and the two port blocks stand at one
155
+ * coordinate. Centring may widen a body and split a column without breaking this, so the column is not tested, the
156
+ * ports are. Planned geometry only reaches here through the planner, which aligns the blocks; a pair that still fails
157
+ * was lost by a step that should have refused its move, so it is an error, once per bundle (a backstop, a bug if seen).
158
+ */
159
+ export declare function checkChainPair(model: LayoutModel, bundle: Bundle): void;
160
+ /** Order only (architecture ticket 12): the common order of every bundle's ports, with no capacity, pitch, path or envelope. Centring reads it before it seats a port. */
161
+ export declare function orderBundles(model: LayoutModel): void;
162
+ /** Geometry-only plan. No path, lane owner, bar reservation or envelope is written here. */
163
+ export declare function prepareBundleGeometry(model: LayoutModel): void;
@@ -0,0 +1,41 @@
1
+ import { Bundle, LayoutModel, PathSegment, Rect } from '../model/index.cjs';
2
+ import { Member } from './bundle-geometry.cjs';
3
+ export interface BundleFans {
4
+ members: Member[];
5
+ a: Map<string, PathSegment[]>;
6
+ b: Map<string, PathSegment[]>;
7
+ }
8
+ /** Expand shared incidence into distinct channel tracks through explicit nested shared runs. */
9
+ export declare function bundleFans(model: LayoutModel, bundle: Bundle, list: Member[], q: number): BundleFans | undefined;
10
+ type Span = {
11
+ lo: number;
12
+ hi: number;
13
+ };
14
+ /** The group and frame boxes a branch from `node` to `farNode` leaves: those that hold `node` and not `farNode` (ticket 18). */
15
+ export declare function leftBoxes(model: LayoutModel, node: string, farNode: string): {
16
+ id: string;
17
+ bounds: Rect;
18
+ }[];
19
+ /**
20
+ * The outer edge bands of `box` along a side's tangent: from each edge out to one edge margin for `stroke`, and a hair in, so a
21
+ * coordinate on the edge is in its band. A track strictly inside a band (`inSpan`) stands on or outside the edge, closer than G6
22
+ * `segment-group-edge` allows; strictly inside the box is the group's own routing space, as `clearOfGroupEdges` leaves it.
23
+ */
24
+ export declare function edgeBands(box: Rect, tangent: 'x' | 'y', stroke: number): Span[];
25
+ /** The span `at` stands strictly inside: the one test the wall step, the edge keeper and the warning read. */
26
+ export declare function inSpan(at: number, spans: readonly Span[]): Span | undefined;
27
+ /**
28
+ * The keepers held when final placement freezes, read from the junctions the last replay recorded them on (architecture-2 ticket 18).
29
+ * From then on neither the member nor its depth is derived again from a box. Present only when a keeper is held, so a sheet without one
30
+ * publishes the bytes it did before; the frozen state itself is `freeze.placement` (see `edgeKeeper`).
31
+ */
32
+ export declare function freezeFanKeepers(model: LayoutModel): void;
33
+ /**
34
+ * A port can belong to several bundles, to a plain fan of routed links, or to a bundle and a later
35
+ * routing remainder. One junction tree owns it: every link leaves the anchor on one shared stem and
36
+ * peels off at its own row, so stage 8 starts each remainder at its leaf instead of drawing the same
37
+ * first 15 px twice (ticket 20). A port whose links all belong to one bundle is that bundle's own
38
+ * fan (`bundleFans`) and is left alone.
39
+ */
40
+ export declare function crossBundleFans(model: LayoutModel): void;
41
+ export {};
@@ -0,0 +1,41 @@
1
+ import { Bundle, LayoutModel, PathSegment, Rect } from '../model/index.js';
2
+ import { Member } from './bundle-geometry.js';
3
+ export interface BundleFans {
4
+ members: Member[];
5
+ a: Map<string, PathSegment[]>;
6
+ b: Map<string, PathSegment[]>;
7
+ }
8
+ /** Expand shared incidence into distinct channel tracks through explicit nested shared runs. */
9
+ export declare function bundleFans(model: LayoutModel, bundle: Bundle, list: Member[], q: number): BundleFans | undefined;
10
+ type Span = {
11
+ lo: number;
12
+ hi: number;
13
+ };
14
+ /** The group and frame boxes a branch from `node` to `farNode` leaves: those that hold `node` and not `farNode` (ticket 18). */
15
+ export declare function leftBoxes(model: LayoutModel, node: string, farNode: string): {
16
+ id: string;
17
+ bounds: Rect;
18
+ }[];
19
+ /**
20
+ * The outer edge bands of `box` along a side's tangent: from each edge out to one edge margin for `stroke`, and a hair in, so a
21
+ * coordinate on the edge is in its band. A track strictly inside a band (`inSpan`) stands on or outside the edge, closer than G6
22
+ * `segment-group-edge` allows; strictly inside the box is the group's own routing space, as `clearOfGroupEdges` leaves it.
23
+ */
24
+ export declare function edgeBands(box: Rect, tangent: 'x' | 'y', stroke: number): Span[];
25
+ /** The span `at` stands strictly inside: the one test the wall step, the edge keeper and the warning read. */
26
+ export declare function inSpan(at: number, spans: readonly Span[]): Span | undefined;
27
+ /**
28
+ * The keepers held when final placement freezes, read from the junctions the last replay recorded them on (architecture-2 ticket 18).
29
+ * From then on neither the member nor its depth is derived again from a box. Present only when a keeper is held, so a sheet without one
30
+ * publishes the bytes it did before; the frozen state itself is `freeze.placement` (see `edgeKeeper`).
31
+ */
32
+ export declare function freezeFanKeepers(model: LayoutModel): void;
33
+ /**
34
+ * A port can belong to several bundles, to a plain fan of routed links, or to a bundle and a later
35
+ * routing remainder. One junction tree owns it: every link leaves the anchor on one shared stem and
36
+ * peels off at its own row, so stage 8 starts each remainder at its leaf instead of drawing the same
37
+ * first 15 px twice (ticket 20). A port whose links all belong to one bundle is that bundle's own
38
+ * fan (`bundleFans`) and is left alone.
39
+ */
40
+ export declare function crossBundleFans(model: LayoutModel): void;
41
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Bundle, LayoutModel } from '../model/index.cjs';
2
+ import { Member } from './bundle-geometry.cjs';
3
+ /** Merge selected members through a comb of real trunk joins, retaining complete logical paths. */
4
+ export declare function mergeMembers(model: LayoutModel, bundle: Bundle, list: Member[], q: number): Bundle['mergeRuns'];
@@ -0,0 +1,4 @@
1
+ import { Bundle, LayoutModel } from '../model/index.js';
2
+ import { Member } from './bundle-geometry.js';
3
+ /** Merge selected members through a comb of real trunk joins, retaining complete logical paths. */
4
+ export declare function mergeMembers(model: LayoutModel, bundle: Bundle, list: Member[], q: number): Bundle['mergeRuns'];
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The room a facing bundle needs between its two bodies, in one place so the grid packer that reserves it
3
+ * (architecture ticket 23) and the bundle planner that reads it (stage 7e) cannot disagree.
4
+ *
5
+ * A stem leaves each face before a member may turn (`BUNDLE_STEM`), and the members that turn toward one side
6
+ * take distinct rows a pitch apart.
7
+ */
8
+ export declare const BUNDLE_STEM = 15;
9
+ /** The depth the turning rows of `turning` members take, a pitch `q` apart (`parallelPaths`). */
10
+ export declare const bundleTurnSpan: (turning: number, q: number) => number;
11
+ /**
12
+ * The channel between the faces of a facing bundle across a tier gap, which stage 7e grows the gap to: `lead` (a merge
13
+ * trunk's rows), the fan depth of both ends, both stems, a row per member (or the crossover of the inverted pairs) and an
14
+ * edge margin each side. The terms are added in the order 7e always added them. An inverted bundle that placement
15
+ * decided straight (`Bundle.straight`, ADR-0017, ticket DR-16) passes `inversions` 0: its members draw stem, one
16
+ * diagonal, stem, and its channel is the one a bundle of the same members without inversions takes.
17
+ */
18
+ export declare const facingBundleNeed: (lead: number, members: number, q: number, inversions: number, fan: number, margin: number) => number;
19
+ /**
20
+ * What a bundle between two bodies of one group needs. Members whose two ends stand at one coordinate run straight
21
+ * between the faces and need nothing; any other bundle needs the channel a tier gap reserves.
22
+ */
23
+ export declare const bundleChannelNeed: (aligned: boolean, members: number, q: number, inversions: number, fan: number, margin: number) => number;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The room a facing bundle needs between its two bodies, in one place so the grid packer that reserves it
3
+ * (architecture ticket 23) and the bundle planner that reads it (stage 7e) cannot disagree.
4
+ *
5
+ * A stem leaves each face before a member may turn (`BUNDLE_STEM`), and the members that turn toward one side
6
+ * take distinct rows a pitch apart.
7
+ */
8
+ export declare const BUNDLE_STEM = 15;
9
+ /** The depth the turning rows of `turning` members take, a pitch `q` apart (`parallelPaths`). */
10
+ export declare const bundleTurnSpan: (turning: number, q: number) => number;
11
+ /**
12
+ * The channel between the faces of a facing bundle across a tier gap, which stage 7e grows the gap to: `lead` (a merge
13
+ * trunk's rows), the fan depth of both ends, both stems, a row per member (or the crossover of the inverted pairs) and an
14
+ * edge margin each side. The terms are added in the order 7e always added them. An inverted bundle that placement
15
+ * decided straight (`Bundle.straight`, ADR-0017, ticket DR-16) passes `inversions` 0: its members draw stem, one
16
+ * diagonal, stem, and its channel is the one a bundle of the same members without inversions takes.
17
+ */
18
+ export declare const facingBundleNeed: (lead: number, members: number, q: number, inversions: number, fan: number, margin: number) => number;
19
+ /**
20
+ * What a bundle between two bodies of one group needs. Members whose two ends stand at one coordinate run straight
21
+ * between the faces and need nothing; any other bundle needs the channel a tier gap reserves.
22
+ */
23
+ export declare const bundleChannelNeed: (aligned: boolean, members: number, q: number, inversions: number, fan: number, margin: number) => number;
@@ -0,0 +1,10 @@
1
+ import { Bundle, LayoutModel, LayoutPort } from '../model/index.cjs';
2
+ export interface BundleOrderResult {
3
+ inversions: number;
4
+ proved: boolean;
5
+ examined: number;
6
+ orders: [LayoutPort[], LayoutPort[]];
7
+ }
8
+ /** Bounded exact enumeration for shared incidence. The result states whether the search completed. */
9
+ export declare function optimizeBundleOrder(model: LayoutModel, bundle: Bundle, limit?: number): BundleOrderResult;
10
+ export declare function applyBundleOrder(model: LayoutModel, bundle: Bundle): void;
@@ -0,0 +1,10 @@
1
+ import { Bundle, LayoutModel, LayoutPort } from '../model/index.js';
2
+ export interface BundleOrderResult {
3
+ inversions: number;
4
+ proved: boolean;
5
+ examined: number;
6
+ orders: [LayoutPort[], LayoutPort[]];
7
+ }
8
+ /** Bounded exact enumeration for shared incidence. The result states whether the search completed. */
9
+ export declare function optimizeBundleOrder(model: LayoutModel, bundle: Bundle, limit?: number): BundleOrderResult;
10
+ export declare function applyBundleOrder(model: LayoutModel, bundle: Bundle): void;
@@ -0,0 +1,33 @@
1
+ import { Bundle, LayoutModel, Owner, PathSegment, Point, Rect } from '../model/index.cjs';
2
+ import { Member } from './bundle-geometry.cjs';
3
+ import { PlacementRefusal } from './placement-refusal.cjs';
4
+ export declare class BundleFeasibilityError extends PlacementRefusal {
5
+ /** The rule that failed (`BUNDLE_CHANNEL_BLOCKED`, ...); `code` is the refusal's family. */
6
+ readonly reason: string;
7
+ readonly bundle: string;
8
+ constructor(reason: string, bundle: string, detail: string);
9
+ }
10
+ export declare function polyline(points: Point[], owner: Owner): PathSegment[];
11
+ export declare function reverse(segments: PathSegment[]): PathSegment[];
12
+ export declare function pathBounds(segments: PathSegment[], padding?: number): Rect;
13
+ /** Strict internal member intersections, deduplicated per pair and geometric point. */
14
+ export declare function bundleCrossings(list: Member[]): number;
15
+ /**
16
+ * Whether an inverted bundle can draw straight members (ADR-0017): it can when the gap holds the member
17
+ * pitch. The gap is the channel between the faces, measured along the bundle's normal: both stems
18
+ * (`MIN_STEM` each) must fit in it with room to spare. The pitch is the bundle member pitch of
19
+ * `CONTEXT.md`: every pair of member segments G6 would measure (stems included, a strictly crossing
20
+ * pair excepted) keeps the member gap plus the pair's own strokes, 17.5 px between centrelines at
21
+ * default strokes. The inversion count and the drawn length play no part (user ruling, 2026-11-07).
22
+ * Only a facing bundle without lanes qualifies, like the staircase. (An authored override is out of
23
+ * scope: `route: straight` is a per-link key and stage 1 excludes such links from bundles.)
24
+ *
25
+ * Placement asks this once per reservation (`straightReservation`, ticket DR-16) and records the answer
26
+ * on `Bundle.straight`; the paths read that record (R1), ask only for a fanned bundle (whose fan leaves
27
+ * they place), and check a stored `true` against the channel that stands. `grow` is the depth
28
+ * placement is about to add to the channel: the test reads the far ends `grow` px deeper along the
29
+ * normal, which is the geometry the move leaves, because the move translates one face along the normal.
30
+ */
31
+ export declare function straightMembers(model: LayoutModel, bundle: Bundle, list: Member[], grow?: number): boolean;
32
+ /** Replace complete bundle paths and swept reservations from the final coherent geometry. */
33
+ export declare function rebuildBundlePaths(model: LayoutModel): void;
@@ -0,0 +1,33 @@
1
+ import { Bundle, LayoutModel, Owner, PathSegment, Point, Rect } from '../model/index.js';
2
+ import { Member } from './bundle-geometry.js';
3
+ import { PlacementRefusal } from './placement-refusal.js';
4
+ export declare class BundleFeasibilityError extends PlacementRefusal {
5
+ /** The rule that failed (`BUNDLE_CHANNEL_BLOCKED`, ...); `code` is the refusal's family. */
6
+ readonly reason: string;
7
+ readonly bundle: string;
8
+ constructor(reason: string, bundle: string, detail: string);
9
+ }
10
+ export declare function polyline(points: Point[], owner: Owner): PathSegment[];
11
+ export declare function reverse(segments: PathSegment[]): PathSegment[];
12
+ export declare function pathBounds(segments: PathSegment[], padding?: number): Rect;
13
+ /** Strict internal member intersections, deduplicated per pair and geometric point. */
14
+ export declare function bundleCrossings(list: Member[]): number;
15
+ /**
16
+ * Whether an inverted bundle can draw straight members (ADR-0017): it can when the gap holds the member
17
+ * pitch. The gap is the channel between the faces, measured along the bundle's normal: both stems
18
+ * (`MIN_STEM` each) must fit in it with room to spare. The pitch is the bundle member pitch of
19
+ * `CONTEXT.md`: every pair of member segments G6 would measure (stems included, a strictly crossing
20
+ * pair excepted) keeps the member gap plus the pair's own strokes, 17.5 px between centrelines at
21
+ * default strokes. The inversion count and the drawn length play no part (user ruling, 2026-11-07).
22
+ * Only a facing bundle without lanes qualifies, like the staircase. (An authored override is out of
23
+ * scope: `route: straight` is a per-link key and stage 1 excludes such links from bundles.)
24
+ *
25
+ * Placement asks this once per reservation (`straightReservation`, ticket DR-16) and records the answer
26
+ * on `Bundle.straight`; the paths read that record (R1), ask only for a fanned bundle (whose fan leaves
27
+ * they place), and check a stored `true` against the channel that stands. `grow` is the depth
28
+ * placement is about to add to the channel: the test reads the far ends `grow` px deeper along the
29
+ * normal, which is the geometry the move leaves, because the move translates one face along the normal.
30
+ */
31
+ export declare function straightMembers(model: LayoutModel, bundle: Bundle, list: Member[], grow?: number): boolean;
32
+ /** Replace complete bundle paths and swept reservations from the final coherent geometry. */
33
+ export declare function rebuildBundlePaths(model: LayoutModel): void;
@@ -0,0 +1,5 @@
1
+ import { LayoutModel } from '../model/index.cjs';
2
+ /** Stage 7e. The checked finalizer plans capacity and derives all bundle geometry atomically. */
3
+ export declare function bundles(model: LayoutModel): LayoutModel;
4
+ export { prepareBundleGeometry } from './bundle-geometry.cjs';
5
+ export { rebuildBundlePaths, BundleFeasibilityError } from './bundle-paths.cjs';
@@ -0,0 +1,5 @@
1
+ import { LayoutModel } from '../model/index.js';
2
+ /** Stage 7e. The checked finalizer plans capacity and derives all bundle geometry atomically. */
3
+ export declare function bundles(model: LayoutModel): LayoutModel;
4
+ export { prepareBundleGeometry } from './bundle-geometry.js';
5
+ export { rebuildBundlePaths, BundleFeasibilityError } from './bundle-paths.js';
@@ -0,0 +1,48 @@
1
+ import { LayoutGroup, LayoutLink, LayoutModel, MeshBus } from '../model/layout.cjs';
2
+ /**
3
+ * The room a mesh bus asks for, in a leaf module that reads the model and the text metrics only, so
4
+ * `regions.ts` (which every placement stage imports) can ask it without a cycle
5
+ * (docs/design/mesh-bus.md, section 4, *Bus band*).
6
+ */
7
+ /** The bar stands this far beyond the row's outermost body or pill extent: the port-stem convention. */
8
+ export declare const BUS_STUB = 15;
9
+ /** The run clearance `k` of the routing rule (11.5 px): the room beyond a bar that has no label. */
10
+ export declare const BUS_RUN_CLEARANCE = 11.5;
11
+ /** The label's font, as a link label's: `FONT_FAMILY` at 9 px. */
12
+ export declare const BUS_LABEL_FONT: {
13
+ readonly fontFamily: "Verdana, DejaVu Sans, sans-serif";
14
+ readonly fontSize: 9;
15
+ readonly fontWeight: 400;
16
+ };
17
+ /** The room above and below the label beyond the bar. */
18
+ export declare const BUS_LABEL_GAP = 4;
19
+ /** The text of a bus label: `<class> mesh (<n> nodes)`. */
20
+ export declare function busLabelText(bus: MeshBus): string;
21
+ /** The key of a trunk join: the members of its buses, top row first. Stage 5 names a blocked join by it, and a placement run declines it. */
22
+ export declare const trunkKey: (buses: readonly MeshBus[]) => string;
23
+ /** The label's measured box. */
24
+ export declare function busLabelSize(bus: MeshBus): {
25
+ width: number;
26
+ height: number;
27
+ };
28
+ /**
29
+ * Whether the bar of this bus carries the label. A joined mesh has one label, on the bar of the bus with more members (the upper bar on a
30
+ * tie); the other bar has the stub, the bar and the run clearance only (mesh-bus.md, section 11.5, *The label*).
31
+ */
32
+ export declare function busCarriesLabel(bus: MeshBus): boolean;
33
+ /** Whether `link` is a cross link of a join: it carries the upper bus's id and is no member (mesh-bus.md, section 11.6). */
34
+ export declare function isCrossLink(model: LayoutModel, link: LayoutLink): boolean;
35
+ /** The bus band: from the row's outermost extent out to the bar, plus `4 px + label height + 4 px` beyond it. */
36
+ export declare function busBandHeight(bus: MeshBus): number;
37
+ /** The in-frame bus whose members stand in `group` (its cell, or the group itself), once the side is fixed. */
38
+ export declare function inFrameBusOf(model: LayoutModel, group: LayoutGroup): MeshBus | undefined;
39
+ /** The room the group must hold on each horizontal edge for its in-frame bus, from the buses (zero without one). */
40
+ export declare function busRoom(model: LayoutModel, group: LayoutGroup): {
41
+ top: number;
42
+ bottom: number;
43
+ };
44
+ /** The room the group holds now, from the bus bands 7f has published (zero before it reserves them). */
45
+ export declare function heldBusRoom(model: LayoutModel, group: LayoutGroup): {
46
+ top: number;
47
+ bottom: number;
48
+ };