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