@likec4/core 1.30.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 +10 -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.CAcZ6_cP.mjs → core.CBpKAlhj.mjs} +1742 -4128
  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 +19 -10
  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 +182 -137
  109. package/src/model/DeploymentModel.ts +88 -65
  110. package/src/model/ElementModel.ts +92 -72
  111. package/src/model/LikeC4Model.ts +430 -241
  112. package/src/model/RelationModel.ts +69 -26
  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.CZR9J1Qx.d.mts +0 -146
  169. package/dist/shared/core.CiFKryGW.d.mts +0 -745
  170. package/dist/shared/core.DJvmfnEi.d.mts +0 -1153
  171. package/dist/shared/core.DgfwjBtu.mjs +0 -495
  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,745 +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
- }
258
-
259
- declare class LikeC4Model<M extends AnyAux = LikeC4Model.Any> {
260
- #private;
261
- readonly $model: M['Model'];
262
- /**
263
- * Don't use in runtime, only for type inference
264
- */
265
- readonly Aux: M;
266
- readonly deployment: LikeC4DeploymentModel<M>;
267
- /**
268
- * Computes views from the parsed model
269
- * Creates a new LikeC4Model instance from a parsed model.
270
- *
271
- * May throw an error if the model is invalid.
272
- *
273
- * @typeParam M - The type of the parsed LikeC4 model, must extend ParsedLikeC4Model
274
- * @param parsed - The parsed LikeC4 model to compute from
275
- * @returns A new LikeC4Model instance with computed relationships and structure
276
- */
277
- static compute<const M extends AnyParsedLikeC4ModelData>(parsed: M): LikeC4Model<Aux.FromParsed<M>>;
278
- /**
279
- * Creates a function that computes a view using the data from the model.
280
- *
281
- * @example
282
- * const compute = LikeC4Model.makeCompute(parsedModel);
283
- * const result = compute(viewSource);
284
- */
285
- static makeCompute<M extends AnyParsedLikeC4ModelData>(parsed: M): (viewsource: LikeC4View) => ComputeViewResult;
286
- /**
287
- * Creates a new LikeC4Model instance from the provided model data.
288
- *
289
- * @typeParam M - Type parameter constrained to AnyLikeC4Model
290
- * @param model - The model data to create a LikeC4Model from
291
- * @returns A new LikeC4Model instance with the type derived from the input model
292
- */
293
- static create<const M extends GenericLikeC4ModelData>(model: M): LikeC4Model<Aux.FromModel<M>>;
294
- /**
295
- * Creates a new LikeC4Model instance from a model dump.
296
- *
297
- * @typeParam M - A constant type parameter extending LikeC4ModelDump
298
- * @param dump - The model dump to create the instance from
299
- * @returns A new LikeC4Model instance with types inferred from the dump
300
- */
301
- static fromDump<const M extends LikeC4ModelDump>(dump: M): LikeC4Model<Aux.FromDump<M>>;
302
- private constructor();
303
- get type(): 'computed' | 'layouted';
304
- element(el: M['ElementOrFqn']): ElementModel<M>;
305
- findElement(el: LiteralUnion<M['Element'], string>): ElementModel<M> | null;
306
- /**
307
- * Returns the root elements of the model.
308
- */
309
- roots(): ElementsIterator<M>;
310
- /**
311
- * Returns all elements in the model.
312
- */
313
- elements(): ElementsIterator<M>;
314
- /**
315
- * Returns all relationships in the model.
316
- */
317
- relationships(): RelationshipsIterator<M>;
318
- /**
319
- * Returns a specific relationship by its ID.
320
- * If the relationship is not found in the model, it will be searched in the deployment model.
321
- * Search can be limited to the model or deployment model only.
322
- */
323
- relationship(id: M['RelationId'], type: 'model'): RelationshipModel<M>;
324
- relationship(id: M['RelationId'], type: 'deployment'): DeploymentRelationModel<M>;
325
- relationship(id: M['RelationId'], type?: 'model' | 'deployment'): RelationshipModel<M> | DeploymentRelationModel<M>;
326
- findRelationship(id: LiteralUnion<M['RelationId'], string>, type: 'model'): RelationshipModel<M> | null;
327
- findRelationship(id: LiteralUnion<M['RelationId'], string>, type: 'deployment'): DeploymentRelationModel<M> | null;
328
- findRelationship(id: LiteralUnion<M['RelationId'], string>, type?: 'model' | 'deployment'): RelationshipModel<M> | DeploymentRelationModel<M> | null;
329
- /**
330
- * Returns all views in the model.
331
- */
332
- views(): IteratorLike<LikeC4ViewModel<M>>;
333
- /**
334
- * Returns a specific view by its ID.
335
- */
336
- view(viewId: M['View']): LikeC4ViewModel<M>;
337
- findView(viewId: M['View']): LikeC4ViewModel<M> | null;
338
- /**
339
- * Returns the parent element of given element.
340
- * @see ancestors
341
- */
342
- parent(element: M['ElementOrFqn']): ElementModel<M> | null;
343
- /**
344
- * Get all children of the element (only direct children),
345
- * @see descendants
346
- */
347
- children(element: M['ElementOrFqn']): ReadonlySet<ElementModel<M>>;
348
- /**
349
- * Get all sibling (i.e. same parent)
350
- */
351
- siblings(element: M['ElementOrFqn']): ElementsIterator<M>;
352
- /**
353
- * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
354
- * (from closest to root)
355
- */
356
- ancestors(element: M['ElementOrFqn']): ElementsIterator<M>;
357
- /**
358
- * Get all descendant elements (i.e. children, children’s children, etc.)
359
- */
360
- descendants(element: M['ElementOrFqn']): ElementsIterator<M>;
361
- /**
362
- * Incoming relationships to the element and its descendants
363
- * @see incomers
364
- */
365
- incoming(element: M['ElementOrFqn'], filter?: IncomingFilter): RelationshipsIterator<M>;
366
- /**
367
- * Outgoing relationships from the element and its descendants
368
- * @see outgoers
369
- */
370
- outgoing(element: M['ElementOrFqn'], filter?: OutgoingFilter): RelationshipsIterator<M>;
371
- globals(): ModelGlobals;
372
- allTags(): ReadonlyArray<Tag>;
373
- private addElement;
374
- private addImportedElement;
375
- private addRelation;
376
- }
377
- declare namespace LikeC4Model {
378
- const EMPTY: LikeC4Model<AnyAux>;
379
- type Any = Aux<string, string, string, ComputedView | DiagramView>;
380
- type Element<M extends AnyAux = Any> = ElementModel<M>;
381
- type Relation<M extends AnyAux = Any> = RelationshipModel<M>;
382
- type AnyRelation<M extends AnyAux = Any> = RelationshipModel<M> | DeploymentRelationModel<M>;
383
- type View<M extends AnyAux = Any, V extends ComputedView | DiagramView = M['ViewType']> = LikeC4ViewModel<M, V>;
384
- type Node<M extends AnyAux = Any, V extends ComputedView | DiagramView = M['ViewType']> = NodeModel<M, V>;
385
- type Edge<M extends AnyAux = Any, V extends ComputedView | DiagramView = M['ViewType']> = EdgeModel<M, V>;
386
- type DeploymentModel<M extends AnyAux = AnyAux> = LikeC4DeploymentModel<M>;
387
- type Deployment<M extends AnyAux = AnyAux> = DeploymentElementModel<M>;
388
- type DeploymentNode<M extends AnyAux = AnyAux> = DeploymentNodeModel<M>;
389
- type DeployedInstance<M extends AnyAux = AnyAux> = DeployedInstanceModel<M>;
390
- type Typed<Elements extends string = string, Deployments extends string = string, Views extends string = string, ViewType = DiagramView<Views> | ComputedView<Views>> = Aux<Elements, Deployments, Views, ViewType>;
391
- type Computed<Elements extends string = string, Deployments extends string = string, Views extends string = string> = LikeC4Model<Typed<Elements, Deployments, Views, ComputedView<Views>>>;
392
- type Layouted<Elements extends string = string, Deployments extends string = string, Views extends string = string> = LikeC4Model<Typed<Elements, Deployments, Views, DiagramView<Views>>>;
393
- }
394
-
395
- declare class LikeC4DeploymentModel<M extends AnyAux = AnyAux> {
396
- #private;
397
- readonly $model: LikeC4Model<M>;
398
- readonly $deployments: GenericLikeC4ModelData['deployments'];
399
- constructor($model: LikeC4Model<M>, $deployments: GenericLikeC4ModelData['deployments']);
400
- element(el: M['DeploymentOrFqn']): DeploymentElementModel<M>;
401
- findElement(el: M['Deployment']): DeploymentElementModel<M> | null;
402
- node(el: M['DeploymentOrFqn']): DeploymentNodeModel<M>;
403
- findNode(el: M['Deployment']): DeploymentNodeModel<M> | null;
404
- instance(el: M['DeploymentOrFqn']): DeployedInstanceModel<M>;
405
- findInstance(el: M['Deployment']): DeployedInstanceModel<M> | null;
406
- /**
407
- * Returns the root elements of the model.
408
- */
409
- roots(): DeploymentNodesIterator<M>;
410
- /**
411
- * Returns all elements in the model.
412
- */
413
- elements(): DeploymentElementsIterator<M>;
414
- /**
415
- * Returns all elements in the model.
416
- */
417
- nodes(): DeploymentNodesIterator<M>;
418
- instances(): DeployedInstancesIterator<M>;
419
- /**
420
- * Iterate over all instances of the given logical element.
421
- */
422
- instancesOf(element: M['ElementOrFqn']): DeployedInstancesIterator<M>;
423
- deploymentRef(ref: DeploymentRef): DeploymentElementModel<M> | NestedElementOfDeployedInstanceModel<M>;
424
- /**
425
- * Returns all relationships in the model.
426
- */
427
- relationships(): IteratorLike<DeploymentRelationModel<M>>;
428
- /**
429
- * Returns a specific relationship by its ID.
430
- */
431
- relationship(id: M['RelationId']): DeploymentRelationModel<M>;
432
- findRelationship(id: LiteralUnion<M['RelationId'], string>): DeploymentRelationModel<M> | null;
433
- /**
434
- * Returns all deployment views in the model.
435
- */
436
- views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
437
- /**
438
- * Returns the parent element of given element.
439
- * @see ancestors
440
- */
441
- parent(element: M['DeploymentOrFqn']): DeploymentNodeModel<M> | null;
442
- /**
443
- * Get all children of the element (only direct children),
444
- * @see descendants
445
- */
446
- children(element: M['DeploymentOrFqn']): ReadonlySet<DeploymentElementModel<M>>;
447
- /**
448
- * Get all sibling (i.e. same parent)
449
- */
450
- siblings(element: M['DeploymentOrFqn']): DeploymentElementsIterator<M>;
451
- /**
452
- * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
453
- * (from closest to root)
454
- */
455
- ancestors(element: M['DeploymentOrFqn']): DeploymentNodesIterator<M>;
456
- /**
457
- * Get all descendant elements (i.e. children, children’s children, etc.)
458
- */
459
- descendants(element: M['DeploymentOrFqn'], sort?: 'asc' | 'desc'): DeploymentElementsIterator<M>;
460
- /**
461
- * Incoming relationships to the element and its descendants
462
- * @see incomers
463
- */
464
- incoming(element: M['DeploymentOrFqn'], filter?: IncomingFilter): IteratorLike<DeploymentRelationModel<M>>;
465
- /**
466
- * Outgoing relationships from the element and its descendants
467
- * @see outgoers
468
- */
469
- outgoing(element: M['DeploymentOrFqn'], filter?: OutgoingFilter): IteratorLike<DeploymentRelationModel<M>>;
470
- private addElement;
471
- private addRelation;
472
- }
473
-
474
- type DeploymentElementsIterator<M extends AnyAux> = IteratorLike<DeploymentNodeModel<M> | DeployedInstanceModel<M>>;
475
- type DeployedInstancesIterator<M extends AnyAux> = IteratorLike<DeployedInstanceModel<M>>;
476
- type DeploymentNodesIterator<M extends AnyAux> = IteratorLike<DeploymentNodeModel<M>>;
477
- type DeploymentElementModel<M extends AnyAux = AnyAux> = DeploymentNodeModel<M> | DeployedInstanceModel<M>;
478
- declare abstract class AbstractDeploymentElementModel<M extends AnyAux = AnyAux> {
479
- abstract readonly id: M['DeploymentFqn'];
480
- abstract readonly parent: DeploymentNodeModel<M> | null;
481
- abstract readonly title: string;
482
- abstract readonly hierarchyLevel: number;
483
- abstract readonly $model: LikeC4DeploymentModel<M>;
484
- abstract readonly $node: DeploymentNode | DeployedInstance;
485
- abstract readonly kind: DeploymentNodeKind | ElementKind;
486
- get style(): SetRequired<DeploymentElementStyle, 'shape' | 'color' | 'size'>;
487
- get shape(): ElementShape;
488
- get color(): ThemeColor;
489
- get tags(): ReadonlyArray<Tag>;
490
- get description(): string | null;
491
- get technology(): string | null;
492
- get links(): ReadonlyArray<Link>;
493
- /**
494
- * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
495
- * (from closest to root)
496
- */
497
- ancestors(): DeploymentNodesIterator<M>;
498
- /**
499
- * Returns the common ancestor of this element and another element.
500
- */
501
- commonAncestor(another: DeploymentElementModel<M>): DeploymentNodeModel<M> | null;
502
- /**
503
- * Get all sibling (i.e. same parent)
504
- */
505
- siblings(): DeploymentElementsIterator<M>;
506
- /**
507
- * Check if the element is a sibling of another element
508
- */
509
- isSibling(other: DeploymentElementModel<M>): boolean;
510
- /**
511
- * Resolve siblings of the element and its ancestors
512
- * (from closest to root)
513
- */
514
- ascendingSiblings(): DeploymentElementsIterator<M>;
515
- /**
516
- * Resolve siblings of the element and its ancestors
517
- * (from root to closest)
518
- */
519
- descendingSiblings(): DeploymentElementsIterator<M>;
520
- incoming(filter?: IncomingFilter): IteratorLike<DeploymentRelationModel<M>>;
521
- outgoing(filter?: OutgoingFilter): IteratorLike<DeploymentRelationModel<M>>;
522
- incomers(filter?: IncomingFilter): IteratorLike<DeploymentRelationEndpoint<M>>;
523
- outgoers(filter?: OutgoingFilter): IteratorLike<DeploymentRelationEndpoint<M>>;
524
- /**
525
- * Iterate over all views that include this deployment element.
526
- */
527
- views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
528
- isDeploymentNode(): this is DeploymentNodeModel<M>;
529
- isInstance(): this is DeployedInstanceModel<M>;
530
- abstract outgoingModelRelationships(): RelationshipsIterator<M>;
531
- abstract incomingModelRelationships(): RelationshipsIterator<M>;
532
- protected cachedOutgoing: RelationshipsAccum<M> | null;
533
- protected cachedIncoming: RelationshipsAccum<M> | null;
534
- get allOutgoing(): RelationshipsAccum<M>;
535
- get allIncoming(): RelationshipsAccum<M>;
536
- }
537
- declare class DeploymentNodeModel<M extends AnyAux = AnyAux> extends AbstractDeploymentElementModel<M> {
538
- readonly $model: LikeC4DeploymentModel<M>;
539
- readonly $node: DeploymentNode;
540
- id: M['DeploymentFqn'];
541
- title: string;
542
- hierarchyLevel: number;
543
- constructor($model: LikeC4DeploymentModel<M>, $node: DeploymentNode);
544
- get parent(): DeploymentNodeModel<M> | null;
545
- get kind(): DeploymentNodeKind;
546
- children(): ReadonlySet<DeploymentElementModel<M>>;
547
- descendants(sort?: 'asc' | 'desc'): DeploymentElementsIterator<M>;
548
- isDeploymentNode(): this is DeploymentNodeModel<M>;
549
- /**
550
- * Iterate over all instances nested in this deployment node.
551
- */
552
- instances(): DeployedInstancesIterator<M>;
553
- /**
554
- * Returns deployed instance inside this deployment node
555
- * if only there are no more instances
556
- */
557
- onlyOneInstance(): DeployedInstanceModel<M> | null;
558
- /**
559
- * Cached result of relationships from instances
560
- */
561
- private _relationshipsFromInstances;
562
- private relationshipsFromInstances;
563
- /**
564
- * We return only relationships that are not already present in nested instances
565
- */
566
- outgoingModelRelationships(): RelationshipsIterator<M>;
567
- /**
568
- * We return only relationships that are not already present in nested instances
569
- */
570
- incomingModelRelationships(): RelationshipsIterator<M>;
571
- /**
572
- * Returns an iterator of relationships between nested instances
573
- */
574
- internalModelRelationships(): ReadonlySet<RelationshipModel<M>>;
575
- }
576
- declare class DeployedInstanceModel<M extends AnyAux = AnyAux> extends AbstractDeploymentElementModel<M> {
577
- readonly $model: LikeC4DeploymentModel<M>;
578
- readonly $instance: DeployedInstance;
579
- readonly element: ElementModel<M>;
580
- readonly id: M['DeploymentFqn'];
581
- readonly title: string;
582
- readonly hierarchyLevel: number;
583
- constructor($model: LikeC4DeploymentModel<M>, $instance: DeployedInstance, element: ElementModel<M>);
584
- get $node(): DeployedInstance;
585
- get parent(): DeploymentNodeModel<M>;
586
- get style(): SetRequired<DeploymentElementStyle, 'shape' | 'color' | 'size'>;
587
- get shape(): ElementShape;
588
- get color(): ThemeColor;
589
- get tags(): ReadonlyArray<Tag>;
590
- get kind(): ElementKind;
591
- get description(): string | null;
592
- get technology(): string | null;
593
- get links(): ReadonlyArray<Link>;
594
- isInstance(): this is DeployedInstanceModel<M>;
595
- outgoingModelRelationships(): RelationshipsIterator<M>;
596
- incomingModelRelationships(): RelationshipsIterator<M>;
597
- /**
598
- * Iterate over all views that include this instance.
599
- * (Some views may include the parent deployment node instead of the instance.)
600
- */
601
- views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
602
- }
603
- declare class NestedElementOfDeployedInstanceModel<M extends AnyAux> {
604
- readonly instance: DeployedInstanceModel<M>;
605
- readonly element: ElementModel<M>;
606
- constructor(instance: DeployedInstanceModel<M>, element: ElementModel<M>);
607
- get id(): M['DeploymentFqn'];
608
- get style(): SetRequired<DeploymentElementStyle, 'shape' | 'color'>;
609
- get shape(): ElementShape;
610
- get color(): ThemeColor;
611
- get title(): string;
612
- get description(): string | null;
613
- get technology(): string | null;
614
- isDeploymentNode(): this is DeploymentNodeModel<M>;
615
- isInstance(): this is DeployedInstanceModel<M>;
616
- }
617
- type DeploymentRelationEndpoint<M extends AnyAux> = DeploymentElementModel<M> | NestedElementOfDeployedInstanceModel<M>;
618
- declare class DeploymentRelationModel<M extends AnyAux = AnyAux> {
619
- readonly $model: LikeC4DeploymentModel<M>;
620
- readonly $relationship: DeploymentRelation;
621
- boundary: DeploymentNodeModel<M> | null;
622
- source: DeploymentRelationEndpoint<M>;
623
- target: DeploymentRelationEndpoint<M>;
624
- constructor($model: LikeC4DeploymentModel<M>, $relationship: DeploymentRelation);
625
- get id(): M['RelationId'];
626
- get expression(): string;
627
- get title(): string | null;
628
- get technology(): string | null;
629
- get description(): string | null;
630
- get tags(): ReadonlyArray<Tag>;
631
- get kind(): RelationshipKind | null;
632
- get navigateTo(): LikeC4ViewModel<M> | null;
633
- get links(): ReadonlyArray<Link>;
634
- get color(): Color;
635
- get line(): RelationshipLineType;
636
- views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
637
- isDeploymentRelation(): this is DeploymentRelationModel<M>;
638
- }
639
- declare class RelationshipsAccum<M extends AnyAux> {
640
- readonly model: ReadonlySet<RelationshipModel<M>>;
641
- readonly deployment: ReadonlySet<DeploymentRelationModel<M>>;
642
- static empty<M extends AnyAux>(): RelationshipsAccum<M>;
643
- static from<M extends AnyAux>(model: Iterable<RelationshipModel<M>> | undefined, deployment?: Iterable<DeploymentRelationModel<M>>): RelationshipsAccum<M>;
644
- /**
645
- * @param model relationships from logical model
646
- * @param deployment relationships from deployment model
647
- */
648
- constructor(model?: ReadonlySet<RelationshipModel<M>>, deployment?: ReadonlySet<DeploymentRelationModel<M>>);
649
- get isEmpty(): boolean;
650
- get nonEmpty(): boolean;
651
- get size(): number;
652
- /**
653
- * Returns new Accum containing all the elements which are both in this and otherAccum
654
- */
655
- intersect(otherAccum: RelationshipsAccum<M>): RelationshipsAccum<M>;
656
- /**
657
- * Returns new Accum containing all the elements which are both in this and otherAccum
658
- */
659
- difference(otherAccum: RelationshipsAccum<M>): RelationshipsAccum<M>;
660
- /**
661
- * Returns new Accum containing all the elements from both
662
- */
663
- union(otherAccum: RelationshipsAccum<M>): RelationshipsAccum<M>;
664
- }
665
-
666
- type ElementsIterator<M extends AnyAux> = IteratorLike<ElementModel<M>>;
667
- declare class ElementModel<M extends AnyAux = AnyAux> {
668
- readonly $model: LikeC4Model<M>;
669
- readonly $element: Element;
670
- readonly id: M['Fqn'];
671
- readonly _literalId: M['Element'];
672
- readonly hierarchyLevel: number;
673
- readonly imported: null | {
674
- from: ProjectId;
675
- fqn: string;
676
- };
677
- constructor($model: LikeC4Model<M>, $element: Element);
678
- get parent(): ElementModel<M> | null;
679
- get kind(): ElementKind;
680
- get shape(): ElementShape;
681
- get color(): ThemeColor;
682
- get icon(): IconUrl | null;
683
- get tags(): ReadonlyArray<Tag>;
684
- get title(): string;
685
- get description(): string | null;
686
- get technology(): string | null;
687
- get links(): ReadonlyArray<Link>;
688
- get defaultView(): LikeC4ViewModel<M> | null;
689
- get isRoot(): boolean;
690
- get style(): SetRequired<ElementStyle, 'size'>;
691
- isAncestorOf(another: ElementModel<M>): boolean;
692
- isDescendantOf(another: ElementModel<M>): boolean;
693
- /**
694
- * Get all ancestor elements (i.e. parent, parent’s parent, etc.)
695
- * (from closest to root)
696
- */
697
- ancestors(): ElementsIterator<M>;
698
- /**
699
- * Returns the common ancestor of this element and another element.
700
- */
701
- commonAncestor(another: ElementModel<M>): ElementModel<M> | null;
702
- children(): ReadonlySet<ElementModel<M>>;
703
- /**
704
- * Get all descendant elements (i.e. children, children’s children, etc.)
705
- */
706
- descendants(sort?: 'asc' | 'desc'): ElementsIterator<M>;
707
- /**
708
- * Get all sibling (i.e. same parent)
709
- */
710
- siblings(): ElementsIterator<M>;
711
- /**
712
- * Resolve siblings of the element and its ancestors
713
- * (from closest to root)
714
- */
715
- ascendingSiblings(): ElementsIterator<M>;
716
- /**
717
- * Resolve siblings of the element and its ancestors
718
- * (from root to closest)
719
- */
720
- descendingSiblings(): ElementsIterator<M>;
721
- incoming(filter?: IncomingFilter): RelationshipsIterator<M>;
722
- incomers(filter?: IncomingFilter): ElementsIterator<M>;
723
- outgoing(filter?: OutgoingFilter): RelationshipsIterator<M>;
724
- outgoers(filter?: OutgoingFilter): ElementsIterator<M>;
725
- protected cachedOutgoing: Set<RelationshipModel<M>> | null;
726
- protected cachedIncoming: Set<RelationshipModel<M>> | null;
727
- get allOutgoing(): ReadonlySet<RelationshipModel<M>>;
728
- get allIncoming(): ReadonlySet<RelationshipModel<M>>;
729
- /**
730
- * Iterate over all views that include this element.
731
- */
732
- views(): ViewsIterator<M>;
733
- /**
734
- * Iterate over all views that scope this element.
735
- * It is possible that element is not included in the view.
736
- */
737
- scopedViews(): ViewsIterator<M>;
738
- /**
739
- * @returns true if the element is deployed
740
- */
741
- isDeployed(): boolean;
742
- deployments(): DeployedInstancesIterator<M>;
743
- }
744
-
745
- 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 };