@likec4/core 1.46.4 → 1.48.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 (181) hide show
  1. package/LICENSE +1 -1
  2. package/dist/_chunks/Builder.view-element.mjs +3284 -0
  3. package/dist/_chunks/LikeC4Model.d.mts +1287 -0
  4. package/dist/_chunks/LikeC4Styles.mjs +691 -0
  5. package/dist/_chunks/RichText.d.mts +84 -0
  6. package/dist/_chunks/RichText.mjs +148 -0
  7. package/dist/_chunks/_aux.d.mts +289 -0
  8. package/dist/_chunks/_aux.mjs +18 -0
  9. package/dist/_chunks/_types.d.mts +781 -0
  10. package/dist/_chunks/_types2.d.mts +38 -0
  11. package/dist/_chunks/assignTagColors.mjs +24 -0
  12. package/dist/_chunks/calcDriftsFromSnapshot.mjs +379 -0
  13. package/dist/_chunks/connection.mjs +0 -0
  14. package/dist/_chunks/const.d.mts +43 -0
  15. package/dist/_chunks/const.mjs +33 -0
  16. package/dist/_chunks/expression-model.d.mts +192 -0
  17. package/dist/_chunks/expression-model.mjs +103 -0
  18. package/dist/_chunks/expression.d.mts +347 -0
  19. package/dist/_chunks/expression.mjs +107 -0
  20. package/dist/_chunks/find.d.mts +82 -0
  21. package/dist/_chunks/find.mjs +646 -0
  22. package/dist/_chunks/find2.d.mts +78 -0
  23. package/dist/_chunks/find2.mjs +287 -0
  24. package/dist/_chunks/fqnRef.d.mts +58 -0
  25. package/dist/_chunks/fqnRef.mjs +41 -0
  26. package/dist/_chunks/geometry.mjs +335 -0
  27. package/dist/_chunks/index.d.mts +169 -0
  28. package/dist/_chunks/index2.d.mts +937 -0
  29. package/dist/_chunks/index3.d.mts +146 -0
  30. package/dist/_chunks/index4.d.mts +62 -0
  31. package/dist/_chunks/index5.d.mts +42 -0
  32. package/dist/_chunks/index6.d.mts +43 -0
  33. package/dist/{shared/core.OtRNdMxy.d.mts → _chunks/index7.d.mts} +113 -197
  34. package/dist/_chunks/index8.d.mts +144 -0
  35. package/dist/_chunks/invariant.mjs +18 -0
  36. package/dist/_chunks/iterable.mjs +146 -0
  37. package/dist/_chunks/libs/@mantine/colors-generator.mjs +3416 -0
  38. package/dist/_chunks/libs/@ungap/structured-clone.mjs +213 -0
  39. package/dist/_chunks/libs/bail.mjs +14 -0
  40. package/dist/_chunks/libs/ccount.mjs +25 -0
  41. package/dist/_chunks/libs/character-entities-html4.mjs +263 -0
  42. package/dist/_chunks/libs/character-entities-legacy.mjs +117 -0
  43. package/dist/_chunks/libs/character-entities.mjs +2136 -0
  44. package/dist/_chunks/libs/comma-separated-tokens.mjs +18 -0
  45. package/dist/_chunks/libs/decode-named-character-reference.mjs +21 -0
  46. package/dist/_chunks/libs/defu.mjs +42 -0
  47. package/dist/_chunks/libs/devlop.mjs +5 -0
  48. package/dist/_chunks/libs/escape-string-regexp.mjs +8 -0
  49. package/dist/_chunks/libs/extend.mjs +77 -0
  50. package/dist/_chunks/libs/graphology-dag.mjs +703 -0
  51. package/dist/_chunks/libs/graphology-types.d.mts +601 -0
  52. package/dist/_chunks/libs/graphology.d.mts +6 -0
  53. package/dist/_chunks/libs/graphology.mjs +4565 -0
  54. package/dist/_chunks/libs/hast-util-sanitize.mjs +863 -0
  55. package/dist/_chunks/libs/hast-util-to-html.mjs +2696 -0
  56. package/dist/_chunks/libs/is-plain-obj.mjs +9 -0
  57. package/dist/_chunks/libs/longest-streak.mjs +30 -0
  58. package/dist/_chunks/libs/markdown-table.mjs +290 -0
  59. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +653 -0
  60. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +8522 -0
  61. package/dist/_chunks/libs/mdast-util-gfm.mjs +2393 -0
  62. package/dist/_chunks/libs/mdast-util-to-hast.mjs +1803 -0
  63. package/dist/_chunks/libs/micromark-extension-gfm.mjs +2243 -0
  64. package/dist/_chunks/libs/mnemonist.d.mts +254 -0
  65. package/dist/_chunks/libs/mnemonist.mjs +1978 -0
  66. package/dist/_chunks/libs/natural-compare-lite.mjs +42 -0
  67. package/dist/_chunks/libs/rehype-sanitize.mjs +29 -0
  68. package/dist/_chunks/libs/rehype-stringify.mjs +34 -0
  69. package/dist/_chunks/libs/remark-gfm.mjs +36 -0
  70. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +100 -0
  71. package/dist/_chunks/libs/remark-parse.mjs +39 -0
  72. package/dist/_chunks/libs/remark-rehype.mjs +171 -0
  73. package/dist/_chunks/libs/remeda.mjs +702 -0
  74. package/dist/_chunks/libs/trough.mjs +158 -0
  75. package/dist/_chunks/libs/unified.mjs +2212 -0
  76. package/dist/_chunks/mnemonist.d.mts +1 -0
  77. package/dist/_chunks/mnemonist.mjs +0 -0
  78. package/dist/_chunks/model.mjs +1898 -0
  79. package/dist/_chunks/model2.mjs +0 -0
  80. package/dist/_chunks/relationships-view.mjs +132 -0
  81. package/dist/_chunks/rolldown-runtime.mjs +42 -0
  82. package/dist/{shared/core.C_3y3eqV.d.mts → _chunks/scalar.d.mts} +13 -43
  83. package/dist/_chunks/scalar.mjs +84 -0
  84. package/dist/_chunks/utils.mjs +483 -0
  85. package/dist/builder/index.d.mts +11 -773
  86. package/dist/builder/index.mjs +631 -978
  87. package/dist/compute-view/index.d.mts +90 -27
  88. package/dist/compute-view/index.mjs +253 -83
  89. package/dist/compute-view/relationships-view/index.d.mts +16 -51
  90. package/dist/compute-view/relationships-view/index.mjs +6 -184
  91. package/dist/geometry/index.d.mts +2 -109
  92. package/dist/geometry/index.mjs +2 -327
  93. package/dist/index.d.mts +18 -20
  94. package/dist/index.mjs +27 -18
  95. package/dist/model/connection/deployment/index.d.mts +12 -15
  96. package/dist/model/connection/deployment/index.mjs +9 -2
  97. package/dist/model/connection/index.d.mts +14 -75
  98. package/dist/model/connection/index.mjs +10 -3
  99. package/dist/model/connection/model/index.d.mts +12 -15
  100. package/dist/model/connection/model/index.mjs +8 -2
  101. package/dist/model/index.d.mts +15 -57
  102. package/dist/model/index.mjs +11 -4
  103. package/dist/styles/index.d.mts +9 -117
  104. package/dist/styles/index.mjs +26 -59
  105. package/dist/types/RichText.d.mts +3 -0
  106. package/dist/types/RichText.mjs +7 -0
  107. package/dist/types/_aux.d.mts +3 -4
  108. package/dist/types/_aux.mjs +2 -7
  109. package/dist/types/expression-model.d.mts +6 -190
  110. package/dist/types/expression-model.mjs +6 -108
  111. package/dist/types/expression.d.mts +5 -6
  112. package/dist/types/expression.mjs +6 -112
  113. package/dist/types/fqnRef.d.mts +4 -60
  114. package/dist/types/fqnRef.mjs +6 -44
  115. package/dist/types/index.d.mts +9 -47
  116. package/dist/types/index.mjs +14 -16
  117. package/dist/types/scalar.d.mts +2 -2
  118. package/dist/types/scalar.mjs +7 -4
  119. package/dist/utils/graphology/index.d.mts +2 -1864
  120. package/dist/utils/graphology/index.mjs +3 -1
  121. package/dist/utils/index.d.mts +11 -124
  122. package/dist/utils/index.mjs +16 -43
  123. package/dist/utils/iterable/index.d.mts +9 -132
  124. package/dist/utils/iterable/index.mjs +2 -61
  125. package/dist/utils/mnemonist.d.mts +2 -0
  126. package/dist/utils/mnemonist.mjs +12 -0
  127. package/package.json +18 -22
  128. package/compute-view/relationships/package.json +0 -4
  129. package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
  130. package/dist/shared/core.78IWAHAE.mjs +0 -332
  131. package/dist/shared/core.B85MJLTf.mjs +0 -5
  132. package/dist/shared/core.BFd1lU9R.mjs +0 -29
  133. package/dist/shared/core.BKlholso.mjs +0 -3
  134. package/dist/shared/core.BPGOjone.d.mts +0 -46
  135. package/dist/shared/core.BYdtmqY5.mjs +0 -1255
  136. package/dist/shared/core.BZCgljZd.d.mts +0 -83
  137. package/dist/shared/core.BbE4y-yl.mjs +0 -177
  138. package/dist/shared/core.BhNcrwzK.mjs +0 -7
  139. package/dist/shared/core.BkVA6gjl.mjs +0 -5
  140. package/dist/shared/core.BoYfZOBm.mjs +0 -3
  141. package/dist/shared/core.BsSXS-_R.mjs +0 -7
  142. package/dist/shared/core.BspBF3SJ.mjs +0 -3944
  143. package/dist/shared/core.BvPm_-u3.d.mts +0 -334
  144. package/dist/shared/core.C-Jdx7xo.d.mts +0 -1263
  145. package/dist/shared/core.C3JowhaZ.mjs +0 -32
  146. package/dist/shared/core.C4x8aaWa.mjs +0 -27
  147. package/dist/shared/core.CBLX4mT8.mjs +0 -28411
  148. package/dist/shared/core.CLSZtnFh.mjs +0 -69
  149. package/dist/shared/core.CRhT4Iio.mjs +0 -785
  150. package/dist/shared/core.CbT8JVYL.mjs +0 -5
  151. package/dist/shared/core.CdNCAwq7.mjs +0 -176
  152. package/dist/shared/core.ClTP6-TN.d.mts +0 -87
  153. package/dist/shared/core.CmGY9blO.mjs +0 -6717
  154. package/dist/shared/core.CmPXpJ8l.mjs +0 -21
  155. package/dist/shared/core.Coi_LOUZ.mjs +0 -7
  156. package/dist/shared/core.CqAJJpK_.mjs +0 -3
  157. package/dist/shared/core.Ctj2S3bD.d.mts +0 -466
  158. package/dist/shared/core.CywrQs86.d.mts +0 -31
  159. package/dist/shared/core.D00YbOhQ.d.mts +0 -300
  160. package/dist/shared/core.D0WZutNd.mjs +0 -94
  161. package/dist/shared/core.D4npX2q8.mjs +0 -18
  162. package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
  163. package/dist/shared/core.DEK-BO3_.mjs +0 -1206
  164. package/dist/shared/core.DH7TXqXf.mjs +0 -136
  165. package/dist/shared/core.DRJma0Ol.mjs +0 -22
  166. package/dist/shared/core.DSalPD6v.mjs +0 -1352
  167. package/dist/shared/core.DVfPJPJj.mjs +0 -2200
  168. package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
  169. package/dist/shared/core.DbfO90vF.mjs +0 -434
  170. package/dist/shared/core.DcS-0zys.mjs +0 -10
  171. package/dist/shared/core.DeDCYTDR.d.mts +0 -98
  172. package/dist/shared/core.DpKY_3NF.d.mts +0 -504
  173. package/dist/shared/core.Dt0v3djy.d.mts +0 -41
  174. package/dist/shared/core.FZ305VYd.mjs +0 -21
  175. package/dist/shared/core.RfnaEmgA.mjs +0 -7
  176. package/dist/shared/core.oSV6SRfk.mjs +0 -13
  177. package/dist/shared/core.om36dXXW.mjs +0 -41
  178. package/dist/shared/core.q10OP9oJ.mjs +0 -5
  179. package/dist/shared/core.uFk_o9X6.mjs +0 -13
  180. package/dist/shared/core.xeuDd__E.mjs +0 -300
  181. package/dist/shared/core.xgoPk2RG.mjs +0 -4989
@@ -0,0 +1,1287 @@
1
+ import { E as MetadataKey, G as Unknown, H as StrictViewId, I as Stage, J as UnknownParsed, K as UnknownComputed, M as RelationId, N as RelationKind, S as LooseTag, St as Link, T as Metadata, U as Tag, W as Tags, Y as ViewId, bt as IteratorLike, c as Aux, ct as toComputed, d as DeploymentKind, g as LooseDeploymentId, h as Fqn, ht as _type, i as AnyLayouted, j as ProjectId, l as DeploymentFqn, m as ElementKind, mt as _stage, n as Any, o as AnyParsed, p as ElementId, q as UnknownLayouted, r as AnyComputed, u as DeploymentId, v as LooseElementId, w as LooseViewId, wt as NonEmptyArray } from "./_aux.mjs";
2
+ import { C as ViewId$1, a as EdgeId, d as IconUrl, g as RelationId$1, h as ProjectId$1, l as GroupElementKind, p as NodeId, y as StepEdgeId } from "./scalar.mjs";
3
+ import { i as BBox } from "./index.mjs";
4
+ import { I as RelationshipArrowType, h as WhereOperator, k as ElementShape, w as Color, z as RelationshipLineType } from "./expression.mjs";
5
+ import { t as FqnRef } from "./fqnRef.mjs";
6
+ import { $ as LikeC4Project, G as ViewManualLayoutSnapshot, Nt as DynamicViewDisplayVariant, St as Relationship, Z as ComputedNodeStyle, b as ViewWithType, bt as ElementStyle, c as ComputedLikeC4ModelData, d as ParsedLikeC4ModelData, dt as DeploymentElement, ht as DeploymentRelationship, kt as ModelGlobals, l as LayoutedLikeC4ModelData, m as LayoutedView, n as AuxFromDump, p as ComputedView, pt as DeploymentNode, r as LikeC4ModelDump, st as Specification, ut as DeployedInstance, yt as Element } from "./index2.mjs";
7
+ import { i as RichTextOrEmpty } from "./RichText.mjs";
8
+ import { a as LikeC4Styles } from "./index3.mjs";
9
+ import { c as DefaultMap } from "./libs/mnemonist.mjs";
10
+ import { IsAny, SetRequired, Tagged } from "type-fest";
11
+
12
+ //#region src/model/RelationModel.d.ts
13
+ type RelationshipsIterator<A extends Any> = IteratorLike<RelationshipModel<A>>;
14
+ /**
15
+ * A relationship between two elements (in logical or deployment model)
16
+ * use {@link isDeploymentRelationModel} guard to check if the relationship is a deployment relationship
17
+ */
18
+ interface AnyRelationshipModel<A extends Any = Any> extends WithTags<A>, WithMetadata<A> {
19
+ readonly id: RelationId$1;
20
+ readonly expression: string;
21
+ readonly title: string | null;
22
+ readonly technology: string | null;
23
+ readonly hasSummary: boolean;
24
+ readonly summary: RichTextOrEmpty;
25
+ readonly description: RichTextOrEmpty;
26
+ readonly navigateTo: LikeC4ViewModel<A> | null;
27
+ readonly kind: RelationKind<A> | null;
28
+ readonly links: ReadonlyArray<Link>;
29
+ readonly color: Color;
30
+ readonly line: RelationshipLineType;
31
+ readonly head: RelationshipArrowType;
32
+ readonly tail: RelationshipArrowType | undefined;
33
+ isDeploymentRelation(): this is DeploymentRelationModel<A>;
34
+ isModelRelation(): this is RelationshipModel<A>;
35
+ views(): ViewsIterator<A>;
36
+ }
37
+ declare class RelationshipModel<A extends Any = Any> implements AnyRelationshipModel<A> {
38
+ readonly model: LikeC4Model<A>;
39
+ readonly $relationship: Relationship<A>;
40
+ readonly source: ElementModel<A>;
41
+ readonly target: ElementModel<A>;
42
+ /**
43
+ * Common ancestor of the source and target elements.
44
+ * Represents the boundary of the Relation.
45
+ */
46
+ readonly boundary: ElementModel<A> | null;
47
+ constructor(model: LikeC4Model<A>, $relationship: Relationship<A>);
48
+ get id(): RelationId$1;
49
+ get expression(): string;
50
+ get title(): string | null;
51
+ get technology(): string | null;
52
+ /**
53
+ * Returns true if the relationship has a summary and a description
54
+ * (if one is missing - it falls back to another)
55
+ */
56
+ get hasSummary(): boolean;
57
+ /**
58
+ * Short description of the relationship.
59
+ * Falls back to description if summary is not provided.
60
+ */
61
+ get summary(): RichTextOrEmpty;
62
+ /**
63
+ * Long description of the relationship.
64
+ * Falls back to summary if description is not provided.
65
+ */
66
+ get description(): RichTextOrEmpty;
67
+ get navigateTo(): LikeC4ViewModel<A> | null;
68
+ get tags(): Tags<A>;
69
+ get kind(): RelationKind<A> | null;
70
+ get links(): ReadonlyArray<Link>;
71
+ get color(): Color;
72
+ get line(): RelationshipLineType;
73
+ get head(): RelationshipArrowType;
74
+ get tail(): RelationshipArrowType | undefined;
75
+ /**
76
+ * Iterate over all views that include this relationship.
77
+ */
78
+ views(): ViewsIterator<A>;
79
+ isDeploymentRelation(): this is DeploymentRelationModel<A>;
80
+ isModelRelation(): this is RelationshipModel<A>;
81
+ hasMetadata(): boolean;
82
+ getMetadata(): Metadata<A>;
83
+ getMetadata(field: MetadataKey<A>): string | string[] | undefined;
84
+ /**
85
+ * Checks if the relationship has the given tag.
86
+ */
87
+ isTagged(tag: LooseTag<A>): boolean;
88
+ }
89
+ //#endregion
90
+ //#region src/model/ElementModel.d.ts
91
+ type ElementsIterator<M extends Any> = IteratorLike<ElementModel<M>>;
92
+ declare class ElementModel<A extends Any = Any> implements WithTags<A>, WithMetadata<A> {
93
+ readonly $model: LikeC4Model<A>;
94
+ readonly $element: Element<A>;
95
+ /**
96
+ * Don't use in runtime, only for type inference
97
+ */
98
+ readonly Aux: A;
99
+ readonly id: Fqn<A>;
100
+ readonly _literalId: ElementId<A>;
101
+ readonly hierarchyLevel: number;
102
+ readonly imported: null | {
103
+ readonly from: ProjectId$1;
104
+ readonly fqn: Fqn<Any>;
105
+ };
106
+ constructor($model: LikeC4Model<A>, $element: Element<A>);
107
+ get name(): string;
108
+ get parent(): ElementModel<A> | null;
109
+ get kind(): ElementKind<A>;
110
+ get shape(): ElementShape;
111
+ get color(): Color;
112
+ get icon(): IconUrl | null;
113
+ /**
114
+ * Returns all tags of the element.
115
+ * It includes tags from the element and its kind.
116
+ */
117
+ get tags(): Tags<A>;
118
+ get title(): string;
119
+ /**
120
+ * Returns true if the element has a summary and a description
121
+ * (if one is missing - it falls back to another)
122
+ */
123
+ get hasSummary(): boolean;
124
+ /**
125
+ * Short description of the element.
126
+ * Falls back to description if summary is not provided.
127
+ */
128
+ get summary(): RichTextOrEmpty;
129
+ /**
130
+ * Long description of the element.
131
+ * Falls back to summary if description is not provided.
132
+ */
133
+ get description(): RichTextOrEmpty;
134
+ get technology(): string | null;
135
+ get links(): ReadonlyArray<Link>;
136
+ get defaultView(): LikeC4ViewModel.ScopedElementView<A> | null;
137
+ get isRoot(): boolean;
138
+ get style(): SetRequired<ElementStyle, 'shape' | 'color' | 'size'>;
139
+ get projectId(): ProjectId<A>;
140
+ isAncestorOf(another: ElementModel<A>): boolean;
141
+ isDescendantOf(another: ElementModel<A>): boolean;
142
+ /**
143
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
144
+ * (from closest to root)
145
+ */
146
+ ancestors(): ElementsIterator<A>;
147
+ /**
148
+ * Returns the common ancestor of this element and another element.
149
+ */
150
+ commonAncestor(another: ElementModel<A>): ElementModel<A> | null;
151
+ children(): ReadonlySet<ElementModel<A>>;
152
+ /**
153
+ * Get all descendant elements (i.e. children, children’s children, etc.)
154
+ */
155
+ descendants(sort?: 'asc' | 'desc'): ElementsIterator<A>;
156
+ /**
157
+ * Get all sibling (i.e. same parent)
158
+ */
159
+ siblings(): ElementsIterator<A>;
160
+ /**
161
+ * Resolve siblings of the element and its ancestors
162
+ * (from closest parent to root)
163
+ */
164
+ ascendingSiblings(): ElementsIterator<A>;
165
+ /**
166
+ * Resolve siblings of the element and its ancestors
167
+ * (from root to closest)
168
+ */
169
+ descendingSiblings(): ElementsIterator<A>;
170
+ incoming(filter?: IncomingFilter): RelationshipsIterator<A>;
171
+ incomers(filter?: IncomingFilter): ElementsIterator<A>;
172
+ outgoing(filter?: OutgoingFilter): RelationshipsIterator<A>;
173
+ outgoers(filter?: OutgoingFilter): ElementsIterator<A>;
174
+ get allOutgoing(): ReadonlySet<RelationshipModel<A>>;
175
+ get allIncoming(): ReadonlySet<RelationshipModel<A>>;
176
+ /**
177
+ * Iterate over all views that include this element.
178
+ */
179
+ views(): ReadonlySet<LikeC4ViewModel<A>>;
180
+ /**
181
+ * Iterate over all views that scope this element.
182
+ * It is possible that element is not included in the view.
183
+ */
184
+ scopedViews(): ReadonlySet<LikeC4ViewModel.ScopedElementView<A>>;
185
+ /**
186
+ * @returns true if the element is deployed
187
+ */
188
+ isDeployed(): boolean;
189
+ deployments(): DeployedInstancesIterator<A>;
190
+ hasMetadata(): boolean;
191
+ getMetadata(): Metadata<A>;
192
+ getMetadata(field: MetadataKey<A>): string | string[] | undefined;
193
+ /**
194
+ * Checks if the element has the given tag.
195
+ */
196
+ isTagged(tag: LooseTag<A>): boolean;
197
+ }
198
+ //#endregion
199
+ //#region src/model/view/NodeModel.d.ts
200
+ type NodesIterator<M extends Any, V extends $View<M>> = IteratorLike<NodeModel<M, V>>;
201
+ declare class NodeModel<A extends Any = Any, V extends $View<A> = $View<A>> implements WithTags<A> {
202
+ readonly Aux: A;
203
+ readonly $viewModel: LikeC4ViewModel<A, V>;
204
+ readonly $view: V;
205
+ readonly $node: V['nodes'][number];
206
+ constructor($viewModel: LikeC4ViewModel<A, V>, $node: V['nodes'][number]);
207
+ get id(): NodeId;
208
+ get title(): string;
209
+ get kind(): ElementKind<A> | DeploymentKind<A> | typeof GroupElementKind | 'instance';
210
+ get description(): RichTextOrEmpty;
211
+ get technology(): string | null;
212
+ get parent(): NodeModel<A, V> | null;
213
+ get element(): ElementModel<A> | null;
214
+ get deployment(): DeploymentElementModel<A> | null;
215
+ get shape(): ElementShape;
216
+ get color(): Color;
217
+ get icon(): IconUrl | null;
218
+ get tags(): Tags<A>;
219
+ get links(): ReadonlyArray<Link>;
220
+ get navigateTo(): LikeC4ViewModel<A> | null;
221
+ get style(): ComputedNodeStyle;
222
+ get x(): number | undefined;
223
+ get y(): number | undefined;
224
+ get width(): number | undefined;
225
+ get height(): number | undefined;
226
+ children(): ReadonlySet<NodeModel<A, V>>;
227
+ /**
228
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
229
+ * (from closest to root)
230
+ */
231
+ ancestors(): NodesIterator<A, V>;
232
+ siblings(): NodesIterator<A, V>;
233
+ incoming(filter?: IncomingFilter): EdgesIterator<A, V>;
234
+ incomers(filter?: IncomingFilter): NodesIterator<A, V>;
235
+ outgoing(filter?: OutgoingFilter): EdgesIterator<A, V>;
236
+ outgoers(filter?: OutgoingFilter): NodesIterator<A, V>;
237
+ isLayouted(): this is NodeModel.Layouted<A>;
238
+ hasChildren(): boolean;
239
+ hasParent(): this is NodeModel.WithParent<A, V>;
240
+ /**
241
+ * Check if this node references to logical model element.
242
+ */
243
+ hasElement(): this is NodeModel.WithElement<A, V>;
244
+ /**
245
+ * Check if this node references to deployment element (Node or Instance).
246
+ */
247
+ hasDeployment(): this is NodeModel.WithDeploymentElement<A, V>;
248
+ /**
249
+ * Check if this node references to deployed instance
250
+ * Deployed instance always references to element and deployment element.
251
+ */
252
+ hasDeployedInstance(): this is NodeModel.WithDeployedInstance<A, V>;
253
+ isGroup(): this is NodeModel.IsGroup<A, V>;
254
+ /**
255
+ * Checks if the node has the given tag.
256
+ */
257
+ isTagged(tag: LooseTag<A>): boolean;
258
+ }
259
+ declare namespace NodeModel {
260
+ type Layouted<A> = A extends AnyLayouted ? NodeModel<A, LayoutedView<A>> & {
261
+ x: number;
262
+ y: number;
263
+ width: number;
264
+ height: number;
265
+ } : never;
266
+ interface WithParent<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
267
+ readonly parent: NodeModel<A, V>;
268
+ }
269
+ interface WithElement<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
270
+ readonly kind: ElementKind<A>;
271
+ readonly element: ElementModel<A>;
272
+ }
273
+ interface WithDeploymentElement<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
274
+ readonly kind: DeploymentKind<A>;
275
+ readonly deployment: DeploymentElementModel<A>;
276
+ }
277
+ interface WithDeployedInstance<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
278
+ readonly kind: 'instance';
279
+ readonly element: ElementModel<A>;
280
+ readonly deployment: DeployedInstanceModel<A>;
281
+ }
282
+ interface IsGroup<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
283
+ readonly kind: typeof GroupElementKind;
284
+ readonly element: null;
285
+ readonly deployment: null;
286
+ }
287
+ }
288
+ //#endregion
289
+ //#region src/model/view/EdgeModel.d.ts
290
+ type EdgesIterator<A extends Any, V extends $View<A>> = IteratorLike<EdgeModel<A, V>>;
291
+ declare class EdgeModel<A extends Any = Any, V extends $View<A> = $View<A>> implements WithTags<A> {
292
+ readonly source: NodeModel<A, V>;
293
+ readonly target: NodeModel<A, V>;
294
+ readonly Aux: A;
295
+ readonly $viewModel: LikeC4ViewModel<A, V>;
296
+ readonly $view: V;
297
+ readonly $edge: V['edges'][number];
298
+ constructor($viewModel: LikeC4ViewModel<A, V>, $edge: V['edges'][number], source: NodeModel<A, V>, target: NodeModel<A, V>);
299
+ get id(): EdgeId;
300
+ get parent(): NodeModel<A, V> | null;
301
+ get label(): string | null;
302
+ get description(): RichTextOrEmpty;
303
+ get technology(): string | null;
304
+ hasParent(): this is EdgeModel.WithParent<A, V>;
305
+ get tags(): Tags<A>;
306
+ get stepNumber(): number | null;
307
+ get navigateTo(): LikeC4ViewModel<A> | null;
308
+ get color(): Color;
309
+ get line(): RelationshipLineType;
310
+ get head(): RelationshipArrowType;
311
+ get tail(): RelationshipArrowType | undefined;
312
+ isStep(): this is EdgeModel.StepEdge<A, V>;
313
+ relationships(type: 'model'): IteratorLike<RelationshipModel<A>>;
314
+ relationships(type: 'deployment'): IteratorLike<DeploymentRelationModel<A>>;
315
+ relationships(type?: 'model' | 'deployment'): IteratorLike<RelationshipModel<A> | DeploymentRelationModel<A>>;
316
+ includesRelation(rel: RelationId | {
317
+ id: RelationId;
318
+ }): boolean;
319
+ isTagged(tag: LooseTag<A>): boolean;
320
+ }
321
+ declare namespace EdgeModel {
322
+ interface StepEdge<A extends Any, V extends $View<A>> extends EdgeModel<A, V> {
323
+ readonly id: StepEdgeId;
324
+ readonly stepNumber: number;
325
+ }
326
+ interface WithParent<A extends Any, V extends $View<A>> extends EdgeModel<A, V> {
327
+ readonly parent: NodeModel<A, V>;
328
+ }
329
+ }
330
+ //#endregion
331
+ //#region src/model/view/LikeC4ViewsFolder.d.ts
332
+ declare class LikeC4ViewsFolder<A extends Any = Any> {
333
+ readonly $model: LikeC4Model<A>;
334
+ /**
335
+ * Path to this view folder, processed by {@link normalizeViewPath}
336
+ *
337
+ * @example
338
+ * "Folder 1/Folder 2/Folder 3"
339
+ */
340
+ readonly path: string;
341
+ /**
342
+ * Title of this view folder.
343
+ *
344
+ * @example
345
+ * // title is the last segment of the path
346
+ * path = "Folder 1/Folder 2/Folder 3"
347
+ * title = "Folder 3"
348
+ */
349
+ readonly title: string;
350
+ /**
351
+ * Whether this is the root view folder.
352
+ *
353
+ * !NOTE
354
+ * Root folder is special folder with an empty path and used only for internal purposes. \
355
+ * It is not visible to the user and should not be used in the code.
356
+ */
357
+ readonly isRoot: boolean;
358
+ protected readonly parentPath: string | undefined;
359
+ protected readonly defaultViewId: StrictViewId<A> | undefined;
360
+ constructor($model: LikeC4Model<A>, path: NonEmptyArray<string>, defaultViewId: StrictViewId<A> | undefined);
361
+ /**
362
+ * Default view of this view folder.\
363
+ * It is for the case when there is a view at the same path as this folder.\
364
+ * (if there are multiple views at the same path, the first one is chosen)
365
+ *
366
+ * @example
367
+ * ```
368
+ * // Assume the following views exist:
369
+ * const views = [
370
+ * "Folder 1/ Folder 2 / View",
371
+ * "Folder 1/ Folder 2 / View / Subview",
372
+ * ]
373
+ * ```
374
+ * Group with path `Folder 1/ Folder 2 / View`\
375
+ * will have default view `Folder 1/ Folder 2 / View`
376
+ */
377
+ get defaultView(): LikeC4ViewModel<A> | null;
378
+ /**
379
+ * Returns path to this view folder as an array of ancestors (excluding root) and this view folder as the last element
380
+ *
381
+ * @throws Error if this is the root folder.
382
+ */
383
+ get breadcrumbs(): [...LikeC4ViewsFolder<A>[], this];
384
+ /**
385
+ * Returns parent folder
386
+ *
387
+ * @throws Error if this is the root folder.
388
+ */
389
+ get parent(): LikeC4ViewsFolder<A> | null;
390
+ /**
391
+ * Returns sorted set of children
392
+ * - First folders
393
+ * - Then views
394
+ */
395
+ get children(): ReadonlySet<LikeC4ViewsFolder<A> | LikeC4ViewModel<A>>;
396
+ /**
397
+ * Returns sorted array of children folders
398
+ */
399
+ get folders(): ReadonlyArray<LikeC4ViewsFolder<A>>;
400
+ /**
401
+ * Returns all views in this view folder.
402
+ */
403
+ get views(): ReadonlyArray<LikeC4ViewModel<A>>;
404
+ }
405
+ //#endregion
406
+ //#region src/model/view/LikeC4ViewModel.d.ts
407
+ type ViewsIterator<A extends Any, V extends $View<A> = $View<A>> = IteratorLike<LikeC4ViewModel<A, V>>;
408
+ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>> implements WithTags<A> {
409
+ #private;
410
+ /**
411
+ * Don't use in runtime, only for type inference
412
+ */
413
+ readonly Aux: A;
414
+ readonly id: StrictViewId<A>;
415
+ /**
416
+ * The model this view belongs to
417
+ */
418
+ readonly $model: LikeC4Model<A>;
419
+ /**
420
+ * The title of the view
421
+ */
422
+ readonly title: string | null;
423
+ /**
424
+ * View folder this view belongs to.
425
+ * If view is top-level, this is the root folder.
426
+ */
427
+ readonly folder: LikeC4ViewsFolder<A>;
428
+ /**
429
+ * Path to this view, processed by {@link normalizeViewPath}
430
+ *
431
+ * @example
432
+ * "Group 1/Group 2/View"
433
+ */
434
+ readonly viewPath: string;
435
+ constructor(model: LikeC4Model<A>, folder: LikeC4ViewsFolder<A>, view: V, manualLayoutSnapshot?: ViewManualLayoutSnapshot | undefined);
436
+ /**
437
+ * Returns the styles configuration for the project.
438
+ */
439
+ get $styles(): LikeC4Styles;
440
+ get _type(): V[_type];
441
+ get stage(): V[_stage];
442
+ get bounds(): Readonly<BBox>;
443
+ /**
444
+ * Returns title if defined, otherwise returns title of the element it is based on, otherwise returns its {@link id}
445
+ */
446
+ get titleOrId(): string;
447
+ /**
448
+ * Returns title if defined, otherwise returns `Untitled`.
449
+ */
450
+ get titleOrUntitled(): string;
451
+ /**
452
+ * Returns path to this view as an array of groups and this view as the last element
453
+ * If view is top-level, returns only this view.
454
+ *
455
+ * @example
456
+ * viewPath = "Group 1/Group 2/View"
457
+ *
458
+ * breadcrumbs = [
459
+ * "Group 1", // folder
460
+ * "Group 1/Group 2", // folder
461
+ * "Group 1/Group 2/View" // view
462
+ * ]
463
+ */
464
+ get breadcrumbs(): [...LikeC4ViewsFolder<A>[], this];
465
+ get description(): RichTextOrEmpty;
466
+ get tags(): Tags<A>;
467
+ get links(): ReadonlyArray<Link>;
468
+ get viewOf(): ElementModel<A> | null;
469
+ /**
470
+ * Available for dynamic views only
471
+ * throws error if view is not dynamic
472
+ */
473
+ get mode(): DynamicViewDisplayVariant | null;
474
+ /**
475
+ * All tags from nodes and edges.
476
+ */
477
+ get includedTags(): Tags<A>;
478
+ /**
479
+ * The original view from the model.
480
+ * In case of layouted model, this is the latest auto-layouted view without manual changes applied
481
+ * @see {@link $layouted} should be used for rendering in the UI
482
+ */
483
+ get $view(): V;
484
+ /**
485
+ * Returns the view with manual layout applied if it exists, otherwise returns the original view
486
+ * This should be used for rendering in the UI
487
+ */
488
+ get $layouted(): V;
489
+ get hasManualLayout(): boolean;
490
+ get hasLayoutDrifts(): boolean;
491
+ /**
492
+ * If view has manual layout, returns it with manual layout applied
493
+ */
494
+ get $manual(): V | null;
495
+ get projectId(): ProjectId<A>;
496
+ roots(): NodesIterator<A, V>;
497
+ /**
498
+ * Iterate over all nodes that have children.
499
+ */
500
+ compounds(): NodesIterator<A, V>;
501
+ /**
502
+ * Get node by id.
503
+ * @throws Error if node is not found.
504
+ */
505
+ node(node: NodeOrId): NodeModel<A, V>;
506
+ /**
507
+ * Find node by id.
508
+ */
509
+ findNode(node: NodeOrId): NodeModel<A, V> | null;
510
+ findNodeWithElement(element: LooseElementId<A> | {
511
+ id: Fqn<A>;
512
+ }): NodeModel.WithElement<A, V> | null;
513
+ /**
514
+ * Iterate over all nodes.
515
+ */
516
+ nodes(): NodesIterator<A, V>;
517
+ /**
518
+ * Get edge by id, throws error if edge is not found.
519
+ * Use {@link findEdge} if you are not sure if the edge exists.
520
+ *
521
+ * @param edge Edge or id
522
+ * @returns {@link EdgeModel}
523
+ */
524
+ edge(edge: EdgeOrId): EdgeModel<A, V>;
525
+ /**
526
+ * Find edge by id.
527
+ * @param edge Edge or id
528
+ * @returns {@link EdgeModel} or null if edge is not found
529
+ */
530
+ findEdge(edge: EdgeOrId): EdgeModel<A, V> | null;
531
+ /**
532
+ * Iterate over all edges.
533
+ */
534
+ edges(): EdgesIterator<A, V>;
535
+ /**
536
+ * Iterate over all edges.
537
+ */
538
+ edgesWithRelation(relation: RelationId): EdgesIterator<A, V>;
539
+ /**
540
+ * Nodes that have references to elements from logical model.
541
+ */
542
+ elements(): IteratorLike<NodeModel.WithElement<A, V>>;
543
+ /**
544
+ * Checks if the view has the given tag.
545
+ */
546
+ isTagged(tag: LooseTag<A>): boolean;
547
+ includesElement(element: LooseElementId<A> | {
548
+ id: Fqn<A>;
549
+ }): boolean;
550
+ includesDeployment(deployment: LooseDeploymentId<A> | {
551
+ id: DeploymentFqn<A>;
552
+ }): boolean;
553
+ includesRelation(relation: RelationId$1 | {
554
+ id: RelationId$1;
555
+ }): boolean;
556
+ /**
557
+ * Below are type guards.
558
+ */
559
+ isComputed(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.Computed<toComputed<A>>;
560
+ isLayouted(): this is LikeC4ViewModel.Layouted<A>;
561
+ /**
562
+ * @deprecated Use {@link isLayouted} instead
563
+ */
564
+ isDiagram(): this is LikeC4ViewModel.Layouted<A>;
565
+ isElementView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.ElementView<A, V>;
566
+ isScopedElementView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.ScopedElementView<A>;
567
+ isDeploymentView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.DeploymentView<A, V>;
568
+ isDynamicView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.DynamicView<A, V>;
569
+ }
570
+ declare namespace LikeC4ViewModel {
571
+ type Computed<A> = A extends AnyComputed ? LikeC4ViewModel<A, ComputedView<A>> : never;
572
+ type Layouted<A> = A extends AnyLayouted ? LikeC4ViewModel<A, LayoutedView<A>> : never;
573
+ interface ElementView<A extends Any, V extends $View<A> = $View<A>> extends LikeC4ViewModel<A, ViewWithType<V, 'element'>> {
574
+ readonly mode: never;
575
+ }
576
+ interface ScopedElementView<A extends Any> extends LikeC4ViewModel<A, ViewWithType<$View<A>, 'element'> & {
577
+ viewOf: Fqn<A>;
578
+ }> {
579
+ readonly mode: never;
580
+ readonly viewOf: ElementModel<A>;
581
+ }
582
+ interface DeploymentView<A extends Any, V extends $View<A> = $View<A>> extends LikeC4ViewModel<A, ViewWithType<V, 'deployment'>> {
583
+ readonly mode: never;
584
+ }
585
+ interface DynamicView<A extends Any, V extends $View<A>> extends LikeC4ViewModel<A, ViewWithType<V, 'dynamic'>> {
586
+ readonly mode: DynamicViewDisplayVariant;
587
+ readonly viewOf: never;
588
+ }
589
+ }
590
+ //#endregion
591
+ //#region src/model/types.d.ts
592
+ type IncomingFilter = 'all' | 'direct' | 'to-descendants';
593
+ type OutgoingFilter = 'all' | 'direct' | 'from-descendants';
594
+ type ElementOrFqn<A> = ElementId<A> | {
595
+ id: Fqn<A>;
596
+ };
597
+ type DeploymentOrFqn<A> = DeploymentId<A> | {
598
+ id: DeploymentFqn<A>;
599
+ };
600
+ type NodeOrId = string | {
601
+ id: NodeId;
602
+ };
603
+ type EdgeOrId = string | {
604
+ id: EdgeId;
605
+ };
606
+ type RelationOrId = string | {
607
+ id: RelationId$1;
608
+ };
609
+ type $View<A extends Any> = {
610
+ parsed: never;
611
+ computed: ComputedView<A>;
612
+ layouted: LayoutedView<A>;
613
+ }[Stage<A>];
614
+ type $ViewModel<A extends Any> = {
615
+ parsed: never;
616
+ computed: LikeC4ViewModel<A, $View<A>>;
617
+ layouted: LikeC4ViewModel<A, $View<A>>;
618
+ }[Stage<A>];
619
+ type $ModelData<A extends Any> = {
620
+ parsed: ParsedLikeC4ModelData<A>;
621
+ computed: ComputedLikeC4ModelData<A>;
622
+ layouted: LayoutedLikeC4ModelData<A>;
623
+ }[Stage<A>];
624
+ interface WithTags<A extends Any> {
625
+ get tags(): Tags<A>;
626
+ isTagged(tag: LooseTag<A>): boolean;
627
+ }
628
+ interface WithMetadata<A extends Any> {
629
+ hasMetadata(): boolean;
630
+ getMetadata(): Metadata<A>;
631
+ getMetadata(field: MetadataKey<A>): string | string[] | undefined;
632
+ }
633
+ //#endregion
634
+ //#region src/model/DeploymentModel.d.ts
635
+ declare class LikeC4DeploymentModel<A extends Any = Any> {
636
+ #private;
637
+ readonly $model: LikeC4Model<A>;
638
+ readonly $deployments: $ModelData<A>['deployments'];
639
+ constructor($model: LikeC4Model<A>);
640
+ /**
641
+ * Returns the styles configuration for the project.
642
+ */
643
+ get $styles(): LikeC4Styles;
644
+ /**
645
+ * Returns the Project ID associated with the model.
646
+ * If the project ID is not defined in the model, it returns "default".
647
+ */
648
+ get projectId(): ProjectId<A>;
649
+ /**
650
+ * Returns the project associated with the model.
651
+ * If the project is not defined in the model, it returns a default project with the ID "default".
652
+ */
653
+ get project(): LikeC4Project;
654
+ get specification(): Specification<A>;
655
+ element(el: DeploymentOrFqn<A>): DeploymentElementModel<A>;
656
+ findElement(el: LooseDeploymentId<A>): DeploymentElementModel<A> | null;
657
+ node(el: DeploymentOrFqn<A>): DeploymentNodeModel<A>;
658
+ findNode(el: LooseDeploymentId<A>): DeploymentNodeModel<A> | null;
659
+ instance(el: DeploymentOrFqn<A>): DeployedInstanceModel<A>;
660
+ findInstance(el: LooseDeploymentId<A>): DeployedInstanceModel<A> | null;
661
+ /**
662
+ * Returns the root elements of the model.
663
+ */
664
+ roots(): DeploymentNodesIterator<A>;
665
+ /**
666
+ * Returns all elements in the model.
667
+ */
668
+ elements(): DeploymentElementsIterator<A>;
669
+ /**
670
+ * Returns all elements in the model.
671
+ */
672
+ nodes(): DeploymentNodesIterator<A>;
673
+ nodesOfKind(kind: DeploymentKind<A>): DeploymentNodesIterator<A>;
674
+ instances(): DeployedInstancesIterator<A>;
675
+ /**
676
+ * Iterate over all instances of the given logical element.
677
+ */
678
+ instancesOf(element: ElementOrFqn<A>): DeployedInstancesIterator<A>;
679
+ deploymentRef(ref: FqnRef.DeploymentRef<A>): DeploymentElementModel<A> | NestedElementOfDeployedInstanceModel<A>;
680
+ /**
681
+ * Returns all relationships in the model.
682
+ */
683
+ relationships(): IteratorLike<DeploymentRelationModel<A>>;
684
+ /**
685
+ * Returns a specific relationship by its ID.
686
+ */
687
+ relationship(id: RelationOrId): DeploymentRelationModel<A>;
688
+ findRelationship(id: string): DeploymentRelationModel<A> | null;
689
+ /**
690
+ * Returns all deployment views in the model.
691
+ */
692
+ views(): IteratorLike<LikeC4ViewModel.DeploymentView<A>>;
693
+ /**
694
+ * Returns the parent element of given element.
695
+ * @see ancestors
696
+ */
697
+ parent(element: DeploymentOrFqn<A>): DeploymentNodeModel<A> | null;
698
+ /**
699
+ * Get all children of the element (only direct children),
700
+ * @see descendants
701
+ */
702
+ children(element: DeploymentOrFqn<A>): ReadonlySet<DeploymentElementModel<A>>;
703
+ /**
704
+ * Get all sibling (i.e. same parent)
705
+ */
706
+ siblings(element: DeploymentOrFqn<A>): DeploymentElementsIterator<A>;
707
+ /**
708
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
709
+ * (from closest to root)
710
+ */
711
+ ancestors(element: DeploymentOrFqn<A>): DeploymentNodesIterator<A>;
712
+ /**
713
+ * Get all descendant elements (i.e. children, children’s children, etc.)
714
+ */
715
+ descendants(element: DeploymentOrFqn<A>, sort?: 'asc' | 'desc'): DeploymentElementsIterator<A>;
716
+ /**
717
+ * Incoming relationships to the element and its descendants
718
+ * @see incomers
719
+ */
720
+ incoming(element: DeploymentOrFqn<A>, filter?: IncomingFilter): IteratorLike<DeploymentRelationModel<A>>;
721
+ /**
722
+ * Outgoing relationships from the element and its descendants
723
+ * @see outgoers
724
+ */
725
+ outgoing(element: DeploymentOrFqn<A>, filter?: OutgoingFilter): IteratorLike<DeploymentRelationModel<A>>;
726
+ private addElement;
727
+ private addRelation;
728
+ }
729
+ //#endregion
730
+ //#region src/model/DeploymentElementModel.d.ts
731
+ type DeploymentElementsIterator<A extends Any> = IteratorLike<DeploymentElementModel<A>>;
732
+ type DeployedInstancesIterator<A extends Any> = IteratorLike<DeployedInstanceModel<A>>;
733
+ type DeploymentNodesIterator<A extends Any> = IteratorLike<DeploymentNodeModel<A>>;
734
+ type DeploymentElementModel<A extends Any = Any> = DeploymentNodeModel<A> | DeployedInstanceModel<A>;
735
+ declare abstract class AbstractDeploymentElementModel<A extends Any> implements WithTags<A>, WithMetadata<A> {
736
+ /**
737
+ * Don't use in runtime, only for type inference
738
+ */
739
+ readonly Aux: A;
740
+ abstract readonly id: DeploymentFqn<A>;
741
+ abstract readonly _literalId: DeploymentId<A>;
742
+ abstract readonly parent: DeploymentNodeModel<A> | null;
743
+ abstract readonly title: string;
744
+ abstract readonly hierarchyLevel: number;
745
+ abstract readonly $model: LikeC4DeploymentModel<A>;
746
+ abstract readonly $node: DeploymentElement<A>;
747
+ abstract readonly tags: Tags<A>;
748
+ get style(): SetRequired<ElementStyle, 'shape' | 'color' | 'size'>;
749
+ get name(): string;
750
+ get shape(): ElementShape;
751
+ get color(): Color;
752
+ get icon(): IconUrl | null;
753
+ /**
754
+ * Short description of the element.
755
+ * Falls back to description if summary is not provided.
756
+ */
757
+ get summary(): RichTextOrEmpty;
758
+ /**
759
+ * Long description of the element.
760
+ * Falls back to summary if description is not provided.
761
+ */
762
+ get description(): RichTextOrEmpty;
763
+ get technology(): string | null;
764
+ get links(): ReadonlyArray<Link>;
765
+ /**
766
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
767
+ * (from closest to root)
768
+ */
769
+ ancestors(): DeploymentNodesIterator<A>;
770
+ /**
771
+ * Returns the common ancestor of this element and another element.
772
+ */
773
+ commonAncestor(another: DeploymentElementModel<A>): DeploymentNodeModel<A> | null;
774
+ /**
775
+ * Get all sibling (i.e. same parent)
776
+ */
777
+ siblings(): DeploymentElementsIterator<A>;
778
+ /**
779
+ * Check if the element is a sibling of another element
780
+ */
781
+ isSibling(other: DeploymentElementModel<A>): boolean;
782
+ /**
783
+ * Resolve siblings of the element and its ancestors
784
+ * (from closest to root)
785
+ */
786
+ ascendingSiblings(): DeploymentElementsIterator<A>;
787
+ /**
788
+ * Resolve siblings of the element and its ancestors
789
+ * (from root to closest)
790
+ */
791
+ descendingSiblings(): DeploymentElementsIterator<A>;
792
+ incoming(filter?: IncomingFilter): IteratorLike<DeploymentRelationModel<A>>;
793
+ outgoing(filter?: OutgoingFilter): IteratorLike<DeploymentRelationModel<A>>;
794
+ incomers(filter?: IncomingFilter): IteratorLike<DeploymentRelationEndpoint<A>>;
795
+ outgoers(filter?: OutgoingFilter): IteratorLike<DeploymentRelationEndpoint<A>>;
796
+ /**
797
+ * Iterate over all views that include this deployment element.
798
+ */
799
+ views(): IteratorLike<LikeC4ViewModel.DeploymentView<A>>;
800
+ isDeploymentNode(): this is DeploymentNodeModel<A>;
801
+ isInstance(): this is DeployedInstanceModel<A>;
802
+ abstract outgoingModelRelationships(): RelationshipsIterator<A>;
803
+ abstract incomingModelRelationships(): RelationshipsIterator<A>;
804
+ get allOutgoing(): RelationshipsAccum<A>;
805
+ get allIncoming(): RelationshipsAccum<A>;
806
+ hasMetadata(): boolean;
807
+ getMetadata(): Metadata<A>;
808
+ getMetadata(field: MetadataKey<A>): string | string[] | undefined;
809
+ /**
810
+ * Checks if the deployment element has the given tag.
811
+ */
812
+ isTagged(tag: LooseTag<A>): boolean;
813
+ }
814
+ declare class DeploymentNodeModel<A extends Any = Any> extends AbstractDeploymentElementModel<A> {
815
+ readonly $model: LikeC4DeploymentModel<A>;
816
+ readonly $node: DeploymentNode<A>;
817
+ id: DeploymentFqn<A>;
818
+ _literalId: DeploymentId<A>;
819
+ title: string;
820
+ hierarchyLevel: number;
821
+ constructor($model: LikeC4DeploymentModel<A>, $node: DeploymentNode<A>);
822
+ get parent(): DeploymentNodeModel<A> | null;
823
+ get kind(): DeploymentKind<A>;
824
+ get tags(): Tags<A>;
825
+ children(): ReadonlySet<DeploymentElementModel<A>>;
826
+ descendants(sort?: 'asc' | 'desc'): DeploymentElementsIterator<A>;
827
+ isDeploymentNode(): this is DeploymentNodeModel<A>;
828
+ /**
829
+ * Iterate over all instances nested in this deployment node.
830
+ */
831
+ instances(): DeployedInstancesIterator<A>;
832
+ /**
833
+ * Returns deployed instance inside this deployment node
834
+ * if only there are no more instances
835
+ */
836
+ onlyOneInstance(): DeployedInstanceModel<A> | null;
837
+ /**
838
+ * Cached result of relationships from instances
839
+ */
840
+ private _relationshipsFromInstances;
841
+ private relationshipsFromInstances;
842
+ /**
843
+ * We return only relationships that are not already present in nested instances
844
+ */
845
+ outgoingModelRelationships(): RelationshipsIterator<A>;
846
+ /**
847
+ * We return only relationships that are not already present in nested instances
848
+ */
849
+ incomingModelRelationships(): RelationshipsIterator<A>;
850
+ /**
851
+ * Returns an iterator of relationships between nested instances
852
+ */
853
+ internalModelRelationships(): ReadonlySet<RelationshipModel<A>>;
854
+ }
855
+ declare class DeployedInstanceModel<A extends Any = Any> extends AbstractDeploymentElementModel<A> {
856
+ readonly $model: LikeC4DeploymentModel<A>;
857
+ readonly $instance: DeployedInstance<A>;
858
+ readonly element: ElementModel<A>;
859
+ readonly id: DeploymentFqn<A>;
860
+ readonly _literalId: DeploymentId<A>;
861
+ readonly title: string;
862
+ readonly hierarchyLevel: number;
863
+ constructor($model: LikeC4DeploymentModel<A>, $instance: DeployedInstance<A>, element: ElementModel<A>);
864
+ get $node(): DeployedInstance<A>;
865
+ get parent(): DeploymentNodeModel<A>;
866
+ get style(): SetRequired<ElementStyle, 'shape' | 'color' | 'size'>;
867
+ get tags(): Tags<A>;
868
+ get kind(): ElementKind<A>;
869
+ get summary(): RichTextOrEmpty;
870
+ get description(): RichTextOrEmpty;
871
+ get technology(): string | null;
872
+ get links(): ReadonlyArray<Link>;
873
+ isInstance(): this is DeployedInstanceModel<A>;
874
+ outgoingModelRelationships(): RelationshipsIterator<A>;
875
+ incomingModelRelationships(): RelationshipsIterator<A>;
876
+ /**
877
+ * Iterate over all views that include this instance.
878
+ * (Some views may include the parent deployment node instead of the instance.)
879
+ */
880
+ views(): IteratorLike<LikeC4ViewModel.DeploymentView<A>>;
881
+ }
882
+ declare class NestedElementOfDeployedInstanceModel<A extends Any = Any> {
883
+ readonly instance: DeployedInstanceModel<A>;
884
+ readonly element: ElementModel<A>;
885
+ constructor(instance: DeployedInstanceModel<A>, element: ElementModel<A>);
886
+ get id(): DeploymentFqn<A>;
887
+ get _literalId(): DeploymentId<A>;
888
+ get style(): SetRequired<ElementStyle, 'shape' | 'color'>;
889
+ get shape(): ElementShape;
890
+ get color(): Color;
891
+ get title(): string;
892
+ get summary(): RichTextOrEmpty;
893
+ get description(): RichTextOrEmpty;
894
+ get technology(): string | null;
895
+ isDeploymentNode(): this is DeploymentNodeModel<A>;
896
+ isInstance(): this is DeployedInstanceModel<A>;
897
+ }
898
+ type DeploymentRelationEndpoint<A extends Any = Any> = DeploymentElementModel<A> | NestedElementOfDeployedInstanceModel<A>;
899
+ declare class DeploymentRelationModel<A extends Any = Any> implements AnyRelationshipModel<A> {
900
+ readonly $model: LikeC4DeploymentModel<A>;
901
+ readonly $relationship: DeploymentRelationship<A>;
902
+ boundary: DeploymentNodeModel<A> | null;
903
+ source: DeploymentRelationEndpoint<A>;
904
+ target: DeploymentRelationEndpoint<A>;
905
+ constructor($model: LikeC4DeploymentModel<A>, $relationship: DeploymentRelationship<A>);
906
+ get id(): RelationId$1;
907
+ get expression(): string;
908
+ get title(): string | null;
909
+ get technology(): string | null;
910
+ /**
911
+ * Returns true if the relationship has a summary and a description
912
+ * (if one is missing - it falls back to another)
913
+ */
914
+ get hasSummary(): boolean;
915
+ /**
916
+ * Short description of the relationship.
917
+ * Falls back to description if summary is not provided.
918
+ */
919
+ get summary(): RichTextOrEmpty;
920
+ /**
921
+ * Long description of the relationship.
922
+ * Falls back to summary if description is not provided.
923
+ */
924
+ get description(): RichTextOrEmpty;
925
+ get tags(): Tags<A>;
926
+ get kind(): RelationKind<A> | null;
927
+ get navigateTo(): LikeC4ViewModel<A> | null;
928
+ get links(): ReadonlyArray<Link>;
929
+ get color(): Color;
930
+ get line(): RelationshipLineType;
931
+ get head(): RelationshipArrowType;
932
+ get tail(): RelationshipArrowType | undefined;
933
+ views(): IteratorLike<LikeC4ViewModel.DeploymentView<A>>;
934
+ isDeploymentRelation(): this is DeploymentRelationModel<A>;
935
+ isModelRelation(): this is RelationshipModel<A>;
936
+ hasMetadata(): boolean;
937
+ getMetadata(): Metadata<A>;
938
+ getMetadata(field: MetadataKey<A>): string | string[] | undefined;
939
+ /**
940
+ * Checks if the relationship has the given tag.
941
+ */
942
+ isTagged(tag: LooseTag<A>): boolean;
943
+ }
944
+ declare class RelationshipsAccum<A extends Any = Any> {
945
+ readonly model: ReadonlySet<RelationshipModel<A>>;
946
+ readonly deployment: ReadonlySet<DeploymentRelationModel<A>>;
947
+ static empty<A extends Any>(): RelationshipsAccum<A>;
948
+ static from<A extends Any>(model: Iterable<RelationshipModel<A>> | undefined, deployment?: Iterable<DeploymentRelationModel<A>>): RelationshipsAccum<A>;
949
+ /**
950
+ * @param model relationships from logical model
951
+ * @param deployment relationships from deployment model
952
+ */
953
+ constructor(model?: ReadonlySet<RelationshipModel<A>>, deployment?: ReadonlySet<DeploymentRelationModel<A>>);
954
+ get isEmpty(): boolean;
955
+ get nonEmpty(): boolean;
956
+ get size(): number;
957
+ /**
958
+ * Returns new Accum containing all the elements which are both in this and otherAccum
959
+ */
960
+ intersect(otherAccum: RelationshipsAccum<A>): RelationshipsAccum<A>;
961
+ /**
962
+ * Returns new Accum containing all the elements which are both in this and otherAccum
963
+ */
964
+ difference(otherAccum: RelationshipsAccum<A>): RelationshipsAccum<A>;
965
+ /**
966
+ * Returns new Accum containing all the elements from both
967
+ */
968
+ union(otherAccum: RelationshipsAccum<A>): RelationshipsAccum<A>;
969
+ }
970
+ //#endregion
971
+ //#region src/model/LikeC4Model.d.ts
972
+ declare class LikeC4Model<A extends Any = Any> {
973
+ /**
974
+ * Don't use in runtime, only for type inference
975
+ */
976
+ readonly Aux: A;
977
+ protected readonly _elements: Map<Fqn<A>, ElementModel<A>>;
978
+ protected readonly _parents: Map<Fqn<A>, ElementModel<A>>;
979
+ protected readonly _children: DefaultMap<Fqn<A>, Set<ElementModel<A>>>;
980
+ protected readonly _rootElements: Set<ElementModel<A>>;
981
+ protected readonly _relations: Map<RelationId$1<string>, RelationshipModel<A>>;
982
+ protected readonly _incoming: DefaultMap<Fqn<A>, Set<RelationshipModel<A>>>;
983
+ protected readonly _outgoing: DefaultMap<Fqn<A>, Set<RelationshipModel<A>>>;
984
+ protected readonly _internal: DefaultMap<Fqn<A>, Set<RelationshipModel<A>>>;
985
+ protected readonly _views: Map<ViewId<A>, LikeC4ViewModel<A, $View<A>>>;
986
+ protected readonly _rootViewFolder: LikeC4ViewsFolder<A>;
987
+ protected readonly _viewFolders: Map<string, LikeC4ViewsFolder<A>>;
988
+ protected readonly _viewFolderItems: DefaultMap<string, Set<LikeC4ViewModel<A, $View<A>> | LikeC4ViewsFolder<A>>>;
989
+ protected readonly _allTags: DefaultMap<Tag<A>, Set<ElementModel<A> | RelationshipModel<A> | LikeC4ViewModel<A, $View<A>>>>;
990
+ static fromParsed<T extends AnyParsed>(model: ParsedLikeC4ModelData<T>): LikeC4Model<T>;
991
+ /**
992
+ * Creates a new LikeC4Model instance from the provided model data.
993
+ * Model with parsed data will not have views, as they must be computed
994
+ * (this model is used for computing views)
995
+ *
996
+ * @typeParam M - Type parameter constrained to AnyLikeC4Model
997
+ * @param model - The model data to create a LikeC4Model from
998
+ * @returns A new LikeC4Model instance with the type derived from the input model
999
+ */
1000
+ static create<T extends AnyParsed>(model: ParsedLikeC4ModelData<T>): LikeC4Model<T>;
1001
+ static create<T extends AnyComputed>(model: ComputedLikeC4ModelData<T>): LikeC4Model<T>;
1002
+ static create<T extends AnyLayouted>(model: LayoutedLikeC4ModelData<T>): LikeC4Model<T>;
1003
+ static create<T extends Any>(model: $ModelData<T>): LikeC4Model<T>;
1004
+ /**
1005
+ * Creates a new LikeC4Model instance and infers types from a model dump.\
1006
+ * Model dump expected to be computed or layouted.
1007
+ *
1008
+ * @typeParam D - A constant type parameter extending LikeC4ModelDump
1009
+ * @param dump - The model dump to create the instance from
1010
+ * @returns A new LikeC4Model instance with types inferred from the dump
1011
+ */
1012
+ static fromDump<const D extends LikeC4ModelDump>(dump: D): LikeC4Model<AuxFromDump<D>>;
1013
+ readonly deployment: LikeC4DeploymentModel<A>;
1014
+ readonly $data: $ModelData<A>;
1015
+ constructor($data: $ModelData<A>);
1016
+ /**
1017
+ * Type narrows the model to the parsed stage.
1018
+ * This is useful for tests
1019
+ */
1020
+ get asParsed(): LikeC4Model.Parsed<A>;
1021
+ /**
1022
+ * Type narrows the model to the layouted stage.
1023
+ * This is useful for tests
1024
+ */
1025
+ get asComputed(): LikeC4Model.Computed<A>;
1026
+ /**
1027
+ * Type narrows the model to the layouted stage.
1028
+ * This is useful for tests
1029
+ */
1030
+ get asLayouted(): LikeC4Model.Layouted<A>;
1031
+ /**
1032
+ * Returns the styles configuration for the project.
1033
+ */
1034
+ get $styles(): LikeC4Styles;
1035
+ /**
1036
+ * Type guard the model to the parsed stage.
1037
+ */
1038
+ isParsed(this: LikeC4Model<any>): this is LikeC4Model.Parsed<A>;
1039
+ /**
1040
+ * Type guard the model to the layouted stage.
1041
+ */
1042
+ isLayouted(this: LikeC4Model<any>): this is LikeC4Model.Layouted<A>;
1043
+ /**
1044
+ * Type guard the model to the computed stage.
1045
+ */
1046
+ isComputed(this: LikeC4Model<any>): this is LikeC4Model.Computed<A>;
1047
+ /**
1048
+ * Keeping here for backward compatibility
1049
+ * @deprecated use {@link $data}
1050
+ */
1051
+ get $model(): $ModelData<A>;
1052
+ get stage(): Stage<A>;
1053
+ /**
1054
+ * Returns the Project ID associated with the model.
1055
+ * If the project ID is not defined in the model, it returns "default".
1056
+ */
1057
+ get projectId(): ProjectId<A>;
1058
+ /**
1059
+ * Returns the project associated with the model.
1060
+ * If the project is not defined in the model, it returns a default project with the ID "default".
1061
+ */
1062
+ get project(): LikeC4Project;
1063
+ get specification(): Specification<A>;
1064
+ get globals(): ModelGlobals<A>;
1065
+ /**
1066
+ * Returns the element with the given FQN.
1067
+ *
1068
+ * @throws Error if element is not found\
1069
+ * Use {@link findElement} if you don't want to throw an error
1070
+ *
1071
+ * @note Method is type-safe for typed model
1072
+ * @example
1073
+ * model.element('cloud.frontend')
1074
+ * // or object with id property of scalar.Fqn
1075
+ * model.element({
1076
+ * id: 'dashboard',
1077
+ * })
1078
+ */
1079
+ element(el: ElementId<A> | {
1080
+ id: Fqn<A>;
1081
+ }): ElementModel<A>;
1082
+ /**
1083
+ * Returns the element with the given FQN.
1084
+ *
1085
+ * @returns Element if found, null otherwise
1086
+ * @note Method is not type-safe as {@link element}
1087
+ *
1088
+ * @example
1089
+ * model.findElement('cloud.frontend')
1090
+ */
1091
+ findElement(el: LooseElementId<A>): ElementModel<A> | null;
1092
+ /**
1093
+ * Returns the root elements of the model.
1094
+ */
1095
+ roots(): ElementsIterator<A>;
1096
+ /**
1097
+ * Returns all elements in the model.
1098
+ */
1099
+ elements(): ElementsIterator<A>;
1100
+ /**
1101
+ * Returns all relationships in the model.
1102
+ */
1103
+ relationships(): RelationshipsIterator<A>;
1104
+ /**
1105
+ * Returns a specific relationship by its ID.
1106
+ * If the relationship is not found in the model, it will be searched in the deployment model.
1107
+ * Search can be limited to the model or deployment model only.
1108
+ */
1109
+ relationship(rel: RelationOrId, type: 'model'): RelationshipModel<A>;
1110
+ relationship(rel: RelationOrId, type: 'deployment'): DeploymentRelationModel<A>;
1111
+ relationship(rel: RelationId$1, type?: 'model' | 'deployment'): RelationshipModel<A> | DeploymentRelationModel<A>;
1112
+ findRelationship(id: string, type: 'model'): RelationshipModel<A> | null;
1113
+ findRelationship(id: string, type: 'deployment'): DeploymentRelationModel<A> | null;
1114
+ findRelationship(id: string, type?: 'model' | 'deployment'): RelationshipModel<A> | DeploymentRelationModel<A> | null;
1115
+ /**
1116
+ * Returns all views in the model.
1117
+ */
1118
+ views(): IteratorLike<LikeC4ViewModel<A, $View<A>>>;
1119
+ /**
1120
+ * Returns a specific view by its ID.
1121
+ * @note Method is type-safe for typed model
1122
+ * @throws Error if view is not found\
1123
+ * Use {@link findView} if you don't want to throw an error
1124
+ *
1125
+ * @example
1126
+ * model.view('index')
1127
+ * // or object with id property of scalar.ViewId
1128
+ * model.view({
1129
+ * id: 'index',
1130
+ * })
1131
+ */
1132
+ view(viewId: ViewId<A> | {
1133
+ id: ViewId$1<ViewId<A>>;
1134
+ }): $ViewModel<A>;
1135
+ /**
1136
+ * Returns a specific view by its ID.
1137
+ * @note Method is not type-safe as {@link view}
1138
+ *
1139
+ * @example
1140
+ * model.findView('index')
1141
+ */
1142
+ findView(viewId: LooseViewId<A>): $ViewModel<A> | null;
1143
+ /**
1144
+ * Returns manual layout snapshot for given view ID, if any.
1145
+ */
1146
+ findManualLayout(viewId: LooseViewId<A>): ViewManualLayoutSnapshot | null;
1147
+ /**
1148
+ * Returns a view folder by its path.
1149
+ * Path is extracted from the view title, e.g. "Group 1/Group 2/View" -> "Group 1/Group 2"
1150
+ * @throws Error if view folder is not found.
1151
+ */
1152
+ viewFolder(path: string): LikeC4ViewsFolder<A>;
1153
+ /**
1154
+ * Root folder is a special one with an empty path and used only for internal purposes.
1155
+ * It is not visible to the user and should be used only to get top-level folders and views.
1156
+ */
1157
+ get rootViewFolder(): LikeC4ViewsFolder<A>;
1158
+ /**
1159
+ * Whether the model has any view folders.
1160
+ */
1161
+ get hasViewFolders(): boolean;
1162
+ /**
1163
+ * Returns all children of a view folder.
1164
+ * Path is extracted from the view title, e.g. "Group 1/Group 2/View" -> "Group 1/Group 2"
1165
+ *
1166
+ * @throws Error if view folder is not found.
1167
+ */
1168
+ viewFolderItems(path: string): ReadonlySet<LikeC4ViewsFolder<A> | LikeC4ViewModel<A>>;
1169
+ /**
1170
+ * Returns the parent element of given element.
1171
+ * @see ancestors
1172
+ */
1173
+ parent(element: ElementOrFqn<A>): ElementModel<A> | null;
1174
+ /**
1175
+ * Get all children of the element (only direct children),
1176
+ * @see descendants
1177
+ */
1178
+ children(element: ElementOrFqn<A>): ReadonlySet<ElementModel<A>>;
1179
+ /**
1180
+ * Get all sibling (i.e. same parent)
1181
+ */
1182
+ siblings(element: ElementOrFqn<A>): ElementsIterator<A>;
1183
+ /**
1184
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
1185
+ * (from closest to root)
1186
+ */
1187
+ ancestors(element: ElementOrFqn<A>): ElementsIterator<A>;
1188
+ /**
1189
+ * Get all descendant elements (i.e. children, children’s children, etc.)
1190
+ */
1191
+ descendants(element: ElementOrFqn<A>): ElementsIterator<A>;
1192
+ /**
1193
+ * Incoming relationships to the element and its descendants
1194
+ * @see incomers
1195
+ */
1196
+ incoming(element: ElementOrFqn<A>, filter?: IncomingFilter): RelationshipsIterator<A>;
1197
+ /**
1198
+ * Outgoing relationships from the element and its descendants
1199
+ * @see outgoers
1200
+ */
1201
+ outgoing(element: ElementOrFqn<A>, filter?: OutgoingFilter): RelationshipsIterator<A>;
1202
+ /**
1203
+ * Returns array of all tags used in the model, sorted naturally.\
1204
+ * Use {@link specification.tags} to get all defined tags
1205
+ */
1206
+ get tags(): Tags<A>;
1207
+ /**
1208
+ * Returns all tags used in the model, sorted by usage count (descending).
1209
+ */
1210
+ get tagsSortedByUsage(): ReadonlyArray<{
1211
+ tag: Tag<A>;
1212
+ count: number;
1213
+ tagged: ReadonlySet<ElementModel<A> | RelationshipModel<A> | LikeC4ViewModel<A>>;
1214
+ }>;
1215
+ /**
1216
+ * Returns all elements, relationships and views marked with the given tag.
1217
+ */
1218
+ findByTag(tag: Tag<A>): IteratorLike<ElementModel<A> | RelationshipModel<A> | LikeC4ViewModel<A>>;
1219
+ findByTag(tag: Tag<A>, type: 'elements'): IteratorLike<ElementModel<A>>;
1220
+ findByTag(tag: Tag<A>, type: 'views'): IteratorLike<LikeC4ViewModel<A>>;
1221
+ findByTag(tag: Tag<A>, type: 'relationships'): IteratorLike<RelationshipModel<A>>;
1222
+ /**
1223
+ * Returns all elements of the given kind.
1224
+ */
1225
+ elementsOfKind(kind: ElementKind<A>): IteratorLike<ElementModel<A>>;
1226
+ /**
1227
+ * Returns all elements that match the given where operator.
1228
+ *
1229
+ * @example
1230
+ * ```ts
1231
+ * model.where({
1232
+ * and: [
1233
+ * { kind: 'component' },
1234
+ * {
1235
+ * or: [
1236
+ * { tag: 'old' },
1237
+ * { tag: { neq: 'new' } },
1238
+ * ],
1239
+ * },
1240
+ * ],
1241
+ * })
1242
+ * ```
1243
+ */
1244
+ elementsWhere(where: WhereOperator<A>): IteratorLike<ElementModel<A>>;
1245
+ /**
1246
+ * Returns all **model** relationships that match the given where operator.
1247
+ *
1248
+ * @example
1249
+ * ```ts
1250
+ * model.relationshipsWhere({
1251
+ * and: [
1252
+ * { kind: 'uses' },
1253
+ * {
1254
+ * or: [
1255
+ * { tag: 'old' },
1256
+ * { tag: { neq: 'new' } },
1257
+ * ],
1258
+ * },
1259
+ * ],
1260
+ * })
1261
+ * ```
1262
+ */
1263
+ relationshipsWhere(where: WhereOperator<A>): IteratorLike<RelationshipModel<A>>;
1264
+ private addElement;
1265
+ private addImportedElement;
1266
+ private addRelation;
1267
+ }
1268
+ /**
1269
+ * When you do not need types in the model
1270
+ */
1271
+ type AnyLikeC4Model = LikeC4Model<any>;
1272
+ declare namespace LikeC4Model {
1273
+ const EMPTY: LikeC4Model<Unknown>;
1274
+ type Parsed<A = unknown> = IsAny<A> extends true ? LikeC4Model<AnyParsed> : A extends Aux<any, infer E, infer D, infer V, infer PID, infer Spec> ? LikeC4Model<Aux<'parsed', E, D, V, PID, Spec>> : LikeC4Model<UnknownParsed>;
1275
+ type Computed<A = unknown> = IsAny<A> extends true ? LikeC4Model<AnyComputed> : A extends Aux<any, infer E, infer D, infer V, infer PID, infer Spec> ? LikeC4Model<Aux<'computed', E, D, V, PID, Spec>> : LikeC4Model<UnknownComputed>;
1276
+ type Layouted<A = unknown> = IsAny<A> extends true ? LikeC4Model<AnyLayouted> : A extends Aux<any, infer E, infer D, infer V, infer PID, infer Spec> ? LikeC4Model<Aux<'layouted', E, D, V, PID, Spec>> : LikeC4Model<UnknownLayouted>;
1277
+ type Node<A = Any> = A extends Any ? NodeModel<A> : never;
1278
+ type Element<A = Any> = A extends Any ? ElementModel<A> : never;
1279
+ type Relationship<A = Any> = A extends Any ? RelationshipModel<A> : never;
1280
+ type View<A = Any> = A extends Any ? $ViewModel<A> : never;
1281
+ type DeploymentNode<A = Any> = A extends Any ? DeploymentNodeModel<A> : never;
1282
+ type DeploymentRelation<A = Any> = A extends Any ? DeploymentRelationModel<A> : never;
1283
+ type DeployedInstance<A = Any> = A extends Any ? DeployedInstanceModel<A> : never;
1284
+ type AnyRelation<M = Any> = M extends Any ? RelationshipModel<M> | DeploymentRelationModel<M> : never;
1285
+ }
1286
+ //#endregion
1287
+ export { ElementModel as C, NodeModel as S, RelationshipModel as T, WithMetadata as _, DeploymentNodeModel as a, LikeC4ViewsFolder as b, NestedElementOfDeployedInstanceModel as c, DeploymentOrFqn as d, EdgeOrId as f, OutgoingFilter as g, NodeOrId as h, DeploymentElementModel as i, RelationshipsAccum as l, IncomingFilter as m, LikeC4Model as n, DeploymentRelationEndpoint as o, ElementOrFqn as p, DeployedInstanceModel as r, DeploymentRelationModel as s, AnyLikeC4Model as t, LikeC4DeploymentModel as u, WithTags as v, AnyRelationshipModel as w, EdgeModel as x, LikeC4ViewModel as y };