@likec4/core 1.32.1 → 1.33.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 +10 -6
- package/dist/builder/index.mjs +45 -13
- package/dist/compute-view/index.d.mts +6 -4
- package/dist/compute-view/index.mjs +33 -10
- package/dist/compute-view/relationships-view/index.d.mts +6 -4
- package/dist/compute-view/relationships-view/index.mjs +6 -3
- package/dist/index.d.mts +9 -138
- package/dist/index.mjs +31 -3712
- package/dist/model/connection/deployment/index.d.mts +10 -0
- package/dist/model/connection/deployment/index.mjs +18 -0
- package/dist/model/connection/index.d.mts +70 -0
- package/dist/model/connection/index.mjs +23 -0
- package/dist/model/connection/model/index.d.mts +10 -0
- package/dist/model/connection/model/index.mjs +11 -0
- package/dist/model/index.d.mts +14 -256
- package/dist/model/index.mjs +27 -5
- package/dist/shared/{core.DXzRBkuI.d.mts → core.1pNeDdRk.d.mts} +92 -81
- package/dist/shared/{core.BuO4ncfY.d.mts → core.668kXpZq.d.mts} +42 -52
- package/dist/shared/core.8KM0D6va.mjs +33 -0
- package/dist/shared/core.B0oEIXqd.mjs +47 -0
- package/dist/shared/core.BH9nN-_I.mjs +22 -0
- package/dist/shared/core.BMCb0wJI.mjs +177 -0
- package/dist/shared/core.BTnf14gD.mjs +331 -0
- package/dist/shared/core.BgvIuGGU.mjs +3 -0
- package/dist/shared/core.BoyJPEen.mjs +21 -0
- package/dist/shared/{core.CUYDgv2-.mjs → core.Br7Fab9l.mjs} +12 -15
- package/dist/shared/{core.BrCnZFTn.mjs → core.Btl47GOn.mjs} +3 -3
- package/dist/shared/core.ByrmCl9I.mjs +5 -0
- package/dist/shared/core.C80Z37Eu.mjs +29 -0
- package/dist/shared/{core.Pf5I9o0e.d.mts → core.CF82MWyh.d.mts} +1 -1
- package/dist/shared/{core.rmvsy0n3.mjs → core.C_C-3c1S.mjs} +5 -198
- package/dist/shared/core.CeQbbp7K.d.mts +41 -0
- package/dist/shared/{core.DoK86JEe.mjs → core.CpwrZi3D.mjs} +2 -73
- package/dist/shared/{core.CpXlRyE5.mjs → core.CtKXPqN_.mjs} +5 -36
- package/dist/shared/core.CxGKeL-L.mjs +144 -0
- package/dist/shared/core.CzdwsPmY.d.mts +69 -0
- package/dist/shared/{core.Cy9smucx.mjs → core.D4npX2q8.mjs} +1 -3
- package/dist/shared/core.D56nCp7e.mjs +168 -0
- package/dist/shared/core.D5qVzkws.mjs +724 -0
- package/dist/shared/core.DDAPzd3T.d.mts +87 -0
- package/dist/shared/{core.CBpKAlhj.mjs → core.DDynPqbh.mjs} +96 -56
- package/dist/shared/{core.Bk7wEZFG.mjs → core.DXRAwwDB.mjs} +3 -2
- package/dist/shared/core.DcS-0zys.mjs +10 -0
- package/dist/shared/{core.BaYE_r29.d.mts → core.De___iBS.d.mts} +4 -3
- package/dist/shared/core.DsMrjY2q.mjs +34 -0
- package/dist/shared/core.DuSLYTG6.d.mts +57 -0
- package/dist/shared/core.Dy-F3xRP.d.mts +83 -0
- package/dist/shared/{core.znRaUX_A.d.mts → core.OLInHaJx.d.mts} +48 -41
- package/dist/shared/core.XptQjhMA.mjs +1295 -0
- package/dist/shared/{core.cbA9VZ02.mjs → core.hoq9W4rW.mjs} +28 -1073
- package/dist/shared/core.zLlww-07.mjs +3 -0
- package/dist/theme/index.d.mts +134 -0
- package/dist/theme/index.mjs +3709 -0
- package/dist/types/aux.d.mts +3 -2
- package/dist/types/index.d.mts +9 -5
- package/dist/types/index.mjs +17 -146
- package/dist/utils/index.d.mts +16 -100
- package/dist/utils/index.mjs +25 -1312
- package/dist/utils/iterable/index.d.mts +100 -0
- package/dist/utils/iterable/index.mjs +24 -0
- package/package.json +26 -10
- package/src/builder/Builder.ts +13 -4
- package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +0 -13
- package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +2 -6
- package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +0 -7
- package/src/builder/_types.ts +6 -2
- package/src/compute-view/deployment-view/__test__/fixture.ts +15 -5
- package/src/compute-view/deployment-view/utils.ts +13 -13
- package/src/compute-view/dynamic-view/compute.ts +2 -1
- package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +2 -2
- package/src/compute-view/relationships-view/layout.ts +1 -1
- package/src/compute-view/utils/applyCustomElementProperties.ts +8 -0
- package/src/compute-view/utils/applyCustomRelationProperties.ts +2 -0
- package/src/compute-view/utils/buildComputedNodes.ts +4 -3
- package/src/compute-view/utils/merge-props-from-relationships.ts +6 -5
- package/src/compute-view/utils/view-hash.ts +24 -3
- package/src/model/DeploymentElementModel.ts +22 -18
- package/src/model/ElementModel.ts +14 -10
- package/src/model/RelationModel.ts +21 -21
- package/src/model/index.ts +4 -0
- package/src/model/types.ts +11 -0
- package/src/model/view/EdgeModel.ts +6 -5
- package/src/model/view/LikeC4ViewModel.ts +10 -4
- package/src/model/view/NodeModel.ts +6 -4
- package/src/theme/index.ts +12 -5
- package/src/types/RichText.ts +200 -0
- package/src/types/aux.ts +1 -1
- package/src/types/index.ts +2 -0
- package/src/types/model-deployment.ts +4 -3
- package/src/types/model-logical.ts +3 -3
- package/src/types/scalar.ts +47 -2
- package/src/types/view-common.ts +1 -1
- package/src/types/view-computed.ts +2 -4
- package/src/types/view-layouted.ts +9 -0
- package/src/types/view-parsed.deployment.ts +0 -1
- package/src/types/view.ts +0 -27
- package/src/utils/index.ts +5 -10
- package/src/utils/markdown/index.ts +2 -0
- package/src/utils/markdown/to-html.ts +32 -0
- package/src/utils/markdown/to-text.ts +14 -0
- package/src/utils/promises.ts +4 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { C as Connection, c as customInspectSymbol } from './core.CeQbbp7K.mjs';
|
|
2
|
+
import { E as ElementModel, R as RelationshipModel } from './core.OLInHaJx.mjs';
|
|
3
|
+
import { A as Any, U as Unknown, B as EdgeId } from './core.De___iBS.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Connection refers to any relationships between two elements,
|
|
7
|
+
* both direct and implicit ones (between their nested elements).
|
|
8
|
+
*
|
|
9
|
+
* Merges relationships together to an single edge on the diagram.
|
|
10
|
+
*/
|
|
11
|
+
declare class ConnectionModel<A extends Any = Unknown> implements Connection<ElementModel<A>, EdgeId> {
|
|
12
|
+
readonly source: ElementModel<A>;
|
|
13
|
+
readonly target: ElementModel<A>;
|
|
14
|
+
readonly relations: ReadonlySet<RelationshipModel<A>>;
|
|
15
|
+
readonly id: EdgeId;
|
|
16
|
+
constructor(source: ElementModel<A>, target: ElementModel<A>, relations?: ReadonlySet<RelationshipModel<A>>);
|
|
17
|
+
private _boundary;
|
|
18
|
+
/**
|
|
19
|
+
* Common ancestor of the source and target elements.
|
|
20
|
+
* Represents the boundary of the connection.
|
|
21
|
+
*/
|
|
22
|
+
get boundary(): ElementModel<A> | null;
|
|
23
|
+
/**
|
|
24
|
+
* Human readable expression of the connection
|
|
25
|
+
* Mostly used for testing and debugging
|
|
26
|
+
*/
|
|
27
|
+
get expression(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if only includes relations between the source and target elements.
|
|
30
|
+
*/
|
|
31
|
+
get isDirect(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Returns true if includes relations between nested elements of the source and target elements.
|
|
34
|
+
*/
|
|
35
|
+
get isImplicit(): boolean;
|
|
36
|
+
get directRelations(): ReadonlySet<RelationshipModel<A>>;
|
|
37
|
+
nonEmpty(): boolean;
|
|
38
|
+
mergeWith(other: ConnectionModel<A>): ConnectionModel<A>;
|
|
39
|
+
difference(other: ConnectionModel<A>): ConnectionModel<A>;
|
|
40
|
+
intersect(other: ConnectionModel<A>): ConnectionModel<A>;
|
|
41
|
+
equals(other: Connection): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a new instance with the updated relations.
|
|
44
|
+
*
|
|
45
|
+
* @param relations - A readonly set of `RelationshipModel` instances representing the new relations.
|
|
46
|
+
* @returns A new `ConnectionModel` instance with the updated relations.
|
|
47
|
+
*/
|
|
48
|
+
update(relations: ReadonlySet<RelationshipModel<A>>): ConnectionModel<A>;
|
|
49
|
+
[customInspectSymbol](depth: any, inspectOptions: any, inspect: any): string;
|
|
50
|
+
toString(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new connection with reversed direction (target becomes source and vice versa)
|
|
53
|
+
* @param search - When true, attempts to find an existing connection between the reversed nodes
|
|
54
|
+
*/
|
|
55
|
+
reversed(search?: boolean): ConnectionModel<A>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Resolve connection from source to target
|
|
60
|
+
*
|
|
61
|
+
* @param direction - if 'both', also returns connection from target to source
|
|
62
|
+
* @default `directed`
|
|
63
|
+
*/
|
|
64
|
+
declare function findConnection<A extends Any>(source: ElementModel<A>, target: ElementModel<A>, direction?: 'directed' | 'both'): [ConnectionModel<A>, ConnectionModel<A>] | [ConnectionModel<A>] | [];
|
|
65
|
+
/**
|
|
66
|
+
* Resolve all connections between element and others
|
|
67
|
+
* @param direction - if 'directed', only look for outgoing connections from the element to others
|
|
68
|
+
* @default `both`
|
|
69
|
+
*/
|
|
70
|
+
declare function findConnectionsBetween<M extends Any>(element: ElementModel<M>, others: Iterable<ElementModel<M>>, direction?: 'directed' | 'both'): readonly ConnectionModel<M>[];
|
|
71
|
+
/**
|
|
72
|
+
* Resolve all connections within a given set of elements
|
|
73
|
+
*/
|
|
74
|
+
declare function findConnectionsWithin<M extends Any>(elements: Iterable<ElementModel<M>>): readonly ConnectionModel<M>[];
|
|
75
|
+
|
|
76
|
+
declare const find_findConnection: typeof findConnection;
|
|
77
|
+
declare const find_findConnectionsBetween: typeof findConnectionsBetween;
|
|
78
|
+
declare const find_findConnectionsWithin: typeof findConnectionsWithin;
|
|
79
|
+
declare namespace find {
|
|
80
|
+
export { find_findConnection as findConnection, find_findConnectionsBetween as findConnectionsBetween, find_findConnectionsWithin as findConnectionsWithin };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { ConnectionModel as C, findConnection as a, findConnectionsBetween as b, findConnectionsWithin as c, find as f };
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import { A as Any,
|
|
1
|
+
import { A as Any, R as RelationKind, T as Tags, h as Metadata, j as MetadataKey, L as LooseTag, F as Fqn, g as ElementId, k as ElementKind, D as DeploymentKind, E as ExtractOnStage, l as RelationId$1, f as _type, m as StrictViewId, n as LooseElementId, o as LooseDeploymentId, p as DeploymentFqn, t as toComputed, q as toLayouted, r as Stage, s as DeploymentId, U as Unknown, V as ViewId, u as Tag, v as toParsed, P as ProjectId$1, w as LooseViewId, b as Aux, S as SpecAux, e as UnknownParsed, c as UnknownComputed, d as UnknownLayouted } from './core.De___iBS.mjs';
|
|
2
2
|
import { D as DefaultMap } from './core.CywrQs86.mjs';
|
|
3
3
|
import { SetRequired } from 'type-fest';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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.668kXpZq.mjs';
|
|
5
|
+
import { b as RichTextOrEmpty, Y as Relationship, Q as Element, O as ElementStyle, as as ViewWithType, ao as ComputedView, am as LayoutedView, n as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, L as LayoutedLikeC4ModelData, f as FqnRef, q as DeployedInstance, D as DeploymentElementStyle, v as DeploymentRelationship, r as DeploymentElement, p as DeploymentNode, y as LikeC4ModelDump, z as AuxFromDump, a2 as Specification, m as ModelGlobals, ah as WhereOperator } from './core.1pNeDdRk.mjs';
|
|
6
|
+
import { I as IteratorLike, L as Link } from './core.DuSLYTG6.mjs';
|
|
7
|
+
import { i as Color, R as RelationshipLineType, c as ElementShape } from './core.CzdwsPmY.mjs';
|
|
6
8
|
|
|
7
9
|
type RelationshipsIterator<A extends Any> = IteratorLike<RelationshipModel<A>>;
|
|
8
10
|
/**
|
|
9
11
|
* A relationship between two elements (in logical or deployment model)
|
|
10
12
|
* use {@link isDeploymentRelationModel} guard to check if the relationship is a deployment relationship
|
|
11
13
|
*/
|
|
12
|
-
interface AnyRelationshipModel<A extends Any> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get line(): RelationshipLineType;
|
|
14
|
+
interface AnyRelationshipModel<A extends Any> extends WithTags<A>, WithMetadata<A> {
|
|
15
|
+
readonly id: RelationId;
|
|
16
|
+
readonly expression: string;
|
|
17
|
+
readonly title: string | null;
|
|
18
|
+
readonly technology: string | null;
|
|
19
|
+
readonly description: RichTextOrEmpty;
|
|
20
|
+
readonly navigateTo: LikeC4ViewModel<A> | null;
|
|
21
|
+
readonly kind: RelationKind<A> | null;
|
|
22
|
+
readonly links: ReadonlyArray<Link>;
|
|
23
|
+
readonly color: Color;
|
|
24
|
+
readonly line: RelationshipLineType;
|
|
24
25
|
isDeploymentRelation(): this is DeploymentRelationModel<A>;
|
|
25
26
|
isModelRelation(): this is RelationshipModel<A>;
|
|
26
|
-
getMetadata(): Metadata<A>;
|
|
27
|
-
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
28
27
|
views(): ViewsIterator<A>;
|
|
29
|
-
isTagged(tag: LooseTag<A>): boolean;
|
|
30
28
|
}
|
|
31
29
|
declare class RelationshipModel<A extends Any = Any> implements AnyRelationshipModel<A> {
|
|
32
30
|
readonly model: LikeC4Model<A>;
|
|
@@ -43,7 +41,7 @@ declare class RelationshipModel<A extends Any = Any> implements AnyRelationshipM
|
|
|
43
41
|
get expression(): string;
|
|
44
42
|
get title(): string | null;
|
|
45
43
|
get technology(): string | null;
|
|
46
|
-
get description():
|
|
44
|
+
get description(): RichTextOrEmpty;
|
|
47
45
|
get navigateTo(): LikeC4ViewModel<A> | null;
|
|
48
46
|
get tags(): Tags<A>;
|
|
49
47
|
get kind(): RelationKind<A> | null;
|
|
@@ -56,6 +54,7 @@ declare class RelationshipModel<A extends Any = Any> implements AnyRelationshipM
|
|
|
56
54
|
views(): ViewsIterator<A>;
|
|
57
55
|
isDeploymentRelation(): this is DeploymentRelationModel<A>;
|
|
58
56
|
isModelRelation(): this is RelationshipModel<A>;
|
|
57
|
+
hasMetadata(): boolean;
|
|
59
58
|
getMetadata(): Metadata<A>;
|
|
60
59
|
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
61
60
|
/**
|
|
@@ -65,7 +64,7 @@ declare class RelationshipModel<A extends Any = Any> implements AnyRelationshipM
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
type ElementsIterator<M extends Any> = IteratorLike<ElementModel<M>>;
|
|
68
|
-
declare class ElementModel<A extends Any = Any> {
|
|
67
|
+
declare class ElementModel<A extends Any = Any> implements WithTags<A>, WithMetadata<A> {
|
|
69
68
|
readonly $model: LikeC4Model<A>;
|
|
70
69
|
readonly $element: Element<A>;
|
|
71
70
|
readonly id: Fqn<A>;
|
|
@@ -87,12 +86,10 @@ declare class ElementModel<A extends Any = Any> {
|
|
|
87
86
|
*/
|
|
88
87
|
get tags(): Tags<A>;
|
|
89
88
|
get title(): string;
|
|
90
|
-
get description():
|
|
89
|
+
get description(): RichTextOrEmpty;
|
|
91
90
|
get technology(): string | null;
|
|
92
91
|
get links(): ReadonlyArray<Link>;
|
|
93
|
-
get defaultView(): LikeC4ViewModel<A
|
|
94
|
-
viewOf: Fqn<A>;
|
|
95
|
-
}> | null;
|
|
92
|
+
get defaultView(): LikeC4ViewModel.ScopedElementView<A> | null;
|
|
96
93
|
get isRoot(): boolean;
|
|
97
94
|
get style(): SetRequired<ElementStyle, 'size'>;
|
|
98
95
|
isAncestorOf(another: ElementModel<A>): boolean;
|
|
@@ -139,14 +136,13 @@ declare class ElementModel<A extends Any = Any> {
|
|
|
139
136
|
* Iterate over all views that scope this element.
|
|
140
137
|
* It is possible that element is not included in the view.
|
|
141
138
|
*/
|
|
142
|
-
scopedViews(): ReadonlySet<LikeC4ViewModel<A
|
|
143
|
-
viewOf: Fqn<A>;
|
|
144
|
-
}>>;
|
|
139
|
+
scopedViews(): ReadonlySet<LikeC4ViewModel.ScopedElementView<A>>;
|
|
145
140
|
/**
|
|
146
141
|
* @returns true if the element is deployed
|
|
147
142
|
*/
|
|
148
143
|
isDeployed(): boolean;
|
|
149
144
|
deployments(): DeployedInstancesIterator<A>;
|
|
145
|
+
hasMetadata(): boolean;
|
|
150
146
|
getMetadata(): Metadata<A>;
|
|
151
147
|
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
152
148
|
/**
|
|
@@ -156,7 +152,7 @@ declare class ElementModel<A extends Any = Any> {
|
|
|
156
152
|
}
|
|
157
153
|
|
|
158
154
|
type NodesIterator<M extends Any, V extends $View<M>> = IteratorLike<NodeModel<M, V>>;
|
|
159
|
-
declare class NodeModel<A extends Any = Any, V extends $View<A> = $View<A>> {
|
|
155
|
+
declare class NodeModel<A extends Any = Any, V extends $View<A> = $View<A>> implements WithTags<A> {
|
|
160
156
|
#private;
|
|
161
157
|
readonly $view: LikeC4ViewModel<A, V>;
|
|
162
158
|
readonly $node: V['nodes'][number];
|
|
@@ -164,7 +160,7 @@ declare class NodeModel<A extends Any = Any, V extends $View<A> = $View<A>> {
|
|
|
164
160
|
get id(): NodeId;
|
|
165
161
|
get title(): string;
|
|
166
162
|
get kind(): ElementKind<A> | DeploymentKind<A> | typeof GroupElementKind | 'instance';
|
|
167
|
-
get description():
|
|
163
|
+
get description(): RichTextOrEmpty;
|
|
168
164
|
get technology(): string | null;
|
|
169
165
|
get parent(): NodeModel<A, V> | null;
|
|
170
166
|
get element(): ElementModel<A> | null;
|
|
@@ -234,7 +230,7 @@ declare namespace NodeModel {
|
|
|
234
230
|
}
|
|
235
231
|
|
|
236
232
|
type EdgesIterator<A extends Any, V extends $View<A>> = IteratorLike<EdgeModel<A, V>>;
|
|
237
|
-
declare class EdgeModel<A extends Any = Any, View extends $View<A> = $View<A>> {
|
|
233
|
+
declare class EdgeModel<A extends Any = Any, View extends $View<A> = $View<A>> implements WithTags<A> {
|
|
238
234
|
#private;
|
|
239
235
|
readonly view: LikeC4ViewModel<A, View>;
|
|
240
236
|
readonly $edge: View['edges'][number];
|
|
@@ -244,7 +240,7 @@ declare class EdgeModel<A extends Any = Any, View extends $View<A> = $View<A>> {
|
|
|
244
240
|
get id(): EdgeId;
|
|
245
241
|
get parent(): NodeModel<A, View> | null;
|
|
246
242
|
get label(): string | null;
|
|
247
|
-
get description():
|
|
243
|
+
get description(): RichTextOrEmpty;
|
|
248
244
|
get technology(): string | null;
|
|
249
245
|
hasParent(): this is EdgeModel.WithParent<A, View>;
|
|
250
246
|
get tags(): Tags<A>;
|
|
@@ -272,7 +268,7 @@ declare namespace EdgeModel {
|
|
|
272
268
|
}
|
|
273
269
|
|
|
274
270
|
type ViewsIterator<A extends Any, V extends $View<A> = $View<A>> = IteratorLike<LikeC4ViewModel<A, V>>;
|
|
275
|
-
declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>> {
|
|
271
|
+
declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>> implements WithTags<A> {
|
|
276
272
|
#private;
|
|
277
273
|
/**
|
|
278
274
|
* Don't use in runtime, only for type inference
|
|
@@ -284,6 +280,7 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
|
|
|
284
280
|
get _type(): V[_type];
|
|
285
281
|
get id(): StrictViewId<A>;
|
|
286
282
|
get title(): string | null;
|
|
283
|
+
get description(): RichTextOrEmpty;
|
|
287
284
|
get tags(): Tags<A>;
|
|
288
285
|
get links(): ReadonlyArray<Link>;
|
|
289
286
|
get viewOf(): ElementModel<A> | null;
|
|
@@ -350,14 +347,14 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
|
|
|
350
347
|
isComputed(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel<toComputed<A>>;
|
|
351
348
|
isDiagram(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel<toLayouted<A>>;
|
|
352
349
|
isElementView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.ElementView<A, V>;
|
|
353
|
-
isScopedElementView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.ScopedElementView<A
|
|
350
|
+
isScopedElementView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.ScopedElementView<A>;
|
|
354
351
|
isDeploymentView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.DeploymentView<A, V>;
|
|
355
352
|
isDynamicView(this: LikeC4ViewModel<any, any>): this is LikeC4ViewModel.DynamicView<A, V>;
|
|
356
353
|
}
|
|
357
354
|
declare namespace LikeC4ViewModel {
|
|
358
355
|
interface ElementView<A extends Any, V extends $View<A> = $View<A>> extends LikeC4ViewModel<A, ViewWithType<V, 'element'>> {
|
|
359
356
|
}
|
|
360
|
-
interface ScopedElementView<A extends Any
|
|
357
|
+
interface ScopedElementView<A extends Any> extends LikeC4ViewModel<A, ViewWithType<$View<A>, 'element'> & {
|
|
361
358
|
viewOf: Fqn<A>;
|
|
362
359
|
}> {
|
|
363
360
|
viewOf: ElementModel<A>;
|
|
@@ -390,7 +387,6 @@ type $View<A extends Any> = {
|
|
|
390
387
|
computed: ComputedView<A>;
|
|
391
388
|
layouted: LayoutedView<A>;
|
|
392
389
|
}[Stage<A>];
|
|
393
|
-
type $ViewWithType<A extends Any, V extends ViewType> = ViewWithType<$View<A>, V>;
|
|
394
390
|
type $ViewModel<A extends Any> = {
|
|
395
391
|
parsed: never;
|
|
396
392
|
computed: LikeC4ViewModel<A>;
|
|
@@ -401,6 +397,15 @@ type $ModelData<A extends Any> = {
|
|
|
401
397
|
computed: ComputedLikeC4ModelData<A>;
|
|
402
398
|
layouted: LayoutedLikeC4ModelData<A>;
|
|
403
399
|
}[Stage<A>];
|
|
400
|
+
interface WithTags<A extends Any> {
|
|
401
|
+
get tags(): Tags<A>;
|
|
402
|
+
isTagged(tag: LooseTag<A>): boolean;
|
|
403
|
+
}
|
|
404
|
+
interface WithMetadata<A extends Any> {
|
|
405
|
+
hasMetadata(): boolean;
|
|
406
|
+
getMetadata(): Metadata<A>;
|
|
407
|
+
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
408
|
+
}
|
|
404
409
|
|
|
405
410
|
declare class LikeC4DeploymentModel<A extends Any = Any> {
|
|
406
411
|
#private;
|
|
@@ -486,7 +491,7 @@ type DeploymentElementsIterator<A extends Any> = IteratorLike<DeploymentElementM
|
|
|
486
491
|
type DeployedInstancesIterator<A extends Any> = IteratorLike<DeployedInstanceModel<A>>;
|
|
487
492
|
type DeploymentNodesIterator<A extends Any> = IteratorLike<DeploymentNodeModel<A>>;
|
|
488
493
|
type DeploymentElementModel<A extends Any = Any> = DeploymentNodeModel<A> | DeployedInstanceModel<A>;
|
|
489
|
-
declare abstract class AbstractDeploymentElementModel<A extends Any> {
|
|
494
|
+
declare abstract class AbstractDeploymentElementModel<A extends Any> implements WithTags<A>, WithMetadata<A> {
|
|
490
495
|
abstract readonly id: DeploymentFqn<A>;
|
|
491
496
|
abstract readonly _literalId: DeploymentId<A>;
|
|
492
497
|
abstract readonly parent: DeploymentNodeModel<A> | null;
|
|
@@ -498,7 +503,7 @@ declare abstract class AbstractDeploymentElementModel<A extends Any> {
|
|
|
498
503
|
get style(): SetRequired<DeploymentElementStyle, 'shape' | 'color' | 'size'>;
|
|
499
504
|
get shape(): ElementShape;
|
|
500
505
|
get color(): Color;
|
|
501
|
-
get description():
|
|
506
|
+
get description(): RichTextOrEmpty;
|
|
502
507
|
get technology(): string | null;
|
|
503
508
|
get links(): ReadonlyArray<Link>;
|
|
504
509
|
/**
|
|
@@ -542,6 +547,7 @@ declare abstract class AbstractDeploymentElementModel<A extends Any> {
|
|
|
542
547
|
abstract incomingModelRelationships(): RelationshipsIterator<A>;
|
|
543
548
|
get allOutgoing(): RelationshipsAccum<A>;
|
|
544
549
|
get allIncoming(): RelationshipsAccum<A>;
|
|
550
|
+
hasMetadata(): boolean;
|
|
545
551
|
getMetadata(): Metadata<A>;
|
|
546
552
|
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
547
553
|
/**
|
|
@@ -606,7 +612,7 @@ declare class DeployedInstanceModel<A extends Any = Any> extends AbstractDeploym
|
|
|
606
612
|
get color(): Color;
|
|
607
613
|
get tags(): Tags<A>;
|
|
608
614
|
get kind(): ElementKind<A>;
|
|
609
|
-
get description():
|
|
615
|
+
get description(): RichTextOrEmpty;
|
|
610
616
|
get technology(): string | null;
|
|
611
617
|
get links(): ReadonlyArray<Link>;
|
|
612
618
|
isInstance(): this is DeployedInstanceModel<A>;
|
|
@@ -628,7 +634,7 @@ declare class NestedElementOfDeployedInstanceModel<A extends Any = Any> {
|
|
|
628
634
|
get shape(): ElementShape;
|
|
629
635
|
get color(): Color;
|
|
630
636
|
get title(): string;
|
|
631
|
-
get description():
|
|
637
|
+
get description(): RichTextOrEmpty;
|
|
632
638
|
get technology(): string | null;
|
|
633
639
|
isDeploymentNode(): this is DeploymentNodeModel<A>;
|
|
634
640
|
isInstance(): this is DeployedInstanceModel<A>;
|
|
@@ -645,7 +651,7 @@ declare class DeploymentRelationModel<A extends Any = Any> implements AnyRelatio
|
|
|
645
651
|
get expression(): string;
|
|
646
652
|
get title(): string | null;
|
|
647
653
|
get technology(): string | null;
|
|
648
|
-
get description():
|
|
654
|
+
get description(): RichTextOrEmpty;
|
|
649
655
|
get tags(): Tags<A>;
|
|
650
656
|
get kind(): RelationKind<A> | null;
|
|
651
657
|
get navigateTo(): LikeC4ViewModel<A> | null;
|
|
@@ -655,6 +661,7 @@ declare class DeploymentRelationModel<A extends Any = Any> implements AnyRelatio
|
|
|
655
661
|
views(): IteratorLike<LikeC4ViewModel.DeploymentView<A>>;
|
|
656
662
|
isDeploymentRelation(): this is DeploymentRelationModel<A>;
|
|
657
663
|
isModelRelation(): this is RelationshipModel<A>;
|
|
664
|
+
hasMetadata(): boolean;
|
|
658
665
|
getMetadata(): Metadata<A>;
|
|
659
666
|
getMetadata(field: MetadataKey<A>): string | undefined;
|
|
660
667
|
/**
|
|
@@ -917,4 +924,4 @@ declare namespace LikeC4Model {
|
|
|
917
924
|
type AnyRelation<M = Unknown> = M extends Any ? RelationshipModel<M> | DeploymentRelationModel<M> : never;
|
|
918
925
|
}
|
|
919
926
|
|
|
920
|
-
export { type AnyRelationshipModel as A,
|
|
927
|
+
export { type AnyRelationshipModel as A, DeploymentNodeModel as D, ElementModel as E, type IncomingFilter as I, LikeC4ViewModel as L, NestedElementOfDeployedInstanceModel as N, type OutgoingFilter as O, RelationshipModel as R, type WithMetadata as W, DeployedInstanceModel as a, DeploymentRelationModel as b, NodeModel as c, EdgeModel as d, type DeploymentElementModel as e, type AnyLikeC4Model as f, LikeC4Model as g, type DeploymentRelationEndpoint as h, RelationshipsAccum as i, LikeC4DeploymentModel as j, type DeploymentOrFqn as k, type EdgeOrId as l, type ElementOrFqn as m, type NodeOrId as n, type WithTags as o };
|