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,38 @@
1
+ import { ElkNode } from './elk-graph.js';
2
+ import { Rect } from '../model/geometry.js';
3
+ import { LayoutGroup, LayoutModel } from '../model/layout.js';
4
+ import { Column } from './columns.js';
5
+ /**
6
+ * The width a box at `x` needs to reach `edge`. `edge - x` is not always it: a rectangle kept as
7
+ * `x` and `width` is read back through `x + width`, and the difference of two absolute edges can
8
+ * round down, leaving the box one ULP short of the box it was built from. The residue grows with
9
+ * the coordinate and the span. One step up is the smallest width that really reaches `edge`
10
+ * (stress ticket 14; ticket 13 measured the same residue through `contains`).
11
+ */
12
+ export declare const span: (x: number, edge: number) => number;
13
+ export declare function union(rects: Rect[]): Rect;
14
+ /** ROOT ports are already absolute. Do not add the node or compound offsets a second time. */
15
+ export declare function readSkeleton(model: LayoutModel, result: ElkNode, tier?: number): void;
16
+ export declare function rebuildBands(model: LayoutModel, includeFlanks?: boolean): void;
17
+ /** Stage-4 counterpart of G8, usable before paths and final port geometry exist. */
18
+ export declare function validateSkeletonBands(model: LayoutModel, includeFlanks?: boolean, onlyTier?: number): string[];
19
+ /** Test only (the side probe, ticket 134): called after each `moveGroup`. Unset in production, so it costs one comparison. */
20
+ export declare const moveTrace: {
21
+ hook?: (model: LayoutModel, group: LayoutGroup, dx: number, dy: number) => void;
22
+ };
23
+ export declare function moveGroup(model: LayoutModel, group: LayoutGroup, dx: number, dy: number): void;
24
+ /**
25
+ * Stage 4 hands ELK one row per group, because ELK's layered pass is what orders the nodes. A grid
26
+ * group then takes that order and packs it into columns and rows (`grid.ts`), which makes the box
27
+ * narrower and taller than the one ELK measured. Two consequences are settled here rather than left
28
+ * for a later stage to discover: the tier is re-packed left to right, so the width a grid gave back
29
+ * is width the canvas gives back too, and the caller re-stacks the bands, because a taller box no
30
+ * longer fits the band ELK sized for a ribbon.
31
+ *
32
+ * Returns whether anything moved, so an input with no grid group keeps ELK's geometry exactly.
33
+ */
34
+ export declare function packGridGroups(model: LayoutModel, tier?: number): boolean;
35
+ /** Select all primary peers from the same ELK result before any repack changes distances. */
36
+ export declare function placeFlanksAndPeers(model: LayoutModel, orderColumns?: (columns: Map<string, Column>) => void): void;
37
+ /** Stack complete band geometry. Preserve each band's valid ELK positions and internal gaps. */
38
+ export declare function stackBands(model: LayoutModel, includeFlanks: boolean): void;
@@ -0,0 +1,33 @@
1
+ import { ElkNode } from './elk-graph.cjs';
2
+ import { PortRef } from '../model/document.cjs';
3
+ import { LayoutGroup, LayoutModel } from '../model/layout.cjs';
4
+ export declare const SKELETON_SPACING: {
5
+ readonly padding: 12;
6
+ readonly tierGap: 60;
7
+ readonly nodeClearance: 20;
8
+ };
9
+ export declare const groupId: (id: string) => string;
10
+ export declare const nodeId: (id: string) => string;
11
+ /** The key of a port, byte-identical to the JSON of `[node, anonymous, name, ordinal]` and built without serializing an array. */
12
+ export declare const portId: (ref: PortRef) => string;
13
+ export declare function nodeGap(model: LayoutModel, a: string, b: string): number;
14
+ /**
15
+ * The horizontal spacing between units: sibling columns, grid columns, flanks, rows of a grid and ELK's layer spacing. One number for
16
+ * the whole diagram, from the node clearance and the widest stroke. The vertical seat of a tier gap is `tierGapMin` (architecture-2
17
+ * ticket 57); today the two are equal.
18
+ */
19
+ export declare function bandGap(model: LayoutModel): number;
20
+ /**
21
+ * The least height of a tier gap, body to body: stage 4 and stage 6 seat every band this far under the band above, and it is the
22
+ * floor of the tier-gap plan (`gap-plan.ts`). The reservations of a gap (its bands, its parts, its link labels) raise a gap above it,
23
+ * never below (architecture-2 ticket 57). Split from `bandGap`, which keeps every horizontal use; the value is the same today.
24
+ */
25
+ export declare function tierGapMin(model: LayoutModel): number;
26
+ export declare function peerCounts(model: LayoutModel, group: LayoutGroup): Map<string, number>;
27
+ export declare function greatestPeers(model: LayoutModel, group: LayoutGroup): string[];
28
+ declare const compareId: (a: string, b: string) => number;
29
+ export { compareId };
30
+ /** Select declaration-order proxies before graph construction, including fallback graphs. */
31
+ export declare function selectProxyPeers(model: LayoutModel): void;
32
+ /** Flank groups and every incident link stay out of the skeleton. They are placed by rule. */
33
+ export declare function buildSkeletonGraph(model: LayoutModel, tier?: number): ElkNode;
@@ -0,0 +1,33 @@
1
+ import { ElkNode } from './elk-graph.js';
2
+ import { PortRef } from '../model/document.js';
3
+ import { LayoutGroup, LayoutModel } from '../model/layout.js';
4
+ export declare const SKELETON_SPACING: {
5
+ readonly padding: 12;
6
+ readonly tierGap: 60;
7
+ readonly nodeClearance: 20;
8
+ };
9
+ export declare const groupId: (id: string) => string;
10
+ export declare const nodeId: (id: string) => string;
11
+ /** The key of a port, byte-identical to the JSON of `[node, anonymous, name, ordinal]` and built without serializing an array. */
12
+ export declare const portId: (ref: PortRef) => string;
13
+ export declare function nodeGap(model: LayoutModel, a: string, b: string): number;
14
+ /**
15
+ * The horizontal spacing between units: sibling columns, grid columns, flanks, rows of a grid and ELK's layer spacing. One number for
16
+ * the whole diagram, from the node clearance and the widest stroke. The vertical seat of a tier gap is `tierGapMin` (architecture-2
17
+ * ticket 57); today the two are equal.
18
+ */
19
+ export declare function bandGap(model: LayoutModel): number;
20
+ /**
21
+ * The least height of a tier gap, body to body: stage 4 and stage 6 seat every band this far under the band above, and it is the
22
+ * floor of the tier-gap plan (`gap-plan.ts`). The reservations of a gap (its bands, its parts, its link labels) raise a gap above it,
23
+ * never below (architecture-2 ticket 57). Split from `bandGap`, which keeps every horizontal use; the value is the same today.
24
+ */
25
+ export declare function tierGapMin(model: LayoutModel): number;
26
+ export declare function peerCounts(model: LayoutModel, group: LayoutGroup): Map<string, number>;
27
+ export declare function greatestPeers(model: LayoutModel, group: LayoutGroup): string[];
28
+ declare const compareId: (a: string, b: string) => number;
29
+ export { compareId };
30
+ /** Select declaration-order proxies before graph construction, including fallback graphs. */
31
+ export declare function selectProxyPeers(model: LayoutModel): void;
32
+ /** Flank groups and every incident link stay out of the skeleton. They are placed by rule. */
33
+ export declare function buildSkeletonGraph(model: LayoutModel, tier?: number): ElkNode;
@@ -0,0 +1,21 @@
1
+ import { LayoutModel } from '../model/layout.cjs';
2
+ import { CreateElkAttempt, ElkClock } from './elk-worker.cjs';
3
+ import { Budget } from '../pipeline/budget.cjs';
4
+ import { PlacementRefusal } from './placement-refusal.cjs';
5
+ export { buildSkeletonGraph } from './skeleton-graph.cjs';
6
+ export { validateSkeletonBands } from './skeleton-geometry.cjs';
7
+ export interface SkeletonOptions {
8
+ createAttempt?: CreateElkAttempt;
9
+ clock?: ElkClock;
10
+ layoutBudgetMs?: number;
11
+ /**
12
+ * The command's shared remainder. Partitioning and every fallback band draw from it, so a
13
+ * sequence of legal attempts cannot add up to more than the command was given (ADR-0006).
14
+ */
15
+ budget?: Budget;
16
+ }
17
+ export declare class SkeletonError extends PlacementRefusal {
18
+ constructor(message: string);
19
+ }
20
+ /** Stage 4 commits geometry only after ordered, nonoverlapping tier bands pass validation. */
21
+ export declare function skeleton(model: LayoutModel, options?: SkeletonOptions): Promise<LayoutModel>;
@@ -0,0 +1,21 @@
1
+ import { LayoutModel } from '../model/layout.js';
2
+ import { CreateElkAttempt, ElkClock } from './elk-worker.js';
3
+ import { Budget } from '../pipeline/budget.js';
4
+ import { PlacementRefusal } from './placement-refusal.js';
5
+ export { buildSkeletonGraph } from './skeleton-graph.js';
6
+ export { validateSkeletonBands } from './skeleton-geometry.js';
7
+ export interface SkeletonOptions {
8
+ createAttempt?: CreateElkAttempt;
9
+ clock?: ElkClock;
10
+ layoutBudgetMs?: number;
11
+ /**
12
+ * The command's shared remainder. Partitioning and every fallback band draw from it, so a
13
+ * sequence of legal attempts cannot add up to more than the command was given (ADR-0006).
14
+ */
15
+ budget?: Budget;
16
+ }
17
+ export declare class SkeletonError extends PlacementRefusal {
18
+ constructor(message: string);
19
+ }
20
+ /** Stage 4 commits geometry only after ordered, nonoverlapping tier bands pass validation. */
21
+ export declare function skeleton(model: LayoutModel, options?: SkeletonOptions): Promise<LayoutModel>;
@@ -0,0 +1,24 @@
1
+ import { LayoutModel } from '../model/layout.cjs';
2
+ /** Ticket 83: capacity is owned before resizing, never by the chord consumer. */
3
+ export declare function reserveBlockPitch(model: LayoutModel): void;
4
+ /** A row of terminal one-link followers needs the newly widened block's spacing.
5
+ * Seat that row before lanes, rather than asking 7c to stretch small hosts across it.
6
+ * A mixed row, flank, or frame keeps its existing owner. Proposed rows are fitted together on a
7
+ * draft; conflicting seats all decline before publication, including conflicts with unseated siblings.
8
+ */
9
+ export declare function seatBlockFollowers(model: LayoutModel, fitRegionGroup: (model: LayoutModel, group: LayoutModel['groups'][string]) => void, conflicts: (before: LayoutModel, after: LayoutModel) => {
10
+ owners: string[];
11
+ reason: string;
12
+ }[]): void;
13
+ /** Complete incidence ties use document order before the corridor/host orders. */
14
+ export declare function seatBlockOrder(model: LayoutModel): void;
15
+ /** Final-x draft before the freeze. Replays after the freeze only read this record.
16
+ * Angle and each facing-edge demand combine by max; shared gap demands also combine by max.
17
+ * The initial draft and the mandatory-pack forecast each contribute one read and one y move; pitch already fixes x capacity.
18
+ */
19
+ export declare function reserveBlockGaps(model: LayoutModel, moveBands: (model: LayoutModel, growth: Map<number, number>) => void, geometry?: LayoutModel): void;
20
+ /** A conservative stage-5 cap bound: even zero inter-node gaps and optimal row translation
21
+ * cannot place one hub face within 34 degrees of both ends of a wider complete row.
22
+ * Endpoint band heights are credited in full, so this can only decline a provably over-cap block.
23
+ */
24
+ export declare function declineOversizedBlocks(model: LayoutModel): void;
@@ -0,0 +1,24 @@
1
+ import { LayoutModel } from '../model/layout.js';
2
+ /** Ticket 83: capacity is owned before resizing, never by the chord consumer. */
3
+ export declare function reserveBlockPitch(model: LayoutModel): void;
4
+ /** A row of terminal one-link followers needs the newly widened block's spacing.
5
+ * Seat that row before lanes, rather than asking 7c to stretch small hosts across it.
6
+ * A mixed row, flank, or frame keeps its existing owner. Proposed rows are fitted together on a
7
+ * draft; conflicting seats all decline before publication, including conflicts with unseated siblings.
8
+ */
9
+ export declare function seatBlockFollowers(model: LayoutModel, fitRegionGroup: (model: LayoutModel, group: LayoutModel['groups'][string]) => void, conflicts: (before: LayoutModel, after: LayoutModel) => {
10
+ owners: string[];
11
+ reason: string;
12
+ }[]): void;
13
+ /** Complete incidence ties use document order before the corridor/host orders. */
14
+ export declare function seatBlockOrder(model: LayoutModel): void;
15
+ /** Final-x draft before the freeze. Replays after the freeze only read this record.
16
+ * Angle and each facing-edge demand combine by max; shared gap demands also combine by max.
17
+ * The initial draft and the mandatory-pack forecast each contribute one read and one y move; pitch already fixes x capacity.
18
+ */
19
+ export declare function reserveBlockGaps(model: LayoutModel, moveBands: (model: LayoutModel, growth: Map<number, number>) => void, geometry?: LayoutModel): void;
20
+ /** A conservative stage-5 cap bound: even zero inter-node gaps and optimal row translation
21
+ * cannot place one hub face within 34 degrees of both ends of a wider complete row.
22
+ * Endpoint band heights are credited in full, so this can only decline a provably over-cap block.
23
+ */
24
+ export declare function declineOversizedBlocks(model: LayoutModel): void;
@@ -0,0 +1,13 @@
1
+ import { LayoutModel } from '../model/layout.cjs';
2
+ /**
3
+ * The span round's judge (architecture ticket 22, docs/design/routed-chords.md, Section 14.4). The trial that reserves the offered span corridors is kept only when
4
+ * (1) no link the baseline's route keeps is removed, (2) every hinted link publishes its chord (the promise) and 7f named no blocked chord, (3) no gate finding and no
5
+ * hard entry of the x constraint catalogue is new (as sets), nor a minimum separation deeper, (4) the canvas grows by 5 % at most, and (5) the unified order on the routed
6
+ * result gains: fewer bent links, then fewer turns, then fewer crossings. A trial that one chord spoils is refused whole (the user's decision 5).
7
+ */
8
+ export interface SpanVerdict {
9
+ kept: boolean;
10
+ reason: 'removed' | 'promise' | 'blocked' | 'gate' | 'constraint' | 'separation' | 'growth' | 'worse' | 'unscored' | undefined;
11
+ detail: string;
12
+ }
13
+ export declare function judgeSpanTrial(routedBase: LayoutModel, routedTrial: LayoutModel, hinted: readonly string[]): SpanVerdict;
@@ -0,0 +1,13 @@
1
+ import { LayoutModel } from '../model/layout.js';
2
+ /**
3
+ * The span round's judge (architecture ticket 22, docs/design/routed-chords.md, Section 14.4). The trial that reserves the offered span corridors is kept only when
4
+ * (1) no link the baseline's route keeps is removed, (2) every hinted link publishes its chord (the promise) and 7f named no blocked chord, (3) no gate finding and no
5
+ * hard entry of the x constraint catalogue is new (as sets), nor a minimum separation deeper, (4) the canvas grows by 5 % at most, and (5) the unified order on the routed
6
+ * result gains: fewer bent links, then fewer turns, then fewer crossings. A trial that one chord spoils is refused whole (the user's decision 5).
7
+ */
8
+ export interface SpanVerdict {
9
+ kept: boolean;
10
+ reason: 'removed' | 'promise' | 'blocked' | 'gate' | 'constraint' | 'separation' | 'growth' | 'worse' | 'unscored' | undefined;
11
+ detail: string;
12
+ }
13
+ export declare function judgeSpanTrial(routedBase: LayoutModel, routedTrial: LayoutModel, hinted: readonly string[]): SpanVerdict;
@@ -0,0 +1,37 @@
1
+ import { Rect } from '../model/geometry.cjs';
2
+ import { Lane, LayoutLink, LayoutModel } from '../model/layout.cjs';
3
+ import { spanLaneId } from './lane-kind.cjs';
4
+ import { SideHintRefusal, RefusalDetail } from './placement-refusal.cjs';
5
+ /**
6
+ * The span corridors of a spanning chord (architecture ticket 22, docs/design/routed-chords.md, Section 14.3). A spanning chord is a hinted routed link on two
7
+ * document tiers that are not consecutive. It owns no transit lane; 7a reserves one **span corridor** per transited band instead: `Lane.kind: 'span'`,
8
+ * id `span:<link>:<sub-tier>`, owner the link. The corridor is the part of the chord between the band's top and bottom, grown by the gate clearances. Its id,
9
+ * owner and band are immutable; its x and width are derived from the two end anchors at every rebuild, as a perimeter lane's x is derived (ADR-0010 amendment of
10
+ * ticket 15). It is no router obstacle: the chord is a fixed path.
11
+ */
12
+ /** A placement run cannot reserve a span corridor (a unit or lane stands in it and cannot move aside). The span round refuses the trial; every other error is a bug. */
13
+ export declare class SpanRefusal extends SideHintRefusal {
14
+ constructor(message: string, detail?: RefusalDetail);
15
+ }
16
+ /** The 7a reservation (`reserveSpanCorridors`) cannot open a corridor. It is thrown before any later stage has run, so the round that asked gives the re-run back; a refusal of 7c to 7e (`SpanRefusal`) comes after most of the placement and gives nothing back. */
17
+ export declare class SpanReservationRefusal extends SpanRefusal {
18
+ }
19
+ export { spanLaneId };
20
+ export declare const isSpanLane: (lane: Pick<Lane, "kind">) => boolean;
21
+ /**
22
+ * The room the label of a spanning chord needs (ticket 16; docs/design/routed-chords.md, Section 14.5), as the boxes stage 9 would put it: a label on a direct line lies on
23
+ * it, centred at the midpoint, turned to the line's angle, with its halo; a label on a line with an axis stands beside it, on either side. A line too short for the text carries
24
+ * the text shortened to its length less the two margins. Reserved here, in 7a, with the corridor, so that no unit stands where stage 9 puts the label.
25
+ */
26
+ export declare function spanLabelRooms(model: LayoutModel, link: LayoutLink): Rect[];
27
+ /**
28
+ * The corridor of the link's chord in one transited band: the part of the segment between the band's top and bottom, grown in x by the group-edge link margin
29
+ * and the half stroke, taken along the normal of the chord (the factor 1 / cos of the angle to the vertical, as `crossingRect`). The box is the extent of a lane:
30
+ * its y and height are the band's. Where the room of the chord's label (`spanLabelRooms`) meets the band, the corridor is widened to hold it with its halo.
31
+ * Undefined where the chord does not reach the band, or when an end has no anchor.
32
+ */
33
+ export declare function spanCorridor(model: LayoutModel, link: LayoutLink, tier: number): Rect | undefined;
34
+ /** The hinted links of the model, in link order. */
35
+ export declare const spanLinks: (model: LayoutModel) => LayoutLink[];
36
+ /** Put the derived geometry on a span lane: x is the centre of the corridor, the box its bounds. Returns false when the chord has left the band. */
37
+ export declare function replaySpanLane(model: LayoutModel, lane: Lane, link: LayoutLink): boolean;
@@ -0,0 +1,37 @@
1
+ import { Rect } from '../model/geometry.js';
2
+ import { Lane, LayoutLink, LayoutModel } from '../model/layout.js';
3
+ import { spanLaneId } from './lane-kind.js';
4
+ import { SideHintRefusal, RefusalDetail } from './placement-refusal.js';
5
+ /**
6
+ * The span corridors of a spanning chord (architecture ticket 22, docs/design/routed-chords.md, Section 14.3). A spanning chord is a hinted routed link on two
7
+ * document tiers that are not consecutive. It owns no transit lane; 7a reserves one **span corridor** per transited band instead: `Lane.kind: 'span'`,
8
+ * id `span:<link>:<sub-tier>`, owner the link. The corridor is the part of the chord between the band's top and bottom, grown by the gate clearances. Its id,
9
+ * owner and band are immutable; its x and width are derived from the two end anchors at every rebuild, as a perimeter lane's x is derived (ADR-0010 amendment of
10
+ * ticket 15). It is no router obstacle: the chord is a fixed path.
11
+ */
12
+ /** A placement run cannot reserve a span corridor (a unit or lane stands in it and cannot move aside). The span round refuses the trial; every other error is a bug. */
13
+ export declare class SpanRefusal extends SideHintRefusal {
14
+ constructor(message: string, detail?: RefusalDetail);
15
+ }
16
+ /** The 7a reservation (`reserveSpanCorridors`) cannot open a corridor. It is thrown before any later stage has run, so the round that asked gives the re-run back; a refusal of 7c to 7e (`SpanRefusal`) comes after most of the placement and gives nothing back. */
17
+ export declare class SpanReservationRefusal extends SpanRefusal {
18
+ }
19
+ export { spanLaneId };
20
+ export declare const isSpanLane: (lane: Pick<Lane, "kind">) => boolean;
21
+ /**
22
+ * The room the label of a spanning chord needs (ticket 16; docs/design/routed-chords.md, Section 14.5), as the boxes stage 9 would put it: a label on a direct line lies on
23
+ * it, centred at the midpoint, turned to the line's angle, with its halo; a label on a line with an axis stands beside it, on either side. A line too short for the text carries
24
+ * the text shortened to its length less the two margins. Reserved here, in 7a, with the corridor, so that no unit stands where stage 9 puts the label.
25
+ */
26
+ export declare function spanLabelRooms(model: LayoutModel, link: LayoutLink): Rect[];
27
+ /**
28
+ * The corridor of the link's chord in one transited band: the part of the segment between the band's top and bottom, grown in x by the group-edge link margin
29
+ * and the half stroke, taken along the normal of the chord (the factor 1 / cos of the angle to the vertical, as `crossingRect`). The box is the extent of a lane:
30
+ * its y and height are the band's. Where the room of the chord's label (`spanLabelRooms`) meets the band, the corridor is widened to hold it with its halo.
31
+ * Undefined where the chord does not reach the band, or when an end has no anchor.
32
+ */
33
+ export declare function spanCorridor(model: LayoutModel, link: LayoutLink, tier: number): Rect | undefined;
34
+ /** The hinted links of the model, in link order. */
35
+ export declare const spanLinks: (model: LayoutModel) => LayoutLink[];
36
+ /** Put the derived geometry on a span lane: x is the centre of the corridor, the box its bounds. Returns false when the chord has left the band. */
37
+ export declare function replaySpanLane(model: LayoutModel, lane: Lane, link: LayoutLink): boolean;
@@ -0,0 +1,35 @@
1
+ import { LayoutLink, LayoutModel, PathSegment } from '../model/layout.cjs';
2
+ import { ChordRefusal } from './frame-paths.cjs';
3
+ /**
4
+ * The span round's offer (architecture ticket 22, docs/design/routed-chords.md, Section 14.4). `measureSpans` reads the 7f baseline and its routed result and
5
+ * names the links that may become a spanning chord: a routed link whose end sub-tiers are not adjacent (`spanCandidate`: document tiers not consecutive, or
6
+ * consecutive with a rank band between, architecture-2 ticket 35), whose corridor (the chord over every
7
+ * transited band, grown by the gate clearances) is clear of every wall a cross-frame chord reads. Phase 1 runs it as a shadow, for the trace only.
8
+ */
9
+ /** Why a candidate is not offered: the first check of `chordVerdict` that refused it, `chord` for a chord held earlier in the pass that stands too near, `leg` for the leg of a link that stays orthogonal. */
10
+ export type SpanRefusal = ChordRefusal;
11
+ export interface SpanOffer {
12
+ /** The offered links, in link order. */
13
+ links: string[];
14
+ /** The chord of each offered link, as the baseline geometry gives it. */
15
+ chords: Map<string, PathSegment>;
16
+ /** Each candidate that was not offered, with the first check that refused it. */
17
+ refused: Map<string, SpanRefusal>;
18
+ /** Offered links whose chord a held chord or a leg stem crowds on the baseline geometry: the port pitch of the trial decides (see `PITCH_BOUND`). */
19
+ crowded: Map<string, SpanRefusal>;
20
+ /** The candidates of the baseline, in link order. Empty offer when none is bent today. */
21
+ candidates: string[];
22
+ }
23
+ /**
24
+ * The corridor reader: the chord of a candidate when every wall of Section 14.2 leaves it clear, else the first check that refuses it. `model` must be the
25
+ * baseline with the offered lanes removed and the chords accepted earlier in the pass held as pinned chords (`measureSpans` builds it): a held chord is a wall
26
+ * at the chord clearance unless the two cross strictly, and the legs of the links that stay orthogonal are walls too (`fixedPointRefusal`, the rule 7f freezes by).
27
+ */
28
+ export declare function spanVerdict(model: LayoutModel, link: LayoutLink, undecided?: ReadonlySet<string>): {
29
+ segment: PathSegment;
30
+ near?: 'chord' | 'leg';
31
+ } | {
32
+ reason: SpanRefusal;
33
+ };
34
+ /** The candidates of the baseline that are bent in its routed result, or removed: no chord can lower the bent count of a sheet without one. */
35
+ export declare function measureSpans(base: LayoutModel, routedBase: LayoutModel): SpanOffer;
@@ -0,0 +1,35 @@
1
+ import { LayoutLink, LayoutModel, PathSegment } from '../model/layout.js';
2
+ import { ChordRefusal } from './frame-paths.js';
3
+ /**
4
+ * The span round's offer (architecture ticket 22, docs/design/routed-chords.md, Section 14.4). `measureSpans` reads the 7f baseline and its routed result and
5
+ * names the links that may become a spanning chord: a routed link whose end sub-tiers are not adjacent (`spanCandidate`: document tiers not consecutive, or
6
+ * consecutive with a rank band between, architecture-2 ticket 35), whose corridor (the chord over every
7
+ * transited band, grown by the gate clearances) is clear of every wall a cross-frame chord reads. Phase 1 runs it as a shadow, for the trace only.
8
+ */
9
+ /** Why a candidate is not offered: the first check of `chordVerdict` that refused it, `chord` for a chord held earlier in the pass that stands too near, `leg` for the leg of a link that stays orthogonal. */
10
+ export type SpanRefusal = ChordRefusal;
11
+ export interface SpanOffer {
12
+ /** The offered links, in link order. */
13
+ links: string[];
14
+ /** The chord of each offered link, as the baseline geometry gives it. */
15
+ chords: Map<string, PathSegment>;
16
+ /** Each candidate that was not offered, with the first check that refused it. */
17
+ refused: Map<string, SpanRefusal>;
18
+ /** Offered links whose chord a held chord or a leg stem crowds on the baseline geometry: the port pitch of the trial decides (see `PITCH_BOUND`). */
19
+ crowded: Map<string, SpanRefusal>;
20
+ /** The candidates of the baseline, in link order. Empty offer when none is bent today. */
21
+ candidates: string[];
22
+ }
23
+ /**
24
+ * The corridor reader: the chord of a candidate when every wall of Section 14.2 leaves it clear, else the first check that refuses it. `model` must be the
25
+ * baseline with the offered lanes removed and the chords accepted earlier in the pass held as pinned chords (`measureSpans` builds it): a held chord is a wall
26
+ * at the chord clearance unless the two cross strictly, and the legs of the links that stay orthogonal are walls too (`fixedPointRefusal`, the rule 7f freezes by).
27
+ */
28
+ export declare function spanVerdict(model: LayoutModel, link: LayoutLink, undecided?: ReadonlySet<string>): {
29
+ segment: PathSegment;
30
+ near?: 'chord' | 'leg';
31
+ } | {
32
+ reason: SpanRefusal;
33
+ };
34
+ /** The candidates of the baseline that are bent in its routed result, or removed: no chord can lower the bent count of a sheet without one. */
35
+ export declare function measureSpans(base: LayoutModel, routedBase: LayoutModel): SpanOffer;
@@ -0,0 +1,40 @@
1
+ import { LayoutModel, StaggerRow } from '../model/layout.cjs';
2
+ import { PlacementRefusal } from './placement-refusal.cjs';
3
+ import { ColumnPlan } from './column-arrangement.cjs';
4
+ export declare const staggerOf: (model: LayoutModel, group: string) => StaggerRow | undefined;
5
+ /** Widest first, then group id. Width is measured on the published, normal row, not declaration order. */
6
+ export declare function staggerCandidates(model: LayoutModel): StaggerRow[];
7
+ /**
8
+ * Stage 5 only: seat both lines, fit containing groups, close the space released in each affected tier. A wrapped rank cell also packs its
9
+ * document tier again and stands its feeding chain over its block (fan wrap, D-Q4), before the feeding faces are seated.
10
+ */
11
+ export declare function seatStaggerRows(model: LayoutModel): void;
12
+ /** A refusal of a stagger reservation, from the seat, its proof or its validator: the first run declines the row, and a fan re-run is cut. */
13
+ export declare function staggerRefusal(error: unknown): error is PlacementRefusal;
14
+ /** Publication and restore keep the two lines, pitch, feed order and passing corridors. Diagnostics grant no exception. */
15
+ export declare function validateStaggerRows(model: LayoutModel): void;
16
+ /**
17
+ * Stage 5 of the first placement run, before the seat (ticket 51): pick each group's arrangement when no budget gave the rows. A candidate
18
+ * row (`rowReason`: a row of three or more members, each with one plain routed link out through one horizontal face, every hub feeding three
19
+ * or more of them) is tried widest first on a draft. It staggers only when its trigger holds (`triggerReason`: the block trigger for a rank
20
+ * cell, the aspect trigger for a plain row), the seated draft passes `prove` (the stage-5 refusals and the topology-freeze validation), and the
21
+ * objective holds (`objectiveReason`: less stage-5 canvas area, and nearer square for a plain row). A draft that a stage-5 stagger refusal
22
+ * refuses is dropped, the row stays, and the record names the reason; any other error of the draft ends the run (a freeze validation that the
23
+ * stage-5 proof did not foresee is a defect, not a reason). Each candidate is tried once (a finite traversal). A `declined` group stays a row:
24
+ * a later stage of an earlier attempt of the first run, or the acceptance gate (`wrapGateVerdict`), could not keep its stagger. When every group
25
+ * keeps its row by a rule before any draft there is nothing to choose and no record: an absent record and an all-`row` record both mean
26
+ * "every group stays one row"; the record exists only when stage 5 tried a group. `columns` are the columns stage 5 seated earlier (ticket
27
+ * 52): each is recorded `column`, and a group the column rule refused by name keeps that reason (the two filters are disjoint).
28
+ */
29
+ export declare function arrangeGroups(model: LayoutModel, declined: ReadonlyMap<string, string>, prove: (draft: LayoutModel) => void, columns?: {
30
+ plans: readonly ColumnPlan[];
31
+ reasons: ReadonlyMap<string, string>;
32
+ }): void;
33
+ /** The diagnostic code of a stage-5 stagger that the acceptance gate declines (fan wrap, D-Q4; ADR-0024, second amendment). */
34
+ export declare const FAN_WRAP_DECLINED = "FAN_WRAP_DECLINED";
35
+ /**
36
+ * The acceptance gate of the stagger stage 5 chose (fan wrap, D-Q4): the complete placement with the two lines (`wrapped`, after 7f, before
37
+ * routing) against the same run with every chosen stagger declined (`plain`). The two lines stand only when they take less area, every link
38
+ * `plain` places straight stays straight, and no hard separation is shorter than in `plain`. Returns the reason to decline, or undefined to keep.
39
+ */
40
+ export declare function wrapGateVerdict(wrapped: LayoutModel, plain: LayoutModel): string | undefined;
@@ -0,0 +1,40 @@
1
+ import { LayoutModel, StaggerRow } from '../model/layout.js';
2
+ import { PlacementRefusal } from './placement-refusal.js';
3
+ import { ColumnPlan } from './column-arrangement.js';
4
+ export declare const staggerOf: (model: LayoutModel, group: string) => StaggerRow | undefined;
5
+ /** Widest first, then group id. Width is measured on the published, normal row, not declaration order. */
6
+ export declare function staggerCandidates(model: LayoutModel): StaggerRow[];
7
+ /**
8
+ * Stage 5 only: seat both lines, fit containing groups, close the space released in each affected tier. A wrapped rank cell also packs its
9
+ * document tier again and stands its feeding chain over its block (fan wrap, D-Q4), before the feeding faces are seated.
10
+ */
11
+ export declare function seatStaggerRows(model: LayoutModel): void;
12
+ /** A refusal of a stagger reservation, from the seat, its proof or its validator: the first run declines the row, and a fan re-run is cut. */
13
+ export declare function staggerRefusal(error: unknown): error is PlacementRefusal;
14
+ /** Publication and restore keep the two lines, pitch, feed order and passing corridors. Diagnostics grant no exception. */
15
+ export declare function validateStaggerRows(model: LayoutModel): void;
16
+ /**
17
+ * Stage 5 of the first placement run, before the seat (ticket 51): pick each group's arrangement when no budget gave the rows. A candidate
18
+ * row (`rowReason`: a row of three or more members, each with one plain routed link out through one horizontal face, every hub feeding three
19
+ * or more of them) is tried widest first on a draft. It staggers only when its trigger holds (`triggerReason`: the block trigger for a rank
20
+ * cell, the aspect trigger for a plain row), the seated draft passes `prove` (the stage-5 refusals and the topology-freeze validation), and the
21
+ * objective holds (`objectiveReason`: less stage-5 canvas area, and nearer square for a plain row). A draft that a stage-5 stagger refusal
22
+ * refuses is dropped, the row stays, and the record names the reason; any other error of the draft ends the run (a freeze validation that the
23
+ * stage-5 proof did not foresee is a defect, not a reason). Each candidate is tried once (a finite traversal). A `declined` group stays a row:
24
+ * a later stage of an earlier attempt of the first run, or the acceptance gate (`wrapGateVerdict`), could not keep its stagger. When every group
25
+ * keeps its row by a rule before any draft there is nothing to choose and no record: an absent record and an all-`row` record both mean
26
+ * "every group stays one row"; the record exists only when stage 5 tried a group. `columns` are the columns stage 5 seated earlier (ticket
27
+ * 52): each is recorded `column`, and a group the column rule refused by name keeps that reason (the two filters are disjoint).
28
+ */
29
+ export declare function arrangeGroups(model: LayoutModel, declined: ReadonlyMap<string, string>, prove: (draft: LayoutModel) => void, columns?: {
30
+ plans: readonly ColumnPlan[];
31
+ reasons: ReadonlyMap<string, string>;
32
+ }): void;
33
+ /** The diagnostic code of a stage-5 stagger that the acceptance gate declines (fan wrap, D-Q4; ADR-0024, second amendment). */
34
+ export declare const FAN_WRAP_DECLINED = "FAN_WRAP_DECLINED";
35
+ /**
36
+ * The acceptance gate of the stagger stage 5 chose (fan wrap, D-Q4): the complete placement with the two lines (`wrapped`, after 7f, before
37
+ * routing) against the same run with every chosen stagger declined (`plain`). The two lines stand only when they take less area, every link
38
+ * `plain` places straight stays straight, and no hard separation is shorter than in `plain`. Returns the reason to decline, or undefined to keep.
39
+ */
40
+ export declare function wrapGateVerdict(wrapped: LayoutModel, plain: LayoutModel): string | undefined;
@@ -0,0 +1,50 @@
1
+ import { LayoutGroup, LayoutModel } from '../model/layout.cjs';
2
+ import { TextMeasurement } from '../text/index.cjs';
3
+ /** The group title type and the margins round it. `bands.ts` re-exports it; this leaf module lets `regions.ts` read it without an import cycle. */
4
+ export declare const GROUP_LABEL_GEOMETRY: {
5
+ readonly fontFamily: "Verdana, DejaVu Sans, sans-serif";
6
+ readonly fontSize: 12;
7
+ readonly fontWeight: 700;
8
+ readonly horizontalInset: 8;
9
+ readonly verticalInset: 4;
10
+ readonly bandExtra: 8;
11
+ /** Shortest outward routing checkpoint stage 8 may use for an ordinary attachment. */
12
+ readonly routerStem: 15;
13
+ /** G6 node clearance; stage 8 expands each node obstacle by this plus the two half strokes. */
14
+ readonly nodeClearance: 10;
15
+ /** Keeps a required entry point strictly outside a stroke-aware obstacle, not on its boundary. */
16
+ readonly entryTolerance: 0.25;
17
+ };
18
+ /** A group or frame title as stage 7f measures and draws it. */
19
+ export declare function measureTitle(label: string): TextMeasurement;
20
+ /**
21
+ * How far past a forbidden range a title's left edge is placed to be clear of it. `placeGroupTitles` (`bands.ts`) counts a blocker
22
+ * within one tolerance of the title as meeting it, so clearing one costs two: at `high + PLACEMENT_EPS` the range is still a hit
23
+ * (stress ticket 19 measured the difference of one tolerance on the Enterprise NTP sheet).
24
+ */
25
+ export declare const LABEL_CLEARANCE_STEP: number;
26
+ /**
27
+ * The width a title asks of the box that holds it: the measured title, on each side the larger of the horizontal inset and the title's
28
+ * link-free margin (`GROUP_LABEL_LINK_CLEARANCE`; both are 8 px), and one clearance step beyond it. A lane stands on the box edge and the
29
+ * margin is kept to it, so the side takes whichever of the two is wider and the two constants cannot drift apart; `placeGroupTitles`
30
+ * refuses an x within one tolerance of a forbidden range: the step on each side is the room the refusal takes.
31
+ */
32
+ export declare function titleRoom(label: string): number;
33
+ /**
34
+ * The rank cell that holds a frame's label band: the frame's own cell on the sub-tier that is the
35
+ * frame's extreme one on that edge, counting the cells of its child frames. The room is reserved in
36
+ * that cell and nowhere else. `undefined` when a child frame holds the edge.
37
+ */
38
+ export declare function frameHost(model: LayoutModel, frame: string, side: 'top' | 'bottom'): string | undefined;
39
+ /**
40
+ * ADR-0011's edge of a frame's title, read on natural sides from stage 5 on: `frameTitleEdge`, or the other edge when no own cell holds the
41
+ * preferred one; `undefined` for a canton (its band is held by the sub-tier) and for a frame with an own cell on neither edge.
42
+ */
43
+ export declare function frameTitleSide(model: LayoutModel, frame: string): 'top' | 'bottom' | undefined;
44
+ /**
45
+ * The width floor a title sets on the box that holds it (snack-theme ticket 157; architecture-2 ticket 54): a free group's own title, and
46
+ * the title of a frame on the rank cell that hosts it (`frameHost`, on the edge `frameTitleSide` reads). Group sizing reads it (`contentBox`)
47
+ * from stage 5 on, so 7a reserves its lanes beside a box that already holds the title, and 7f only places it: no stage widens a box for a
48
+ * title. A cell that hosts no title and a group without nodes have no floor (0). A canton's floor is its union's (`contentBox`).
49
+ */
50
+ export declare function ownTitleFloor(model: LayoutModel, group: LayoutGroup): number;
@@ -0,0 +1,50 @@
1
+ import { LayoutGroup, LayoutModel } from '../model/layout.js';
2
+ import { TextMeasurement } from '../text/index.js';
3
+ /** The group title type and the margins round it. `bands.ts` re-exports it; this leaf module lets `regions.ts` read it without an import cycle. */
4
+ export declare const GROUP_LABEL_GEOMETRY: {
5
+ readonly fontFamily: "Verdana, DejaVu Sans, sans-serif";
6
+ readonly fontSize: 12;
7
+ readonly fontWeight: 700;
8
+ readonly horizontalInset: 8;
9
+ readonly verticalInset: 4;
10
+ readonly bandExtra: 8;
11
+ /** Shortest outward routing checkpoint stage 8 may use for an ordinary attachment. */
12
+ readonly routerStem: 15;
13
+ /** G6 node clearance; stage 8 expands each node obstacle by this plus the two half strokes. */
14
+ readonly nodeClearance: 10;
15
+ /** Keeps a required entry point strictly outside a stroke-aware obstacle, not on its boundary. */
16
+ readonly entryTolerance: 0.25;
17
+ };
18
+ /** A group or frame title as stage 7f measures and draws it. */
19
+ export declare function measureTitle(label: string): TextMeasurement;
20
+ /**
21
+ * How far past a forbidden range a title's left edge is placed to be clear of it. `placeGroupTitles` (`bands.ts`) counts a blocker
22
+ * within one tolerance of the title as meeting it, so clearing one costs two: at `high + PLACEMENT_EPS` the range is still a hit
23
+ * (stress ticket 19 measured the difference of one tolerance on the Enterprise NTP sheet).
24
+ */
25
+ export declare const LABEL_CLEARANCE_STEP: number;
26
+ /**
27
+ * The width a title asks of the box that holds it: the measured title, on each side the larger of the horizontal inset and the title's
28
+ * link-free margin (`GROUP_LABEL_LINK_CLEARANCE`; both are 8 px), and one clearance step beyond it. A lane stands on the box edge and the
29
+ * margin is kept to it, so the side takes whichever of the two is wider and the two constants cannot drift apart; `placeGroupTitles`
30
+ * refuses an x within one tolerance of a forbidden range: the step on each side is the room the refusal takes.
31
+ */
32
+ export declare function titleRoom(label: string): number;
33
+ /**
34
+ * The rank cell that holds a frame's label band: the frame's own cell on the sub-tier that is the
35
+ * frame's extreme one on that edge, counting the cells of its child frames. The room is reserved in
36
+ * that cell and nowhere else. `undefined` when a child frame holds the edge.
37
+ */
38
+ export declare function frameHost(model: LayoutModel, frame: string, side: 'top' | 'bottom'): string | undefined;
39
+ /**
40
+ * ADR-0011's edge of a frame's title, read on natural sides from stage 5 on: `frameTitleEdge`, or the other edge when no own cell holds the
41
+ * preferred one; `undefined` for a canton (its band is held by the sub-tier) and for a frame with an own cell on neither edge.
42
+ */
43
+ export declare function frameTitleSide(model: LayoutModel, frame: string): 'top' | 'bottom' | undefined;
44
+ /**
45
+ * The width floor a title sets on the box that holds it (snack-theme ticket 157; architecture-2 ticket 54): a free group's own title, and
46
+ * the title of a frame on the rank cell that hosts it (`frameHost`, on the edge `frameTitleSide` reads). Group sizing reads it (`contentBox`)
47
+ * from stage 5 on, so 7a reserves its lanes beside a box that already holds the title, and 7f only places it: no stage widens a box for a
48
+ * title. A cell that hosts no title and a group without nodes have no floor (0). A canton's floor is its union's (`contentBox`).
49
+ */
50
+ export declare function ownTitleFloor(model: LayoutModel, group: LayoutGroup): number;