@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
@@ -0,0 +1,719 @@
1
+ import { IsStringLiteral, LiteralUnion, Simplify, SetRequired } from 'type-fest';
2
+ import { C as ComputedView, L as LikeC4View, a9 as ParsedLikeC4Model, a as ComputedLikeC4Model, bj as ViewId, at as RelationId, be as NodeId, bb as EdgeId, a6 as GenericLikeC4Model, a7 as LayoutedLikeC4Model, b4 as DiagramView, a8 as LikeC4ModelDump, f as DeploymentNodeKind, aX as ComputedDynamicView, bg as StepEdgeId, aZ as ComputedElementView, aW as ComputedDeploymentView, as as ModelRelation, a5 as AnyParsedLikeC4Model, a4 as ModelGlobals, h as DeploymentRef, d as DeploymentNode, b as DeployedInstance, c as DeploymentElementStyle, i as DeploymentRelation } from './core.C05RDLhi.js';
3
+ import { F as Fqn, K as KeysOf, f as ElementKind, l as ElementShape, s as Color, o as Tag, n as Link, a as IteratorLike, x as ThemeColor, i as Element } from './core.D74xkKkG.js';
4
+
5
+ type ComputeViewResult<V extends ComputedView = ComputedView> = {
6
+ isSuccess: true;
7
+ error?: undefined;
8
+ view: V;
9
+ } | {
10
+ isSuccess: false;
11
+ error: Error;
12
+ view: undefined;
13
+ };
14
+ declare function unsafeComputeView(viewsource: LikeC4View, likec4model: LikeC4Model): ComputedView;
15
+ declare function computeView<V extends LikeC4View>(viewsource: V, likec4model: LikeC4Model): ComputeViewResult;
16
+ declare function computeViews<P extends ParsedLikeC4Model>(parsed: P): ComputedLikeC4Model;
17
+
18
+ type IncomingFilter = 'all' | 'direct' | 'to-descendants';
19
+ type OutgoingFilter = 'all' | 'direct' | 'from-descendants';
20
+ type WithId<Id> = {
21
+ id: Id;
22
+ };
23
+ type WithViews<Id extends string, ViewType> = {
24
+ views: Record<Id, ViewType>;
25
+ };
26
+ type AnyAux = Aux<string, string, string, any>;
27
+ /**
28
+ * Auxilary type to keep track
29
+ */
30
+ interface Aux<Element extends string, Deployment extends string, View extends string, ViewType> {
31
+ Element: Element;
32
+ Deployment: Deployment;
33
+ View: View;
34
+ Fqn: IsStringLiteral<Element> extends true ? Fqn<Element> : Fqn;
35
+ ElementOrFqn: Element | WithId<this['Fqn']>;
36
+ DeploymentFqn: IsStringLiteral<Deployment> extends true ? Fqn<Deployment> : Fqn;
37
+ DeploymentOrFqn: Deployment | WithId<this['DeploymentFqn']>;
38
+ ViewId: IsStringLiteral<View> extends true ? ViewId<View> : ViewId;
39
+ ViewType: ViewType;
40
+ RelationId: RelationId;
41
+ NodeId: NodeId;
42
+ NodeIdLiteral: string;
43
+ EdgeId: EdgeId;
44
+ EdgeIdLiteral: string;
45
+ NodeOrId: LiteralUnion<this['NodeIdLiteral'], string> | WithId<this['NodeId']>;
46
+ EdgeOrId: LiteralUnion<this['EdgeIdLiteral'], string> | WithId<this['EdgeId']>;
47
+ Model: Simplify<Omit<GenericLikeC4Model, 'views'> & WithViews<this['ViewId'], ViewType>>;
48
+ }
49
+ declare namespace Aux {
50
+ type FromParsed<M> = M extends ParsedLikeC4Model ? Aux<KeysOf<M['elements']>, KeysOf<M['deployments']['elements']>, KeysOf<M['views']>, ComputedView<ViewId<KeysOf<M['views']>>, string>> : never;
51
+ type FromModel<M> = M extends GenericLikeC4Model ? Aux<KeysOf<M['elements']>, KeysOf<M['deployments']['elements']>, KeysOf<M['views']>, M extends LayoutedLikeC4Model ? DiagramView<ViewId<KeysOf<M['views']>>, string> : ComputedView<ViewId<KeysOf<M['views']>>, string>> : never;
52
+ type FromDump<M> = M extends LikeC4ModelDump ? Aux<KeysOf<M['elements']>, KeysOf<M['deployments']['elements']>, KeysOf<M['views']>, DiagramView<ViewId<KeysOf<M['views']>>, string>> : never;
53
+ }
54
+
55
+ type NodesIterator<M extends AnyAux, V extends ComputedView | DiagramView> = IteratorLike<NodeModel<M, V>>;
56
+ declare namespace NodeModel {
57
+ interface WithParent<M extends AnyAux, V extends ComputedView | DiagramView> extends NodeModel<M, V> {
58
+ parent: NodeModel<M, V>;
59
+ }
60
+ interface WithElement<M extends AnyAux, V extends ComputedView | DiagramView> extends NodeModel<M, V> {
61
+ kind: ElementKind;
62
+ element: ElementModel<M>;
63
+ }
64
+ interface WithDeploymentElement<M extends AnyAux, V extends ComputedView | DiagramView> extends NodeModel<M, V> {
65
+ kind: DeploymentNodeKind;
66
+ deployment: DeploymentElementModel<M>;
67
+ }
68
+ interface WithDeployedInstance<M extends AnyAux, V extends ComputedView | DiagramView> extends NodeModel<M, V> {
69
+ kind: 'instance';
70
+ element: ElementModel<M>;
71
+ deployment: DeployedInstanceModel<M>;
72
+ }
73
+ interface IsGroup<M extends AnyAux, V extends ComputedView | DiagramView> extends NodeModel<M, V> {
74
+ kind: typeof ElementKind.Group;
75
+ element: null;
76
+ deployment: null;
77
+ }
78
+ }
79
+ declare class NodeModel<M extends AnyAux, V extends ComputedView | DiagramView = M['ViewType']> {
80
+ readonly $view: LikeC4ViewModel<M, V>;
81
+ readonly $node: V['nodes'][number];
82
+ constructor($view: LikeC4ViewModel<M, V>, $node: V['nodes'][number]);
83
+ get id(): NodeId;
84
+ get title(): string;
85
+ get kind(): ElementKind | DeploymentNodeKind | typeof ElementKind.Group | 'instance';
86
+ get description(): string | null;
87
+ get technology(): string | null;
88
+ get parent(): NodeModel<M, V> | null;
89
+ get element(): ElementModel<M> | null;
90
+ get deployment(): DeploymentElementModel<M> | null;
91
+ get shape(): ElementShape;
92
+ get color(): Color;
93
+ get tags(): ReadonlyArray<Tag>;
94
+ get links(): ReadonlyArray<Link>;
95
+ get navigateTo(): LikeC4ViewModel<M> | null;
96
+ /**
97
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
98
+ * (from closest to root)
99
+ */
100
+ ancestors(): NodesIterator<M, V>;
101
+ children(): NodesIterator<M, V>;
102
+ sublings(): NodesIterator<M, V>;
103
+ incoming(filter?: IncomingFilter): EdgesIterator<M, V>;
104
+ incomers(filter?: IncomingFilter): NodesIterator<M, V>;
105
+ outgoing(filter?: OutgoingFilter): EdgesIterator<M, V>;
106
+ outgoers(filter?: OutgoingFilter): NodesIterator<M, V>;
107
+ isDiagramNode(): this is NodeModel<M, DiagramView>;
108
+ hasChildren(): boolean;
109
+ hasParent(): this is NodeModel.WithParent<M, V>;
110
+ /**
111
+ * Check if this node references to logical model element.
112
+ */
113
+ hasElement(): this is NodeModel.WithElement<M, V>;
114
+ /**
115
+ * Check if this node references to deployment element (Node or Instance).
116
+ */
117
+ hasDeployment(): this is NodeModel.WithDeploymentElement<M, V>;
118
+ /**
119
+ * Check if this node references to deployed instance
120
+ * Deployed instance always references to element and deployment element.
121
+ */
122
+ hasDeployedInstance(): this is NodeModel.WithDeployedInstance<M, V>;
123
+ isGroup(): this is NodeModel.IsGroup<M, V>;
124
+ }
125
+
126
+ type EdgesIterator<M extends AnyAux, V extends ComputedView | DiagramView> = IteratorLike<EdgeModel<M, V>>;
127
+ declare class EdgeModel<M extends AnyAux, V extends ComputedView | DiagramView = M['ViewType']> {
128
+ readonly view: LikeC4ViewModel<M, V>;
129
+ readonly $edge: V['edges'][number];
130
+ readonly source: NodeModel<M, V>;
131
+ readonly target: NodeModel<M, V>;
132
+ constructor(view: LikeC4ViewModel<M, V>, $edge: V['edges'][number], source: NodeModel<M, V>, target: NodeModel<M, V>);
133
+ get id(): M['EdgeId'];
134
+ get parent(): NodeModel<M, V> | null;
135
+ get label(): string | null;
136
+ get description(): string | null;
137
+ get technology(): string | null;
138
+ hasParent(): this is EdgeModel.WithParent<M, V>;
139
+ get tags(): ReadonlyArray<Tag>;
140
+ get stepNumber(): number | null;
141
+ get navigateTo(): LikeC4ViewModel<M> | null;
142
+ isStep(): this is EdgeModel.StepEdge<M, ComputedDynamicView>;
143
+ relationships(type: 'model'): IteratorLike<RelationshipModel<M>>;
144
+ relationships(type: 'deployment'): IteratorLike<DeploymentRelationModel<M>>;
145
+ relationships(type?: 'model' | 'deployment'): IteratorLike<LikeC4Model.AnyRelation<M>>;
146
+ includesRelation(rel: M['RelationId']): boolean;
147
+ }
148
+ declare namespace EdgeModel {
149
+ interface StepEdge<M extends AnyAux, V extends ComputedView | DiagramView> extends EdgeModel<M, V> {
150
+ id: StepEdgeId;
151
+ stepNumber: number;
152
+ }
153
+ interface WithParent<M extends AnyAux, V extends ComputedView | DiagramView> extends EdgeModel<M, V> {
154
+ parent: NodeModel<M, V>;
155
+ }
156
+ }
157
+
158
+ type ViewsIterator<M extends AnyAux> = IteratorLike<LikeC4ViewModel<M>>;
159
+ declare class LikeC4ViewModel<M extends AnyAux, V extends ComputedView | DiagramView = M['ViewType']> {
160
+ #private;
161
+ readonly $model: LikeC4Model<M>;
162
+ readonly $view: V;
163
+ constructor($model: LikeC4Model<M>, $view: V);
164
+ get __(): NonNullable<M['ViewType']['__']>;
165
+ get id(): M['ViewId'];
166
+ get title(): string | null;
167
+ get tags(): ReadonlyArray<Tag>;
168
+ get links(): ReadonlyArray<Link>;
169
+ get viewOf(): ElementModel<M> | null;
170
+ /**
171
+ * All tags from nodes and edges.
172
+ */
173
+ get includedTags(): ReadonlyArray<Tag>;
174
+ roots(): NodesIterator<M, V>;
175
+ /**
176
+ * Iterate over all nodes that have children.
177
+ */
178
+ compounds(): NodesIterator<M, V>;
179
+ /**
180
+ * Get node by id.
181
+ * @throws Error if node is not found.
182
+ */
183
+ node(node: M['NodeOrId']): NodeModel<M, V>;
184
+ /**
185
+ * Find node by id.
186
+ */
187
+ findNode(node: M['NodeOrId']): NodeModel<M, V> | null;
188
+ /**
189
+ * Iterate over all nodes.
190
+ */
191
+ nodes(): NodesIterator<M, V>;
192
+ /**
193
+ * Find edge by id.
194
+ * @param edge Edge or id
195
+ * @returns EdgeModel
196
+ */
197
+ edge(edge: M['EdgeOrId']): EdgeModel<M, V>;
198
+ findEdge(edge: M['EdgeOrId']): EdgeModel<M, V> | null;
199
+ /**
200
+ * Iterate over all edges.
201
+ */
202
+ edges(): EdgesIterator<M, V>;
203
+ /**
204
+ * Iterate over all edges.
205
+ */
206
+ edgesWithRelation(relation: M['RelationId']): EdgesIterator<M, V>;
207
+ /**
208
+ * Nodes that have references to elements from logical model.
209
+ */
210
+ elements(): IteratorLike<NodeModel.WithElement<M, V>>;
211
+ includesElement(elementId: M['Element']): boolean;
212
+ includesDeployment(deploymentId: M['Deployment']): boolean;
213
+ includesRelation(relationId: M['RelationId']): boolean;
214
+ /**
215
+ * Below are type guards.
216
+ */
217
+ isComputed(): this is LikeC4ViewModel<M, ComputedView>;
218
+ isDiagram(): this is LikeC4ViewModel<M, DiagramView>;
219
+ isElementView(): this is LikeC4ViewModel<M, ComputedElementView>;
220
+ isDeploymentView(): this is LikeC4ViewModel<M, ComputedDeploymentView>;
221
+ isDynamicView(): this is LikeC4ViewModel<M, ComputedDynamicView>;
222
+ }
223
+
224
+ type RelationshipsIterator<M extends AnyAux> = IteratorLike<RelationshipModel<M>>;
225
+ declare class RelationshipModel<M extends AnyAux = AnyAux> {
226
+ readonly model: LikeC4Model<M>;
227
+ readonly $relationship: ModelRelation;
228
+ readonly source: ElementModel<M>;
229
+ readonly target: ElementModel<M>;
230
+ /**
231
+ * Common ancestor of the source and target elements.
232
+ * Represents the boundary of the Relation.
233
+ */
234
+ readonly boundary: ElementModel<M> | null;
235
+ constructor(model: LikeC4Model<M>, $relationship: ModelRelation);
236
+ get id(): M['RelationId'];
237
+ get expression(): string;
238
+ get title(): string | null;
239
+ get technology(): string | null;
240
+ get description(): string | null;
241
+ get navigateTo(): LikeC4ViewModel<M> | null;
242
+ get tags(): ReadonlyArray<Tag>;
243
+ get links(): ReadonlyArray<Link>;
244
+ /**
245
+ * Iterate over all views that include this relationship.
246
+ */
247
+ views(): ViewsIterator<M>;
248
+ }
249
+
250
+ declare class LikeC4Model<M extends AnyAux = LikeC4Model.Any> {
251
+ #private;
252
+ readonly $model: M['Model'];
253
+ /**
254
+ * Only available in compile tim
255
+ */
256
+ readonly Aux: M;
257
+ readonly deployment: LikeC4DeploymentModel<M>;
258
+ /**
259
+ * Computes views from the parsed model
260
+ * Creates a new LikeC4Model instance from a parsed model.
261
+ *
262
+ * May throw an error if the model is invalid.
263
+ *
264
+ * @typeParam M - The type of the parsed LikeC4 model, must extend ParsedLikeC4Model
265
+ * @param parsed - The parsed LikeC4 model to compute from
266
+ * @returns A new LikeC4Model instance with computed relationships and structure
267
+ */
268
+ static compute<const M extends AnyParsedLikeC4Model>(parsed: M): LikeC4Model<Aux.FromParsed<M>>;
269
+ /**
270
+ * Creates a function that computes a view using the data from the model.
271
+ *
272
+ * @example
273
+ * const compute = LikeC4Model.makeCompute(parsedModel);
274
+ * const result = compute(viewSource);
275
+ */
276
+ static makeCompute<M extends AnyParsedLikeC4Model>(parsed: M): (viewsource: LikeC4View) => ComputeViewResult;
277
+ /**
278
+ * Creates a new LikeC4Model instance from the provided model data.
279
+ *
280
+ * @typeParam M - Type parameter constrained to AnyLikeC4Model
281
+ * @param model - The model data to create a LikeC4Model from
282
+ * @returns A new LikeC4Model instance with the type derived from the input model
283
+ */
284
+ static create<const M extends GenericLikeC4Model>(model: M): LikeC4Model<Aux.FromModel<M>>;
285
+ /**
286
+ * Creates a new LikeC4Model instance from a model dump.
287
+ *
288
+ * @typeParam M - A constant type parameter extending LikeC4ModelDump
289
+ * @param dump - The model dump to create the instance from
290
+ * @returns A new LikeC4Model instance with types inferred from the dump
291
+ */
292
+ static fromDump<const M extends LikeC4ModelDump>(dump: M): LikeC4Model<Aux.FromDump<M>>;
293
+ private constructor();
294
+ get type(): 'computed' | 'layouted';
295
+ element(el: M['ElementOrFqn']): ElementModel<M>;
296
+ findElement(el: LiteralUnion<M['Element'], string>): ElementModel<M> | null;
297
+ /**
298
+ * Returns the root elements of the model.
299
+ */
300
+ roots(): ElementsIterator<M>;
301
+ /**
302
+ * Returns all elements in the model.
303
+ */
304
+ elements(): ElementsIterator<M>;
305
+ /**
306
+ * Returns all relationships in the model.
307
+ */
308
+ relationships(): RelationshipsIterator<M>;
309
+ /**
310
+ * Returns a specific relationship by its ID.
311
+ * If the relationship is not found in the model, it will be searched in the deployment model.
312
+ * Search can be limited to the model or deployment model only.
313
+ */
314
+ relationship(id: M['RelationId'], type: 'model'): RelationshipModel<M>;
315
+ relationship(id: M['RelationId'], type: 'deployment'): DeploymentRelationModel<M>;
316
+ relationship(id: M['RelationId'], type?: 'model' | 'deployment'): RelationshipModel<M> | DeploymentRelationModel<M>;
317
+ findRelationship(id: LiteralUnion<M['RelationId'], string>, type: 'model'): RelationshipModel<M> | null;
318
+ findRelationship(id: LiteralUnion<M['RelationId'], string>, type: 'deployment'): DeploymentRelationModel<M> | null;
319
+ findRelationship(id: LiteralUnion<M['RelationId'], string>, type?: 'model' | 'deployment'): RelationshipModel<M> | DeploymentRelationModel<M> | null;
320
+ /**
321
+ * Returns all views in the model.
322
+ */
323
+ views(): IteratorLike<LikeC4ViewModel<M>>;
324
+ /**
325
+ * Returns a specific view by its ID.
326
+ */
327
+ view(viewId: M['View']): LikeC4ViewModel<M>;
328
+ findView(viewId: M['View']): LikeC4ViewModel<M>;
329
+ /**
330
+ * Returns the parent element of given element.
331
+ * @see ancestors
332
+ */
333
+ parent(element: M['ElementOrFqn']): ElementModel<M> | null;
334
+ /**
335
+ * Get all children of the element (only direct children),
336
+ * @see descendants
337
+ */
338
+ children(element: M['ElementOrFqn']): ReadonlySet<ElementModel<M>>;
339
+ /**
340
+ * Get all sibling (i.e. same parent)
341
+ */
342
+ siblings(element: M['ElementOrFqn']): ElementsIterator<M>;
343
+ /**
344
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
345
+ * (from closest to root)
346
+ */
347
+ ancestors(element: M['ElementOrFqn']): ElementsIterator<M>;
348
+ /**
349
+ * Get all descendant elements (i.e. children, children’s children, etc.)
350
+ */
351
+ descendants(element: M['ElementOrFqn']): ElementsIterator<M>;
352
+ /**
353
+ * Incoming relationships to the element and its descendants
354
+ * @see incomers
355
+ */
356
+ incoming(element: M['ElementOrFqn'], filter?: IncomingFilter): RelationshipsIterator<M>;
357
+ /**
358
+ * Outgoing relationships from the element and its descendants
359
+ * @see outgoers
360
+ */
361
+ outgoing(element: M['ElementOrFqn'], filter?: OutgoingFilter): RelationshipsIterator<M>;
362
+ globals(): ModelGlobals;
363
+ private addElement;
364
+ private addRelation;
365
+ }
366
+ declare namespace LikeC4Model {
367
+ type Any = Aux<string, string, string, ComputedView | DiagramView>;
368
+ type Element<M extends AnyAux = Any> = ElementModel<M>;
369
+ type Relation<M extends AnyAux = Any> = RelationshipModel<M>;
370
+ type AnyRelation<M extends AnyAux = Any> = RelationshipModel<M> | DeploymentRelationModel<M>;
371
+ type View<M extends AnyAux = Any, V extends ComputedView | DiagramView = M['ViewType']> = LikeC4ViewModel<M, V>;
372
+ type Node<M extends AnyAux = Any, V extends ComputedView | DiagramView = M['ViewType']> = NodeModel<M, V>;
373
+ type Edge<M extends AnyAux = Any, V extends ComputedView | DiagramView = M['ViewType']> = EdgeModel<M, V>;
374
+ type DeploymentModel<M extends AnyAux = AnyAux> = LikeC4DeploymentModel<M>;
375
+ type Deployment<M extends AnyAux = AnyAux> = DeploymentElementModel<M>;
376
+ type DeploymentNode<M extends AnyAux = AnyAux> = DeploymentNodeModel<M>;
377
+ type DeployedInstance<M extends AnyAux = AnyAux> = DeployedInstanceModel<M>;
378
+ type Typed<Elements extends string = string, Deployments extends string = string, Views extends string = string, ViewType = DiagramView<Views> | ComputedView<Views>> = Aux<Elements, Deployments, Views, ViewType>;
379
+ type Computed<Elements extends string = string, Deployments extends string = string, Views extends string = string> = LikeC4Model<Typed<Elements, Deployments, Views, ComputedView<Views>>>;
380
+ type Layouted<Elements extends string = string, Deployments extends string = string, Views extends string = string> = LikeC4Model<Typed<Elements, Deployments, Views, DiagramView<Views>>>;
381
+ }
382
+
383
+ declare class LikeC4DeploymentModel<M extends AnyAux = AnyAux> {
384
+ #private;
385
+ readonly $model: LikeC4Model<M>;
386
+ readonly $deployments: GenericLikeC4Model['deployments'];
387
+ constructor($model: LikeC4Model<M>, $deployments: GenericLikeC4Model['deployments']);
388
+ element(el: M['DeploymentOrFqn']): DeploymentElementModel<M>;
389
+ findElement(el: M['Deployment']): DeploymentElementModel<M> | null;
390
+ node(el: M['DeploymentOrFqn']): DeploymentNodeModel<M>;
391
+ findNode(el: M['Deployment']): DeploymentNodeModel<M> | null;
392
+ instance(el: M['DeploymentOrFqn']): DeployedInstanceModel<M>;
393
+ findInstance(el: M['Deployment']): DeployedInstanceModel<M> | null;
394
+ /**
395
+ * Returns the root elements of the model.
396
+ */
397
+ roots(): DeploymentNodesIterator<M>;
398
+ /**
399
+ * Returns all elements in the model.
400
+ */
401
+ elements(): DeploymentElementsIterator<M>;
402
+ /**
403
+ * Returns all elements in the model.
404
+ */
405
+ nodes(): DeploymentNodesIterator<M>;
406
+ instances(): DeployedInstancesIterator<M>;
407
+ /**
408
+ * Iterate over all instances of the given logical element.
409
+ */
410
+ instancesOf(element: M['ElementOrFqn']): DeployedInstancesIterator<M>;
411
+ deploymentRef(ref: DeploymentRef): DeploymentElementModel<M> | NestedElementOfDeployedInstanceModel<M>;
412
+ /**
413
+ * Returns all relationships in the model.
414
+ */
415
+ relationships(): IteratorLike<DeploymentRelationModel<M>>;
416
+ /**
417
+ * Returns a specific relationship by its ID.
418
+ */
419
+ relationship(id: M['RelationId']): DeploymentRelationModel<M>;
420
+ findRelationship(id: LiteralUnion<M['RelationId'], string>): DeploymentRelationModel<M> | null;
421
+ /**
422
+ * Returns all deployment views in the model.
423
+ */
424
+ views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
425
+ /**
426
+ * Returns the parent element of given element.
427
+ * @see ancestors
428
+ */
429
+ parent(element: M['DeploymentOrFqn']): DeploymentNodeModel<M> | null;
430
+ /**
431
+ * Get all children of the element (only direct children),
432
+ * @see descendants
433
+ */
434
+ children(element: M['DeploymentOrFqn']): ReadonlySet<DeploymentElementModel<M>>;
435
+ /**
436
+ * Get all sibling (i.e. same parent)
437
+ */
438
+ siblings(element: M['DeploymentOrFqn']): DeploymentElementsIterator<M>;
439
+ /**
440
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
441
+ * (from closest to root)
442
+ */
443
+ ancestors(element: M['DeploymentOrFqn']): DeploymentNodesIterator<M>;
444
+ /**
445
+ * Get all descendant elements (i.e. children, children’s children, etc.)
446
+ */
447
+ descendants(element: M['DeploymentOrFqn'], sort?: 'asc' | 'desc'): DeploymentElementsIterator<M>;
448
+ /**
449
+ * Incoming relationships to the element and its descendants
450
+ * @see incomers
451
+ */
452
+ incoming(element: M['DeploymentOrFqn'], filter?: IncomingFilter): IteratorLike<DeploymentRelationModel<M>>;
453
+ /**
454
+ * Outgoing relationships from the element and its descendants
455
+ * @see outgoers
456
+ */
457
+ outgoing(element: M['DeploymentOrFqn'], filter?: OutgoingFilter): IteratorLike<DeploymentRelationModel<M>>;
458
+ private addElement;
459
+ private addRelation;
460
+ }
461
+
462
+ type DeploymentElementsIterator<M extends AnyAux> = IteratorLike<DeploymentNodeModel<M> | DeployedInstanceModel<M>>;
463
+ type DeployedInstancesIterator<M extends AnyAux> = IteratorLike<DeployedInstanceModel<M>>;
464
+ type DeploymentNodesIterator<M extends AnyAux> = IteratorLike<DeploymentNodeModel<M>>;
465
+ type DeploymentElementModel<M extends AnyAux = AnyAux> = DeploymentNodeModel<M> | DeployedInstanceModel<M>;
466
+ declare abstract class AbstractDeploymentElementModel<M extends AnyAux = AnyAux> {
467
+ abstract readonly id: M['DeploymentFqn'];
468
+ abstract readonly parent: DeploymentNodeModel<M> | null;
469
+ abstract readonly title: string;
470
+ abstract readonly hierarchyLevel: number;
471
+ abstract readonly $model: LikeC4DeploymentModel<M>;
472
+ abstract readonly $node: DeploymentNode | DeployedInstance;
473
+ get style(): SetRequired<DeploymentElementStyle, 'shape' | 'color'>;
474
+ get shape(): ElementShape;
475
+ get color(): ThemeColor;
476
+ get tags(): ReadonlyArray<Tag>;
477
+ get description(): string | null;
478
+ get technology(): string | null;
479
+ get links(): ReadonlyArray<Link>;
480
+ /**
481
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
482
+ * (from closest to root)
483
+ */
484
+ ancestors(): DeploymentNodesIterator<M>;
485
+ /**
486
+ * Returns the common ancestor of this element and another element.
487
+ */
488
+ commonAncestor(another: DeploymentElementModel<M>): DeploymentNodeModel<M> | null;
489
+ /**
490
+ * Get all sibling (i.e. same parent)
491
+ */
492
+ siblings(): DeploymentElementsIterator<M>;
493
+ /**
494
+ * Check if the element is a sibling of another element
495
+ */
496
+ isSibling(other: DeploymentElementModel<M>): boolean;
497
+ /**
498
+ * Resolve siblings of the element and its ancestors
499
+ * (from closest to root)
500
+ */
501
+ ascendingSiblings(): DeploymentElementsIterator<M>;
502
+ /**
503
+ * Resolve siblings of the element and its ancestors
504
+ * (from root to closest)
505
+ */
506
+ descendingSiblings(): DeploymentElementsIterator<M>;
507
+ incoming(filter?: IncomingFilter): IteratorLike<DeploymentRelationModel<M>>;
508
+ outgoing(filter?: OutgoingFilter): IteratorLike<DeploymentRelationModel<M>>;
509
+ incomers(filter?: IncomingFilter): IteratorLike<DeploymentRelationEndpoint<M>>;
510
+ outgoers(filter?: OutgoingFilter): IteratorLike<DeploymentRelationEndpoint<M>>;
511
+ /**
512
+ * Iterate over all views that include this deployment element.
513
+ */
514
+ views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
515
+ isDeploymentNode(): this is DeploymentNodeModel<M>;
516
+ isInstance(): this is DeployedInstanceModel<M>;
517
+ abstract outgoingModelRelationships(): RelationshipsIterator<M>;
518
+ abstract incomingModelRelationships(): RelationshipsIterator<M>;
519
+ protected cachedOutgoing: RelationshipsAccum<M> | null;
520
+ protected cachedIncoming: RelationshipsAccum<M> | null;
521
+ get allOutgoing(): RelationshipsAccum<M>;
522
+ get allIncoming(): RelationshipsAccum<M>;
523
+ }
524
+ declare class DeploymentNodeModel<M extends AnyAux = AnyAux> extends AbstractDeploymentElementModel<M> {
525
+ readonly $model: LikeC4DeploymentModel<M>;
526
+ readonly $node: DeploymentNode;
527
+ id: M['DeploymentFqn'];
528
+ title: string;
529
+ hierarchyLevel: number;
530
+ constructor($model: LikeC4DeploymentModel<M>, $node: DeploymentNode);
531
+ get parent(): DeploymentNodeModel<M> | null;
532
+ get kind(): DeploymentNodeKind;
533
+ children(): ReadonlySet<DeploymentElementModel<M>>;
534
+ descendants(sort?: 'asc' | 'desc'): DeploymentElementsIterator<M>;
535
+ isDeploymentNode(): this is DeploymentNodeModel<M>;
536
+ /**
537
+ * Iterate over all instances nested in this deployment node.
538
+ */
539
+ instances(): DeployedInstancesIterator<M>;
540
+ /**
541
+ * Returns deployed instance inside this deployment node
542
+ * if only there are no more instances
543
+ */
544
+ onlyOneInstance(): DeployedInstanceModel<M> | null;
545
+ /**
546
+ * Cached result of relationships from instances
547
+ */
548
+ private _relationshipsFromInstances;
549
+ private relationshipsFromInstances;
550
+ /**
551
+ * We return only relationships that are not already present in nested instances
552
+ */
553
+ outgoingModelRelationships(): RelationshipsIterator<M>;
554
+ /**
555
+ * We return only relationships that are not already present in nested instances
556
+ */
557
+ incomingModelRelationships(): RelationshipsIterator<M>;
558
+ /**
559
+ * Returns an iterator of relationships between nested instances
560
+ */
561
+ internalModelRelationships(): ReadonlySet<RelationshipModel<M>>;
562
+ }
563
+ declare class DeployedInstanceModel<M extends AnyAux = AnyAux> extends AbstractDeploymentElementModel<M> {
564
+ readonly $model: LikeC4DeploymentModel<M>;
565
+ readonly $instance: DeployedInstance;
566
+ readonly element: ElementModel<M>;
567
+ readonly id: M['DeploymentFqn'];
568
+ readonly title: string;
569
+ readonly hierarchyLevel: number;
570
+ constructor($model: LikeC4DeploymentModel<M>, $instance: DeployedInstance, element: ElementModel<M>);
571
+ get $node(): DeployedInstance;
572
+ get parent(): DeploymentNodeModel<M>;
573
+ get style(): SetRequired<DeploymentElementStyle, 'shape' | 'color'>;
574
+ get shape(): ElementShape;
575
+ get color(): ThemeColor;
576
+ get tags(): ReadonlyArray<Tag>;
577
+ get description(): string | null;
578
+ get technology(): string | null;
579
+ get links(): ReadonlyArray<Link>;
580
+ isInstance(): this is DeployedInstanceModel<M>;
581
+ outgoingModelRelationships(): RelationshipsIterator<M>;
582
+ incomingModelRelationships(): RelationshipsIterator<M>;
583
+ /**
584
+ * Iterate over all views that include this instance.
585
+ * (Some views may include the parent deployment node instead of the instance.)
586
+ */
587
+ views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
588
+ }
589
+ declare class NestedElementOfDeployedInstanceModel<M extends AnyAux> {
590
+ readonly instance: DeployedInstanceModel<M>;
591
+ readonly element: ElementModel<M>;
592
+ constructor(instance: DeployedInstanceModel<M>, element: ElementModel<M>);
593
+ get id(): M['DeploymentFqn'];
594
+ get style(): SetRequired<DeploymentElementStyle, 'shape' | 'color'>;
595
+ get shape(): ElementShape;
596
+ get color(): ThemeColor;
597
+ get title(): string;
598
+ get description(): string | null;
599
+ get technology(): string | null;
600
+ isDeploymentNode(): this is DeploymentNodeModel<M>;
601
+ isInstance(): this is DeployedInstanceModel<M>;
602
+ }
603
+ type DeploymentRelationEndpoint<M extends AnyAux> = DeploymentElementModel<M> | NestedElementOfDeployedInstanceModel<M>;
604
+ declare class DeploymentRelationModel<M extends AnyAux = AnyAux> {
605
+ readonly $model: LikeC4DeploymentModel<M>;
606
+ readonly $relationship: DeploymentRelation;
607
+ boundary: DeploymentNodeModel<M> | null;
608
+ source: DeploymentRelationEndpoint<M>;
609
+ target: DeploymentRelationEndpoint<M>;
610
+ constructor($model: LikeC4DeploymentModel<M>, $relationship: DeploymentRelation);
611
+ get id(): M['RelationId'];
612
+ get expression(): string;
613
+ get title(): string | null;
614
+ get technology(): string | null;
615
+ get description(): string | null;
616
+ get tags(): ReadonlyArray<Tag>;
617
+ get navigateTo(): LikeC4ViewModel<M> | null;
618
+ get links(): ReadonlyArray<Link>;
619
+ views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
620
+ }
621
+ declare class RelationshipsAccum<M extends AnyAux> {
622
+ readonly model: ReadonlySet<RelationshipModel<M>>;
623
+ readonly deployment: ReadonlySet<DeploymentRelationModel<M>>;
624
+ static empty<M extends AnyAux>(): RelationshipsAccum<M>;
625
+ static from<M extends AnyAux>(model: Iterable<RelationshipModel<M>> | undefined, deployment?: Iterable<DeploymentRelationModel<M>>): RelationshipsAccum<M>;
626
+ /**
627
+ * @param model relationships from logical model
628
+ * @param deployment relationships from deployment model
629
+ */
630
+ constructor(model?: ReadonlySet<RelationshipModel<M>>, deployment?: ReadonlySet<DeploymentRelationModel<M>>);
631
+ get isEmpty(): boolean;
632
+ get nonEmpty(): boolean;
633
+ get size(): number;
634
+ /**
635
+ * Returns new Accum containing all the elements which are both in this and otherAccum
636
+ */
637
+ intersect(otherAccum: RelationshipsAccum<M>): RelationshipsAccum<M>;
638
+ /**
639
+ * Returns new Accum containing all the elements which are both in this and otherAccum
640
+ */
641
+ difference(otherAccum: RelationshipsAccum<M>): RelationshipsAccum<M>;
642
+ /**
643
+ * Returns new Accum containing all the elements from both
644
+ */
645
+ union(otherAccum: RelationshipsAccum<M>): RelationshipsAccum<M>;
646
+ }
647
+
648
+ type ElementsIterator<M extends AnyAux> = IteratorLike<ElementModel<M>>;
649
+ declare class ElementModel<M extends AnyAux = AnyAux> {
650
+ readonly $model: LikeC4Model<M>;
651
+ readonly $element: Element;
652
+ readonly id: M['Fqn'];
653
+ readonly hierarchyLevel: number;
654
+ constructor($model: LikeC4Model<M>, $element: Element);
655
+ get parent(): ElementModel<M> | null;
656
+ get kind(): ElementKind;
657
+ get shape(): ElementShape;
658
+ get color(): ThemeColor;
659
+ get tags(): ReadonlyArray<Tag>;
660
+ get title(): string;
661
+ get description(): string | null;
662
+ get technology(): string | null;
663
+ get links(): ReadonlyArray<Link>;
664
+ get defaultView(): LikeC4ViewModel<M> | null;
665
+ isAncestorOf(another: ElementModel<M>): boolean;
666
+ isDescendantOf(another: ElementModel<M>): boolean;
667
+ /**
668
+ * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
669
+ * (from closest to root)
670
+ */
671
+ ancestors(): ElementsIterator<M>;
672
+ /**
673
+ * Returns the common ancestor of this element and another element.
674
+ */
675
+ commonAncestor(another: ElementModel<M>): ElementModel<M> | null;
676
+ children(): ReadonlySet<ElementModel<M>>;
677
+ /**
678
+ * Get all descendant elements (i.e. children, children’s children, etc.)
679
+ */
680
+ descendants(sort?: 'asc' | 'desc'): ElementsIterator<M>;
681
+ /**
682
+ * Get all sibling (i.e. same parent)
683
+ */
684
+ siblings(): ElementsIterator<M>;
685
+ /**
686
+ * Resolve siblings of the element and its ancestors
687
+ * (from closest to root)
688
+ */
689
+ ascendingSiblings(): ElementsIterator<M>;
690
+ /**
691
+ * Resolve siblings of the element and its ancestors
692
+ * (from root to closest)
693
+ */
694
+ descendingSiblings(): ElementsIterator<M>;
695
+ incoming(filter?: IncomingFilter): RelationshipsIterator<M>;
696
+ incomers(filter?: IncomingFilter): ElementsIterator<M>;
697
+ outgoing(filter?: OutgoingFilter): RelationshipsIterator<M>;
698
+ outgoers(filter?: OutgoingFilter): ElementsIterator<M>;
699
+ protected cachedOutgoing: Set<RelationshipModel<M>> | null;
700
+ protected cachedIncoming: Set<RelationshipModel<M>> | null;
701
+ get allOutgoing(): ReadonlySet<RelationshipModel<M>>;
702
+ get allIncoming(): ReadonlySet<RelationshipModel<M>>;
703
+ /**
704
+ * Iterate over all views that include this element.
705
+ */
706
+ views(): ViewsIterator<M>;
707
+ /**
708
+ * Iterate over all views that scope this element.
709
+ * It is possible that element is not included in the view.
710
+ */
711
+ scopedViews(): ViewsIterator<M>;
712
+ /**
713
+ * @returns true if the element is deployed
714
+ */
715
+ isDeployed(): boolean;
716
+ deployments(): DeployedInstancesIterator<M>;
717
+ }
718
+
719
+ export { type AnyAux as A, type ComputeViewResult as C, type DeploymentElementModel as D, ElementModel as E, LikeC4DeploymentModel as L, NodeModel as N, RelationshipsAccum as R, computeViews as a, Aux as b, computeView as c, LikeC4Model as d, LikeC4ViewModel as e, DeploymentNodeModel as f, DeployedInstanceModel as g, RelationshipModel as h, DeploymentRelationModel as i, EdgeModel as j, unsafeComputeView as u };