@vscada/core 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/a11y/contrast.d.ts +11 -0
  3. package/dist/a11y/contrast.d.ts.map +1 -0
  4. package/dist/a11y/live-region.d.ts +42 -0
  5. package/dist/a11y/live-region.d.ts.map +1 -0
  6. package/dist/a11y/reduced-motion.d.ts +55 -0
  7. package/dist/a11y/reduced-motion.d.ts.map +1 -0
  8. package/dist/a11y/static-representation-registry.d.ts +20 -0
  9. package/dist/a11y/static-representation-registry.d.ts.map +1 -0
  10. package/dist/bindings/binding-fixture.d.ts +3 -0
  11. package/dist/bindings/binding-fixture.d.ts.map +1 -0
  12. package/dist/bindings/binding-types.d.ts +52 -0
  13. package/dist/bindings/binding-types.d.ts.map +1 -0
  14. package/dist/bindings/color-ramp.d.ts +9 -0
  15. package/dist/bindings/color-ramp.d.ts.map +1 -0
  16. package/dist/bindings/transforms.d.ts +103 -0
  17. package/dist/bindings/transforms.d.ts.map +1 -0
  18. package/dist/constants-DMdpoOyH.js +4 -0
  19. package/dist/contracts/connection-renderer.d.ts +16 -0
  20. package/dist/contracts/connection-renderer.d.ts.map +1 -0
  21. package/dist/contracts/connection-state.d.ts +8 -0
  22. package/dist/contracts/connection-state.d.ts.map +1 -0
  23. package/dist/contracts/handles.d.ts +83 -0
  24. package/dist/contracts/handles.d.ts.map +1 -0
  25. package/dist/contracts/primitive.d.ts +37 -0
  26. package/dist/contracts/primitive.d.ts.map +1 -0
  27. package/dist/contracts/renderer.d.ts +34 -0
  28. package/dist/contracts/renderer.d.ts.map +1 -0
  29. package/dist/contracts/tag-value.d.ts +33 -0
  30. package/dist/contracts/tag-value.d.ts.map +1 -0
  31. package/dist/contracts/time-source.d.ts +14 -0
  32. package/dist/contracts/time-source.d.ts.map +1 -0
  33. package/dist/custom-elements.json +1068 -0
  34. package/dist/export/svg-export.d.ts +24 -0
  35. package/dist/export/svg-export.d.ts.map +1 -0
  36. package/dist/fsm/fsm.d.ts +45 -0
  37. package/dist/fsm/fsm.d.ts.map +1 -0
  38. package/dist/fsm/tween.d.ts +39 -0
  39. package/dist/fsm/tween.d.ts.map +1 -0
  40. package/dist/import/load-svg-import.d.ts +22 -0
  41. package/dist/import/load-svg-import.d.ts.map +1 -0
  42. package/dist/import/svg-source-registry.d.ts +4 -0
  43. package/dist/import/svg-source-registry.d.ts.map +1 -0
  44. package/dist/index.d.ts +61 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +4549 -0
  47. package/dist/interaction/gesture-arbiter.d.ts +20 -0
  48. package/dist/interaction/gesture-arbiter.d.ts.map +1 -0
  49. package/dist/interaction/hit-area.d.ts +44 -0
  50. package/dist/interaction/hit-area.d.ts.map +1 -0
  51. package/dist/interaction/pan-zoom-gestures.d.ts +43 -0
  52. package/dist/interaction/pan-zoom-gestures.d.ts.map +1 -0
  53. package/dist/interaction/pointer-pipeline.d.ts +38 -0
  54. package/dist/interaction/pointer-pipeline.d.ts.map +1 -0
  55. package/dist/license/console-notice.d.ts +15 -0
  56. package/dist/license/console-notice.d.ts.map +1 -0
  57. package/dist/license/format.d.ts +29 -0
  58. package/dist/license/format.d.ts.map +1 -0
  59. package/dist/license/state.d.ts +43 -0
  60. package/dist/license/state.d.ts.map +1 -0
  61. package/dist/license/vendor-keys.d.ts +12 -0
  62. package/dist/license/vendor-keys.d.ts.map +1 -0
  63. package/dist/license/verify-fallback.d.ts +31 -0
  64. package/dist/license/verify-fallback.d.ts.map +1 -0
  65. package/dist/license/verify-webcrypto.d.ts +4 -0
  66. package/dist/license/verify-webcrypto.d.ts.map +1 -0
  67. package/dist/license/watermark.d.ts +20 -0
  68. package/dist/license/watermark.d.ts.map +1 -0
  69. package/dist/media/registry.d.ts +97 -0
  70. package/dist/media/registry.d.ts.map +1 -0
  71. package/dist/registry/connection-registry.d.ts +5 -0
  72. package/dist/registry/connection-registry.d.ts.map +1 -0
  73. package/dist/registry/element-catalog.d.ts +805 -0
  74. package/dist/registry/element-catalog.d.ts.map +1 -0
  75. package/dist/registry/primitive-registry.d.ts +7 -0
  76. package/dist/registry/primitive-registry.d.ts.map +1 -0
  77. package/dist/registry/theme-registry.d.ts +6 -0
  78. package/dist/registry/theme-registry.d.ts.map +1 -0
  79. package/dist/registry.d.ts +8 -0
  80. package/dist/registry.d.ts.map +1 -0
  81. package/dist/scada-view.d.ts +322 -0
  82. package/dist/scada-view.d.ts.map +1 -0
  83. package/dist/scene/connection-geometry.d.ts +95 -0
  84. package/dist/scene/connection-geometry.d.ts.map +1 -0
  85. package/dist/scene/constants.d.ts +10 -0
  86. package/dist/scene/constants.d.ts.map +1 -0
  87. package/dist/scene/crossing-jumps.d.ts +85 -0
  88. package/dist/scene/crossing-jumps.d.ts.map +1 -0
  89. package/dist/scene/dev-validate.d.ts +24 -0
  90. package/dist/scene/dev-validate.d.ts.map +1 -0
  91. package/dist/scene/errors.d.ts +15 -0
  92. package/dist/scene/errors.d.ts.map +1 -0
  93. package/dist/scene/groups.d.ts +90 -0
  94. package/dist/scene/groups.d.ts.map +1 -0
  95. package/dist/scene/lane-offset.d.ts +69 -0
  96. package/dist/scene/lane-offset.d.ts.map +1 -0
  97. package/dist/scene/orthogonal-router.d.ts +63 -0
  98. package/dist/scene/orthogonal-router.d.ts.map +1 -0
  99. package/dist/scene/scene-schema.d.ts +881 -0
  100. package/dist/scene/scene-schema.d.ts.map +1 -0
  101. package/dist/scene/structural-validator.d.ts +25 -0
  102. package/dist/scene/structural-validator.d.ts.map +1 -0
  103. package/dist/scene/validate-scene.d.ts +26 -0
  104. package/dist/scene/validate-scene.d.ts.map +1 -0
  105. package/dist/scene-authoring.d.ts +12 -0
  106. package/dist/scene-authoring.d.ts.map +1 -0
  107. package/dist/scene-authoring.js +952 -0
  108. package/dist/scheduler/alarm-band.d.ts +33 -0
  109. package/dist/scheduler/alarm-band.d.ts.map +1 -0
  110. package/dist/scheduler/animation-registry.d.ts +38 -0
  111. package/dist/scheduler/animation-registry.d.ts.map +1 -0
  112. package/dist/scheduler/lod.d.ts +25 -0
  113. package/dist/scheduler/lod.d.ts.map +1 -0
  114. package/dist/scheduler/quality-overlay.d.ts +19 -0
  115. package/dist/scheduler/quality-overlay.d.ts.map +1 -0
  116. package/dist/scheduler/quality.d.ts +15 -0
  117. package/dist/scheduler/quality.d.ts.map +1 -0
  118. package/dist/scheduler/scheduler.d.ts +243 -0
  119. package/dist/scheduler/scheduler.d.ts.map +1 -0
  120. package/dist/scheduler/visual-state-resolver.d.ts +31 -0
  121. package/dist/scheduler/visual-state-resolver.d.ts.map +1 -0
  122. package/dist/store/value-store.d.ts +65 -0
  123. package/dist/store/value-store.d.ts.map +1 -0
  124. package/dist/tokens.d.ts +703 -0
  125. package/dist/tokens.d.ts.map +1 -0
  126. package/dist/topology/graph.d.ts +33 -0
  127. package/dist/topology/graph.d.ts.map +1 -0
  128. package/dist/topology/group-collapse.d.ts +15 -0
  129. package/dist/topology/group-collapse.d.ts.map +1 -0
  130. package/dist/topology/inference.d.ts +71 -0
  131. package/dist/topology/inference.d.ts.map +1 -0
  132. package/dist/topology/traversal.d.ts +29 -0
  133. package/dist/topology/traversal.d.ts.map +1 -0
  134. package/dist/topology/upstream-highlight.d.ts +75 -0
  135. package/dist/topology/upstream-highlight.d.ts.map +1 -0
  136. package/dist/units/formatter.d.ts +22 -0
  137. package/dist/units/formatter.d.ts.map +1 -0
  138. package/dist/units/registry.d.ts +21 -0
  139. package/dist/units/registry.d.ts.map +1 -0
  140. package/dist/view/group-view-state.d.ts +77 -0
  141. package/dist/view/group-view-state.d.ts.map +1 -0
  142. package/dist/view/viewport-state.d.ts +112 -0
  143. package/dist/view/viewport-state.d.ts.map +1 -0
  144. package/dist/vscada.umd.cjs +45 -0
  145. package/package.json +37 -0
@@ -0,0 +1,90 @@
1
+ import type { Connection, Group, Scene } from './scene-schema';
2
+ import { type ResolvedRoute } from './connection-geometry';
3
+ import type { TopologyGraph } from '../topology/graph';
4
+ import type { ThemeContext } from '../contracts/primitive';
5
+ import type { Renderer } from '../contracts/renderer';
6
+ import { type Condition } from '../scheduler/quality';
7
+ /**
8
+ * Story 2.5 — group model, collapsed/expanded rendering, and boundary
9
+ * connection re-termination (§5.5). Structurally separate from
10
+ * `connection-geometry.ts`/`topology/*.ts`, which stay UNMODIFIED: every
11
+ * function here builds a presentation-layer view (a fresh `Scene`/
12
+ * `Connection` object) and hands it to the existing, untouched router —
13
+ * "the existing router then routes to the group's port position like any
14
+ * other port" is implemented literally, not by teaching the router about
15
+ * groups.
16
+ *
17
+ * Scope: one level of collapse presentation only (matches the story's
18
+ * declared boundary) — a child that is itself a collapsed group's summary
19
+ * is not folded further here.
20
+ */
21
+ /**
22
+ * The group's rolled-up alarm indicator = worst-of-children, using the
23
+ * EXACT SAME precedence Story 1.6/2.4 already established (`worstOf`,
24
+ * `bad ⟩ stale ⟩ uncertain ⟩ good`) — no new rollup rule invented at the
25
+ * group level. Callers compute each child's resolved `Condition` (however
26
+ * they already do today, e.g. via the scheduler's quality evaluation) and
27
+ * pass the list in; this function only does the aggregation.
28
+ *
29
+ * Fix 5 (adversarial review): an empty input means "no data collected" for
30
+ * this group's alarm rollup — that must never silently read as the BEST
31
+ * state. `worstOf([])` itself resolves to `'good'` (correct for its OWN
32
+ * callers, e.g. an element with no bound tags — deliberately left
33
+ * unchanged, see `scheduler/quality.ts`), so the empty-input fail-safe is
34
+ * special-cased here rather than by changing that shared utility.
35
+ */
36
+ export declare function rollUpGroupCondition(childConditions: readonly Condition[]): Condition;
37
+ export interface GroupSummaryBlock {
38
+ svg: SVGGElement;
39
+ /** Discrete state, always paired with the indicator's text label (AD-3). */
40
+ setAlarmCondition(renderer: Renderer, condition: Condition): void;
41
+ /** One readout per declared `summaryTags` entry; unknown tags are silently ignored. */
42
+ setSummaryValue(renderer: Renderer, tag: string, text: string): void;
43
+ }
44
+ /**
45
+ * Builds the collapsed group's summary block: raised-panel chrome (§7.6),
46
+ * group label, one readout line per `summaryTags` entry, and the
47
+ * worst-of-children alarm indicator. Pure structure factory (AD-2/AD-3
48
+ * discipline, mirrors `quality-overlay.ts`) — built once per collapse; all
49
+ * per-frame updates go through the returned setters via the renderer seam.
50
+ * Degrades to an empty, no-op block when the theme has no `panel` tokens
51
+ * (never a literal-color fallback, same convention as the quality overlay).
52
+ */
53
+ export declare function buildGroupSummaryBlock(group: Group, theme: ThemeContext): GroupSummaryBlock;
54
+ /**
55
+ * Expanded-state nice-to-have (AC1's "outline/label frame"): a dashed
56
+ * boundary + label, no readouts/indicator (children render normally and
57
+ * carry their own quality overlays). Kept intentionally minimal — the
58
+ * hard requirements are the alarm rollup and boundary re-termination.
59
+ */
60
+ export declare function buildGroupExpandedFrame(group: Group, theme: ThemeContext): SVGGElement;
61
+ /**
62
+ * `"childId.portName"` (an interior connection-endpoint reference) ->
63
+ * `"groupId.groupPortName"` (the re-terminated reference), for every
64
+ * mapping declared by a group that is CURRENTLY collapsed. Only mapped
65
+ * ports participate — an interior port with no `portMap` entry is left
66
+ * alone (graceful degradation, not an error; see the schema doc comment).
67
+ */
68
+ export declare function buildBoundaryReferenceIndex(scene: Scene, collapsedGroupIds: ReadonlySet<string>): Map<string, string>;
69
+ /**
70
+ * A presentation-layer view of the scene where every currently-collapsed
71
+ * group is ALSO present as a synthetic element (id = group id, ports =
72
+ * the group's own declared `ports`) — this is what lets the UNMODIFIED
73
+ * `resolveConnectionGeometry` resolve a re-terminated `"groupId.port"`
74
+ * reference exactly like any real element's port. Connections are
75
+ * rewritten (via `buildBoundaryReferenceIndex`) to point at the group
76
+ * instead of the interior child they originally named. Never mutates
77
+ * `scene` — always a fresh object; the original is untouched (AD-2's
78
+ * "structure once" concern is about the RENDERED DOM, not this pure read).
79
+ */
80
+ export declare function buildPresentationScene(scene: Scene, collapsedGroupIds: ReadonlySet<string>): Scene;
81
+ /**
82
+ * AC2 — resolves a connection exactly like `resolveConnectionGeometry`
83
+ * (Story 1.4-2.2, untouched), except any endpoint inside a currently-
84
+ * collapsed group re-terminates at that group's own declared port first.
85
+ * `topology`, when supplied, is passed straight through for the same
86
+ * medium-inheritance behavior 2.3 already documented — this wrapper adds
87
+ * no new medium-resolution behavior of its own.
88
+ */
89
+ export declare function resolveGroupAwareConnectionGeometry(connection: Connection, scene: Scene, collapsedGroupIds: ReadonlySet<string>, topology?: TopologyGraph): ResolvedRoute | null;
90
+ //# sourceMappingURL=groups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../src/scene/groups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAI/D;;;;;;;;;;;;;GAaG;AAIH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,CAGrF;AAID,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,WAAW,CAAC;IACjB,4EAA4E;IAC5E,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAClE,uFAAuF;IACvF,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAgG3F;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,GAAG,WAAW,CA0BtF;AAkBD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CASrH;AAyBD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,KAAK,CAyClG;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,EACtC,QAAQ,CAAC,EAAE,aAAa,GACvB,aAAa,GAAG,IAAI,CActB"}
@@ -0,0 +1,69 @@
1
+ import type { Point } from './connection-geometry';
2
+ /**
3
+ * Story 2.2, Task 1: lane offset displacement. Pure post-process on a raw
4
+ * (pre-corner-rounding) route polyline — no store, no clock, no scene
5
+ * access, so the same points + offset always produce the same output
6
+ * (determinism is load-bearing for visual regression, same discipline as
7
+ * Story 2.1's `orthogonal-router.ts`).
8
+ */
9
+ /**
10
+ * Reference pipe stroke width at 1x scale — mirrors classic-hmi's
11
+ * `pipe.strokeWidth` default (22-26px range, 24px reference value used
12
+ * throughout Story 1.4/2.1's Dev Notes). Core geometry has no access to
13
+ * theme tokens (AD-10: core never depends on `@vscada/themes`), so this
14
+ * is a named constant purely for computing sensible lane/jump defaults —
15
+ * not a token lookup, and not itself rendered anywhere.
16
+ */
17
+ export declare const PIPE_WIDTH_REFERENCE = 24;
18
+ /**
19
+ * Default lane separation applied when a connection's `laneOffset` unit
20
+ * distance isn't otherwise configured: ~1.5x the reference pipe width —
21
+ * wide enough that two adjacent parallel pipe bodies (each drawn at
22
+ * `PIPE_WIDTH_REFERENCE`) never visually touch even at the minimum
23
+ * `laneOffset` difference of exactly 1 (AC 1).
24
+ */
25
+ export declare const LANE_WIDTH: number;
26
+ /**
27
+ * Displaces a raw route polyline perpendicular to each of its own
28
+ * segments by `laneOffset * laneWidth`, then re-derives each interior
29
+ * corner by intersecting the offset segments' infinite lines — the
30
+ * standard "offset polyline" construction (the same thing a stroke
31
+ * outline does per side). This is what "corners re-fillet after
32
+ * displacement" means in practice: the corner-rounding pass downstream
33
+ * (`roundedPolylinePoints`) runs on these already-displaced points, so
34
+ * it fillets the NEW corner, not the original centerline's.
35
+ *
36
+ * `laneOffset` of `0` or `undefined` returns `points` completely
37
+ * unchanged (same array reference) — Task 1's explicit no-regression
38
+ * requirement for every connection that never sets `laneOffset`.
39
+ *
40
+ * Bug 1 fix (adversarial review, Story 2.2): `points[0]` and the last
41
+ * point are the connection's actual absolute port positions (computed
42
+ * by `absolutePortPosition` in `connection-geometry.ts`) — they are
43
+ * NEVER displaced, on pain of visually detaching the pipe from its
44
+ * equipment port. Only the route's BODY (everything between the two
45
+ * mandatory port-terminal points) is offset into the parallel lane; the
46
+ * anchors are reconnected to the shifted body by direct connecting
47
+ * segments. A route with no body at all (a straight 2-point run — e.g.
48
+ * `direct` routing, or an `orthogonal` route that collapsed to a
49
+ * straight line) has nothing to displace without first synthesizing a
50
+ * short body — `withSyntheticStubs` does that, mirroring the same
51
+ * "mandatory port stub" concept `orthogonal-router.ts`'s
52
+ * `MIN_STUB_LENGTH` already establishes: the pipe leaves its port dead
53
+ * straight for a short distance, THEN the lane displacement begins.
54
+ *
55
+ * Bug 2 fix: the offset magnitude is clamped to at most half the
56
+ * shortest ORIGINAL segment in the route (mirroring
57
+ * `roundedPolylinePoints`' own radius clamp) so a large `laneOffset`
58
+ * can never fold a tight route (segments as short as
59
+ * `orthogonal-router.ts`'s `MIN_STUB_LENGTH`) back over itself.
60
+ *
61
+ * Bug 5 fix: a degenerate zero-length segment has no direction of its
62
+ * own — instead of collapsing its shift to `{0,0}` (which freezes that
63
+ * point in place while its neighbors displace, producing a kink), it
64
+ * inherits the nearest non-degenerate neighbor's direction.
65
+ *
66
+ * Pure, deterministic: same points + offset in, same points out, always.
67
+ */
68
+ export declare function applyLaneOffset(points: Point[], laneOffset: number | undefined, laneWidth?: number): Point[];
69
+ //# sourceMappingURL=lane-offset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lane-offset.d.ts","sourceRoot":"","sources":["../../src/scene/lane-offset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,QAA6B,CAAC;AAQrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,GAAE,MAAmB,GAAG,KAAK,EAAE,CAqBxH"}
@@ -0,0 +1,63 @@
1
+ import type { Corner, Point, Segment } from './connection-geometry';
2
+ import type { Port } from './scene-schema';
3
+ export type PortDirection = Port['dir'];
4
+ /**
5
+ * Story 2.1 elbow generator (rule-based, not A*). Pure function of the two
6
+ * port positions/directions — no store, no clock, no scene access — so the
7
+ * same inputs always produce the same output (determinism is load-bearing
8
+ * for visual regression, per the frozen spec).
9
+ *
10
+ * Every default that would otherwise be a scattered literal lives here as a
11
+ * named constant.
12
+ */
13
+ /** Minimum length a port's exit/entry stub travels along its own `dir`
14
+ * before the router is free to turn. This is what makes a `dir:down`
15
+ * outlet's very first movement structurally always downward — no case
16
+ * branch below can shorten or skip it. */
17
+ export declare const MIN_STUB_LENGTH = 24;
18
+ /** Corner radius used when a connection doesn't declare its own
19
+ * `cornerRadius`. Clamped (by the shared rounding pass) to half the
20
+ * shortest adjacent segment, same as the manual/direct paths. */
21
+ export declare const DEFAULT_CORNER_RADIUS = 12;
22
+ /**
23
+ * Generates the ordered waypoint list for an orthogonal (Manhattan) route
24
+ * between two directed ports: `from` exits along `fromDir`, `to` is entered
25
+ * along `toDir` (i.e. the final approach segment travels in the direction
26
+ * opposite `toDir`, into the port).
27
+ *
28
+ * Case table (by dir-pair + relative position — see spec I/O matrix):
29
+ * - perpendicular dirs, compatible position -> 1 turn (L)
30
+ * - opposing dirs, offset -> 2 turns (Z/S)
31
+ * - opposing dirs, aligned & facing -> 0 turns (straight)
32
+ * - same dir, differing on-axis levels -> 4 turns (U, via a dedicated detour
33
+ * lane); same dir, same on-axis level -> 2 turns (direct)
34
+ *
35
+ * Turn count is an emergent property of trying an ordered list of candidate
36
+ * bridge constructions (see `candidateBridges`) and picking the first whose
37
+ * simplified route doesn't self-overlap — no single fixed formula is safe
38
+ * for every relative position (review loop 1 found and fixed two: a
39
+ * perpendicular formula that could reuse an axis its own first segment was
40
+ * already on, and a same-axis formula that could pass through the target's
41
+ * own level and retreat). This is what keeps the first segment always along
42
+ * `fromDir` (so a down-facing outlet never kinks immediately upward) AND
43
+ * guarantees no segment re-traverses ground another segment already
44
+ * covered, verified against the full dir-pair × relative-position sweep in
45
+ * the test file — except the narrow near-coincident/aligned
46
+ * degenerate-closeness floor documented in the spec's Boundaries, which no
47
+ * bridge selection can avoid (the two mandatory port stubs themselves would
48
+ * already overlap, independent of any routing choice).
49
+ *
50
+ * Never throws, never produces NaN, and is deterministic: same inputs,
51
+ * byte-identical output, always.
52
+ */
53
+ export declare function generateOrthogonalWaypoints(from: Point, fromDir: PortDirection, to: Point, toDir: PortDirection): Point[];
54
+ /**
55
+ * Full generator entry point: produces the same `{segments, corners}` shape
56
+ * `connection-geometry.ts`'s manual/direct paths already return, corner
57
+ * radius clamped by the same shared rounding pass (unchanged from 1.4).
58
+ */
59
+ export declare function generateOrthogonalRoute(from: Point, fromDir: PortDirection, to: Point, toDir: PortDirection, cornerRadius?: number): {
60
+ segments: Segment[];
61
+ corners: Corner[];
62
+ };
63
+ //# sourceMappingURL=orthogonal-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orthogonal-router.d.ts","sourceRoot":"","sources":["../../src/scene/orthogonal-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;AAExC;;;;;;;;GAQG;AAEH;;;0CAG0C;AAC1C,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;iEAEiE;AACjE,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAiBxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,KAAK,EACX,OAAO,EAAE,aAAa,EACtB,EAAE,EAAE,KAAK,EACT,KAAK,EAAE,aAAa,GACnB,KAAK,EAAE,CAgBT;AAiID;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,KAAK,EACX,OAAO,EAAE,aAAa,EACtB,EAAE,EAAE,KAAK,EACT,KAAK,EAAE,aAAa,EACpB,YAAY,GAAE,MAA8B,GAC3C;IAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAM5C"}