@likec4/core 1.17.1 → 1.19.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 (184) hide show
  1. package/LICENSE +1 -1
  2. package/dist/builder/index.d.mts +502 -0
  3. package/dist/builder/index.d.ts +502 -0
  4. package/dist/builder/index.js +871 -0
  5. package/dist/compute-view/index.d.mts +22 -0
  6. package/dist/compute-view/index.d.ts +22 -0
  7. package/dist/compute-view/index.js +78 -0
  8. package/dist/index.d.mts +10 -919
  9. package/dist/index.d.ts +10 -919
  10. package/dist/{index.mjs → index.js} +7 -1688
  11. package/dist/model/index.d.mts +254 -0
  12. package/dist/model/index.d.ts +254 -0
  13. package/dist/model/index.js +1 -0
  14. package/dist/shared/chunk-RAAYCPUM.M-JWF7SS.js +21 -0
  15. package/dist/shared/core.BIfgabEw.d.ts +719 -0
  16. package/dist/shared/core.BZ9Msq7w.d.mts +719 -0
  17. package/dist/shared/{core.CoLQkcYL.d.cts → core.C05RDLhi.d.ts} +460 -362
  18. package/dist/shared/{core.CoLQkcYL.d.mts → core.CmYMqgha.d.mts} +460 -362
  19. package/dist/shared/core.D6-fWbM3.d.ts +127 -0
  20. package/dist/shared/core.D74xkKkG.d.mts +148 -0
  21. package/dist/shared/core.D74xkKkG.d.ts +148 -0
  22. package/dist/shared/core.sLaWHBjR.d.mts +127 -0
  23. package/dist/shared/index.-BdzdI2C.js +7443 -0
  24. package/dist/shared/object_hash.CE_oF3I3.js +1222 -0
  25. package/dist/shared/{core.BXTs-8n7.mjs → view.CyZrG8BJ.js} +108 -47
  26. package/dist/types/index.d.mts +71 -1
  27. package/dist/types/index.d.ts +71 -1
  28. package/dist/types/index.js +20 -0
  29. package/dist/utils/index.d.mts +404 -0
  30. package/dist/utils/index.d.ts +404 -0
  31. package/dist/utils/index.js +330 -0
  32. package/package.json +59 -47
  33. package/src/builder/Builder-style1.test-d.ts +190 -0
  34. package/src/builder/Builder-style2.test-d.ts +175 -0
  35. package/src/builder/Builder.deployment.ts +224 -0
  36. package/src/builder/Builder.deploymentModel.ts +385 -0
  37. package/src/builder/Builder.element.ts +19 -19
  38. package/src/builder/Builder.model.ts +67 -42
  39. package/src/builder/Builder.ts +533 -367
  40. package/src/builder/Builder.view-common.ts +234 -0
  41. package/src/builder/Builder.view-deployment.ts +135 -0
  42. package/src/builder/Builder.view-element.ts +189 -0
  43. package/src/builder/Builder.views.ts +109 -33
  44. package/src/builder/Builder.with.ts +475 -0
  45. package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +374 -0
  46. package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +183 -0
  47. package/src/builder/__snapshots__/Builder.spec.ts.snap +374 -0
  48. package/src/builder/_types.ts +113 -18
  49. package/src/builder/index.ts +10 -4
  50. package/src/colors/index.ts +2 -2
  51. package/src/compute-view/compute-view.ts +83 -0
  52. package/src/compute-view/deployment-view/__test__/TestHelper.ts +236 -0
  53. package/src/compute-view/deployment-view/__test__/fixture.ts +198 -0
  54. package/src/compute-view/deployment-view/_types.ts +37 -0
  55. package/src/compute-view/deployment-view/clean-connections.ts +238 -0
  56. package/src/compute-view/deployment-view/compute.ts +125 -0
  57. package/src/compute-view/deployment-view/memory/index.ts +9 -0
  58. package/src/compute-view/deployment-view/memory/memory.ts +97 -0
  59. package/src/compute-view/deployment-view/predicates/elements.ts +144 -0
  60. package/src/compute-view/deployment-view/predicates/relation-direct.ts +237 -0
  61. package/src/compute-view/deployment-view/predicates/relation-in-out.ts +61 -0
  62. package/src/compute-view/deployment-view/predicates/relation-incoming.ts +95 -0
  63. package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +88 -0
  64. package/src/compute-view/deployment-view/predicates/wildcard.ts +29 -0
  65. package/src/compute-view/deployment-view/stages/stage-exclude.ts +5 -0
  66. package/src/compute-view/deployment-view/stages/stage-final.ts +245 -0
  67. package/src/compute-view/deployment-view/stages/stage-include.ts +95 -0
  68. package/src/compute-view/deployment-view/utils.ts +276 -0
  69. package/src/compute-view/dynamic-view/__test__/fixture.ts +58 -0
  70. package/src/compute-view/dynamic-view/compute.ts +324 -0
  71. package/src/compute-view/element-view/__test__/TestHelper.ts +258 -0
  72. package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +458 -0
  73. package/src/compute-view/element-view/__test__/fixture.ts +675 -0
  74. package/src/compute-view/element-view/_types.ts +48 -0
  75. package/src/compute-view/element-view/clean-connections.ts +113 -0
  76. package/src/compute-view/element-view/compute.ts +315 -0
  77. package/src/compute-view/element-view/memory/NodeGroup.ts +31 -0
  78. package/src/compute-view/element-view/memory/index.ts +10 -0
  79. package/src/compute-view/element-view/memory/memory.ts +177 -0
  80. package/src/compute-view/element-view/memory/stage-exclude.ts +59 -0
  81. package/src/compute-view/element-view/memory/stage-final.ts +129 -0
  82. package/src/compute-view/element-view/memory/stage-include.ts +128 -0
  83. package/src/compute-view/element-view/predicates/_utils.ts +86 -0
  84. package/src/compute-view/element-view/predicates/element-expand.ts +33 -0
  85. package/src/compute-view/element-view/predicates/element-kind-tag.ts +26 -0
  86. package/src/compute-view/element-view/predicates/element-ref.ts +37 -0
  87. package/src/compute-view/element-view/predicates/relation-direct.ts +309 -0
  88. package/src/compute-view/element-view/predicates/relation-in-out.ts +66 -0
  89. package/src/compute-view/element-view/predicates/relation-in.ts +118 -0
  90. package/src/compute-view/element-view/predicates/relation-out.ts +116 -0
  91. package/src/compute-view/element-view/predicates/wildcard.ts +88 -0
  92. package/src/compute-view/element-view/utils.ts +59 -0
  93. package/src/compute-view/index.ts +4 -0
  94. package/src/compute-view/memory/AbstractMemory.ts +45 -0
  95. package/src/compute-view/memory/AbstractStageExclude.ts +216 -0
  96. package/src/compute-view/memory/AbstractStageInclude.ts +200 -0
  97. package/src/compute-view/memory/_types.ts +147 -0
  98. package/src/compute-view/memory/index.ts +5 -0
  99. package/src/compute-view/memory/ops.ts +43 -0
  100. package/src/compute-view/utils/__snapshots__/sortNodes.spec.ts.snap +113 -0
  101. package/src/compute-view/utils/ancestorsOfNode.ts +19 -0
  102. package/src/compute-view/utils/applyCustomElementProperties.ts +66 -0
  103. package/src/compute-view/utils/applyCustomRelationProperties.ts +41 -0
  104. package/src/compute-view/utils/applyViewRuleStyles.ts +53 -0
  105. package/src/compute-view/utils/buildComputedNodes.ts +148 -0
  106. package/src/compute-view/utils/buildElementNotations.ts +63 -0
  107. package/src/compute-view/utils/elementExpressionToPredicate.ts +50 -0
  108. package/src/compute-view/utils/link-nodes-with-edges.ts +54 -0
  109. package/src/compute-view/utils/merge-props-from-relationships.ts +128 -0
  110. package/src/compute-view/utils/relationExpressionToPredicates.ts +55 -0
  111. package/src/compute-view/utils/resolve-extended-views.ts +69 -0
  112. package/src/compute-view/utils/resolve-global-rules.ts +83 -0
  113. package/src/compute-view/utils/topological-sort.ts +256 -0
  114. package/src/compute-view/utils/uniqueTags.test.ts +42 -0
  115. package/src/compute-view/utils/uniqueTags.ts +21 -0
  116. package/src/compute-view/utils/view-hash.ts +27 -0
  117. package/src/compute-view/utils/with-readable-edges.ts +36 -0
  118. package/src/index.ts +22 -12
  119. package/src/model/DeploymentElementModel.ts +599 -0
  120. package/src/model/DeploymentModel.ts +370 -0
  121. package/src/model/ElementModel.ts +221 -0
  122. package/src/model/LikeC4Model.test-d.ts +152 -0
  123. package/src/model/LikeC4Model.ts +336 -457
  124. package/src/model/RelationModel.ts +85 -0
  125. package/src/model/__test__/fixture.ts +149 -338
  126. package/src/model/connection/Connection.ts +72 -0
  127. package/src/model/connection/deployment/DeploymentConnectionModel.ts +178 -0
  128. package/src/model/connection/deployment/find.ts +120 -0
  129. package/src/model/connection/deployment/index.ts +8 -0
  130. package/src/model/connection/index.ts +22 -0
  131. package/src/model/connection/model/ConnectionModel.ts +157 -0
  132. package/src/model/connection/model/find.ts +117 -0
  133. package/src/model/connection/model/index.ts +8 -0
  134. package/src/model/connection/ops.ts +274 -0
  135. package/src/model/guards.ts +9 -0
  136. package/src/model/index.ts +46 -2
  137. package/src/model/types.ts +112 -15
  138. package/src/model/view/EdgeModel.ts +103 -0
  139. package/src/model/view/LikeC4ViewModel.ts +226 -0
  140. package/src/model/view/NodeModel.ts +229 -0
  141. package/src/types/_common.ts +55 -1
  142. package/src/types/deployments.ts +169 -0
  143. package/src/types/element.ts +9 -5
  144. package/src/types/expression-v2.ts +172 -0
  145. package/src/types/expression.ts +17 -11
  146. package/src/types/global.ts +3 -3
  147. package/src/types/index.ts +220 -12
  148. package/src/types/model.ts +75 -12
  149. package/src/types/operators.ts +1 -1
  150. package/src/types/overview-graph.ts +2 -2
  151. package/src/types/relation.ts +18 -14
  152. package/src/types/theme.ts +0 -1
  153. package/src/types/view-notation.ts +2 -2
  154. package/src/types/view.ts +117 -41
  155. package/src/utils/{commonHead.ts → common-head.ts} +2 -0
  156. package/src/utils/const.ts +1 -0
  157. package/src/utils/fqn.ts +203 -56
  158. package/src/utils/getOrCreate.ts +42 -0
  159. package/src/utils/graphlib.ts +10 -0
  160. package/src/utils/index.ts +74 -6
  161. package/src/utils/iterable/_types.ts +5 -0
  162. package/src/utils/iterable/filter.ts +55 -0
  163. package/src/utils/iterable/flat.ts +17 -0
  164. package/src/utils/iterable/index.ts +12 -0
  165. package/src/utils/iterable/map.ts +40 -0
  166. package/src/utils/iterable/reduce.ts +24 -0
  167. package/src/utils/iterable/some.ts +36 -0
  168. package/src/utils/iterable/to.ts +19 -0
  169. package/src/utils/iterable/unique.ts +29 -0
  170. package/src/utils/object-hash.ts +3 -0
  171. package/src/utils/relations.ts +3 -64
  172. package/src/utils/set.ts +78 -0
  173. package/src/utils/string-hash.ts +16 -0
  174. package/dist/index.cjs +0 -5452
  175. package/dist/index.d.cts +0 -1053
  176. package/dist/shared/core.CoLQkcYL.d.ts +0 -734
  177. package/dist/shared/core.DIYZvpVg.cjs +0 -353
  178. package/dist/types/index.cjs +0 -70
  179. package/dist/types/index.d.cts +0 -2
  180. package/dist/types/index.mjs +0 -1
  181. package/src/builder/Builder.test-d.ts +0 -69
  182. package/src/builder/Builder.view.ts +0 -358
  183. package/src/model/LikeC4DiagramModel.ts +0 -338
  184. package/src/model/LikeC4ViewModel.ts +0 -320
@@ -1,104 +1,5 @@
1
- import { Tagged, LiteralUnion, TupleToUnion, NonEmptyTuple } from 'type-fest';
2
-
3
- type NonEmptyArray<T> = [T, ...T[]];
4
- type NonEmptyReadonlyArray<T> = readonly [T, ...T[]];
5
- type IconUrl = Tagged<string, 'IconUrl'> | 'none';
6
- type CustomColor = string;
7
- type Point = readonly [x: number, y: number];
8
- interface XYPoint {
9
- x: number;
10
- y: number;
11
- }
12
-
13
- declare const ThemeColors: readonly ["amber", "blue", "gray", "slate", "green", "indigo", "muted", "primary", "red", "secondary", "sky"];
14
- type ThemeColor = typeof ThemeColors[number];
15
- type HexColorLiteral = `#${string}`;
16
- type ColorLiteral = HexColorLiteral;
17
- type Color = LiteralUnion<ThemeColor, string>;
18
- declare function isThemeColor(color: Color): color is ThemeColor;
19
- interface ElementThemeColorValues {
20
- fill: ColorLiteral;
21
- stroke: ColorLiteral;
22
- hiContrast: ColorLiteral;
23
- loContrast: ColorLiteral;
24
- }
25
- type ElementThemeColors = {
26
- [key in ThemeColor]: ElementThemeColorValues;
27
- };
28
- interface RelationshipThemeColorValues {
29
- lineColor: ColorLiteral;
30
- labelBgColor: ColorLiteral;
31
- labelColor: ColorLiteral;
32
- }
33
- interface ThemeColorValues {
34
- elements: ElementThemeColorValues;
35
- relationships: RelationshipThemeColorValues;
36
- }
37
- type RelationshipThemeColors = {
38
- [key in ThemeColor]: RelationshipThemeColorValues;
39
- };
40
- interface LikeC4Theme {
41
- font: 'Arial';
42
- shadow: ColorLiteral;
43
- relationships: RelationshipThemeColors;
44
- elements: ElementThemeColors;
45
- }
46
-
47
- type Fqn<Id extends string = string> = Tagged<Id, 'Fqn'>;
48
- declare function AsFqn(name: string, parent?: Fqn | null): Fqn;
49
- declare const BorderStyles: readonly ["solid", "dashed", "dotted", "none"];
50
- type BorderStyle = TupleToUnion<typeof BorderStyles>;
51
- type ElementKind<Kinds extends string = string> = Tagged<Kinds, 'ElementKind'>;
52
- declare namespace ElementKind {
53
- const Group: ElementKind;
54
- }
55
- declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile", "cylinder", "storage", "queue"];
56
- type ElementShape = TupleToUnion<typeof ElementShapes>;
57
- declare const DefaultThemeColor = "primary";
58
- declare const DefaultElementShape = "rectangle";
59
- interface ElementStyle {
60
- border?: BorderStyle;
61
- opacity?: number;
62
- }
63
- type Tag<Tags extends string = string> = Tagged<Tags, 'Tag'>;
64
- interface TagSpec {
65
- readonly id: Tag;
66
- readonly style: ElementStyle;
67
- }
68
- interface Link {
69
- readonly title?: string;
70
- readonly url: string;
71
- readonly relative?: string;
72
- }
73
- interface TypedElement<Ids extends string, Kinds extends string, Tags extends string, MetadataKeys extends string = never> {
74
- readonly id: Fqn<Ids>;
75
- readonly kind: ElementKind<Kinds>;
76
- readonly title: string;
77
- readonly description: string | null;
78
- readonly technology: string | null;
79
- readonly tags: NonEmptyArray<Tag<Tags>> | null;
80
- readonly links: NonEmptyArray<Link> | null;
81
- readonly icon?: IconUrl;
82
- readonly shape?: ElementShape;
83
- readonly color?: Color;
84
- readonly style?: ElementStyle;
85
- readonly notation?: string;
86
- readonly metadata?: Record<MetadataKeys, string>;
87
- }
88
- interface Element extends TypedElement<string, string, string, string> {
89
- }
90
- interface ElementKindSpecificationStyle {
91
- shape?: ElementShape;
92
- icon?: IconUrl;
93
- color?: Color;
94
- border?: BorderStyle;
95
- opacity?: number;
96
- }
97
- interface ElementKindSpecification {
98
- readonly technology?: string;
99
- readonly notation?: string;
100
- readonly style: ElementKindSpecificationStyle;
101
- }
1
+ import { Tagged, NonEmptyTuple, Simplify, MergeExclusive } from 'type-fest';
2
+ import { N as NonEmptyArray, F as Fqn, l as ElementShape, s as Color, I as IconUrl, h as BorderStyle, f as ElementKind, o as Tag, E as ExclusiveUnion, m as ElementStyle, n as Link, T as ThemeColorValues, X as XYPoint, P as Point, x as ThemeColor, j as ElementKindSpecification, q as TypedElement } from './core.D74xkKkG.js';
102
3
 
103
4
  type EqualOperator<V> = {
104
5
  eq: V;
@@ -136,31 +37,300 @@ type OrOperator<Tag, Kind> = Omit<AllNever, 'or'> & {
136
37
  declare const isOrOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is OrOperator<Tag, Kind>;
137
38
  type WhereOperator<Tag, Kind> = TagEqual<Tag> | KindEqual<Kind> | NotOperator<Tag, Kind> | AndOperator<Tag, Kind> | OrOperator<Tag, Kind>;
138
39
  type Filterable<FTag extends string = string, FKind extends string = string> = {
139
- tags?: FTag[] | null;
40
+ tags?: readonly FTag[] | null;
140
41
  kind?: FKind;
141
42
  };
142
43
  type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
143
44
  declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
144
45
 
46
+ interface BaseExpr {
47
+ where?: never;
48
+ element?: never;
49
+ custom?: never;
50
+ expanded?: never;
51
+ elementKind?: never;
52
+ elementTag?: never;
53
+ isEqual?: never;
54
+ isChildren?: never;
55
+ isDescendants?: never;
56
+ wildcard?: never;
57
+ source?: never;
58
+ target?: never;
59
+ inout?: never;
60
+ incoming?: never;
61
+ outgoing?: never;
62
+ customRelation?: never;
63
+ }
64
+ interface ElementRefExpr extends Omit<BaseExpr, 'element' | 'isChildren' | 'isDescendants'> {
65
+ element: Fqn;
66
+ isChildren?: boolean;
67
+ isDescendants?: boolean;
68
+ }
69
+ declare function isElementRef(expr: Expression): expr is ElementRefExpr;
70
+ interface ExpandedElementExpr extends Omit<BaseExpr, 'expanded'> {
71
+ expanded: Fqn;
72
+ }
73
+ declare function isExpandedElementExpr(expr: Expression): expr is ExpandedElementExpr;
74
+ interface CustomElementExpr extends Omit<BaseExpr, 'custom'> {
75
+ custom: {
76
+ expr: ElementExpression | ElementWhereExpr;
77
+ title?: string;
78
+ description?: string;
79
+ technology?: string;
80
+ notation?: string;
81
+ shape?: ElementShape;
82
+ color?: Color;
83
+ icon?: IconUrl;
84
+ border?: BorderStyle;
85
+ opacity?: number;
86
+ navigateTo?: ViewId;
87
+ };
88
+ }
89
+ declare function isCustomElement(expr: Expression): expr is CustomElementExpr;
90
+ interface WildcardExpr extends Omit<BaseExpr, 'wildcard'> {
91
+ wildcard: true;
92
+ }
93
+ declare function isWildcard(expr: Expression): expr is WildcardExpr;
94
+ interface ElementKindExpr extends Omit<BaseExpr, 'elementKind' | 'isEqual'> {
95
+ elementKind: ElementKind;
96
+ isEqual: boolean;
97
+ }
98
+ declare function isElementKindExpr(expr: Expression): expr is ElementKindExpr;
99
+ interface ElementTagExpr extends Omit<BaseExpr, 'elementTag' | 'isEqual'> {
100
+ elementTag: Tag;
101
+ isEqual: boolean;
102
+ }
103
+ declare function isElementTagExpr(expr: Expression): expr is ElementTagExpr;
104
+ type NonWilcard = ElementRefExpr | ElementKindExpr | ElementTagExpr | ExpandedElementExpr;
105
+ type ElementExpression = NonWilcard | WildcardExpr;
106
+ declare function isElement(expr: Expression): expr is ElementExpression;
107
+ interface ElementWhereExpr extends Omit<BaseExpr, 'where'> {
108
+ where: {
109
+ expr: ElementExpression;
110
+ condition: WhereOperator<string, string>;
111
+ };
112
+ }
113
+ declare function isElementWhere(expr: Expression): expr is ElementWhereExpr;
114
+ type ElementPredicateExpression = ElementExpression | ElementWhereExpr | CustomElementExpr;
115
+ declare function isElementPredicateExpr(expr: Expression): expr is ElementPredicateExpression;
116
+ interface DirectRelationExpr extends Omit<BaseExpr, 'source' | 'target'> {
117
+ source: ElementExpression;
118
+ target: ElementExpression;
119
+ isBidirectional?: boolean;
120
+ }
121
+ declare function isRelation(expr: Expression): expr is DirectRelationExpr;
122
+ interface InOutExpr extends Omit<BaseExpr, 'inout'> {
123
+ inout: ElementExpression;
124
+ }
125
+ declare function isInOut(expr: Expression): expr is InOutExpr;
126
+ interface IncomingExpr extends Omit<BaseExpr, 'incoming'> {
127
+ incoming: ElementExpression;
128
+ }
129
+ declare function isIncoming(expr: Expression): expr is IncomingExpr;
130
+ interface OutgoingExpr extends Omit<BaseExpr, 'outgoing'> {
131
+ outgoing: ElementExpression;
132
+ }
133
+ declare function isOutgoing(expr: Expression): expr is OutgoingExpr;
134
+ type RelationExpression = DirectRelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
135
+ declare function isRelationExpression(expr: Expression): expr is RelationExpression;
136
+ interface RelationWhereExpr extends Omit<BaseExpr, 'where'> {
137
+ where: {
138
+ expr: RelationExpression;
139
+ condition: WhereOperator<string, string>;
140
+ };
141
+ }
142
+ declare function isRelationWhere(expr: Expression): expr is RelationWhereExpr;
143
+ interface CustomRelationExpr extends Omit<BaseExpr, 'customRelation'> {
144
+ customRelation: {
145
+ relation: RelationExpression | RelationWhereExpr;
146
+ title?: string;
147
+ description?: string;
148
+ technology?: string;
149
+ notation?: string;
150
+ navigateTo?: ViewId;
151
+ notes?: string;
152
+ color?: Color;
153
+ line?: RelationshipLineType;
154
+ head?: RelationshipArrowType;
155
+ tail?: RelationshipArrowType;
156
+ };
157
+ }
158
+ declare function isCustomRelationExpr(expr: Expression): expr is CustomRelationExpr;
159
+ type RelationPredicateExpression = RelationExpression | RelationWhereExpr | CustomRelationExpr;
160
+ declare function isRelationPredicateExpr(expr: Expression): expr is RelationPredicateExpression;
161
+ type Expression = ElementPredicateExpression | RelationPredicateExpression;
162
+
163
+ type expression_CustomElementExpr = CustomElementExpr;
164
+ type expression_CustomRelationExpr = CustomRelationExpr;
165
+ type expression_DirectRelationExpr = DirectRelationExpr;
166
+ type expression_ElementExpression = ElementExpression;
167
+ type expression_ElementKindExpr = ElementKindExpr;
168
+ type expression_ElementPredicateExpression = ElementPredicateExpression;
169
+ type expression_ElementRefExpr = ElementRefExpr;
170
+ type expression_ElementTagExpr = ElementTagExpr;
171
+ type expression_ElementWhereExpr = ElementWhereExpr;
172
+ type expression_ExpandedElementExpr = ExpandedElementExpr;
173
+ type expression_Expression = Expression;
174
+ type expression_InOutExpr = InOutExpr;
175
+ type expression_IncomingExpr = IncomingExpr;
176
+ type expression_NonWilcard = NonWilcard;
177
+ type expression_OutgoingExpr = OutgoingExpr;
178
+ type expression_RelationExpression = RelationExpression;
179
+ type expression_RelationPredicateExpression = RelationPredicateExpression;
180
+ type expression_RelationWhereExpr = RelationWhereExpr;
181
+ type expression_WildcardExpr = WildcardExpr;
182
+ declare const expression_isCustomElement: typeof isCustomElement;
183
+ declare const expression_isCustomRelationExpr: typeof isCustomRelationExpr;
184
+ declare const expression_isElement: typeof isElement;
185
+ declare const expression_isElementKindExpr: typeof isElementKindExpr;
186
+ declare const expression_isElementPredicateExpr: typeof isElementPredicateExpr;
187
+ declare const expression_isElementRef: typeof isElementRef;
188
+ declare const expression_isElementTagExpr: typeof isElementTagExpr;
189
+ declare const expression_isElementWhere: typeof isElementWhere;
190
+ declare const expression_isExpandedElementExpr: typeof isExpandedElementExpr;
191
+ declare const expression_isInOut: typeof isInOut;
192
+ declare const expression_isIncoming: typeof isIncoming;
193
+ declare const expression_isOutgoing: typeof isOutgoing;
194
+ declare const expression_isRelation: typeof isRelation;
195
+ declare const expression_isRelationExpression: typeof isRelationExpression;
196
+ declare const expression_isRelationPredicateExpr: typeof isRelationPredicateExpr;
197
+ declare const expression_isRelationWhere: typeof isRelationWhere;
198
+ declare const expression_isWildcard: typeof isWildcard;
199
+ declare namespace expression {
200
+ export { type expression_CustomElementExpr as CustomElementExpr, type expression_CustomRelationExpr as CustomRelationExpr, type expression_DirectRelationExpr as DirectRelationExpr, type expression_ElementExpression as ElementExpression, type expression_ElementKindExpr as ElementKindExpr, type expression_ElementPredicateExpression as ElementPredicateExpression, type expression_ElementRefExpr as ElementRefExpr, type expression_ElementTagExpr as ElementTagExpr, type expression_ElementWhereExpr as ElementWhereExpr, type expression_ExpandedElementExpr as ExpandedElementExpr, type expression_Expression as Expression, type expression_InOutExpr as InOutExpr, type expression_IncomingExpr as IncomingExpr, type expression_NonWilcard as NonWilcard, type expression_OutgoingExpr as OutgoingExpr, type expression_RelationExpression as RelationExpression, type expression_RelationPredicateExpression as RelationPredicateExpression, type expression_RelationWhereExpr as RelationWhereExpr, type expression_WildcardExpr as WildcardExpr, expression_isCustomElement as isCustomElement, expression_isCustomRelationExpr as isCustomRelationExpr, expression_isElement as isElement, expression_isElementKindExpr as isElementKindExpr, expression_isElementPredicateExpr as isElementPredicateExpr, expression_isElementRef as isElementRef, expression_isElementTagExpr as isElementTagExpr, expression_isElementWhere as isElementWhere, expression_isExpandedElementExpr as isExpandedElementExpr, expression_isInOut as isInOut, expression_isIncoming as isIncoming, expression_isOutgoing as isOutgoing, expression_isRelation as isRelation, expression_isRelationExpression as isRelationExpression, expression_isRelationPredicateExpr as isRelationPredicateExpr, expression_isRelationWhere as isRelationWhere, expression_isWildcard as isWildcard };
201
+ }
202
+
203
+ declare namespace FqnRef {
204
+ /**
205
+ * Represents a reference to an instance within a deployment.
206
+ *
207
+ * @template D - The type representing the deployment fqn. Defaults to `Fqn`.
208
+ * @template M - The type representing the model fqn. Defaults to `Fqn`.
209
+ *
210
+ * @property {D} deployment - TThe fully qualified name (FQN) of the deployed instance.
211
+ * @property {M} element - The element reference within the deployment.
212
+ */
213
+ type InsideInstanceRef<D = Fqn, M = Fqn> = {
214
+ deployment: D;
215
+ element: M;
216
+ };
217
+ const isInsideInstanceRef: (ref: FqnRef) => ref is InsideInstanceRef;
218
+ /**
219
+ * Represents a reference to a deployment element.
220
+ *
221
+ * @template F - The type of the fully qualified name (FQN) of the deployment element. Defaults to `Fqn`.
222
+ * @property {F} deployment - The fully qualified name (FQN) of the deployment element.
223
+ */
224
+ type DeploymentElementRef<F = Fqn> = {
225
+ deployment: F;
226
+ };
227
+ const isDeploymentElementRef: (ref: FqnRef) => ref is DeploymentElementRef;
228
+ type DeploymentRef<D = Fqn, M = Fqn> = DeploymentElementRef<D> | InsideInstanceRef<D, M>;
229
+ const isDeploymentRef: (ref: FqnRef) => ref is DeploymentRef;
230
+ /**
231
+ * Reference to logical model element
232
+ */
233
+ type ModelRef<F = Fqn> = {
234
+ model: F;
235
+ };
236
+ const isModelRef: (ref: FqnRef) => ref is ModelRef;
237
+ const toDeploymentRef: (ref: FqnRef) => DeploymentRef;
238
+ }
239
+ type FqnRef<D = Fqn, M = Fqn> = ExclusiveUnion<{
240
+ InsideInstanceRef: FqnRef.InsideInstanceRef<D, M>;
241
+ DeploymentRef: FqnRef.DeploymentRef<D>;
242
+ ModelRef: FqnRef.ModelRef<M>;
243
+ }>;
244
+ declare namespace FqnExpr {
245
+ type Wildcard = {
246
+ wildcard: true;
247
+ };
248
+ const isWildcard: (expr: ExpressionV2) => expr is Wildcard;
249
+ type ModelRef<M = Fqn> = {
250
+ ref: FqnRef.ModelRef<M>;
251
+ selector?: PredicateSelector;
252
+ };
253
+ const isModelRef: (ref: ExpressionV2) => ref is ModelRef;
254
+ type DeploymentRef<D = Fqn, M = Fqn> = {
255
+ ref: FqnRef.DeploymentRef<D> | FqnRef.InsideInstanceRef<D, M>;
256
+ selector?: PredicateSelector;
257
+ };
258
+ const isDeploymentRef: (ref: ExpressionV2) => ref is FqnExpr.DeploymentRef;
259
+ type NonWildcard<D = Fqn, M = Fqn> = ExclusiveUnion<{
260
+ ModelRef: ModelRef<M>;
261
+ DeploymentRef: DeploymentRef<D, M>;
262
+ }>;
263
+ }
264
+ type FqnExpr<D = Fqn, M = Fqn> = ExclusiveUnion<{
265
+ Wildcard: FqnExpr.Wildcard;
266
+ ModelRef: FqnExpr.ModelRef<M>;
267
+ DeploymentRef: FqnExpr.DeploymentRef<D, M>;
268
+ }>;
269
+ declare namespace RelationExpr {
270
+ type Direct<D = Fqn, M = Fqn> = {
271
+ source: FqnExpr<D, M>;
272
+ target: FqnExpr<D, M>;
273
+ isBidirectional?: boolean;
274
+ };
275
+ const isDirect: (expr: ExpressionV2) => expr is Direct;
276
+ type Incoming<D = Fqn, M = Fqn> = {
277
+ incoming: FqnExpr<D, M>;
278
+ };
279
+ const isIncoming: (expr: ExpressionV2) => expr is Incoming;
280
+ type Outgoing<D = Fqn, M = Fqn> = {
281
+ outgoing: FqnExpr<D, M>;
282
+ };
283
+ const isOutgoing: (expr: ExpressionV2) => expr is Outgoing;
284
+ type InOut<D = Fqn, M = Fqn> = {
285
+ inout: FqnExpr<D, M>;
286
+ };
287
+ const isInOut: (expr: ExpressionV2) => expr is InOut;
288
+ }
289
+ type RelationExpr<D = Fqn, M = Fqn> = ExclusiveUnion<{
290
+ Direct: RelationExpr.Direct<D, M>;
291
+ Incoming: RelationExpr.Incoming<D, M>;
292
+ Outgoing: RelationExpr.Outgoing<D, M>;
293
+ InOut: RelationExpr.InOut<D, M>;
294
+ }>;
295
+ /**
296
+ * Represents a version 2 expression which can be one of several types.
297
+ *
298
+ * @template D - The type for the deployment FQN, defaults to `Fqn`.
299
+ * @template M - The type for the model FQN, defaults to `Fqn`.
300
+ */
301
+ type ExpressionV2<D = Fqn, M = Fqn> = ExclusiveUnion<{
302
+ Wildcard: FqnExpr.Wildcard;
303
+ ModelRef: FqnExpr.ModelRef<M>;
304
+ DeploymentRef: FqnExpr.DeploymentRef<D, M>;
305
+ Direct: RelationExpr.Direct<D, M>;
306
+ Incoming: RelationExpr.Incoming<D, M>;
307
+ Outgoing: RelationExpr.Outgoing<D, M>;
308
+ InOut: RelationExpr.InOut<D, M>;
309
+ }>;
310
+ declare namespace ExpressionV2 {
311
+ const isFqnExpr: (expr: ExpressionV2) => expr is FqnExpr;
312
+ const isRelation: (expr: ExpressionV2) => expr is RelationExpr;
313
+ }
314
+
145
315
  type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
146
316
  type GlobalPredicates = NonEmptyArray<ViewRulePredicate>;
147
317
  type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>;
148
318
  type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
149
319
  type GlobalStyles = NonEmptyTuple<ViewRuleStyle>;
150
320
  interface ModelGlobals {
151
- predicates: Record<GlobalPredicateId, GlobalPredicates>;
152
- dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
153
- styles: Record<GlobalStyleID, GlobalStyles>;
321
+ readonly predicates: Record<GlobalPredicateId, GlobalPredicates>;
322
+ readonly dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
323
+ readonly styles: Record<GlobalStyleID, GlobalStyles>;
154
324
  }
155
325
 
156
326
  type ElementNotation = {
157
- kinds: ElementKind[];
327
+ kinds: string[];
158
328
  shape: ElementShape;
159
329
  color: Color;
160
330
  title: string;
161
331
  };
162
332
 
163
- type ViewID<Id extends string = string> = Tagged<Id, 'ViewID'>;
333
+ type ViewId<Id extends string = string> = Tagged<Id, 'ViewID'>;
164
334
  type ViewRulePredicate = {
165
335
  include: Expression[];
166
336
  exclude?: never;
@@ -168,6 +338,8 @@ type ViewRulePredicate = {
168
338
  include?: never;
169
339
  exclude: Expression[];
170
340
  };
341
+ declare function isViewRulePredicate(rule: DeploymentViewRule): rule is DeploymentViewRulePredicate;
342
+ declare function isViewRulePredicate(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
171
343
  declare function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate;
172
344
  interface ViewRuleGlobalPredicateRef {
173
345
  predicateId: GlobalPredicateId;
@@ -182,6 +354,7 @@ interface ViewRuleStyle {
182
354
  icon?: IconUrl;
183
355
  };
184
356
  }
357
+ declare function isViewRuleStyle(rule: DeploymentViewRule): rule is DeploymentViewRuleStyle;
185
358
  declare function isViewRuleStyle(rule: ViewRule): rule is ViewRuleStyle;
186
359
  interface ViewRuleGlobalStyle {
187
360
  styleId: GlobalStyleID;
@@ -195,7 +368,7 @@ interface ViewRuleAutoLayout {
195
368
  nodeSep?: number;
196
369
  rankSep?: number;
197
370
  }
198
- declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
371
+ declare function isViewRuleAutoLayout(rule: DeploymentViewRule | DynamicViewRule | ViewRule): rule is ViewRuleAutoLayout;
199
372
  interface ViewRuleGroup {
200
373
  groupRules: Array<ViewRulePredicate | ViewRuleGroup>;
201
374
  title: string | null;
@@ -205,9 +378,9 @@ interface ViewRuleGroup {
205
378
  }
206
379
  declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
207
380
  type ViewRule = ViewRulePredicate | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
208
- interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
381
+ interface BasicView<ViewType extends 'element' | 'dynamic' | 'deployment', ViewIDs extends string, Tags extends string> {
209
382
  readonly __?: ViewType;
210
- readonly id: ViewID<ViewIDs>;
383
+ readonly id: ViewId<ViewIDs>;
211
384
  readonly title: string | null;
212
385
  readonly description: string | null;
213
386
  readonly tags: NonEmptyArray<Tag<Tags>> | null;
@@ -240,7 +413,7 @@ interface ScopedElementView<ViewIDs extends string, Tags extends string> extends
240
413
  readonly viewOf: Fqn;
241
414
  }
242
415
  interface ExtendsElementView<ViewIDs extends string, Tags extends string> extends BasicElementView<ViewIDs, Tags> {
243
- readonly extends: ViewID<ViewIDs>;
416
+ readonly extends: ViewId<ViewIDs>;
244
417
  }
245
418
  type ElementView<ViewIDs extends string = string, Tags extends string = string> = ScopedElementView<ViewIDs, Tags> | ExtendsElementView<ViewIDs, Tags> | BasicElementView<ViewIDs, Tags>;
246
419
  interface DynamicViewStep {
@@ -256,7 +429,7 @@ interface DynamicViewStep {
256
429
  readonly head?: RelationshipArrowType;
257
430
  readonly tail?: RelationshipArrowType;
258
431
  readonly isBackward?: boolean;
259
- readonly navigateTo?: ViewID;
432
+ readonly navigateTo?: ViewId;
260
433
  __parallel?: never;
261
434
  }
262
435
  interface DynamicViewParallelSteps {
@@ -266,7 +439,6 @@ type DynamicViewStepOrParallel = DynamicViewStep | DynamicViewParallelSteps;
266
439
  type DynamicViewIncludeRule = {
267
440
  include: ElementPredicateExpression[];
268
441
  };
269
- declare function isDynamicViewIncludeRule(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
270
442
  type DynamicViewRule = DynamicViewIncludeRule | ViewRuleGlobalPredicateRef | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
271
443
  interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'dynamic', ViewIDs, Tags> {
272
444
  readonly __: 'dynamic';
@@ -277,7 +449,32 @@ declare function isDynamicViewParallelSteps(step: DynamicViewStepOrParallel): st
277
449
  type CustomColorDefinitions = {
278
450
  [key: string]: ThemeColorValues;
279
451
  };
280
- type LikeC4View<ViewIDs extends string = string, Tags extends string = string> = ElementView<ViewIDs, Tags> | DynamicView<ViewIDs, Tags>;
452
+ type DeploymentViewRulePredicate = {
453
+ include: ExpressionV2[];
454
+ exclude?: never;
455
+ } | {
456
+ include?: never;
457
+ exclude: ExpressionV2[];
458
+ };
459
+ type DeploymentViewRuleStyle = {
460
+ targets: FqnExpr[];
461
+ notation?: string;
462
+ style: ElementStyle & {
463
+ color?: Color;
464
+ shape?: ElementShape;
465
+ icon?: IconUrl;
466
+ };
467
+ };
468
+ type DeploymentViewRule = DeploymentViewRulePredicate | ViewRuleAutoLayout | DeploymentViewRuleStyle;
469
+ interface DeploymentView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'deployment', ViewIDs, Tags> {
470
+ readonly __: 'deployment';
471
+ readonly rules: DeploymentViewRule[];
472
+ }
473
+ type LikeC4View<ViewIDs extends string = string, Tags extends string = string> = ElementView<ViewIDs, Tags> | DynamicView<ViewIDs, Tags> | DeploymentView<ViewIDs, Tags>;
474
+ declare function isDeploymentView(view: LikeC4View): view is DeploymentView;
475
+ declare function isDeploymentView<V extends {
476
+ __?: string;
477
+ }>(view: V): boolean;
281
478
  declare function isDynamicView(view: LikeC4View): view is DynamicView;
282
479
  declare function isElementView(view: LikeC4View): view is ElementView;
283
480
  declare function isExtendsElementView(view: LikeC4View): view is ExtendsElementView<string, string>;
@@ -286,14 +483,24 @@ type NodeId<IDs extends string = string> = Tagged<IDs, 'Fqn'>;
286
483
  type EdgeId = Tagged<string, 'EdgeId'>;
287
484
  type StepEdgeIdLiteral = `step-${number}` | `step-${number}.${number}`;
288
485
  type StepEdgeId = Tagged<StepEdgeIdLiteral, 'EdgeId'>;
289
- declare function StepEdgeId(step: number, parallelStep?: number): StepEdgeId;
486
+ declare function stepEdgeId(step: number, parallelStep?: number): StepEdgeId;
290
487
  declare function isStepEdgeId(id: string): id is StepEdgeId;
291
488
  declare function extractStep(id: EdgeId): number;
292
489
  declare function getParallelStepsPrefix(id: string): string | null;
293
490
  interface ComputedNode {
294
491
  id: NodeId;
295
- kind: ElementKind;
492
+ kind: string;
296
493
  parent: NodeId | null;
494
+ /**
495
+ * Reference to model element
496
+ * If 1 - node id is a reference
497
+ */
498
+ modelRef?: 1 | Fqn;
499
+ /**
500
+ * Reference to deployment element
501
+ * If 1 - node id is a reference
502
+ */
503
+ deploymentRef?: 1 | Fqn;
297
504
  title: string;
298
505
  description: string | null;
299
506
  technology: string | null;
@@ -304,16 +511,13 @@ interface ComputedNode {
304
511
  inEdges: EdgeId[];
305
512
  outEdges: EdgeId[];
306
513
  shape: ElementShape;
307
- /**
308
- * @deprecated Use `style` instead
309
- */
310
514
  color: Color;
311
515
  /**
312
516
  * @deprecated Use `style` instead
313
517
  */
314
518
  icon?: IconUrl;
315
519
  style: ElementStyle;
316
- navigateTo?: ViewID;
520
+ navigateTo?: ViewId;
317
521
  level: number;
318
522
  depth?: number;
319
523
  /**
@@ -322,6 +526,8 @@ interface ComputedNode {
322
526
  isCustomized?: boolean;
323
527
  }
324
528
  declare namespace ComputedNode {
529
+ function modelRef(node: ComputedNode): Fqn | null;
530
+ function deploymentRef(node: ComputedNode): Fqn | null;
325
531
  /**
326
532
  * Nodes group is a special kind of node, exisiting only in view
327
533
  */
@@ -335,7 +541,7 @@ interface ComputedEdge {
335
541
  label: string | null;
336
542
  description?: string;
337
543
  technology?: string;
338
- relations: RelationID[];
544
+ relations: RelationId[];
339
545
  kind?: RelationshipKind;
340
546
  notation?: string;
341
547
  notes?: string;
@@ -344,7 +550,7 @@ interface ComputedEdge {
344
550
  head?: RelationshipArrowType;
345
551
  tail?: RelationshipArrowType;
346
552
  tags?: NonEmptyArray<Tag>;
347
- navigateTo?: ViewID;
553
+ navigateTo?: ViewId;
348
554
  /**
349
555
  * If this edge is derived from custom relationship predicate
350
556
  */
@@ -353,7 +559,7 @@ interface ComputedEdge {
353
559
  * For layouting purposes
354
560
  * @default 'forward'
355
561
  */
356
- dir?: 'forward' | 'back';
562
+ dir?: 'forward' | 'back' | 'both';
357
563
  }
358
564
  interface ViewWithHash {
359
565
  /**
@@ -373,7 +579,7 @@ interface ViewAutoLayout {
373
579
  nodeSep?: number;
374
580
  }
375
581
  interface ComputedElementView<ViewIDs extends string = string, Tags extends string = string> extends Omit<ElementView<ViewIDs, Tags>, 'rules' | 'docUri'>, ViewWithHash, ViewWithNotation {
376
- readonly extends?: ViewID<ViewIDs>;
582
+ readonly extends?: ViewId<ViewIDs>;
377
583
  readonly autoLayout: ViewAutoLayout;
378
584
  readonly nodes: ComputedNode[];
379
585
  readonly edges: ComputedEdge[];
@@ -388,16 +594,26 @@ interface ComputedDynamicView<ViewIDs extends string = string, Tags extends stri
388
594
  rules?: never;
389
595
  docUri?: never;
390
596
  }
391
- declare function isComputedDynamicView(view: ComputedView): view is ComputedDynamicView;
392
- type ComputedView<ViewIDs extends string = string, Tags extends string = string> = ComputedElementView<ViewIDs, Tags> | ComputedDynamicView<ViewIDs, Tags>;
393
- declare function isComputedElementView(view: ComputedView): view is ComputedElementView;
597
+ interface ComputedDeploymentView<ViewIDs extends string = string, Tags extends string = string> extends Omit<DeploymentView<ViewIDs, Tags>, 'rules' | 'docUri'>, ViewWithHash, ViewWithNotation {
598
+ readonly autoLayout: ViewAutoLayout;
599
+ readonly nodes: ComputedNode[];
600
+ readonly edges: ComputedEdge[];
601
+ rules?: never;
602
+ docUri?: never;
603
+ }
604
+ type ComputedView<ViewIDs extends string = string, Tags extends string = string> = ComputedElementView<ViewIDs, Tags> | ComputedDynamicView<ViewIDs, Tags> | ComputedDeploymentView<ViewIDs, Tags>;
605
+ declare namespace ComputedView {
606
+ function isDeployment(view: ComputedView): view is ComputedDeploymentView;
607
+ function isDynamic(view: ComputedView): view is ComputedDynamicView;
608
+ function isElement(view: ComputedView): view is ComputedElementView;
609
+ }
394
610
  type BBox = {
395
611
  x: number;
396
612
  y: number;
397
613
  width: number;
398
614
  height: number;
399
615
  };
400
- declare function getBBoxCenter({ x, y, width, height }: BBox): XYPoint;
616
+ declare function getBBoxCenter({ x, y, width, height, }: BBox): XYPoint;
401
617
  interface DiagramNode extends ComputedNode {
402
618
  width: number;
403
619
  height: number;
@@ -405,6 +621,8 @@ interface DiagramNode extends ComputedNode {
405
621
  labelBBox: BBox;
406
622
  }
407
623
  declare namespace DiagramNode {
624
+ function modelRef(node: DiagramNode): Fqn | null;
625
+ function deploymentRef(node: DiagramNode): Fqn | null;
408
626
  /**
409
627
  * Nodes group is a special kind of node, exisiting only in view
410
628
  */
@@ -449,32 +667,35 @@ type ViewManualLayout = {
449
667
  }>;
450
668
  };
451
669
 
452
- type RelationID = Tagged<string, 'RelationID'>;
670
+ type RelationId = Tagged<string, 'RelationID'>;
453
671
  type RelationshipKind<Kinds extends string = string> = Tagged<Kinds, 'RelationshipKind'>;
454
672
  type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
455
673
  type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'dot' | 'odot' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
456
- declare const DefaultLineStyle = "dashed";
457
- declare const DefaultArrowType = "normal";
458
- declare const DefaultRelationshipColor = "gray";
459
- interface Relation {
460
- readonly id: RelationID;
461
- readonly source: Fqn;
462
- readonly target: Fqn;
463
- readonly title: string;
674
+ declare const DefaultLineStyle: RelationshipLineType;
675
+ declare const DefaultArrowType: RelationshipArrowType;
676
+ declare const DefaultRelationshipColor: ThemeColor;
677
+ interface AbstractRelation {
678
+ readonly id: RelationId;
679
+ readonly title?: string;
464
680
  readonly description?: string;
465
681
  readonly technology?: string;
466
- readonly tags?: NonEmptyArray<Tag>;
682
+ readonly tags?: NonEmptyArray<Tag> | null;
467
683
  readonly kind?: RelationshipKind;
468
684
  readonly color?: Color;
469
685
  readonly line?: RelationshipLineType;
470
686
  readonly head?: RelationshipArrowType;
471
687
  readonly tail?: RelationshipArrowType;
472
- readonly links?: NonEmptyArray<Link>;
473
- readonly navigateTo?: ViewID;
688
+ readonly links?: NonEmptyArray<Link> | null;
689
+ readonly navigateTo?: ViewId;
474
690
  readonly metadata?: {
475
691
  [key: string]: string;
476
692
  };
477
693
  }
694
+ interface ModelRelation extends AbstractRelation {
695
+ readonly source: Fqn;
696
+ readonly target: Fqn;
697
+ readonly title: string;
698
+ }
478
699
  interface RelationshipKindSpecification {
479
700
  readonly technology?: string;
480
701
  readonly notation?: string;
@@ -484,251 +705,128 @@ interface RelationshipKindSpecification {
484
705
  readonly tail?: RelationshipArrowType;
485
706
  }
486
707
 
487
- interface BaseExpr {
488
- where?: never;
489
- element?: never;
490
- custom?: never;
491
- expanded?: never;
492
- elementKind?: never;
493
- elementTag?: never;
494
- isEqual?: never;
495
- isDescedants?: never;
496
- wildcard?: never;
497
- source?: never;
498
- target?: never;
499
- inout?: never;
500
- incoming?: never;
501
- outgoing?: never;
502
- customRelation?: never;
503
- }
504
- interface ElementRefExpr extends Omit<BaseExpr, 'element' | 'isDescedants'> {
505
- element: Fqn;
506
- isDescedants?: boolean;
507
- }
508
- declare function isElementRef(expr: Expression): expr is ElementRefExpr;
509
- interface ExpandedElementExpr extends Omit<BaseExpr, 'expanded'> {
510
- expanded: Fqn;
511
- }
512
- declare function isExpandedElementExpr(expr: Expression): expr is ExpandedElementExpr;
513
- interface CustomElementExpr extends Omit<BaseExpr, 'custom'> {
514
- custom: {
515
- expr: ElementExpression | ElementWhereExpr;
516
- title?: string;
517
- description?: string;
518
- technology?: string;
519
- notation?: string;
520
- shape?: ElementShape;
521
- color?: Color;
522
- icon?: IconUrl;
523
- border?: BorderStyle;
524
- opacity?: number;
525
- navigateTo?: ViewID;
526
- };
527
- }
528
- declare function isCustomElement(expr: Expression): expr is CustomElementExpr;
529
- interface WildcardExpr extends Omit<BaseExpr, 'wildcard'> {
530
- wildcard: true;
531
- }
532
- declare function isWildcard(expr: Expression): expr is WildcardExpr;
533
- interface ElementKindExpr extends Omit<BaseExpr, 'elementKind' | 'isEqual'> {
534
- elementKind: ElementKind;
535
- isEqual: boolean;
536
- }
537
- declare function isElementKindExpr(expr: Expression): expr is ElementKindExpr;
538
- interface ElementTagExpr extends Omit<BaseExpr, 'elementTag' | 'isEqual'> {
539
- elementTag: Tag;
540
- isEqual: boolean;
541
- }
542
- declare function isElementTagExpr(expr: Expression): expr is ElementTagExpr;
543
- type ElementExpression = ElementRefExpr | WildcardExpr | ElementKindExpr | ElementTagExpr | ExpandedElementExpr;
544
- declare function isElement(expr: Expression): expr is ElementExpression;
545
- interface ElementWhereExpr extends Omit<BaseExpr, 'where'> {
546
- where: {
547
- expr: ElementExpression;
548
- condition: WhereOperator<string, string>;
549
- };
550
- }
551
- declare function isElementWhere(expr: Expression): expr is ElementWhereExpr;
552
- type ElementPredicateExpression = ElementExpression | ElementWhereExpr | CustomElementExpr;
553
- declare function isElementPredicateExpr(expr: Expression): expr is ElementPredicateExpression;
554
- interface RelationExpr extends Omit<BaseExpr, 'source' | 'target'> {
555
- source: ElementExpression;
556
- target: ElementExpression;
557
- isBidirectional?: boolean;
558
- }
559
- declare function isRelation(expr: Expression): expr is RelationExpr;
560
- interface InOutExpr extends Omit<BaseExpr, 'inout'> {
561
- inout: ElementExpression;
708
+ type DeploymentNodeKind<Kinds extends string = string> = Tagged<Kinds, 'DeploymentNodeKind'>;
709
+ type DeploymentElementStyle = ElementStyle & {
710
+ readonly icon?: IconUrl;
711
+ readonly shape?: ElementShape;
712
+ readonly color?: Color;
713
+ };
714
+ interface DeploymentNodeKindSpecification {
715
+ readonly technology?: string;
716
+ readonly notation?: string;
717
+ readonly style: DeploymentElementStyle;
562
718
  }
563
- declare function isInOut(expr: Expression): expr is InOutExpr;
564
- interface IncomingExpr extends Omit<BaseExpr, 'incoming'> {
565
- incoming: ElementExpression;
719
+ interface DeploymentNode {
720
+ readonly id: Fqn;
721
+ readonly kind: DeploymentNodeKind;
722
+ readonly title: string;
723
+ readonly description?: string | null;
724
+ readonly technology?: string | null;
725
+ readonly tags?: NonEmptyArray<Tag> | null;
726
+ readonly links?: NonEmptyArray<Link> | null;
727
+ readonly style?: DeploymentElementStyle;
728
+ readonly notation?: string;
729
+ readonly metadata?: Record<string, string>;
566
730
  }
567
- declare function isIncoming(expr: Expression): expr is IncomingExpr;
568
- interface OutgoingExpr extends Omit<BaseExpr, 'outgoing'> {
569
- outgoing: ElementExpression;
731
+ interface DeployedInstance {
732
+ /**
733
+ * Format: `<DeploymentNode Fqn>.<Instance Id>`
734
+ * i.e parent fqn is deployment target
735
+ */
736
+ readonly id: Fqn;
737
+ readonly element: Fqn;
738
+ readonly title?: string;
739
+ readonly description?: string | null;
740
+ readonly technology?: string | null;
741
+ readonly tags?: NonEmptyArray<Tag> | null;
742
+ readonly links?: NonEmptyArray<Link> | null;
743
+ readonly style?: DeploymentElementStyle;
744
+ readonly notation?: string;
745
+ readonly metadata?: Record<string, string>;
570
746
  }
571
- declare function isOutgoing(expr: Expression): expr is OutgoingExpr;
572
- type RelationExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
573
- declare function isRelationExpression(expr: Expression): expr is RelationExpression;
574
- interface RelationWhereExpr extends Omit<BaseExpr, 'where'> {
575
- where: {
576
- expr: RelationExpression;
577
- condition: WhereOperator<string, string>;
578
- };
747
+ type DeploymentElement = Simplify<MergeExclusive<DeploymentNode, DeployedInstance>>;
748
+ declare namespace DeploymentElement {
749
+ const isDeploymentNode: (el: DeploymentElement) => el is DeploymentNode;
750
+ const isInstance: (el: DeploymentElement) => el is DeployedInstance;
579
751
  }
580
- declare function isRelationWhere(expr: Expression): expr is RelationWhereExpr;
581
- interface CustomRelationExpr extends Omit<BaseExpr, 'customRelation'> {
582
- customRelation: {
583
- relation: RelationExpression | RelationWhereExpr;
584
- title?: string;
585
- description?: string;
586
- technology?: string;
587
- notation?: string;
588
- navigateTo?: ViewID;
589
- notes?: string;
590
- color?: Color;
591
- line?: RelationshipLineType;
592
- head?: RelationshipArrowType;
593
- tail?: RelationshipArrowType;
594
- };
752
+ type PredicateSelector = 'children' | 'expanded' | 'descendants';
753
+ interface DeploymentRef {
754
+ readonly id: Fqn;
755
+ readonly element?: Fqn;
595
756
  }
596
- declare function isCustomRelationExpr(expr: Expression): expr is CustomRelationExpr;
597
- type RelationPredicateExpression = RelationExpression | RelationWhereExpr | CustomRelationExpr;
598
- declare function isRelationPredicateExpr(expr: Expression): expr is RelationPredicateExpression;
599
- type Expression = ElementPredicateExpression | RelationPredicateExpression;
600
-
601
- type expression_CustomElementExpr = CustomElementExpr;
602
- type expression_CustomRelationExpr = CustomRelationExpr;
603
- type expression_ElementExpression = ElementExpression;
604
- type expression_ElementKindExpr = ElementKindExpr;
605
- type expression_ElementPredicateExpression = ElementPredicateExpression;
606
- type expression_ElementRefExpr = ElementRefExpr;
607
- type expression_ElementTagExpr = ElementTagExpr;
608
- type expression_ElementWhereExpr = ElementWhereExpr;
609
- type expression_ExpandedElementExpr = ExpandedElementExpr;
610
- type expression_Expression = Expression;
611
- type expression_InOutExpr = InOutExpr;
612
- type expression_IncomingExpr = IncomingExpr;
613
- type expression_OutgoingExpr = OutgoingExpr;
614
- type expression_RelationExpr = RelationExpr;
615
- type expression_RelationExpression = RelationExpression;
616
- type expression_RelationPredicateExpression = RelationPredicateExpression;
617
- type expression_RelationWhereExpr = RelationWhereExpr;
618
- type expression_WildcardExpr = WildcardExpr;
619
- declare const expression_isCustomElement: typeof isCustomElement;
620
- declare const expression_isCustomRelationExpr: typeof isCustomRelationExpr;
621
- declare const expression_isElement: typeof isElement;
622
- declare const expression_isElementKindExpr: typeof isElementKindExpr;
623
- declare const expression_isElementPredicateExpr: typeof isElementPredicateExpr;
624
- declare const expression_isElementRef: typeof isElementRef;
625
- declare const expression_isElementTagExpr: typeof isElementTagExpr;
626
- declare const expression_isElementWhere: typeof isElementWhere;
627
- declare const expression_isExpandedElementExpr: typeof isExpandedElementExpr;
628
- declare const expression_isInOut: typeof isInOut;
629
- declare const expression_isIncoming: typeof isIncoming;
630
- declare const expression_isOutgoing: typeof isOutgoing;
631
- declare const expression_isRelation: typeof isRelation;
632
- declare const expression_isRelationExpression: typeof isRelationExpression;
633
- declare const expression_isRelationPredicateExpr: typeof isRelationPredicateExpr;
634
- declare const expression_isRelationWhere: typeof isRelationWhere;
635
- declare const expression_isWildcard: typeof isWildcard;
636
- declare namespace expression {
637
- export { type expression_CustomElementExpr as CustomElementExpr, type expression_CustomRelationExpr as CustomRelationExpr, type expression_ElementExpression as ElementExpression, type expression_ElementKindExpr as ElementKindExpr, type expression_ElementPredicateExpression as ElementPredicateExpression, type expression_ElementRefExpr as ElementRefExpr, type expression_ElementTagExpr as ElementTagExpr, type expression_ElementWhereExpr as ElementWhereExpr, type expression_ExpandedElementExpr as ExpandedElementExpr, type expression_Expression as Expression, type expression_InOutExpr as InOutExpr, type expression_IncomingExpr as IncomingExpr, type expression_OutgoingExpr as OutgoingExpr, type expression_RelationExpr as RelationExpr, type expression_RelationExpression as RelationExpression, type expression_RelationPredicateExpression as RelationPredicateExpression, type expression_RelationWhereExpr as RelationWhereExpr, type expression_WildcardExpr as WildcardExpr, expression_isCustomElement as isCustomElement, expression_isCustomRelationExpr as isCustomRelationExpr, expression_isElement as isElement, expression_isElementKindExpr as isElementKindExpr, expression_isElementPredicateExpr as isElementPredicateExpr, expression_isElementRef as isElementRef, expression_isElementTagExpr as isElementTagExpr, expression_isElementWhere as isElementWhere, expression_isExpandedElementExpr as isExpandedElementExpr, expression_isInOut as isInOut, expression_isIncoming as isIncoming, expression_isOutgoing as isOutgoing, expression_isRelation as isRelation, expression_isRelationExpression as isRelationExpression, expression_isRelationPredicateExpr as isRelationPredicateExpr, expression_isRelationWhere as isRelationWhere, expression_isWildcard as isWildcard };
757
+ /**
758
+ * NOTE:
759
+ */
760
+ interface DeploymentRelation extends AbstractRelation {
761
+ readonly id: RelationId;
762
+ readonly source: DeploymentRef;
763
+ readonly target: DeploymentRef;
638
764
  }
639
765
 
640
766
  /**
641
- * Parsed elements, relations, and views.
767
+ * Represents a LikeC4 model with customizable type parameters,
768
+ * parsed from DSL or result from Builder
769
+ *
770
+ * !IMPORTANT: This is a low-level type, use `LikeC4Model` instead.
771
+ * !NOTE: Views are not computed yet.
772
+ *
773
+ * @typeParam ElementKinds - Types of elements in the model (defaults to string)
774
+ * @typeParam RelationKinds - Types of relationships (defaults to string)
775
+ * @typeParam Tags - Types of tags that can be applied (defaults to string)
776
+ * @typeParam Fqns - Fully Qualified Names for elements (defaults to string)
777
+ * @typeParam Views - Types of views in the model (defaults to string)
778
+ * @typeParam DeploymentFqns - Fully Qualified Names for deployment nodes (defaults to string)
642
779
  */
643
- interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds extends string = string, Tags extends string = string, Fqns extends string = string, Views extends string = string> {
780
+ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds extends string = string, Tags extends string = string, Fqns extends string = string, Views extends string = string, DeploymentFqns extends string = string> {
781
+ __?: never;
644
782
  specification: {
645
783
  tags: Tag<Tags>[];
646
784
  elements: Record<ElementKinds, ElementKindSpecification>;
785
+ deployments: Record<DeploymentNodeKind, DeploymentNodeKindSpecification>;
647
786
  relationships: Record<RelationKinds, RelationshipKindSpecification>;
648
787
  };
649
788
  elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
650
- relations: Record<RelationID, Relation>;
789
+ relations: Record<RelationId, ModelRelation>;
651
790
  globals: ModelGlobals;
652
791
  views: Record<Views, LikeC4View<Views, Tags>>;
792
+ /**
793
+ * Deployment Model.
794
+ */
795
+ deployments: {
796
+ elements: Record<DeploymentFqns, DeploymentElement>;
797
+ relations: Record<RelationId, DeploymentRelation>;
798
+ };
653
799
  }
800
+ type AnyParsedLikeC4Model = ParsedLikeC4Model<any, any, any, any, any, any>;
654
801
  /**
655
- * Same as `ParsedLikeC4Model` but with computed views.
656
- */
657
- interface ComputedLikeC4Model extends Omit<ParsedLikeC4Model, 'views'> {
658
- __?: never;
659
- views: Record<ViewID, ComputedView>;
660
- }
661
- /**
662
- * Same as `ParsedLikeC4Model` but with layouted views (DiagramView)
663
- */
664
- interface LayoutedLikeC4Model extends Omit<ParsedLikeC4Model, 'views'> {
665
- __: 'layouted';
666
- views: Record<ViewID, DiagramView>;
667
- }
668
-
669
- /**
670
- * OverviewGraph is a graph representation of all views in a model
802
+ * Hook to get types from dump
671
803
  */
672
- declare namespace OverviewGraph {
673
- type Node = {
674
- id: string;
675
- type: 'folder' | 'file';
676
- path: string;
677
- label: string;
678
- parentId: string | null;
679
- position: XYPoint;
680
- width: number;
681
- height: number;
682
- } | {
683
- id: string;
684
- type: 'view';
685
- viewId: ViewID;
686
- label: string;
687
- parentId: string | null;
688
- position: XYPoint;
689
- width: number;
690
- height: number;
804
+ type LikeC4ModelDump = {
805
+ elements: {
806
+ [kind: string]: object;
691
807
  };
692
- /**
693
- * Edge represents a navigational link from one view to another
694
- */
695
- type Edge = {
696
- id: string;
697
- source: string;
698
- target: string;
699
- points: NonEmptyArray<Point>;
808
+ deployments: {
809
+ elements: {
810
+ [kind: string]: object;
811
+ };
812
+ };
813
+ views: {
814
+ [kind: string]: object;
700
815
  };
816
+ };
817
+ /**
818
+ * Same as {@link ParsedLikeC4Model}, but with computed views or layouted views.
819
+ */
820
+ interface GenericLikeC4Model<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string, T = 'computed' | 'layouted'> extends Omit<ParsedLikeC4Model<string, string, Tags, Fqns, Views, DeploymentFqns>, 'views' | '__'> {
821
+ __?: T;
822
+ views: Record<Views, ComputedView<Views> | DiagramView<Views>>;
701
823
  }
702
- interface OverviewGraph {
703
- nodes: OverviewGraph.Node[];
704
- edges: OverviewGraph.Edge[];
705
- bounds: BBox;
824
+ interface ComputedLikeC4Model<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string> extends Omit<GenericLikeC4Model<Fqns, DeploymentFqns, Views, Tags, 'computed'>, 'views'> {
825
+ views: Record<Views, ComputedView<Views>>;
706
826
  }
707
-
708
- declare namespace ViewChange {
709
- interface ChangeElementStyle {
710
- op: 'change-element-style';
711
- style: {
712
- border?: BorderStyle;
713
- opacity?: number;
714
- shape?: ElementShape;
715
- color?: ThemeColor;
716
- };
717
- targets: NonEmptyArray<Fqn>;
718
- }
719
- interface SaveManualLayout {
720
- op: 'save-manual-layout';
721
- layout: ViewManualLayout;
722
- }
723
- interface ChangeAutoLayout {
724
- op: 'change-autolayout';
725
- layout: {
726
- direction: AutoLayoutDirection;
727
- nodeSep?: number | null;
728
- rankSep?: number | null;
729
- };
730
- }
827
+ interface LayoutedLikeC4Model<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string> extends Omit<GenericLikeC4Model<Fqns, DeploymentFqns, Views, Tags, 'layouted'>, 'views'> {
828
+ __: 'layouted';
829
+ views: Record<Views, DiagramView<Views, Tags>>;
731
830
  }
732
- type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
733
831
 
734
- export { type ExpandedElementExpr as $, type AutoLayoutDirection as A, type BorderStyle as B, type Color as C, type DiagramView as D, type ElementKindSpecification as E, type Fqn as F, AsFqn as G, type HexColorLiteral as H, type IconUrl as I, BorderStyles as J, ElementShapes as K, type LikeC4View as L, DefaultThemeColor as M, type NonEmptyArray as N, DefaultElementShape as O, type ParsedLikeC4Model as P, type ElementStyle as Q, type RelationshipKindSpecification as R, type TagSpec as S, type ThemeColorValues as T, type Link as U, type ViewRuleStyle as V, type TypedElement as W, type XYPoint as X, type ElementKindSpecificationStyle as Y, type ElementRefExpr as Z, isElementRef as _, type ElementShape as a, type ViewRuleGlobalPredicateRef as a$, isExpandedElementExpr as a0, isCustomElement as a1, type WildcardExpr as a2, isWildcard as a3, type ElementKindExpr as a4, isElementKindExpr as a5, type ElementTagExpr as a6, isElementTagExpr as a7, type ElementExpression as a8, isElement as a9, type TagEqual as aA, isTagEqual as aB, type KindEqual as aC, isKindEqual as aD, type NotOperator as aE, isNotOperator as aF, type AndOperator as aG, isAndOperator as aH, type OrOperator as aI, isOrOperator as aJ, type WhereOperator as aK, type Filterable as aL, whereOperatorAsPredicate as aM, OverviewGraph as aN, DefaultLineStyle as aO, DefaultArrowType as aP, DefaultRelationshipColor as aQ, type ThemeColor as aR, type ColorLiteral as aS, isThemeColor as aT, type ElementThemeColorValues as aU, type ElementThemeColors as aV, type RelationshipThemeColorValues as aW, type RelationshipThemeColors as aX, type LikeC4Theme as aY, type ViewRulePredicate as aZ, isViewRulePredicate as a_, type ElementWhereExpr as aa, isElementWhere as ab, type ElementPredicateExpression as ac, isElementPredicateExpr as ad, type RelationExpr as ae, isRelation as af, type InOutExpr as ag, isInOut as ah, type IncomingExpr as ai, isIncoming as aj, type OutgoingExpr as ak, isOutgoing as al, type RelationExpression as am, isRelationExpression as an, type RelationWhereExpr as ao, isRelationWhere as ap, isCustomRelationExpr as aq, type RelationPredicateExpression as ar, isRelationPredicateExpr as as, type GlobalPredicateId as at, type GlobalPredicates as au, type GlobalDynamicPredicates as av, type GlobalStyleID as aw, type GlobalStyles as ax, type ModelGlobals as ay, type EqualOperator as az, type RelationshipArrowType as b, isViewRuleGlobalPredicateRef as b0, isViewRuleStyle as b1, type ViewRuleGlobalStyle as b2, isViewRuleGlobalStyle as b3, type ViewRuleStyleOrGlobalRef as b4, isAutoLayoutDirection as b5, type ViewRuleAutoLayout as b6, isViewRuleAutoLayout as b7, type ViewRuleGroup as b8, isViewRuleGroup as b9, type ViewAutoLayout as bA, type ComputedElementView as bB, type ComputedDynamicView as bC, isComputedDynamicView as bD, isComputedElementView as bE, type BBox as bF, getBBoxCenter as bG, type ViewManualLayout as bH, ViewChange as bI, type ElementNotation as bJ, type ViewRule as ba, type BasicView as bb, type BasicElementView as bc, type ScopedElementView as bd, type ExtendsElementView as be, type ElementView as bf, type DynamicViewStep as bg, type DynamicViewParallelSteps as bh, type DynamicViewStepOrParallel as bi, type DynamicViewIncludeRule as bj, isDynamicViewIncludeRule as bk, type DynamicViewRule as bl, type DynamicView as bm, isDynamicViewParallelSteps as bn, type CustomColorDefinitions as bo, isDynamicView as bp, isElementView as bq, isExtendsElementView as br, isScopedElementView as bs, type StepEdgeIdLiteral as bt, StepEdgeId as bu, isStepEdgeId as bv, extractStep as bw, getParallelStepsPrefix as bx, type ViewWithHash as by, type ViewWithNotation as bz, type RelationshipLineType as c, type Element as d, type Relation as e, type Expression as f, type CustomElementExpr as g, type CustomRelationExpr as h, type RelationID as i, type ViewID as j, type EdgeId as k, type ComputedView as l, type Tag as m, ComputedNode as n, type NodeId as o, ElementKind as p, type ComputedEdge as q, type ComputedLikeC4Model as r, type LayoutedLikeC4Model as s, type RelationshipKind as t, DiagramNode as u, type DiagramEdge as v, expression as w, type NonEmptyReadonlyArray as x, type CustomColor as y, type Point as z };
832
+ export { type GlobalDynamicPredicates as $, type CustomElementExpr as A, type CustomRelationExpr as B, ComputedView as C, DeploymentElement as D, type DirectRelationExpr as E, type ElementExpression as F, type ElementKindExpr as G, type ElementPredicateExpression as H, type ElementRefExpr as I, type ElementTagExpr as J, type ElementWhereExpr as K, type LikeC4View as L, type ExpandedElementExpr as M, type Expression as N, type IncomingExpr as O, type PredicateSelector as P, type InOutExpr as Q, type NonWilcard as R, type OutgoingExpr as S, type RelationExpression as T, type RelationPredicateExpression as U, type RelationWhereExpr as V, type WildcardExpr as W, ExpressionV2 as X, FqnExpr as Y, FqnRef as Z, RelationExpr as _, type ComputedLikeC4Model as a, type DeploymentView as a$, type GlobalPredicateId as a0, type GlobalPredicates as a1, type GlobalStyleID as a2, type GlobalStyles as a3, type ModelGlobals as a4, type AnyParsedLikeC4Model as a5, type GenericLikeC4Model as a6, type LayoutedLikeC4Model as a7, type LikeC4ModelDump as a8, type ParsedLikeC4Model as a9, extractStep as aA, getBBoxCenter as aB, getParallelStepsPrefix as aC, isAutoLayoutDirection as aD, isDeploymentView as aE, isDynamicView as aF, isDynamicViewParallelSteps as aG, isElementView as aH, isExtendsElementView as aI, isScopedElementView as aJ, isStepEdgeId as aK, isViewRuleAutoLayout as aL, isViewRuleGlobalPredicateRef as aM, isViewRuleGlobalStyle as aN, isViewRuleGroup as aO, isViewRulePredicate as aP, isViewRuleStyle as aQ, stepEdgeId as aR, type AutoLayoutDirection as aS, type BasicElementView as aT, type BasicView as aU, type BBox as aV, type ComputedDeploymentView as aW, type ComputedDynamicView as aX, type ComputedEdge as aY, type ComputedElementView as aZ, type CustomColorDefinitions as a_, isAndOperator as aa, isKindEqual as ab, isNotOperator as ac, isOrOperator as ad, isTagEqual as ae, whereOperatorAsPredicate as af, type AndOperator as ag, type EqualOperator as ah, type Filterable as ai, type KindEqual as aj, type NotOperator as ak, type OrOperator as al, type TagEqual as am, type WhereOperator as an, DefaultArrowType as ao, DefaultLineStyle as ap, DefaultRelationshipColor as aq, type AbstractRelation as ar, type ModelRelation as as, type RelationId as at, type RelationshipArrowType as au, type RelationshipKind as av, type RelationshipKindSpecification as aw, type RelationshipLineType as ax, ComputedNode as ay, DiagramNode as az, type DeployedInstance as b, type DeploymentViewRule as b0, type DeploymentViewRulePredicate as b1, type DeploymentViewRuleStyle as b2, type DiagramEdge as b3, type DiagramView as b4, type DynamicView as b5, type DynamicViewIncludeRule as b6, type DynamicViewParallelSteps as b7, type DynamicViewRule as b8, type DynamicViewStep as b9, type DynamicViewStepOrParallel as ba, type EdgeId as bb, type ElementView as bc, type ExtendsElementView as bd, type NodeId as be, type ScopedElementView as bf, type StepEdgeId as bg, type StepEdgeIdLiteral as bh, type ViewAutoLayout as bi, type ViewId as bj, type ViewManualLayout as bk, type ViewRule as bl, type ViewRuleAutoLayout as bm, type ViewRuleGlobalPredicateRef as bn, type ViewRuleGlobalStyle as bo, type ViewRuleGroup as bp, type ViewRulePredicate as bq, type ViewRuleStyle as br, type ViewRuleStyleOrGlobalRef as bs, type ViewWithHash as bt, type ViewWithNotation as bu, type ElementNotation as bv, type DeploymentElementStyle as c, type DeploymentNode as d, expression as e, type DeploymentNodeKind as f, type DeploymentNodeKindSpecification as g, type DeploymentRef as h, type DeploymentRelation as i, isCustomElement as j, isCustomRelationExpr as k, isElement as l, isElementKindExpr as m, isElementPredicateExpr as n, isElementRef as o, isElementTagExpr as p, isElementWhere as q, isExpandedElementExpr as r, isIncoming as s, isInOut as t, isOutgoing as u, isRelation as v, isRelationExpression as w, isRelationPredicateExpr as x, isRelationWhere as y, isWildcard as z };