@crazyhappyone/auto-graph 0.0.21 → 0.1.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.
package/dist/index.d.cts CHANGED
@@ -80,6 +80,14 @@ interface Diagnostic {
80
80
  path?: DiagnosticPathSegment[];
81
81
  detail?: JsonObject;
82
82
  }
83
+ /**
84
+ * Diagnostic codes that indicate the solver produced a degraded
85
+ * (non-deliverable) layout. Downstream consumers can gate on the
86
+ * {@link CoordinatedDiagram.degraded} flag or use the
87
+ * {@link SolveDiagramOptions.strict} option to promote these to
88
+ * errors.
89
+ */
90
+ declare const DELIVERABILITY_DIAGNOSTIC_CODES: ReadonlySet<string>;
83
91
 
84
92
  interface TextStyleOptions {
85
93
  fontFamily: string;
@@ -180,6 +188,23 @@ interface LabelLayout {
180
188
  };
181
189
  diagnostics: Diagnostic[];
182
190
  }
191
+ type TextSurfaceKind = "node-label" | "group-label" | "port-label" | "edge-label" | "compartment-row" | "swimlane-label" | "frame-title";
192
+ interface SolvedTextAnnotation {
193
+ text: string;
194
+ ownerId: string;
195
+ surfaceKind: TextSurfaceKind;
196
+ surfaceIndex?: number;
197
+ box: Box;
198
+ anchor: Box | {
199
+ x: number;
200
+ y: number;
201
+ };
202
+ paddings: Insets;
203
+ lines: LabelLayout["lines"];
204
+ fontFamily: string;
205
+ fontSize: number;
206
+ textBackend?: LabelLayout["textBackend"];
207
+ }
183
208
 
184
209
  type NodeShape = "rectangle" | "rounded-rectangle" | "ellipse" | "diamond" | "parallelogram" | "hexagon" | "cylinder";
185
210
  interface Label {
@@ -231,6 +256,72 @@ type PortKind = "proxy" | "flow";
231
256
  interface VisualStyle {
232
257
  fill?: string;
233
258
  stroke?: string;
259
+ fontFamily?: string;
260
+ fontSize?: number;
261
+ }
262
+ interface EvidenceCell {
263
+ text: string;
264
+ style?: VisualStyle;
265
+ }
266
+ interface EvidenceTextLayout {
267
+ lines: string[];
268
+ }
269
+ interface MatrixBlock {
270
+ id: string;
271
+ rows: string[];
272
+ cols: string[];
273
+ cells: EvidenceCell[][];
274
+ position?: Point;
275
+ size?: Size;
276
+ style?: VisualStyle;
277
+ }
278
+ interface CoordinatedMatrixBlock extends MatrixBlock {
279
+ box: Box;
280
+ columnLabelLayouts?: EvidenceTextLayout[];
281
+ rowLabelLayouts?: EvidenceTextLayout[];
282
+ cellLabelLayouts?: EvidenceTextLayout[][];
283
+ }
284
+ interface TableColumn {
285
+ id: string;
286
+ label: Label;
287
+ }
288
+ interface TableRow {
289
+ id: string;
290
+ cells: Record<string, EvidenceCell>;
291
+ }
292
+ interface TableBlock {
293
+ id: string;
294
+ columns: TableColumn[];
295
+ rows: TableRow[];
296
+ position?: Point;
297
+ size?: Size;
298
+ style?: VisualStyle;
299
+ }
300
+ interface CoordinatedTableBlock extends TableBlock {
301
+ box: Box;
302
+ columnXOffsets: number[];
303
+ columnLabelLayouts?: EvidenceTextLayout[];
304
+ cellLabelLayouts?: EvidenceTextLayout[][];
305
+ }
306
+ type EvidencePanelKind = "legend" | "rule" | "note" | "verification";
307
+ interface EvidencePanelItem {
308
+ id?: string;
309
+ label: Label;
310
+ detail?: Label;
311
+ style?: VisualStyle;
312
+ }
313
+ interface EvidencePanel {
314
+ id: string;
315
+ kind: EvidencePanelKind;
316
+ items: EvidencePanelItem[];
317
+ position?: Point;
318
+ size?: Size;
319
+ style?: VisualStyle;
320
+ }
321
+ interface CoordinatedEvidencePanel extends EvidencePanel {
322
+ box: Box;
323
+ titleLayout?: EvidenceTextLayout;
324
+ itemLayouts?: EvidenceTextLayout[];
234
325
  }
235
326
  interface NodePort {
236
327
  id: string;
@@ -278,6 +369,9 @@ interface IntentGroup {
278
369
  nodeIds?: string[];
279
370
  groupIds?: string[];
280
371
  padding?: Insets;
372
+ headerHeight?: number;
373
+ labelPosition?: "top" | "inside" | "outside";
374
+ direction?: "horizontal" | "vertical";
281
375
  metadata?: JsonObject;
282
376
  }
283
377
  interface NormalizedGroup {
@@ -286,6 +380,9 @@ interface NormalizedGroup {
286
380
  nodeIds: string[];
287
381
  groupIds: string[];
288
382
  padding: Insets;
383
+ headerHeight?: number;
384
+ labelPosition?: "top" | "inside" | "outside";
385
+ direction?: "horizontal" | "vertical";
289
386
  metadata?: JsonObject;
290
387
  labelLayout?: LabelLayout;
291
388
  }
@@ -293,24 +390,34 @@ interface CoordinatedGroup extends NormalizedGroup {
293
390
  box: Box;
294
391
  }
295
392
  type SwimlaneOrientation = "vertical" | "horizontal";
393
+ type SwimlaneLayout = "overlay" | "contract";
296
394
  interface SwimlaneLane {
297
395
  id: string;
298
396
  label?: Label;
299
397
  children: string[];
300
398
  box?: Box;
399
+ headerBox?: Box;
400
+ contentBox?: Box;
301
401
  }
302
402
  interface Swimlane {
303
403
  id: string;
304
404
  label?: Label;
305
405
  orientation: SwimlaneOrientation;
406
+ layout?: SwimlaneLayout;
306
407
  lanes: SwimlaneLane[];
307
408
  box?: Box;
409
+ headerHeight?: number;
410
+ padding?: number;
308
411
  }
309
412
  interface DiagramFrame {
310
413
  kind: string;
311
414
  context?: string;
312
415
  name?: string;
313
416
  titleTab: string;
417
+ headerHeight?: number;
418
+ padding?: number | Insets;
419
+ labelPosition?: "top" | "inside" | "outside";
420
+ direction?: "horizontal" | "vertical";
314
421
  style?: VisualStyle;
315
422
  }
316
423
  interface CoordinatedFrame extends DiagramFrame {
@@ -326,6 +433,8 @@ interface LayoutLock {
326
433
  interface ConstraintSolverInput {
327
434
  direction: DiagramDirection;
328
435
  overlapSpacing?: number;
436
+ minSiblingGap?: number;
437
+ distributeContainedChildren?: boolean;
329
438
  boxes: ReadonlyMap<string, Box>;
330
439
  nodes: readonly NormalizedNode[];
331
440
  groups: readonly NormalizedGroup[];
@@ -349,6 +458,9 @@ interface IntentDiagram {
349
458
  edges?: IntentEdge[];
350
459
  groups?: IntentGroup[];
351
460
  swimlanes?: Swimlane[];
461
+ matrices?: MatrixBlock[];
462
+ tables?: TableBlock[];
463
+ evidencePanels?: EvidencePanel[];
352
464
  constraints?: Constraint[];
353
465
  frame?: DiagramFrame;
354
466
  metadata?: DiagramMetadata;
@@ -361,6 +473,9 @@ interface NormalizedDiagram {
361
473
  edges: NormalizedEdge[];
362
474
  groups: NormalizedGroup[];
363
475
  swimlanes?: Swimlane[];
476
+ matrices?: MatrixBlock[];
477
+ tables?: TableBlock[];
478
+ evidencePanels?: EvidencePanel[];
364
479
  constraints: Constraint[];
365
480
  diagnostics: Diagnostic[];
366
481
  frame?: DiagramFrame;
@@ -374,7 +489,13 @@ interface CoordinatedDiagram {
374
489
  edges: CoordinatedEdge[];
375
490
  groups: CoordinatedGroup[];
376
491
  swimlanes?: Swimlane[];
492
+ matrices?: CoordinatedMatrixBlock[];
493
+ tables?: CoordinatedTableBlock[];
494
+ evidencePanels?: CoordinatedEvidencePanel[];
495
+ textAnnotations?: SolvedTextAnnotation[];
377
496
  diagnostics: Diagnostic[];
497
+ /** True when any deliverability-breaking diagnostic was emitted. */
498
+ degraded: boolean;
378
499
  bounds: Box;
379
500
  frame?: CoordinatedFrame;
380
501
  metadata?: DiagramMetadata;
@@ -566,6 +687,7 @@ interface RouteEdgeInput {
566
687
  sourceAnchor?: AnchorName;
567
688
  targetAnchor?: AnchorName;
568
689
  obstacles?: readonly Box[];
690
+ hardObstacles?: readonly Box[];
569
691
  }
570
692
  interface RouteEdgeResult {
571
693
  points: Point[];
@@ -589,12 +711,37 @@ interface SolveDiagramOptions {
589
711
  routeKind?: RouteKind;
590
712
  obstacleMargin?: number | Insets;
591
713
  overlapSpacing?: number;
714
+ minLaneGutter?: number;
715
+ prefitLabelSize?: boolean;
716
+ minSiblingGap?: number;
717
+ distributeContainedChildren?: boolean;
718
+ pageBounds?: {
719
+ width: number;
720
+ height: number;
721
+ };
722
+ maxStackDepth?: number;
723
+ preferredAspectRatio?: number;
592
724
  portShifting?: PortShiftingOptions;
725
+ cjkFontFamily?: string | false;
726
+ minCjkFontSize?: number | false;
727
+ textMeasurer?: TextMeasurer;
728
+ /** When true, promote deliverability-breaking diagnostics to errors. */
729
+ strict?: boolean;
593
730
  }
594
731
  interface PortShiftingOptions {
595
732
  enabled?: boolean;
596
733
  spacing?: number;
597
734
  }
598
735
  declare function solveDiagram(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
599
-
600
- export { type AlignConstraint, type AlignmentAxis, type AnchorName, type AnchorPoint, type Arrowhead, type Box, type CanonicalJson, type CanonicalizeOptions, type Constraint, type ConstraintBase, type ConstraintSolverInput, type ConstraintSolverResult, type ConstraintTarget, type ConstraintTargetKind, type ContainerGeometry, type ContainerGeometryInput, type ContainmentConstraint, type CoordinatedDiagram, type CoordinatedEdge, type CoordinatedFrame, type CoordinatedGroup, type CoordinatedNode, type CoordinatedPort, DEFAULT_CANONICAL_PRECISION, DEFAULT_DSL_MAX_BYTES, type DagreLayoutEdge, type DagreLayoutInput, type DagreLayoutNode, type DagreLayoutOptions, type DefaultTextMeasurerOptions, DeterministicTextMeasurer, type Diagnostic, type DiagnosticPathSegment, type DiagnosticSeverity, type DiagramDirection, type DiagramFrame, type DiagramMetadata, type DiagramStage, type DistributeConstraint, type DistributionAxis, type DslDiagnostic, type DslDiagnosticLayer, type DslOutputFormat, type EdgeArrowhead, type EdgeEndpoint, type EdgeStrokeStyle, type ExactPositionConstraint, type ExportFormat, type ExportOptions, type ExportResult, type InitialLayoutResult, type Insets, type IntentDiagram, type IntentEdge, type IntentGroup, type IntentNode, type JsonObject, type JsonPrimitive, type JsonValue, type Label, type LabelFitOptions, LabelFitter, type LabelLayout, type LabelLineLayout, type LayoutLock, type LayoutLockSource, type NodeBase, type NodeCompartments, type NodePort, type NodeShape, type NormalizeDiagramDslOptions, type NormalizeDiagramDslResult, type NormalizedDiagram, type NormalizedEdge, type NormalizedGroup, type NormalizedNode, type ParseDiagramDslOptions, type ParseDiagramDslResult, type ParsedEdgeShorthand, type Point, type PortKind, type PortShiftingOptions, type PortSide, type PreparedText, PretextTextMeasurer, type RelativePositionConstraint, type RelativePositionRelation, type RenderDiagramDslOptions, type RenderDiagramDslResult, type RouteEdgeInput, type RouteEdgeResult, type RouteKind, type ShapeGeometry, type ShapeGeometryInput, type Size, type SolveDiagramOptions, type Swimlane, type SwimlaneLane, type SwimlaneOrientation, type TextCursor, type TextLayout, type TextLayoutLine, type TextMeasurementBackend, type TextMeasurer, type TextStyleOptions, type VisualStyle, applyLayoutConstraints, assertFiniteNonNegative, assertFinitePositive, boxCenter, canonicalize, computeArrowhead, computeContainerGeometry, computeShapeGeometry, createDefaultTextMeasurer, expandBox, exportExcalidraw, exportSvg, fitLabel, getEdgePort, installNodeCanvasRuntime, intersectsAabb, isPretextRuntimeAvailable, normalizeDiagramDsl, normalizeInsets, parseDiagramDsl, parseEdgeShorthand, renderDiagramDsl, resolveLineHeight, resolveOutputFormat, routeEdge, runDagreInitialLayout, simplifyRoute, solveDiagram, sortDslDiagnostics, stringifyCanonical, toCanvasFont, unionBoxes, validateBox, validateTextStyle };
736
+ /**
737
+ * Convenience wrapper around {@link solveDiagram} that enables
738
+ * {@link SolveDiagramOptions.prefitLabelSize} by default so node sizes are
739
+ * expanded to fit their label text. Direct callers of `solveDiagram` who
740
+ * pass hard-coded `NormalizedNode.size` values without a `labelLayout`
741
+ * often see truncated labels; this wrapper avoids that trap.
742
+ *
743
+ * @see SolveDiagramOptions.prefitLabelSize
744
+ */
745
+ declare function solveDiagramSafe(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
746
+
747
+ export { type AlignConstraint, type AlignmentAxis, type AnchorName, type AnchorPoint, type Arrowhead, type Box, type CanonicalJson, type CanonicalizeOptions, type Constraint, type ConstraintBase, type ConstraintSolverInput, type ConstraintSolverResult, type ConstraintTarget, type ConstraintTargetKind, type ContainerGeometry, type ContainerGeometryInput, type ContainmentConstraint, type CoordinatedDiagram, type CoordinatedEdge, type CoordinatedEvidencePanel, type CoordinatedFrame, type CoordinatedGroup, type CoordinatedMatrixBlock, type CoordinatedNode, type CoordinatedPort, type CoordinatedTableBlock, DEFAULT_CANONICAL_PRECISION, DEFAULT_DSL_MAX_BYTES, DELIVERABILITY_DIAGNOSTIC_CODES, type DagreLayoutEdge, type DagreLayoutInput, type DagreLayoutNode, type DagreLayoutOptions, type DefaultTextMeasurerOptions, DeterministicTextMeasurer, type Diagnostic, type DiagnosticPathSegment, type DiagnosticSeverity, type DiagramDirection, type DiagramFrame, type DiagramMetadata, type DiagramStage, type DistributeConstraint, type DistributionAxis, type DslDiagnostic, type DslDiagnosticLayer, type DslOutputFormat, type EdgeArrowhead, type EdgeEndpoint, type EdgeStrokeStyle, type EvidenceCell, type EvidencePanel, type EvidencePanelItem, type EvidencePanelKind, type EvidenceTextLayout, type ExactPositionConstraint, type ExportFormat, type ExportOptions, type ExportResult, type InitialLayoutResult, type Insets, type IntentDiagram, type IntentEdge, type IntentGroup, type IntentNode, type JsonObject, type JsonPrimitive, type JsonValue, type Label, type LabelFitOptions, LabelFitter, type LabelLayout, type LabelLineLayout, type LayoutLock, type LayoutLockSource, type MatrixBlock, type NodeBase, type NodeCompartments, type NodePort, type NodeShape, type NormalizeDiagramDslOptions, type NormalizeDiagramDslResult, type NormalizedDiagram, type NormalizedEdge, type NormalizedGroup, type NormalizedNode, type ParseDiagramDslOptions, type ParseDiagramDslResult, type ParsedEdgeShorthand, type Point, type PortKind, type PortShiftingOptions, type PortSide, type PreparedText, PretextTextMeasurer, type RelativePositionConstraint, type RelativePositionRelation, type RenderDiagramDslOptions, type RenderDiagramDslResult, type RouteEdgeInput, type RouteEdgeResult, type RouteKind, type ShapeGeometry, type ShapeGeometryInput, type Size, type SolveDiagramOptions, type SolvedTextAnnotation, type Swimlane, type SwimlaneLane, type SwimlaneLayout, type SwimlaneOrientation, type TableBlock, type TableColumn, type TableRow, type TextCursor, type TextLayout, type TextLayoutLine, type TextMeasurementBackend, type TextMeasurer, type TextStyleOptions, type TextSurfaceKind, type VisualStyle, applyLayoutConstraints, assertFiniteNonNegative, assertFinitePositive, boxCenter, canonicalize, computeArrowhead, computeContainerGeometry, computeShapeGeometry, createDefaultTextMeasurer, expandBox, exportExcalidraw, exportSvg, fitLabel, getEdgePort, installNodeCanvasRuntime, intersectsAabb, isPretextRuntimeAvailable, normalizeDiagramDsl, normalizeInsets, parseDiagramDsl, parseEdgeShorthand, renderDiagramDsl, resolveLineHeight, resolveOutputFormat, routeEdge, runDagreInitialLayout, simplifyRoute, solveDiagram, solveDiagramSafe, sortDslDiagnostics, stringifyCanonical, toCanvasFont, unionBoxes, validateBox, validateTextStyle };
package/dist/index.d.ts CHANGED
@@ -80,6 +80,14 @@ interface Diagnostic {
80
80
  path?: DiagnosticPathSegment[];
81
81
  detail?: JsonObject;
82
82
  }
83
+ /**
84
+ * Diagnostic codes that indicate the solver produced a degraded
85
+ * (non-deliverable) layout. Downstream consumers can gate on the
86
+ * {@link CoordinatedDiagram.degraded} flag or use the
87
+ * {@link SolveDiagramOptions.strict} option to promote these to
88
+ * errors.
89
+ */
90
+ declare const DELIVERABILITY_DIAGNOSTIC_CODES: ReadonlySet<string>;
83
91
 
84
92
  interface TextStyleOptions {
85
93
  fontFamily: string;
@@ -180,6 +188,23 @@ interface LabelLayout {
180
188
  };
181
189
  diagnostics: Diagnostic[];
182
190
  }
191
+ type TextSurfaceKind = "node-label" | "group-label" | "port-label" | "edge-label" | "compartment-row" | "swimlane-label" | "frame-title";
192
+ interface SolvedTextAnnotation {
193
+ text: string;
194
+ ownerId: string;
195
+ surfaceKind: TextSurfaceKind;
196
+ surfaceIndex?: number;
197
+ box: Box;
198
+ anchor: Box | {
199
+ x: number;
200
+ y: number;
201
+ };
202
+ paddings: Insets;
203
+ lines: LabelLayout["lines"];
204
+ fontFamily: string;
205
+ fontSize: number;
206
+ textBackend?: LabelLayout["textBackend"];
207
+ }
183
208
 
184
209
  type NodeShape = "rectangle" | "rounded-rectangle" | "ellipse" | "diamond" | "parallelogram" | "hexagon" | "cylinder";
185
210
  interface Label {
@@ -231,6 +256,72 @@ type PortKind = "proxy" | "flow";
231
256
  interface VisualStyle {
232
257
  fill?: string;
233
258
  stroke?: string;
259
+ fontFamily?: string;
260
+ fontSize?: number;
261
+ }
262
+ interface EvidenceCell {
263
+ text: string;
264
+ style?: VisualStyle;
265
+ }
266
+ interface EvidenceTextLayout {
267
+ lines: string[];
268
+ }
269
+ interface MatrixBlock {
270
+ id: string;
271
+ rows: string[];
272
+ cols: string[];
273
+ cells: EvidenceCell[][];
274
+ position?: Point;
275
+ size?: Size;
276
+ style?: VisualStyle;
277
+ }
278
+ interface CoordinatedMatrixBlock extends MatrixBlock {
279
+ box: Box;
280
+ columnLabelLayouts?: EvidenceTextLayout[];
281
+ rowLabelLayouts?: EvidenceTextLayout[];
282
+ cellLabelLayouts?: EvidenceTextLayout[][];
283
+ }
284
+ interface TableColumn {
285
+ id: string;
286
+ label: Label;
287
+ }
288
+ interface TableRow {
289
+ id: string;
290
+ cells: Record<string, EvidenceCell>;
291
+ }
292
+ interface TableBlock {
293
+ id: string;
294
+ columns: TableColumn[];
295
+ rows: TableRow[];
296
+ position?: Point;
297
+ size?: Size;
298
+ style?: VisualStyle;
299
+ }
300
+ interface CoordinatedTableBlock extends TableBlock {
301
+ box: Box;
302
+ columnXOffsets: number[];
303
+ columnLabelLayouts?: EvidenceTextLayout[];
304
+ cellLabelLayouts?: EvidenceTextLayout[][];
305
+ }
306
+ type EvidencePanelKind = "legend" | "rule" | "note" | "verification";
307
+ interface EvidencePanelItem {
308
+ id?: string;
309
+ label: Label;
310
+ detail?: Label;
311
+ style?: VisualStyle;
312
+ }
313
+ interface EvidencePanel {
314
+ id: string;
315
+ kind: EvidencePanelKind;
316
+ items: EvidencePanelItem[];
317
+ position?: Point;
318
+ size?: Size;
319
+ style?: VisualStyle;
320
+ }
321
+ interface CoordinatedEvidencePanel extends EvidencePanel {
322
+ box: Box;
323
+ titleLayout?: EvidenceTextLayout;
324
+ itemLayouts?: EvidenceTextLayout[];
234
325
  }
235
326
  interface NodePort {
236
327
  id: string;
@@ -278,6 +369,9 @@ interface IntentGroup {
278
369
  nodeIds?: string[];
279
370
  groupIds?: string[];
280
371
  padding?: Insets;
372
+ headerHeight?: number;
373
+ labelPosition?: "top" | "inside" | "outside";
374
+ direction?: "horizontal" | "vertical";
281
375
  metadata?: JsonObject;
282
376
  }
283
377
  interface NormalizedGroup {
@@ -286,6 +380,9 @@ interface NormalizedGroup {
286
380
  nodeIds: string[];
287
381
  groupIds: string[];
288
382
  padding: Insets;
383
+ headerHeight?: number;
384
+ labelPosition?: "top" | "inside" | "outside";
385
+ direction?: "horizontal" | "vertical";
289
386
  metadata?: JsonObject;
290
387
  labelLayout?: LabelLayout;
291
388
  }
@@ -293,24 +390,34 @@ interface CoordinatedGroup extends NormalizedGroup {
293
390
  box: Box;
294
391
  }
295
392
  type SwimlaneOrientation = "vertical" | "horizontal";
393
+ type SwimlaneLayout = "overlay" | "contract";
296
394
  interface SwimlaneLane {
297
395
  id: string;
298
396
  label?: Label;
299
397
  children: string[];
300
398
  box?: Box;
399
+ headerBox?: Box;
400
+ contentBox?: Box;
301
401
  }
302
402
  interface Swimlane {
303
403
  id: string;
304
404
  label?: Label;
305
405
  orientation: SwimlaneOrientation;
406
+ layout?: SwimlaneLayout;
306
407
  lanes: SwimlaneLane[];
307
408
  box?: Box;
409
+ headerHeight?: number;
410
+ padding?: number;
308
411
  }
309
412
  interface DiagramFrame {
310
413
  kind: string;
311
414
  context?: string;
312
415
  name?: string;
313
416
  titleTab: string;
417
+ headerHeight?: number;
418
+ padding?: number | Insets;
419
+ labelPosition?: "top" | "inside" | "outside";
420
+ direction?: "horizontal" | "vertical";
314
421
  style?: VisualStyle;
315
422
  }
316
423
  interface CoordinatedFrame extends DiagramFrame {
@@ -326,6 +433,8 @@ interface LayoutLock {
326
433
  interface ConstraintSolverInput {
327
434
  direction: DiagramDirection;
328
435
  overlapSpacing?: number;
436
+ minSiblingGap?: number;
437
+ distributeContainedChildren?: boolean;
329
438
  boxes: ReadonlyMap<string, Box>;
330
439
  nodes: readonly NormalizedNode[];
331
440
  groups: readonly NormalizedGroup[];
@@ -349,6 +458,9 @@ interface IntentDiagram {
349
458
  edges?: IntentEdge[];
350
459
  groups?: IntentGroup[];
351
460
  swimlanes?: Swimlane[];
461
+ matrices?: MatrixBlock[];
462
+ tables?: TableBlock[];
463
+ evidencePanels?: EvidencePanel[];
352
464
  constraints?: Constraint[];
353
465
  frame?: DiagramFrame;
354
466
  metadata?: DiagramMetadata;
@@ -361,6 +473,9 @@ interface NormalizedDiagram {
361
473
  edges: NormalizedEdge[];
362
474
  groups: NormalizedGroup[];
363
475
  swimlanes?: Swimlane[];
476
+ matrices?: MatrixBlock[];
477
+ tables?: TableBlock[];
478
+ evidencePanels?: EvidencePanel[];
364
479
  constraints: Constraint[];
365
480
  diagnostics: Diagnostic[];
366
481
  frame?: DiagramFrame;
@@ -374,7 +489,13 @@ interface CoordinatedDiagram {
374
489
  edges: CoordinatedEdge[];
375
490
  groups: CoordinatedGroup[];
376
491
  swimlanes?: Swimlane[];
492
+ matrices?: CoordinatedMatrixBlock[];
493
+ tables?: CoordinatedTableBlock[];
494
+ evidencePanels?: CoordinatedEvidencePanel[];
495
+ textAnnotations?: SolvedTextAnnotation[];
377
496
  diagnostics: Diagnostic[];
497
+ /** True when any deliverability-breaking diagnostic was emitted. */
498
+ degraded: boolean;
378
499
  bounds: Box;
379
500
  frame?: CoordinatedFrame;
380
501
  metadata?: DiagramMetadata;
@@ -566,6 +687,7 @@ interface RouteEdgeInput {
566
687
  sourceAnchor?: AnchorName;
567
688
  targetAnchor?: AnchorName;
568
689
  obstacles?: readonly Box[];
690
+ hardObstacles?: readonly Box[];
569
691
  }
570
692
  interface RouteEdgeResult {
571
693
  points: Point[];
@@ -589,12 +711,37 @@ interface SolveDiagramOptions {
589
711
  routeKind?: RouteKind;
590
712
  obstacleMargin?: number | Insets;
591
713
  overlapSpacing?: number;
714
+ minLaneGutter?: number;
715
+ prefitLabelSize?: boolean;
716
+ minSiblingGap?: number;
717
+ distributeContainedChildren?: boolean;
718
+ pageBounds?: {
719
+ width: number;
720
+ height: number;
721
+ };
722
+ maxStackDepth?: number;
723
+ preferredAspectRatio?: number;
592
724
  portShifting?: PortShiftingOptions;
725
+ cjkFontFamily?: string | false;
726
+ minCjkFontSize?: number | false;
727
+ textMeasurer?: TextMeasurer;
728
+ /** When true, promote deliverability-breaking diagnostics to errors. */
729
+ strict?: boolean;
593
730
  }
594
731
  interface PortShiftingOptions {
595
732
  enabled?: boolean;
596
733
  spacing?: number;
597
734
  }
598
735
  declare function solveDiagram(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
599
-
600
- export { type AlignConstraint, type AlignmentAxis, type AnchorName, type AnchorPoint, type Arrowhead, type Box, type CanonicalJson, type CanonicalizeOptions, type Constraint, type ConstraintBase, type ConstraintSolverInput, type ConstraintSolverResult, type ConstraintTarget, type ConstraintTargetKind, type ContainerGeometry, type ContainerGeometryInput, type ContainmentConstraint, type CoordinatedDiagram, type CoordinatedEdge, type CoordinatedFrame, type CoordinatedGroup, type CoordinatedNode, type CoordinatedPort, DEFAULT_CANONICAL_PRECISION, DEFAULT_DSL_MAX_BYTES, type DagreLayoutEdge, type DagreLayoutInput, type DagreLayoutNode, type DagreLayoutOptions, type DefaultTextMeasurerOptions, DeterministicTextMeasurer, type Diagnostic, type DiagnosticPathSegment, type DiagnosticSeverity, type DiagramDirection, type DiagramFrame, type DiagramMetadata, type DiagramStage, type DistributeConstraint, type DistributionAxis, type DslDiagnostic, type DslDiagnosticLayer, type DslOutputFormat, type EdgeArrowhead, type EdgeEndpoint, type EdgeStrokeStyle, type ExactPositionConstraint, type ExportFormat, type ExportOptions, type ExportResult, type InitialLayoutResult, type Insets, type IntentDiagram, type IntentEdge, type IntentGroup, type IntentNode, type JsonObject, type JsonPrimitive, type JsonValue, type Label, type LabelFitOptions, LabelFitter, type LabelLayout, type LabelLineLayout, type LayoutLock, type LayoutLockSource, type NodeBase, type NodeCompartments, type NodePort, type NodeShape, type NormalizeDiagramDslOptions, type NormalizeDiagramDslResult, type NormalizedDiagram, type NormalizedEdge, type NormalizedGroup, type NormalizedNode, type ParseDiagramDslOptions, type ParseDiagramDslResult, type ParsedEdgeShorthand, type Point, type PortKind, type PortShiftingOptions, type PortSide, type PreparedText, PretextTextMeasurer, type RelativePositionConstraint, type RelativePositionRelation, type RenderDiagramDslOptions, type RenderDiagramDslResult, type RouteEdgeInput, type RouteEdgeResult, type RouteKind, type ShapeGeometry, type ShapeGeometryInput, type Size, type SolveDiagramOptions, type Swimlane, type SwimlaneLane, type SwimlaneOrientation, type TextCursor, type TextLayout, type TextLayoutLine, type TextMeasurementBackend, type TextMeasurer, type TextStyleOptions, type VisualStyle, applyLayoutConstraints, assertFiniteNonNegative, assertFinitePositive, boxCenter, canonicalize, computeArrowhead, computeContainerGeometry, computeShapeGeometry, createDefaultTextMeasurer, expandBox, exportExcalidraw, exportSvg, fitLabel, getEdgePort, installNodeCanvasRuntime, intersectsAabb, isPretextRuntimeAvailable, normalizeDiagramDsl, normalizeInsets, parseDiagramDsl, parseEdgeShorthand, renderDiagramDsl, resolveLineHeight, resolveOutputFormat, routeEdge, runDagreInitialLayout, simplifyRoute, solveDiagram, sortDslDiagnostics, stringifyCanonical, toCanvasFont, unionBoxes, validateBox, validateTextStyle };
736
+ /**
737
+ * Convenience wrapper around {@link solveDiagram} that enables
738
+ * {@link SolveDiagramOptions.prefitLabelSize} by default so node sizes are
739
+ * expanded to fit their label text. Direct callers of `solveDiagram` who
740
+ * pass hard-coded `NormalizedNode.size` values without a `labelLayout`
741
+ * often see truncated labels; this wrapper avoids that trap.
742
+ *
743
+ * @see SolveDiagramOptions.prefitLabelSize
744
+ */
745
+ declare function solveDiagramSafe(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
746
+
747
+ export { type AlignConstraint, type AlignmentAxis, type AnchorName, type AnchorPoint, type Arrowhead, type Box, type CanonicalJson, type CanonicalizeOptions, type Constraint, type ConstraintBase, type ConstraintSolverInput, type ConstraintSolverResult, type ConstraintTarget, type ConstraintTargetKind, type ContainerGeometry, type ContainerGeometryInput, type ContainmentConstraint, type CoordinatedDiagram, type CoordinatedEdge, type CoordinatedEvidencePanel, type CoordinatedFrame, type CoordinatedGroup, type CoordinatedMatrixBlock, type CoordinatedNode, type CoordinatedPort, type CoordinatedTableBlock, DEFAULT_CANONICAL_PRECISION, DEFAULT_DSL_MAX_BYTES, DELIVERABILITY_DIAGNOSTIC_CODES, type DagreLayoutEdge, type DagreLayoutInput, type DagreLayoutNode, type DagreLayoutOptions, type DefaultTextMeasurerOptions, DeterministicTextMeasurer, type Diagnostic, type DiagnosticPathSegment, type DiagnosticSeverity, type DiagramDirection, type DiagramFrame, type DiagramMetadata, type DiagramStage, type DistributeConstraint, type DistributionAxis, type DslDiagnostic, type DslDiagnosticLayer, type DslOutputFormat, type EdgeArrowhead, type EdgeEndpoint, type EdgeStrokeStyle, type EvidenceCell, type EvidencePanel, type EvidencePanelItem, type EvidencePanelKind, type EvidenceTextLayout, type ExactPositionConstraint, type ExportFormat, type ExportOptions, type ExportResult, type InitialLayoutResult, type Insets, type IntentDiagram, type IntentEdge, type IntentGroup, type IntentNode, type JsonObject, type JsonPrimitive, type JsonValue, type Label, type LabelFitOptions, LabelFitter, type LabelLayout, type LabelLineLayout, type LayoutLock, type LayoutLockSource, type MatrixBlock, type NodeBase, type NodeCompartments, type NodePort, type NodeShape, type NormalizeDiagramDslOptions, type NormalizeDiagramDslResult, type NormalizedDiagram, type NormalizedEdge, type NormalizedGroup, type NormalizedNode, type ParseDiagramDslOptions, type ParseDiagramDslResult, type ParsedEdgeShorthand, type Point, type PortKind, type PortShiftingOptions, type PortSide, type PreparedText, PretextTextMeasurer, type RelativePositionConstraint, type RelativePositionRelation, type RenderDiagramDslOptions, type RenderDiagramDslResult, type RouteEdgeInput, type RouteEdgeResult, type RouteKind, type ShapeGeometry, type ShapeGeometryInput, type Size, type SolveDiagramOptions, type SolvedTextAnnotation, type Swimlane, type SwimlaneLane, type SwimlaneLayout, type SwimlaneOrientation, type TableBlock, type TableColumn, type TableRow, type TextCursor, type TextLayout, type TextLayoutLine, type TextMeasurementBackend, type TextMeasurer, type TextStyleOptions, type TextSurfaceKind, type VisualStyle, applyLayoutConstraints, assertFiniteNonNegative, assertFinitePositive, boxCenter, canonicalize, computeArrowhead, computeContainerGeometry, computeShapeGeometry, createDefaultTextMeasurer, expandBox, exportExcalidraw, exportSvg, fitLabel, getEdgePort, installNodeCanvasRuntime, intersectsAabb, isPretextRuntimeAvailable, normalizeDiagramDsl, normalizeInsets, parseDiagramDsl, parseEdgeShorthand, renderDiagramDsl, resolveLineHeight, resolveOutputFormat, routeEdge, runDagreInitialLayout, simplifyRoute, solveDiagram, solveDiagramSafe, sortDslDiagnostics, stringifyCanonical, toCanvasFont, unionBoxes, validateBox, validateTextStyle };