@diagrammo/dgmo 0.2.19 → 0.2.21

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
@@ -1,6 +1,16 @@
1
1
  import { EChartsOption } from 'echarts';
2
2
  import * as d3Scale from 'd3-scale';
3
3
 
4
+ type DgmoSeverity = 'error' | 'warning';
5
+ interface DgmoError {
6
+ line: number;
7
+ column?: number;
8
+ message: string;
9
+ severity: DgmoSeverity;
10
+ }
11
+ declare function makeDgmoError(line: number, message: string, severity?: DgmoSeverity): DgmoError;
12
+ declare function formatDgmoError(err: DgmoError): string;
13
+
4
14
  /**
5
15
  * Render DGMO source to an SVG string.
6
16
  *
@@ -50,6 +60,13 @@ declare function getDgmoFramework(chartType: string): DgmoFramework | null;
50
60
  * (e.g. content containing `->` is inferred as `sequence`).
51
61
  */
52
62
  declare function parseDgmoChartType(content: string): string | null;
63
+ /**
64
+ * Parse DGMO content and return diagnostics without rendering.
65
+ * Useful for the CLI and editor to surface all errors before attempting render.
66
+ */
67
+ declare function parseDgmo(content: string): {
68
+ diagnostics: DgmoError[];
69
+ };
53
70
 
54
71
  /**
55
72
  * Color definitions for a single mode (light or dark).
@@ -195,6 +212,7 @@ interface ChartDataPoint {
195
212
  color?: string;
196
213
  lineNumber: number;
197
214
  }
215
+
198
216
  interface ParsedChart {
199
217
  type: ChartType;
200
218
  title?: string;
@@ -209,6 +227,7 @@ interface ParsedChart {
209
227
  label?: string;
210
228
  labels?: 'name' | 'value' | 'percent' | 'full';
211
229
  data: ChartDataPoint[];
230
+ diagnostics: DgmoError[];
212
231
  error?: string;
213
232
  }
214
233
 
@@ -261,6 +280,7 @@ interface ParsedHeatmapRow {
261
280
  values: number[];
262
281
  lineNumber: number;
263
282
  }
283
+
264
284
  interface ParsedEChart {
265
285
  type: EChartsChartType;
266
286
  title?: string;
@@ -284,6 +304,7 @@ interface ParsedEChart {
284
304
  sizelabel?: string;
285
305
  showLabels?: boolean;
286
306
  categoryColors?: Record<string, string>;
307
+ diagnostics: DgmoError[];
287
308
  error?: string;
288
309
  }
289
310
 
@@ -442,6 +463,7 @@ interface ParsedD3 {
442
463
  quadrantYAxis: [string, string] | null;
443
464
  quadrantYAxisLineNumber: number | null;
444
465
  quadrantTitleLineNumber: number | null;
466
+ diagnostics: DgmoError[];
445
467
  error: string | null;
446
468
  }
447
469
 
@@ -611,6 +633,7 @@ interface ParsedSequenceDgmo {
611
633
  groups: SequenceGroup[];
612
634
  sections: SequenceSection[];
613
635
  options: Record<string, string>;
636
+ diagnostics: DgmoError[];
614
637
  error: string | null;
615
638
  }
616
639
  /**
@@ -657,6 +680,7 @@ interface ParsedQuadrant {
657
680
  y: number;
658
681
  lineNumber: number;
659
682
  }[];
683
+ diagnostics: DgmoError[];
660
684
  error: string | null;
661
685
  }
662
686
  /**
@@ -698,6 +722,7 @@ interface GraphGroup {
698
722
  nodeIds: string[];
699
723
  lineNumber: number;
700
724
  }
725
+
701
726
  interface ParsedGraph {
702
727
  type: 'flowchart';
703
728
  title?: string;
@@ -706,6 +731,8 @@ interface ParsedGraph {
706
731
  nodes: GraphNode[];
707
732
  edges: GraphEdge[];
708
733
  groups?: GraphGroup[];
734
+ options: Record<string, string>;
735
+ diagnostics: DgmoError[];
709
736
  error?: string;
710
737
  }
711
738
 
@@ -744,12 +771,15 @@ interface ClassRelationship {
744
771
  label?: string;
745
772
  lineNumber: number;
746
773
  }
774
+
747
775
  interface ParsedClassDiagram {
748
776
  type: 'class';
749
777
  title?: string;
750
778
  titleLineNumber?: number;
751
779
  classes: ClassNode[];
752
780
  relationships: ClassRelationship[];
781
+ options: Record<string, string>;
782
+ diagnostics: DgmoError[];
753
783
  error?: string;
754
784
  }
755
785
 
@@ -820,6 +850,7 @@ interface ERRelationship {
820
850
  label?: string;
821
851
  lineNumber: number;
822
852
  }
853
+
823
854
  interface ParsedERDiagram {
824
855
  type: 'er';
825
856
  title?: string;
@@ -827,6 +858,7 @@ interface ParsedERDiagram {
827
858
  options: Record<string, string>;
828
859
  tables: ERTable[];
829
860
  relationships: ERRelationship[];
861
+ diagnostics: DgmoError[];
830
862
  error?: string;
831
863
  }
832
864
 
@@ -902,6 +934,7 @@ interface ParsedOrg {
902
934
  roots: OrgNode[];
903
935
  tagGroups: OrgTagGroup[];
904
936
  options: Record<string, string>;
937
+ diagnostics: DgmoError[];
905
938
  error: string | null;
906
939
  }
907
940
  declare function parseOrg(content: string, palette?: PaletteColors): ParsedOrg;
@@ -957,6 +990,8 @@ interface OrgLegendGroup {
957
990
  y: number;
958
991
  width: number;
959
992
  height: number;
993
+ minifiedWidth: number;
994
+ minifiedHeight: number;
960
995
  }
961
996
  interface OrgLayoutResult {
962
997
  nodes: OrgLayoutNode[];
@@ -974,6 +1009,75 @@ declare function renderOrg(container: HTMLDivElement, parsed: ParsedOrg, layout:
974
1009
  }, activeTagGroup?: string | null, hiddenAttributes?: Set<string>): void;
975
1010
  declare function renderOrgForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
976
1011
 
1012
+ interface KanbanTagEntry {
1013
+ value: string;
1014
+ color: string;
1015
+ lineNumber: number;
1016
+ }
1017
+ interface KanbanTagGroup {
1018
+ name: string;
1019
+ alias?: string;
1020
+ entries: KanbanTagEntry[];
1021
+ defaultValue?: string;
1022
+ lineNumber: number;
1023
+ }
1024
+ interface KanbanCard {
1025
+ id: string;
1026
+ title: string;
1027
+ tags: Record<string, string>;
1028
+ details: string[];
1029
+ lineNumber: number;
1030
+ endLineNumber: number;
1031
+ color?: string;
1032
+ }
1033
+ interface KanbanColumn {
1034
+ id: string;
1035
+ name: string;
1036
+ wipLimit?: number;
1037
+ color?: string;
1038
+ cards: KanbanCard[];
1039
+ lineNumber: number;
1040
+ }
1041
+ interface ParsedKanban {
1042
+ type: 'kanban';
1043
+ title?: string;
1044
+ titleLineNumber?: number;
1045
+ columns: KanbanColumn[];
1046
+ tagGroups: KanbanTagGroup[];
1047
+ options: Record<string, string>;
1048
+ diagnostics: DgmoError[];
1049
+ error?: string;
1050
+ }
1051
+
1052
+ declare function parseKanban(content: string, palette?: PaletteColors): ParsedKanban;
1053
+
1054
+ /**
1055
+ * Compute new file content after moving a card to a different position.
1056
+ *
1057
+ * @param content - original file content string
1058
+ * @param parsed - parsed kanban board
1059
+ * @param cardId - id of the card to move
1060
+ * @param targetColumnId - id of the destination column
1061
+ * @param targetIndex - position within target column (0 = first card)
1062
+ * @returns new content string, or null if move is invalid
1063
+ */
1064
+ declare function computeCardMove(content: string, parsed: ParsedKanban, cardId: string, targetColumnId: string, targetIndex: number): string | null;
1065
+ /**
1066
+ * Move a card to the Archive section at the end of the file.
1067
+ * Creates `== Archive ==` if it doesn't exist.
1068
+ *
1069
+ * @returns new content string, or null if the card is not found
1070
+ */
1071
+ declare function computeCardArchive(content: string, parsed: ParsedKanban, cardId: string): string | null;
1072
+ /** Check if a column name is the archive column (case-insensitive). */
1073
+ declare function isArchiveColumn(name: string): boolean;
1074
+
1075
+ declare function renderKanban(container: HTMLElement, parsed: ParsedKanban, palette: PaletteColors, isDark: boolean, _onNavigateToLine?: (line: number) => void, exportDims?: {
1076
+ width: number;
1077
+ height: number;
1078
+ }, activeTagGroup?: string | null): void;
1079
+ declare function renderKanbanForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
1080
+
977
1081
  interface CollapsedOrgResult {
978
1082
  /** ParsedOrg with collapsed subtrees pruned (deep-cloned, never mutates original) */
979
1083
  parsed: ParsedOrg;
@@ -982,6 +1086,25 @@ interface CollapsedOrgResult {
982
1086
  }
983
1087
  declare function collapseOrgTree(original: ParsedOrg, collapsedIds: Set<string>): CollapsedOrgResult;
984
1088
 
1089
+ /**
1090
+ * Async or sync file reader. Receives an absolute path, returns content.
1091
+ * Throwing means "file not found".
1092
+ */
1093
+ type ReadFileFn = (path: string) => string | Promise<string>;
1094
+ interface ResolveImportsResult {
1095
+ content: string;
1096
+ diagnostics: DgmoError[];
1097
+ }
1098
+ /**
1099
+ * Pre-processes org chart content, resolving `tags:` and `import:` directives.
1100
+ *
1101
+ * @param content - Raw .dgmo file content
1102
+ * @param filePath - Absolute path of the file (for relative path resolution)
1103
+ * @param readFileFn - Function to read files (sync or async)
1104
+ * @returns Merged content with all imports resolved + diagnostics
1105
+ */
1106
+ declare function resolveOrgImports(content: string, filePath: string, readFileFn: ReadFileFn): Promise<ResolveImportsResult>;
1107
+
985
1108
  interface LayoutNode {
986
1109
  id: string;
987
1110
  label: string;
@@ -1167,4 +1290,4 @@ declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
1167
1290
  */
1168
1291
  declare function injectBranding(svgHtml: string, mutedColor: string): string;
1169
1292
 
1170
- export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DecodedDiagramUrl, type DgmoFramework, type DiagramViewState, type EChartsChartType, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, type OrgTagEntry, type OrgTagGroup, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedClassDiagram, type ParsedD3, type ParsedEChart, type ParsedERDiagram, type ParsedGraph, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type RelationshipType, type RenderStep, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildThemeCSS, catppuccinPalette, collapseOrgTree, colorNames, computeActivations, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, formatDateLabel, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, injectBranding, isSequenceBlock, isSequenceNote, isValidHex, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutOrg, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseClassDiagram, parseD3, parseDgmoChartType, parseEChart, parseERDiagram, parseFlowchart, parseOrg, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, render, renderArcDiagram, renderClassDiagram, renderClassDiagramForExport, renderD3ForExport, renderEChartsForExport, renderERDiagram, renderERDiagramForExport, renderFlowchart, renderFlowchartForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
1293
+ export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DecodedDiagramUrl, type DgmoError, type DgmoFramework, type DgmoSeverity, type DiagramViewState, type EChartsChartType, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, type OrgTagEntry, type OrgTagGroup, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedClassDiagram, type ParsedD3, type ParsedEChart, type ParsedERDiagram, type ParsedGraph, type ParsedKanban, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderStep, type ResolveImportsResult, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildThemeCSS, catppuccinPalette, collapseOrgTree, colorNames, computeActivations, computeCardArchive, computeCardMove, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, formatDateLabel, formatDgmoError, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, injectBranding, isArchiveColumn, isSequenceBlock, isSequenceNote, isValidHex, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutOrg, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseClassDiagram, parseD3, parseDgmo, parseDgmoChartType, parseEChart, parseERDiagram, parseFlowchart, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, render, renderArcDiagram, renderClassDiagram, renderClassDiagramForExport, renderD3ForExport, renderEChartsForExport, renderERDiagram, renderERDiagramForExport, renderFlowchart, renderFlowchartForExport, renderKanban, renderKanbanForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveOrgImports, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,16 @@
1
1
  import { EChartsOption } from 'echarts';
2
2
  import * as d3Scale from 'd3-scale';
3
3
 
4
+ type DgmoSeverity = 'error' | 'warning';
5
+ interface DgmoError {
6
+ line: number;
7
+ column?: number;
8
+ message: string;
9
+ severity: DgmoSeverity;
10
+ }
11
+ declare function makeDgmoError(line: number, message: string, severity?: DgmoSeverity): DgmoError;
12
+ declare function formatDgmoError(err: DgmoError): string;
13
+
4
14
  /**
5
15
  * Render DGMO source to an SVG string.
6
16
  *
@@ -50,6 +60,13 @@ declare function getDgmoFramework(chartType: string): DgmoFramework | null;
50
60
  * (e.g. content containing `->` is inferred as `sequence`).
51
61
  */
52
62
  declare function parseDgmoChartType(content: string): string | null;
63
+ /**
64
+ * Parse DGMO content and return diagnostics without rendering.
65
+ * Useful for the CLI and editor to surface all errors before attempting render.
66
+ */
67
+ declare function parseDgmo(content: string): {
68
+ diagnostics: DgmoError[];
69
+ };
53
70
 
54
71
  /**
55
72
  * Color definitions for a single mode (light or dark).
@@ -195,6 +212,7 @@ interface ChartDataPoint {
195
212
  color?: string;
196
213
  lineNumber: number;
197
214
  }
215
+
198
216
  interface ParsedChart {
199
217
  type: ChartType;
200
218
  title?: string;
@@ -209,6 +227,7 @@ interface ParsedChart {
209
227
  label?: string;
210
228
  labels?: 'name' | 'value' | 'percent' | 'full';
211
229
  data: ChartDataPoint[];
230
+ diagnostics: DgmoError[];
212
231
  error?: string;
213
232
  }
214
233
 
@@ -261,6 +280,7 @@ interface ParsedHeatmapRow {
261
280
  values: number[];
262
281
  lineNumber: number;
263
282
  }
283
+
264
284
  interface ParsedEChart {
265
285
  type: EChartsChartType;
266
286
  title?: string;
@@ -284,6 +304,7 @@ interface ParsedEChart {
284
304
  sizelabel?: string;
285
305
  showLabels?: boolean;
286
306
  categoryColors?: Record<string, string>;
307
+ diagnostics: DgmoError[];
287
308
  error?: string;
288
309
  }
289
310
 
@@ -442,6 +463,7 @@ interface ParsedD3 {
442
463
  quadrantYAxis: [string, string] | null;
443
464
  quadrantYAxisLineNumber: number | null;
444
465
  quadrantTitleLineNumber: number | null;
466
+ diagnostics: DgmoError[];
445
467
  error: string | null;
446
468
  }
447
469
 
@@ -611,6 +633,7 @@ interface ParsedSequenceDgmo {
611
633
  groups: SequenceGroup[];
612
634
  sections: SequenceSection[];
613
635
  options: Record<string, string>;
636
+ diagnostics: DgmoError[];
614
637
  error: string | null;
615
638
  }
616
639
  /**
@@ -657,6 +680,7 @@ interface ParsedQuadrant {
657
680
  y: number;
658
681
  lineNumber: number;
659
682
  }[];
683
+ diagnostics: DgmoError[];
660
684
  error: string | null;
661
685
  }
662
686
  /**
@@ -698,6 +722,7 @@ interface GraphGroup {
698
722
  nodeIds: string[];
699
723
  lineNumber: number;
700
724
  }
725
+
701
726
  interface ParsedGraph {
702
727
  type: 'flowchart';
703
728
  title?: string;
@@ -706,6 +731,8 @@ interface ParsedGraph {
706
731
  nodes: GraphNode[];
707
732
  edges: GraphEdge[];
708
733
  groups?: GraphGroup[];
734
+ options: Record<string, string>;
735
+ diagnostics: DgmoError[];
709
736
  error?: string;
710
737
  }
711
738
 
@@ -744,12 +771,15 @@ interface ClassRelationship {
744
771
  label?: string;
745
772
  lineNumber: number;
746
773
  }
774
+
747
775
  interface ParsedClassDiagram {
748
776
  type: 'class';
749
777
  title?: string;
750
778
  titleLineNumber?: number;
751
779
  classes: ClassNode[];
752
780
  relationships: ClassRelationship[];
781
+ options: Record<string, string>;
782
+ diagnostics: DgmoError[];
753
783
  error?: string;
754
784
  }
755
785
 
@@ -820,6 +850,7 @@ interface ERRelationship {
820
850
  label?: string;
821
851
  lineNumber: number;
822
852
  }
853
+
823
854
  interface ParsedERDiagram {
824
855
  type: 'er';
825
856
  title?: string;
@@ -827,6 +858,7 @@ interface ParsedERDiagram {
827
858
  options: Record<string, string>;
828
859
  tables: ERTable[];
829
860
  relationships: ERRelationship[];
861
+ diagnostics: DgmoError[];
830
862
  error?: string;
831
863
  }
832
864
 
@@ -902,6 +934,7 @@ interface ParsedOrg {
902
934
  roots: OrgNode[];
903
935
  tagGroups: OrgTagGroup[];
904
936
  options: Record<string, string>;
937
+ diagnostics: DgmoError[];
905
938
  error: string | null;
906
939
  }
907
940
  declare function parseOrg(content: string, palette?: PaletteColors): ParsedOrg;
@@ -957,6 +990,8 @@ interface OrgLegendGroup {
957
990
  y: number;
958
991
  width: number;
959
992
  height: number;
993
+ minifiedWidth: number;
994
+ minifiedHeight: number;
960
995
  }
961
996
  interface OrgLayoutResult {
962
997
  nodes: OrgLayoutNode[];
@@ -974,6 +1009,75 @@ declare function renderOrg(container: HTMLDivElement, parsed: ParsedOrg, layout:
974
1009
  }, activeTagGroup?: string | null, hiddenAttributes?: Set<string>): void;
975
1010
  declare function renderOrgForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
976
1011
 
1012
+ interface KanbanTagEntry {
1013
+ value: string;
1014
+ color: string;
1015
+ lineNumber: number;
1016
+ }
1017
+ interface KanbanTagGroup {
1018
+ name: string;
1019
+ alias?: string;
1020
+ entries: KanbanTagEntry[];
1021
+ defaultValue?: string;
1022
+ lineNumber: number;
1023
+ }
1024
+ interface KanbanCard {
1025
+ id: string;
1026
+ title: string;
1027
+ tags: Record<string, string>;
1028
+ details: string[];
1029
+ lineNumber: number;
1030
+ endLineNumber: number;
1031
+ color?: string;
1032
+ }
1033
+ interface KanbanColumn {
1034
+ id: string;
1035
+ name: string;
1036
+ wipLimit?: number;
1037
+ color?: string;
1038
+ cards: KanbanCard[];
1039
+ lineNumber: number;
1040
+ }
1041
+ interface ParsedKanban {
1042
+ type: 'kanban';
1043
+ title?: string;
1044
+ titleLineNumber?: number;
1045
+ columns: KanbanColumn[];
1046
+ tagGroups: KanbanTagGroup[];
1047
+ options: Record<string, string>;
1048
+ diagnostics: DgmoError[];
1049
+ error?: string;
1050
+ }
1051
+
1052
+ declare function parseKanban(content: string, palette?: PaletteColors): ParsedKanban;
1053
+
1054
+ /**
1055
+ * Compute new file content after moving a card to a different position.
1056
+ *
1057
+ * @param content - original file content string
1058
+ * @param parsed - parsed kanban board
1059
+ * @param cardId - id of the card to move
1060
+ * @param targetColumnId - id of the destination column
1061
+ * @param targetIndex - position within target column (0 = first card)
1062
+ * @returns new content string, or null if move is invalid
1063
+ */
1064
+ declare function computeCardMove(content: string, parsed: ParsedKanban, cardId: string, targetColumnId: string, targetIndex: number): string | null;
1065
+ /**
1066
+ * Move a card to the Archive section at the end of the file.
1067
+ * Creates `== Archive ==` if it doesn't exist.
1068
+ *
1069
+ * @returns new content string, or null if the card is not found
1070
+ */
1071
+ declare function computeCardArchive(content: string, parsed: ParsedKanban, cardId: string): string | null;
1072
+ /** Check if a column name is the archive column (case-insensitive). */
1073
+ declare function isArchiveColumn(name: string): boolean;
1074
+
1075
+ declare function renderKanban(container: HTMLElement, parsed: ParsedKanban, palette: PaletteColors, isDark: boolean, _onNavigateToLine?: (line: number) => void, exportDims?: {
1076
+ width: number;
1077
+ height: number;
1078
+ }, activeTagGroup?: string | null): void;
1079
+ declare function renderKanbanForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
1080
+
977
1081
  interface CollapsedOrgResult {
978
1082
  /** ParsedOrg with collapsed subtrees pruned (deep-cloned, never mutates original) */
979
1083
  parsed: ParsedOrg;
@@ -982,6 +1086,25 @@ interface CollapsedOrgResult {
982
1086
  }
983
1087
  declare function collapseOrgTree(original: ParsedOrg, collapsedIds: Set<string>): CollapsedOrgResult;
984
1088
 
1089
+ /**
1090
+ * Async or sync file reader. Receives an absolute path, returns content.
1091
+ * Throwing means "file not found".
1092
+ */
1093
+ type ReadFileFn = (path: string) => string | Promise<string>;
1094
+ interface ResolveImportsResult {
1095
+ content: string;
1096
+ diagnostics: DgmoError[];
1097
+ }
1098
+ /**
1099
+ * Pre-processes org chart content, resolving `tags:` and `import:` directives.
1100
+ *
1101
+ * @param content - Raw .dgmo file content
1102
+ * @param filePath - Absolute path of the file (for relative path resolution)
1103
+ * @param readFileFn - Function to read files (sync or async)
1104
+ * @returns Merged content with all imports resolved + diagnostics
1105
+ */
1106
+ declare function resolveOrgImports(content: string, filePath: string, readFileFn: ReadFileFn): Promise<ResolveImportsResult>;
1107
+
985
1108
  interface LayoutNode {
986
1109
  id: string;
987
1110
  label: string;
@@ -1167,4 +1290,4 @@ declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
1167
1290
  */
1168
1291
  declare function injectBranding(svgHtml: string, mutedColor: string): string;
1169
1292
 
1170
- export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DecodedDiagramUrl, type DgmoFramework, type DiagramViewState, type EChartsChartType, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, type OrgTagEntry, type OrgTagGroup, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedClassDiagram, type ParsedD3, type ParsedEChart, type ParsedERDiagram, type ParsedGraph, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type RelationshipType, type RenderStep, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildThemeCSS, catppuccinPalette, collapseOrgTree, colorNames, computeActivations, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, formatDateLabel, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, injectBranding, isSequenceBlock, isSequenceNote, isValidHex, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutOrg, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseClassDiagram, parseD3, parseDgmoChartType, parseEChart, parseERDiagram, parseFlowchart, parseOrg, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, render, renderArcDiagram, renderClassDiagram, renderClassDiagramForExport, renderD3ForExport, renderEChartsForExport, renderERDiagram, renderERDiagramForExport, renderFlowchart, renderFlowchartForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };
1293
+ export { type Activation, type ArcLink, type ArcNodeGroup, type ChartDataPoint, type ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type D3ChartType, type D3ExportDimensions, DGMO_CHART_TYPE_MAP, type DecodedDiagramUrl, type DgmoError, type DgmoFramework, type DgmoSeverity, type DiagramViewState, type EChartsChartType, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, type OrgTagEntry, type OrgTagGroup, type PaletteColors, type PaletteConfig, type ParsedChart, type ParsedClassDiagram, type ParsedD3, type ParsedEChart, type ParsedERDiagram, type ParsedGraph, type ParsedKanban, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParticipantType, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderStep, type ResolveImportsResult, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildEChartsOption, buildEChartsOptionFromChart, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildThemeCSS, catppuccinPalette, collapseOrgTree, colorNames, computeActivations, computeCardArchive, computeCardMove, computeTimeTicks, contrastText, decodeDiagramUrl, encodeDiagramUrl, formatDateLabel, formatDgmoError, getAvailablePalettes, getDgmoFramework, getPalette, getSeriesColors, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, injectBranding, isArchiveColumn, isSequenceBlock, isSequenceNote, isValidHex, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutOrg, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, makeDgmoError, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseChart, parseClassDiagram, parseD3, parseDgmo, parseDgmoChartType, parseEChart, parseERDiagram, parseFlowchart, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseTimelineDate, registerPalette, render, renderArcDiagram, renderClassDiagram, renderClassDiagramForExport, renderD3ForExport, renderEChartsForExport, renderERDiagram, renderERDiagramForExport, renderFlowchart, renderFlowchartForExport, renderKanban, renderKanbanForExport, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSlopeChart, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveOrgImports, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette };