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