@likec4/core 1.42.1 → 1.44.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.
- package/dist/builder/index.d.mts +9 -9
- package/dist/builder/index.mjs +10 -8
- package/dist/compute-view/index.d.mts +9 -9
- package/dist/compute-view/index.mjs +7 -7
- package/dist/compute-view/relationships-view/index.d.mts +7 -7
- package/dist/compute-view/relationships-view/index.mjs +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +7 -7
- package/dist/model/connection/deployment/index.d.mts +9 -9
- package/dist/model/connection/deployment/index.mjs +2 -2
- package/dist/model/connection/index.d.mts +10 -10
- package/dist/model/connection/index.mjs +3 -3
- package/dist/model/connection/model/index.d.mts +9 -9
- package/dist/model/connection/model/index.mjs +2 -2
- package/dist/model/index.d.mts +26 -12
- package/dist/model/index.mjs +4 -4
- package/dist/shared/{core.DSO_rTC2.mjs → core.23WeDKcI.mjs} +269 -632
- package/dist/shared/{core.D_vkffV4.d.mts → core.5ZQ-r3Oa.d.mts} +22 -2
- package/dist/shared/{core.DRhg-gVU.mjs → core.6VsRBhGY.mjs} +7 -101
- package/dist/shared/{core.yna0OdV5.d.mts → core.8mmHFn9g.d.mts} +2 -2
- package/dist/shared/core.B9BjmjuH.mjs +9 -0
- package/dist/shared/{core.fHR_8Tnq.d.mts → core.BMtVqKl7.d.mts} +89 -11
- package/dist/shared/{core.rCeaAqgW.mjs → core.BdPcbSkN.mjs} +1 -1
- package/dist/shared/{core.DIol3syK.d.mts → core.BnDbAOR2.d.mts} +2 -2
- package/dist/shared/{core.CQngdcuj.d.mts → core.BnOetIAR.d.mts} +2 -2
- package/dist/shared/core.BuQZczj6.mjs +38 -0
- package/dist/shared/core.Bv3cd-jC.mjs +102 -0
- package/dist/shared/{core.B7KhhkRY.mjs → core.C0Ye2OCr.mjs} +1 -1
- package/dist/shared/{core.Dgs6-nuz.d.mts → core.CDOKQTW6.d.mts} +56 -37
- package/dist/shared/{core.BIqHjQiH.mjs → core.CHwVhuc9.mjs} +36 -10
- package/dist/shared/{core.DdMJk7nx.d.mts → core.CKNmSm2W.d.mts} +85 -89
- package/dist/shared/{core.DFi2dOTl.mjs → core.CR3PmPzr.mjs} +85 -1
- package/dist/shared/{core.C2TiyjI6.mjs → core.CbsSAn1j.mjs} +19 -19
- package/dist/shared/{core.QJD_fcrc.mjs → core.CmPXpJ8l.mjs} +1 -14
- package/dist/shared/{core.D5fzJWbF.d.mts → core.DB0Ue5Wx.d.mts} +1 -1
- package/dist/shared/{core.DNbUPnve.mjs → core.DEieYfbG.mjs} +27 -25
- package/dist/shared/{core.C8YY6Uub.mjs → core.DFCHU59b.mjs} +4 -4
- package/dist/shared/{core.BYNkXQ8A.mjs → core.DH7TXqXf.mjs} +30 -1
- package/dist/shared/{core.DMMOWQqc.mjs → core.DIE3F6sw.mjs} +2 -2
- package/dist/shared/{core.s9uwOt60.d.mts → core.DTJYgLXI.d.mts} +3 -3
- package/dist/shared/{core.D0PjZzIS.d.mts → core.DjAM-S6a.d.mts} +179 -82
- package/dist/shared/{core.CNgZvKb8.mjs → core.DrUt0Lbi.mjs} +1 -1
- package/dist/shared/core.M9ayqQZa.mjs +1207 -0
- package/dist/shared/{core.DACpKp35.d.mts → core.WwMWeiFL.d.mts} +4 -4
- package/dist/shared/{core.lRvxPoao.mjs → core.bKIs4oDO.mjs} +3 -3
- package/dist/shared/{core.C8sl5Y8Z.mjs → core.h4TqqSC0.mjs} +1360 -124
- package/dist/shared/core.q10OP9oJ.mjs +5 -0
- package/dist/shared/core.uFk_o9X6.mjs +13 -0
- package/dist/styles/index.d.mts +18 -8
- package/dist/styles/index.mjs +63 -1
- package/dist/types/_aux.d.mts +2 -2
- package/dist/types/_aux.mjs +8 -1
- package/dist/types/expression-model.d.mts +3 -3
- package/dist/types/expression.d.mts +3 -3
- package/dist/types/fqnRef.d.mts +7 -8
- package/dist/types/index.d.mts +17 -13
- package/dist/types/index.mjs +28 -5
- package/dist/utils/graphology/index.mjs +1 -1
- package/dist/utils/index.d.mts +3 -2
- package/dist/utils/index.mjs +8 -6
- package/dist/utils/iterable/index.d.mts +1 -1
- package/dist/utils/iterable/index.mjs +2 -1
- package/package.json +21 -20
- package/dist/shared/core.01VTr9qu.mjs +0 -170
- package/dist/shared/core.1vX5a9AY.mjs +0 -86
- package/dist/shared/core.BazD6cot.mjs +0 -14
- package/dist/shared/core.BzTakU3I.mjs +0 -67
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SetRequired, IsAny } from 'type-fest';
|
|
2
|
+
import { L as LikeC4Styles } from './core.8mmHFn9g.mjs';
|
|
3
|
+
import { A as Any, R as RelationKind, r as Tags, H as Metadata, C as MetadataKey, I as LooseTag, F as Fqn, o as ElementId, n as ElementKind, y as DeploymentKind, b as AnyLayouted, J as RelationId$1, m as StrictViewId, k as _type, j as _stage, K as LooseElementId, O as LooseDeploymentId, x as DeploymentFqn, t as toComputed, a as AnyComputed, Q as Stage, D as DeploymentId, V as ViewId, T as Tag, c as AnyParsed, P as ProjectId$1, X as LooseViewId, U as Unknown, d as Aux, g as UnknownParsed, e as UnknownComputed, f as UnknownLayouted } from './core.CDOKQTW6.mjs';
|
|
3
4
|
import { d as RelationId, P as ProjectId, a as IconUrl, N as NodeId, G as GroupElementKind, j as EdgeId, k as StepEdgeId, V as ViewId$1 } from './core.DX-WYEPA.mjs';
|
|
4
5
|
import { D as DefaultMap } from './core.CywrQs86.mjs';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { g as Relationship, f as Element, E as ElementStyle, F as ComputedNodeStyle, a1 as DynamicViewDisplayVariant, k as LikeC4Project, M as ModelGlobals } from './core.fHR_8Tnq.mjs';
|
|
6
|
+
import { b as RichTextOrEmpty, p as LayoutedView, W as ViewManualLayoutSnapshot, Q as LayoutedViewDriftReason, r as ComputedView, u as ViewWithType, P as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, L as LayoutedLikeC4ModelData, d as DeployedInstance, h as DeploymentRelationship, e as DeploymentElement, D as DeploymentNode, l as LikeC4ModelDump, n as AuxFromDump } from './core.CKNmSm2W.mjs';
|
|
7
|
+
import { c as IteratorLike, L as Link, N as NonEmptyArray } from './core.DB0Ue5Wx.mjs';
|
|
8
|
+
import { Q as Color, v as RelationshipLineType, y as RelationshipArrowType, u as ElementShape, W as WhereOperator } from './core.BnOetIAR.mjs';
|
|
9
|
+
import { g as Relationship, f as Element, E as ElementStyle, K as ComputedNodeStyle, B as BBox, a7 as DynamicViewDisplayVariant, o as LikeC4Project, S as Specification, M as ModelGlobals } from './core.BMtVqKl7.mjs';
|
|
10
10
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
11
11
|
|
|
12
12
|
type RelationshipsIterator<A extends Any> = IteratorLike<RelationshipModel<A>>;
|
|
@@ -19,6 +19,8 @@ interface AnyRelationshipModel<A extends Any = Any> extends WithTags<A>, WithMet
|
|
|
19
19
|
readonly expression: string;
|
|
20
20
|
readonly title: string | null;
|
|
21
21
|
readonly technology: string | null;
|
|
22
|
+
readonly hasSummary: boolean;
|
|
23
|
+
readonly summary: RichTextOrEmpty;
|
|
22
24
|
readonly description: RichTextOrEmpty;
|
|
23
25
|
readonly navigateTo: LikeC4ViewModel<A> | null;
|
|
24
26
|
readonly kind: RelationKind<A> | null;
|
|
@@ -46,6 +48,20 @@ declare class RelationshipModel<A extends Any = Any> implements AnyRelationshipM
|
|
|
46
48
|
get expression(): string;
|
|
47
49
|
get title(): string | null;
|
|
48
50
|
get technology(): string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Returns true if the relationship has a summary and a description
|
|
53
|
+
* (if one is missing - it falls back to another)
|
|
54
|
+
*/
|
|
55
|
+
get hasSummary(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Short description of the relationship.
|
|
58
|
+
* Falls back to description if summary is not provided.
|
|
59
|
+
*/
|
|
60
|
+
get summary(): RichTextOrEmpty;
|
|
61
|
+
/**
|
|
62
|
+
* Long description of the relationship.
|
|
63
|
+
* Falls back to summary if description is not provided.
|
|
64
|
+
*/
|
|
49
65
|
get description(): RichTextOrEmpty;
|
|
50
66
|
get navigateTo(): LikeC4ViewModel<A> | null;
|
|
51
67
|
get tags(): Tags<A>;
|
|
@@ -63,7 +79,7 @@ declare class RelationshipModel<A extends Any = Any> implements AnyRelationshipM
|
|
|
63
79
|
isModelRelation(): this is RelationshipModel<A>;
|
|
64
80
|
hasMetadata(): boolean;
|
|
65
81
|
getMetadata(): Metadata<A>;
|
|
66
|
-
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
82
|
+
getMetadata(field: MetadataKey<A>): string | string[] | undefined;
|
|
67
83
|
/**
|
|
68
84
|
* Checks if the relationship has the given tag.
|
|
69
85
|
*/
|
|
@@ -74,6 +90,10 @@ type ElementsIterator<M extends Any> = IteratorLike<ElementModel<M>>;
|
|
|
74
90
|
declare class ElementModel<A extends Any = Any> implements WithTags<A>, WithMetadata<A> {
|
|
75
91
|
readonly $model: LikeC4Model<A>;
|
|
76
92
|
readonly $element: Element<A>;
|
|
93
|
+
/**
|
|
94
|
+
* Don't use in runtime, only for type inference
|
|
95
|
+
*/
|
|
96
|
+
readonly Aux: A;
|
|
77
97
|
readonly id: Fqn<A>;
|
|
78
98
|
readonly _literalId: ElementId<A>;
|
|
79
99
|
readonly hierarchyLevel: number;
|
|
@@ -166,7 +186,7 @@ declare class ElementModel<A extends Any = Any> implements WithTags<A>, WithMeta
|
|
|
166
186
|
deployments(): DeployedInstancesIterator<A>;
|
|
167
187
|
hasMetadata(): boolean;
|
|
168
188
|
getMetadata(): Metadata<A>;
|
|
169
|
-
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
189
|
+
getMetadata(field: MetadataKey<A>): string | string[] | undefined;
|
|
170
190
|
/**
|
|
171
191
|
* Checks if the element has the given tag.
|
|
172
192
|
*/
|
|
@@ -175,10 +195,11 @@ declare class ElementModel<A extends Any = Any> implements WithTags<A>, WithMeta
|
|
|
175
195
|
|
|
176
196
|
type NodesIterator<M extends Any, V extends $View<M>> = IteratorLike<NodeModel<M, V>>;
|
|
177
197
|
declare class NodeModel<A extends Any = Any, V extends $View<A> = $View<A>> implements WithTags<A> {
|
|
178
|
-
|
|
179
|
-
readonly $
|
|
198
|
+
readonly Aux: A;
|
|
199
|
+
readonly $viewModel: LikeC4ViewModel<A, V>;
|
|
200
|
+
readonly $view: V;
|
|
180
201
|
readonly $node: V['nodes'][number];
|
|
181
|
-
constructor($
|
|
202
|
+
constructor($viewModel: LikeC4ViewModel<A, V>, $node: V['nodes'][number]);
|
|
182
203
|
get id(): NodeId;
|
|
183
204
|
get title(): string;
|
|
184
205
|
get kind(): ElementKind<A> | DeploymentKind<A> | typeof GroupElementKind | 'instance';
|
|
@@ -194,6 +215,10 @@ declare class NodeModel<A extends Any = Any, V extends $View<A> = $View<A>> impl
|
|
|
194
215
|
get links(): ReadonlyArray<Link>;
|
|
195
216
|
get navigateTo(): LikeC4ViewModel<A> | null;
|
|
196
217
|
get style(): ComputedNodeStyle;
|
|
218
|
+
get x(): number | undefined;
|
|
219
|
+
get y(): number | undefined;
|
|
220
|
+
get width(): number | undefined;
|
|
221
|
+
get height(): number | undefined;
|
|
197
222
|
children(): ReadonlySet<NodeModel<A, V>>;
|
|
198
223
|
/**
|
|
199
224
|
* Get all ancestor elements (i.e. parent, parent’s parent, etc.)
|
|
@@ -205,7 +230,7 @@ declare class NodeModel<A extends Any = Any, V extends $View<A> = $View<A>> impl
|
|
|
205
230
|
incomers(filter?: IncomingFilter): NodesIterator<A, V>;
|
|
206
231
|
outgoing(filter?: OutgoingFilter): EdgesIterator<A, V>;
|
|
207
232
|
outgoers(filter?: OutgoingFilter): NodesIterator<A, V>;
|
|
208
|
-
|
|
233
|
+
isLayouted(): this is NodeModel.Layouted<A>;
|
|
209
234
|
hasChildren(): boolean;
|
|
210
235
|
hasParent(): this is NodeModel.WithParent<A, V>;
|
|
211
236
|
/**
|
|
@@ -228,43 +253,50 @@ declare class NodeModel<A extends Any = Any, V extends $View<A> = $View<A>> impl
|
|
|
228
253
|
isTagged(tag: LooseTag<A>): boolean;
|
|
229
254
|
}
|
|
230
255
|
declare namespace NodeModel {
|
|
231
|
-
|
|
232
|
-
|
|
256
|
+
type Layouted<A> = A extends AnyLayouted ? NodeModel<A, LayoutedView<A>> & {
|
|
257
|
+
x: number;
|
|
258
|
+
y: number;
|
|
259
|
+
width: number;
|
|
260
|
+
height: number;
|
|
261
|
+
} : never;
|
|
262
|
+
interface WithParent<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
|
|
263
|
+
readonly parent: NodeModel<A, V>;
|
|
233
264
|
}
|
|
234
|
-
interface WithElement<A extends Any
|
|
235
|
-
kind: ElementKind<A>;
|
|
236
|
-
element: ElementModel<A>;
|
|
265
|
+
interface WithElement<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
|
|
266
|
+
readonly kind: ElementKind<A>;
|
|
267
|
+
readonly element: ElementModel<A>;
|
|
237
268
|
}
|
|
238
|
-
interface WithDeploymentElement<A extends Any
|
|
239
|
-
kind: DeploymentKind<A>;
|
|
240
|
-
deployment: DeploymentElementModel<A>;
|
|
269
|
+
interface WithDeploymentElement<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
|
|
270
|
+
readonly kind: DeploymentKind<A>;
|
|
271
|
+
readonly deployment: DeploymentElementModel<A>;
|
|
241
272
|
}
|
|
242
|
-
interface WithDeployedInstance<A extends Any
|
|
243
|
-
kind: 'instance';
|
|
244
|
-
element: ElementModel<A>;
|
|
245
|
-
deployment: DeployedInstanceModel<A>;
|
|
273
|
+
interface WithDeployedInstance<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
|
|
274
|
+
readonly kind: 'instance';
|
|
275
|
+
readonly element: ElementModel<A>;
|
|
276
|
+
readonly deployment: DeployedInstanceModel<A>;
|
|
246
277
|
}
|
|
247
|
-
interface IsGroup<A extends Any
|
|
248
|
-
kind: typeof GroupElementKind;
|
|
249
|
-
element: null;
|
|
250
|
-
deployment: null;
|
|
278
|
+
interface IsGroup<A extends Any, V extends $View<A> = $View<A>> extends NodeModel<A, V> {
|
|
279
|
+
readonly kind: typeof GroupElementKind;
|
|
280
|
+
readonly element: null;
|
|
281
|
+
readonly deployment: null;
|
|
251
282
|
}
|
|
252
283
|
}
|
|
253
284
|
|
|
254
285
|
type EdgesIterator<A extends Any, V extends $View<A>> = IteratorLike<EdgeModel<A, V>>;
|
|
255
|
-
declare class EdgeModel<A extends Any = Any,
|
|
256
|
-
|
|
257
|
-
readonly
|
|
258
|
-
readonly
|
|
259
|
-
readonly
|
|
260
|
-
readonly
|
|
261
|
-
|
|
286
|
+
declare class EdgeModel<A extends Any = Any, V extends $View<A> = $View<A>> implements WithTags<A> {
|
|
287
|
+
readonly source: NodeModel<A, V>;
|
|
288
|
+
readonly target: NodeModel<A, V>;
|
|
289
|
+
readonly Aux: A;
|
|
290
|
+
readonly $viewModel: LikeC4ViewModel<A, V>;
|
|
291
|
+
readonly $view: V;
|
|
292
|
+
readonly $edge: V['edges'][number];
|
|
293
|
+
constructor($viewModel: LikeC4ViewModel<A, V>, $edge: V['edges'][number], source: NodeModel<A, V>, target: NodeModel<A, V>);
|
|
262
294
|
get id(): EdgeId;
|
|
263
|
-
get parent(): NodeModel<A,
|
|
295
|
+
get parent(): NodeModel<A, V> | null;
|
|
264
296
|
get label(): string | null;
|
|
265
297
|
get description(): RichTextOrEmpty;
|
|
266
298
|
get technology(): string | null;
|
|
267
|
-
hasParent(): this is EdgeModel.WithParent<A,
|
|
299
|
+
hasParent(): this is EdgeModel.WithParent<A, V>;
|
|
268
300
|
get tags(): Tags<A>;
|
|
269
301
|
get stepNumber(): number | null;
|
|
270
302
|
get navigateTo(): LikeC4ViewModel<A> | null;
|
|
@@ -272,7 +304,7 @@ declare class EdgeModel<A extends Any = Any, View extends $View<A> = $View<A>> i
|
|
|
272
304
|
get line(): RelationshipLineType;
|
|
273
305
|
get head(): RelationshipArrowType;
|
|
274
306
|
get tail(): RelationshipArrowType | undefined;
|
|
275
|
-
isStep(): this is EdgeModel.StepEdge<A,
|
|
307
|
+
isStep(): this is EdgeModel.StepEdge<A, V>;
|
|
276
308
|
relationships(type: 'model'): IteratorLike<RelationshipModel<A>>;
|
|
277
309
|
relationships(type: 'deployment'): IteratorLike<DeploymentRelationModel<A>>;
|
|
278
310
|
relationships(type?: 'model' | 'deployment'): IteratorLike<RelationshipModel<A> | DeploymentRelationModel<A>>;
|
|
@@ -283,11 +315,11 @@ declare class EdgeModel<A extends Any = Any, View extends $View<A> = $View<A>> i
|
|
|
283
315
|
}
|
|
284
316
|
declare namespace EdgeModel {
|
|
285
317
|
interface StepEdge<A extends Any, V extends $View<A>> extends EdgeModel<A, V> {
|
|
286
|
-
id: StepEdgeId;
|
|
287
|
-
stepNumber: number;
|
|
318
|
+
readonly id: StepEdgeId;
|
|
319
|
+
readonly stepNumber: number;
|
|
288
320
|
}
|
|
289
321
|
interface WithParent<A extends Any, V extends $View<A>> extends EdgeModel<A, V> {
|
|
290
|
-
parent: NodeModel<A, V>;
|
|
322
|
+
readonly parent: NodeModel<A, V>;
|
|
291
323
|
}
|
|
292
324
|
}
|
|
293
325
|
|
|
@@ -372,8 +404,14 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
|
|
|
372
404
|
* Don't use in runtime, only for type inference
|
|
373
405
|
*/
|
|
374
406
|
readonly Aux: A;
|
|
375
|
-
readonly
|
|
407
|
+
readonly id: StrictViewId<A>;
|
|
408
|
+
/**
|
|
409
|
+
* The model this view belongs to
|
|
410
|
+
*/
|
|
376
411
|
readonly $model: LikeC4Model<A>;
|
|
412
|
+
/**
|
|
413
|
+
* The title of the view
|
|
414
|
+
*/
|
|
377
415
|
readonly title: string | null;
|
|
378
416
|
/**
|
|
379
417
|
* View folder this view belongs to.
|
|
@@ -387,9 +425,14 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
|
|
|
387
425
|
* "Group 1/Group 2/View"
|
|
388
426
|
*/
|
|
389
427
|
readonly viewPath: string;
|
|
390
|
-
constructor(model: LikeC4Model<A>, view: V,
|
|
428
|
+
constructor(model: LikeC4Model<A>, folder: LikeC4ViewsFolder<A>, view: V, manualLayoutSnapshot?: ViewManualLayoutSnapshot | undefined);
|
|
429
|
+
/**
|
|
430
|
+
* Returns the styles configuration for the project.
|
|
431
|
+
*/
|
|
432
|
+
get $styles(): LikeC4Styles;
|
|
391
433
|
get _type(): V[_type];
|
|
392
|
-
get
|
|
434
|
+
get stage(): V[_stage];
|
|
435
|
+
get bounds(): Readonly<BBox>;
|
|
393
436
|
/**
|
|
394
437
|
* Returns title if defined, otherwise returns title of the element it is based on, otherwise returns its {@link id}
|
|
395
438
|
*/
|
|
@@ -420,11 +463,31 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
|
|
|
420
463
|
* Available for dynamic views only
|
|
421
464
|
* throws error if view is not dynamic
|
|
422
465
|
*/
|
|
423
|
-
get mode(): DynamicViewDisplayVariant;
|
|
466
|
+
get mode(): DynamicViewDisplayVariant | null;
|
|
424
467
|
/**
|
|
425
468
|
* All tags from nodes and edges.
|
|
426
469
|
*/
|
|
427
470
|
get includedTags(): Tags<A>;
|
|
471
|
+
/**
|
|
472
|
+
* The original view (auto-layouted).
|
|
473
|
+
* @see {@link $layouted} should be used for rendering in the UI
|
|
474
|
+
*/
|
|
475
|
+
get $view(): V;
|
|
476
|
+
/**
|
|
477
|
+
* Returns the view with manual layout applied if it exists, otherwise returns the original view
|
|
478
|
+
* This should be used for rendering in the UI
|
|
479
|
+
*/
|
|
480
|
+
get $layouted(): V;
|
|
481
|
+
get hasManualLayout(): boolean;
|
|
482
|
+
/**
|
|
483
|
+
* If view has manual layout, returns it with manual layout applied
|
|
484
|
+
*/
|
|
485
|
+
get manualLayouted(): V | null;
|
|
486
|
+
/**
|
|
487
|
+
* Returns the layout drift reasons, if any
|
|
488
|
+
* (Only for layouted views with manual layout)
|
|
489
|
+
*/
|
|
490
|
+
get driftReasons(): readonly LayoutedViewDriftReason[];
|
|
428
491
|
roots(): NodesIterator<A, V>;
|
|
429
492
|
/**
|
|
430
493
|
* Iterate over all nodes that have children.
|
|
@@ -488,32 +551,44 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
|
|
|
488
551
|
/**
|
|
489
552
|
* Below are type guards.
|
|
490
553
|
*/
|
|
491
|
-
isComputed(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel<toComputed<A>>;
|
|
492
|
-
|
|
554
|
+
isComputed(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.Computed<toComputed<A>>;
|
|
555
|
+
isLayouted(): this is LikeC4ViewModel.Layouted<A>;
|
|
556
|
+
/**
|
|
557
|
+
* @deprecated Use {@link isLayouted} instead
|
|
558
|
+
*/
|
|
559
|
+
isDiagram(): this is LikeC4ViewModel.Layouted<A>;
|
|
493
560
|
isElementView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.ElementView<A, V>;
|
|
494
561
|
isScopedElementView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.ScopedElementView<A>;
|
|
495
562
|
isDeploymentView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.DeploymentView<A, V>;
|
|
496
563
|
isDynamicView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.DynamicView<A, V>;
|
|
497
564
|
}
|
|
498
565
|
declare namespace LikeC4ViewModel {
|
|
566
|
+
type Computed<A> = A extends AnyComputed ? LikeC4ViewModel<A, ComputedView<A>> : never;
|
|
567
|
+
type Layouted<A> = A extends AnyLayouted ? LikeC4ViewModel<A, LayoutedView<A>> : never;
|
|
499
568
|
interface ElementView<A extends Any, V extends $View<A> = $View<A>> extends LikeC4ViewModel<A, ViewWithType<V, 'element'>> {
|
|
569
|
+
readonly mode: never;
|
|
500
570
|
}
|
|
501
571
|
interface ScopedElementView<A extends Any> extends LikeC4ViewModel<A, ViewWithType<$View<A>, 'element'> & {
|
|
502
572
|
viewOf: Fqn<A>;
|
|
503
573
|
}> {
|
|
504
|
-
|
|
574
|
+
readonly mode: never;
|
|
575
|
+
readonly viewOf: ElementModel<A>;
|
|
505
576
|
}
|
|
506
577
|
interface DeploymentView<A extends Any, V extends $View<A> = $View<A>> extends LikeC4ViewModel<A, ViewWithType<V, 'deployment'>> {
|
|
578
|
+
readonly mode: never;
|
|
579
|
+
}
|
|
580
|
+
interface DynamicView<A extends Any, V extends $View<A>> extends LikeC4ViewModel<A, ViewWithType<V, 'dynamic'>> {
|
|
581
|
+
readonly mode: DynamicViewDisplayVariant;
|
|
582
|
+
readonly viewOf: never;
|
|
507
583
|
}
|
|
508
|
-
type DynamicView<A extends Any, V extends $View<A> = $View<A>> = LikeC4ViewModel<A, ViewWithType<V, 'dynamic'>>;
|
|
509
584
|
}
|
|
510
585
|
|
|
511
586
|
type IncomingFilter = 'all' | 'direct' | 'to-descendants';
|
|
512
587
|
type OutgoingFilter = 'all' | 'direct' | 'from-descendants';
|
|
513
|
-
type ElementOrFqn<A
|
|
588
|
+
type ElementOrFqn<A> = ElementId<A> | {
|
|
514
589
|
id: Fqn<A>;
|
|
515
590
|
};
|
|
516
|
-
type DeploymentOrFqn<A
|
|
591
|
+
type DeploymentOrFqn<A> = DeploymentId<A> | {
|
|
517
592
|
id: DeploymentFqn<A>;
|
|
518
593
|
};
|
|
519
594
|
type NodeOrId = string | {
|
|
@@ -532,8 +607,8 @@ type $View<A extends Any> = {
|
|
|
532
607
|
}[Stage<A>];
|
|
533
608
|
type $ViewModel<A extends Any> = {
|
|
534
609
|
parsed: never;
|
|
535
|
-
computed: LikeC4ViewModel<A
|
|
536
|
-
layouted: LikeC4ViewModel<A
|
|
610
|
+
computed: LikeC4ViewModel<A, $View<A>>;
|
|
611
|
+
layouted: LikeC4ViewModel<A, $View<A>>;
|
|
537
612
|
}[Stage<A>];
|
|
538
613
|
type $ModelData<A extends Any> = {
|
|
539
614
|
parsed: ParsedLikeC4ModelData<A>;
|
|
@@ -547,7 +622,7 @@ interface WithTags<A extends Any> {
|
|
|
547
622
|
interface WithMetadata<A extends Any> {
|
|
548
623
|
hasMetadata(): boolean;
|
|
549
624
|
getMetadata(): Metadata<A>;
|
|
550
|
-
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
625
|
+
getMetadata(field: MetadataKey<A>): string | string[] | undefined;
|
|
551
626
|
}
|
|
552
627
|
|
|
553
628
|
declare class LikeC4DeploymentModel<A extends Any = Any> {
|
|
@@ -636,6 +711,10 @@ type DeployedInstancesIterator<A extends Any> = IteratorLike<DeployedInstanceMod
|
|
|
636
711
|
type DeploymentNodesIterator<A extends Any> = IteratorLike<DeploymentNodeModel<A>>;
|
|
637
712
|
type DeploymentElementModel<A extends Any = Any> = DeploymentNodeModel<A> | DeployedInstanceModel<A>;
|
|
638
713
|
declare abstract class AbstractDeploymentElementModel<A extends Any> implements WithTags<A>, WithMetadata<A> {
|
|
714
|
+
/**
|
|
715
|
+
* Don't use in runtime, only for type inference
|
|
716
|
+
*/
|
|
717
|
+
readonly Aux: A;
|
|
639
718
|
abstract readonly id: DeploymentFqn<A>;
|
|
640
719
|
abstract readonly _literalId: DeploymentId<A>;
|
|
641
720
|
abstract readonly parent: DeploymentNodeModel<A> | null;
|
|
@@ -703,7 +782,7 @@ declare abstract class AbstractDeploymentElementModel<A extends Any> implements
|
|
|
703
782
|
get allIncoming(): RelationshipsAccum<A>;
|
|
704
783
|
hasMetadata(): boolean;
|
|
705
784
|
getMetadata(): Metadata<A>;
|
|
706
|
-
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
785
|
+
getMetadata(field: MetadataKey<A>): string | string[] | undefined;
|
|
707
786
|
/**
|
|
708
787
|
* Checks if the deployment element has the given tag.
|
|
709
788
|
*/
|
|
@@ -805,6 +884,20 @@ declare class DeploymentRelationModel<A extends Any = Any> implements AnyRelatio
|
|
|
805
884
|
get expression(): string;
|
|
806
885
|
get title(): string | null;
|
|
807
886
|
get technology(): string | null;
|
|
887
|
+
/**
|
|
888
|
+
* Returns true if the relationship has a summary and a description
|
|
889
|
+
* (if one is missing - it falls back to another)
|
|
890
|
+
*/
|
|
891
|
+
get hasSummary(): boolean;
|
|
892
|
+
/**
|
|
893
|
+
* Short description of the relationship.
|
|
894
|
+
* Falls back to description if summary is not provided.
|
|
895
|
+
*/
|
|
896
|
+
get summary(): RichTextOrEmpty;
|
|
897
|
+
/**
|
|
898
|
+
* Long description of the relationship.
|
|
899
|
+
* Falls back to summary if description is not provided.
|
|
900
|
+
*/
|
|
808
901
|
get description(): RichTextOrEmpty;
|
|
809
902
|
get tags(): Tags<A>;
|
|
810
903
|
get kind(): RelationKind<A> | null;
|
|
@@ -819,7 +912,7 @@ declare class DeploymentRelationModel<A extends Any = Any> implements AnyRelatio
|
|
|
819
912
|
isModelRelation(): this is RelationshipModel<A>;
|
|
820
913
|
hasMetadata(): boolean;
|
|
821
914
|
getMetadata(): Metadata<A>;
|
|
822
|
-
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
915
|
+
getMetadata(field: MetadataKey<A>): string | string[] | undefined;
|
|
823
916
|
/**
|
|
824
917
|
* Checks if the relationship has the given tag.
|
|
825
918
|
*/
|
|
@@ -856,7 +949,7 @@ declare class RelationshipsAccum<A extends Any = Any> {
|
|
|
856
949
|
* When you do not need types in the model
|
|
857
950
|
*/
|
|
858
951
|
type AnyLikeC4Model = LikeC4Model<any>;
|
|
859
|
-
declare class LikeC4Model<A extends Any =
|
|
952
|
+
declare class LikeC4Model<A extends Any = Any> {
|
|
860
953
|
/**
|
|
861
954
|
* Don't use in runtime, only for type inference
|
|
862
955
|
*/
|
|
@@ -872,9 +965,9 @@ declare class LikeC4Model<A extends Any = Unknown> {
|
|
|
872
965
|
protected readonly _views: Map<ViewId<A>, LikeC4ViewModel<A, $View<A>>>;
|
|
873
966
|
protected readonly _rootViewFolder: LikeC4ViewsFolder<A>;
|
|
874
967
|
protected readonly _viewFolders: Map<string, LikeC4ViewsFolder<A>>;
|
|
875
|
-
protected readonly _viewFolderItems: DefaultMap<string, Set<LikeC4ViewModel<A, $View<A
|
|
876
|
-
protected readonly _allTags: DefaultMap<Tag<A>, Set<ElementModel<A> | LikeC4ViewModel<A, $View<A
|
|
877
|
-
static fromParsed<T extends
|
|
968
|
+
protected readonly _viewFolderItems: DefaultMap<string, Set<LikeC4ViewsFolder<A> | LikeC4ViewModel<A, $View<A>>>>;
|
|
969
|
+
protected readonly _allTags: DefaultMap<Tag<A>, Set<ElementModel<A> | RelationshipModel<A> | LikeC4ViewModel<A, $View<A>>>>;
|
|
970
|
+
static fromParsed<T extends AnyParsed>(model: ParsedLikeC4ModelData<T>): LikeC4Model<T>;
|
|
878
971
|
/**
|
|
879
972
|
* Creates a new LikeC4Model instance from the provided model data.
|
|
880
973
|
* Model with parsed data will not have views, as they must be computed
|
|
@@ -884,9 +977,10 @@ declare class LikeC4Model<A extends Any = Unknown> {
|
|
|
884
977
|
* @param model - The model data to create a LikeC4Model from
|
|
885
978
|
* @returns A new LikeC4Model instance with the type derived from the input model
|
|
886
979
|
*/
|
|
887
|
-
static create<T extends
|
|
888
|
-
static create<T extends
|
|
889
|
-
static create<T extends
|
|
980
|
+
static create<T extends AnyParsed>(model: ParsedLikeC4ModelData<T>): LikeC4Model<T>;
|
|
981
|
+
static create<T extends AnyComputed>(model: ComputedLikeC4ModelData<T>): LikeC4Model<T>;
|
|
982
|
+
static create<T extends AnyLayouted>(model: LayoutedLikeC4ModelData<T>): LikeC4Model<T>;
|
|
983
|
+
static create<T extends Any>(model: $ModelData<T>): LikeC4Model<T>;
|
|
890
984
|
/**
|
|
891
985
|
* Creates a new LikeC4Model instance and infers types from a model dump.\
|
|
892
986
|
* Model dump expected to be computed or layouted.
|
|
@@ -921,15 +1015,15 @@ declare class LikeC4Model<A extends Any = Unknown> {
|
|
|
921
1015
|
/**
|
|
922
1016
|
* Type guard the model to the parsed stage.
|
|
923
1017
|
*/
|
|
924
|
-
isParsed(this: LikeC4Model<any>): this is LikeC4Model<
|
|
1018
|
+
isParsed(this: LikeC4Model<any>): this is LikeC4Model.Parsed<A>;
|
|
925
1019
|
/**
|
|
926
1020
|
* Type guard the model to the layouted stage.
|
|
927
1021
|
*/
|
|
928
|
-
isLayouted(this: LikeC4Model<any>): this is LikeC4Model<
|
|
1022
|
+
isLayouted(this: LikeC4Model<any>): this is LikeC4Model.Layouted<A>;
|
|
929
1023
|
/**
|
|
930
1024
|
* Type guard the model to the computed stage.
|
|
931
1025
|
*/
|
|
932
|
-
isComputed(this: LikeC4Model<any>): this is LikeC4Model<
|
|
1026
|
+
isComputed(this: LikeC4Model<any>): this is LikeC4Model.Computed<A>;
|
|
933
1027
|
/**
|
|
934
1028
|
* Keeping here for backward compatibility
|
|
935
1029
|
* @deprecated use {@link $data}
|
|
@@ -963,7 +1057,9 @@ declare class LikeC4Model<A extends Any = Unknown> {
|
|
|
963
1057
|
* id: 'dashboard',
|
|
964
1058
|
* })
|
|
965
1059
|
*/
|
|
966
|
-
element(el:
|
|
1060
|
+
element(el: ElementId<A> | {
|
|
1061
|
+
id: Fqn<A>;
|
|
1062
|
+
}): ElementModel<A>;
|
|
967
1063
|
/**
|
|
968
1064
|
* Returns the element with the given FQN.
|
|
969
1065
|
*
|
|
@@ -1016,7 +1112,7 @@ declare class LikeC4Model<A extends Any = Unknown> {
|
|
|
1016
1112
|
*/
|
|
1017
1113
|
view(viewId: ViewId<A> | {
|
|
1018
1114
|
id: ViewId$1<ViewId<A>>;
|
|
1019
|
-
}):
|
|
1115
|
+
}): $ViewModel<A>;
|
|
1020
1116
|
/**
|
|
1021
1117
|
* Returns a specific view by its ID.
|
|
1022
1118
|
* @note Method is not type-safe as {@link view}
|
|
@@ -1024,7 +1120,7 @@ declare class LikeC4Model<A extends Any = Unknown> {
|
|
|
1024
1120
|
* @example
|
|
1025
1121
|
* model.findView('index')
|
|
1026
1122
|
*/
|
|
1027
|
-
findView(viewId: LooseViewId<A>):
|
|
1123
|
+
findView(viewId: LooseViewId<A>): $ViewModel<A> | null;
|
|
1028
1124
|
/**
|
|
1029
1125
|
* Returns a view folder by its path.
|
|
1030
1126
|
* Path is extracted from the view title, e.g. "Group 1/Group 2/View" -> "Group 1/Group 2"
|
|
@@ -1147,17 +1243,18 @@ declare class LikeC4Model<A extends Any = Unknown> {
|
|
|
1147
1243
|
private addRelation;
|
|
1148
1244
|
}
|
|
1149
1245
|
declare namespace LikeC4Model {
|
|
1150
|
-
const EMPTY: LikeC4Model<
|
|
1151
|
-
type Parsed<A =
|
|
1152
|
-
type Computed<A =
|
|
1153
|
-
type Layouted<A =
|
|
1154
|
-
type Node<A =
|
|
1155
|
-
type Element<A =
|
|
1156
|
-
type Relationship<A =
|
|
1157
|
-
type View<A =
|
|
1158
|
-
type DeploymentNode<A =
|
|
1159
|
-
type
|
|
1160
|
-
type
|
|
1246
|
+
const EMPTY: LikeC4Model<Unknown>;
|
|
1247
|
+
type Parsed<A = unknown> = IsAny<A> extends true ? LikeC4Model<AnyParsed> : A extends Aux<any, infer E, infer D, infer V, infer PID, infer Spec> ? LikeC4Model<Aux<'parsed', E, D, V, PID, Spec>> : LikeC4Model<UnknownParsed>;
|
|
1248
|
+
type Computed<A = unknown> = IsAny<A> extends true ? LikeC4Model<AnyComputed> : A extends Aux<any, infer E, infer D, infer V, infer PID, infer Spec> ? LikeC4Model<Aux<'computed', E, D, V, PID, Spec>> : LikeC4Model<UnknownComputed>;
|
|
1249
|
+
type Layouted<A = unknown> = IsAny<A> extends true ? LikeC4Model<AnyLayouted> : A extends Aux<any, infer E, infer D, infer V, infer PID, infer Spec> ? LikeC4Model<Aux<'layouted', E, D, V, PID, Spec>> : LikeC4Model<UnknownLayouted>;
|
|
1250
|
+
type Node<A = Any> = A extends Any ? NodeModel<A> : never;
|
|
1251
|
+
type Element<A = Any> = A extends Any ? ElementModel<A> : never;
|
|
1252
|
+
type Relationship<A = Any> = A extends Any ? RelationshipModel<A> : never;
|
|
1253
|
+
type View<A = Any> = A extends Any ? $ViewModel<A> : never;
|
|
1254
|
+
type DeploymentNode<A = Any> = A extends Any ? DeploymentNodeModel<A> : never;
|
|
1255
|
+
type DeploymentRelation<A = Any> = A extends Any ? DeploymentRelationModel<A> : never;
|
|
1256
|
+
type DeployedInstance<A = Any> = A extends Any ? DeployedInstanceModel<A> : never;
|
|
1257
|
+
type AnyRelation<M = Any> = M extends Any ? RelationshipModel<M> | DeploymentRelationModel<M> : never;
|
|
1161
1258
|
}
|
|
1162
1259
|
|
|
1163
|
-
export { type AnyRelationshipModel as A,
|
|
1260
|
+
export { type AnyRelationshipModel as A, type DeploymentElementModel as D, ElementModel as E, type IncomingFilter as I, LikeC4Model as L, NestedElementOfDeployedInstanceModel as N, type OutgoingFilter as O, RelationshipModel as R, type WithMetadata as W, DeploymentNodeModel as a, DeployedInstanceModel as b, DeploymentRelationModel as c, LikeC4ViewModel as d, NodeModel as e, EdgeModel as f, type AnyLikeC4Model as g, RelationshipsAccum as h, type DeploymentRelationEndpoint as i, LikeC4DeploymentModel as j, LikeC4ViewsFolder as k, type DeploymentOrFqn as l, type EdgeOrId as m, type ElementOrFqn as n, type NodeOrId as o, type WithTags as p };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import { g as getDefaultExportFromCjs } from './core.B85MJLTf.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { r as requireIterator, a as requireSupport } from './core.BdPcbSkN.mjs';
|
|
4
4
|
|
|
5
5
|
var iteratorExports = requireIterator();
|
|
6
6
|
const Iterator = /*@__PURE__*/getDefaultExportFromCjs(iteratorExports);
|