@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,858 +0,0 @@
|
|
|
1
|
-
import { Tagged, NonEmptyTuple, Simplify, MergeExclusive } from 'type-fest';
|
|
2
|
-
import { N as NonEmptyArray, F as Fqn, j as ElementKind, s as Tag, p as ElementShape, x as Color, I as IconUrl, l as BorderStyle, S as ShapeSize, E as ExclusiveUnion, q as ElementStyle, r as Link, P as Point, X as XYPoint, T as ThemeColorValues, M as SpacingSize, O as TextSize, Q as ThemeColor, n as ElementKindSpecification, u as TypedElement } from './core.30yYKXcZ.js';
|
|
3
|
-
|
|
4
|
-
type EqualOperator<V> = {
|
|
5
|
-
eq: V;
|
|
6
|
-
neq?: never;
|
|
7
|
-
} | {
|
|
8
|
-
eq?: never;
|
|
9
|
-
neq: V;
|
|
10
|
-
};
|
|
11
|
-
type AllNever = {
|
|
12
|
-
not?: never;
|
|
13
|
-
and?: never;
|
|
14
|
-
or?: never;
|
|
15
|
-
tag?: never;
|
|
16
|
-
kind?: never;
|
|
17
|
-
participant?: never;
|
|
18
|
-
};
|
|
19
|
-
type TagEqual<Tag> = Omit<AllNever, 'tag'> & {
|
|
20
|
-
tag: EqualOperator<Tag>;
|
|
21
|
-
};
|
|
22
|
-
declare const isTagEqual: <Tag>(operator: WhereOperator<Tag, any>) => operator is TagEqual<Tag>;
|
|
23
|
-
type KindEqual<Kind> = Omit<AllNever, 'kind'> & {
|
|
24
|
-
kind: EqualOperator<Kind>;
|
|
25
|
-
};
|
|
26
|
-
declare const isKindEqual: <Kind>(operator: WhereOperator<any, Kind>) => operator is KindEqual<Kind>;
|
|
27
|
-
type Participant = 'source' | 'target';
|
|
28
|
-
type ParticipantOperator<Tag, Kind> = Omit<AllNever, 'participant'> & {
|
|
29
|
-
participant: Participant;
|
|
30
|
-
operator: KindEqual<Kind> | TagEqual<Tag>;
|
|
31
|
-
};
|
|
32
|
-
declare const isParticipantOperator: <Tag, Kind>(operator: WhereOperator<Tag, any>) => operator is ParticipantOperator<Tag, Kind>;
|
|
33
|
-
type NotOperator<Tag, Kind> = Omit<AllNever, 'not'> & {
|
|
34
|
-
not: WhereOperator<Tag, Kind>;
|
|
35
|
-
};
|
|
36
|
-
declare const isNotOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is NotOperator<Tag, Kind>;
|
|
37
|
-
type AndOperator<Tag, Kind> = Omit<AllNever, 'and'> & {
|
|
38
|
-
and: NonEmptyArray<WhereOperator<Tag, Kind>>;
|
|
39
|
-
};
|
|
40
|
-
declare const isAndOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is AndOperator<Tag, Kind>;
|
|
41
|
-
type OrOperator<Tag, Kind> = Omit<AllNever, 'or'> & {
|
|
42
|
-
or: NonEmptyArray<WhereOperator<Tag, Kind>>;
|
|
43
|
-
};
|
|
44
|
-
declare const isOrOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is OrOperator<Tag, Kind>;
|
|
45
|
-
type WhereOperator<Tag, Kind> = TagEqual<Tag> | KindEqual<Kind> | ParticipantOperator<Tag, Kind> | NotOperator<Tag, Kind> | AndOperator<Tag, Kind> | OrOperator<Tag, Kind>;
|
|
46
|
-
type Filterable<FTag extends string | null = string | null, FKind extends string | null = string | null> = {
|
|
47
|
-
tags?: readonly FTag[] | null;
|
|
48
|
-
kind?: FKind;
|
|
49
|
-
source?: Filterable<FTag, FKind>;
|
|
50
|
-
target?: Filterable<FTag, FKind>;
|
|
51
|
-
};
|
|
52
|
-
type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
|
|
53
|
-
declare function whereOperatorAsPredicate<FTag extends string | null = string | null, FKind extends string | null = string | null>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable>;
|
|
54
|
-
|
|
55
|
-
interface BaseExpr {
|
|
56
|
-
where?: never;
|
|
57
|
-
element?: never;
|
|
58
|
-
custom?: never;
|
|
59
|
-
expanded?: never;
|
|
60
|
-
elementKind?: never;
|
|
61
|
-
elementTag?: never;
|
|
62
|
-
isEqual?: never;
|
|
63
|
-
isChildren?: never;
|
|
64
|
-
isDescendants?: never;
|
|
65
|
-
wildcard?: never;
|
|
66
|
-
source?: never;
|
|
67
|
-
target?: never;
|
|
68
|
-
inout?: never;
|
|
69
|
-
incoming?: never;
|
|
70
|
-
outgoing?: never;
|
|
71
|
-
customRelation?: never;
|
|
72
|
-
}
|
|
73
|
-
interface ElementRefExpr extends Omit<BaseExpr, 'element' | 'isChildren' | 'isDescendants'> {
|
|
74
|
-
element: Fqn;
|
|
75
|
-
isChildren?: boolean;
|
|
76
|
-
isDescendants?: boolean;
|
|
77
|
-
}
|
|
78
|
-
declare function isElementRef(expr: Expression): expr is ElementRefExpr;
|
|
79
|
-
interface ExpandedElementExpr extends Omit<BaseExpr, 'expanded'> {
|
|
80
|
-
expanded: Fqn;
|
|
81
|
-
}
|
|
82
|
-
declare function isExpandedElementExpr(expr: Expression): expr is ExpandedElementExpr;
|
|
83
|
-
interface CustomElementExpr extends Omit<BaseExpr, 'custom'> {
|
|
84
|
-
custom: {
|
|
85
|
-
expr: ElementExpression | ElementWhereExpr;
|
|
86
|
-
title?: string;
|
|
87
|
-
description?: string;
|
|
88
|
-
technology?: string;
|
|
89
|
-
notation?: string;
|
|
90
|
-
shape?: ElementShape;
|
|
91
|
-
color?: Color;
|
|
92
|
-
icon?: IconUrl;
|
|
93
|
-
border?: BorderStyle;
|
|
94
|
-
opacity?: number;
|
|
95
|
-
navigateTo?: ViewId;
|
|
96
|
-
multiple?: boolean;
|
|
97
|
-
size?: ShapeSize;
|
|
98
|
-
padding?: ShapeSize;
|
|
99
|
-
textSize?: ShapeSize;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
declare function isCustomElement(expr: Expression): expr is CustomElementExpr;
|
|
103
|
-
interface WildcardExpr extends Omit<BaseExpr, 'wildcard'> {
|
|
104
|
-
wildcard: true;
|
|
105
|
-
}
|
|
106
|
-
declare function isWildcard(expr: Expression): expr is WildcardExpr;
|
|
107
|
-
interface ElementKindExpr extends Omit<BaseExpr, 'elementKind' | 'isEqual'> {
|
|
108
|
-
elementKind: ElementKind;
|
|
109
|
-
isEqual: boolean;
|
|
110
|
-
}
|
|
111
|
-
declare function isElementKindExpr(expr: Expression): expr is ElementKindExpr;
|
|
112
|
-
interface ElementTagExpr extends Omit<BaseExpr, 'elementTag' | 'isEqual'> {
|
|
113
|
-
elementTag: Tag;
|
|
114
|
-
isEqual: boolean;
|
|
115
|
-
}
|
|
116
|
-
declare function isElementTagExpr(expr: Expression): expr is ElementTagExpr;
|
|
117
|
-
type NonWilcard = ElementRefExpr | ElementKindExpr | ElementTagExpr | ExpandedElementExpr;
|
|
118
|
-
type ElementExpression = NonWilcard | WildcardExpr;
|
|
119
|
-
declare function isElement(expr: Expression): expr is ElementExpression;
|
|
120
|
-
interface ElementWhereExpr extends Omit<BaseExpr, 'where'> {
|
|
121
|
-
where: {
|
|
122
|
-
expr: ElementExpression;
|
|
123
|
-
condition: WhereOperator<string, string>;
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
declare function isElementWhere(expr: Expression): expr is ElementWhereExpr;
|
|
127
|
-
type ElementPredicateExpression = ElementExpression | ElementWhereExpr | CustomElementExpr;
|
|
128
|
-
declare function isElementPredicateExpr(expr: Expression): expr is ElementPredicateExpression;
|
|
129
|
-
interface DirectRelationExpr extends Omit<BaseExpr, 'source' | 'target'> {
|
|
130
|
-
source: ElementExpression;
|
|
131
|
-
target: ElementExpression;
|
|
132
|
-
isBidirectional?: boolean;
|
|
133
|
-
}
|
|
134
|
-
declare function isRelation(expr: Expression): expr is DirectRelationExpr;
|
|
135
|
-
interface InOutExpr extends Omit<BaseExpr, 'inout'> {
|
|
136
|
-
inout: ElementExpression;
|
|
137
|
-
}
|
|
138
|
-
declare function isInOut(expr: Expression): expr is InOutExpr;
|
|
139
|
-
interface IncomingExpr extends Omit<BaseExpr, 'incoming'> {
|
|
140
|
-
incoming: ElementExpression;
|
|
141
|
-
}
|
|
142
|
-
declare function isIncoming(expr: Expression): expr is IncomingExpr;
|
|
143
|
-
interface OutgoingExpr extends Omit<BaseExpr, 'outgoing'> {
|
|
144
|
-
outgoing: ElementExpression;
|
|
145
|
-
}
|
|
146
|
-
declare function isOutgoing(expr: Expression): expr is OutgoingExpr;
|
|
147
|
-
type RelationExpression = DirectRelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
|
|
148
|
-
declare function isRelationExpression(expr: Expression): expr is RelationExpression;
|
|
149
|
-
interface RelationWhereExpr extends Omit<BaseExpr, 'where'> {
|
|
150
|
-
where: {
|
|
151
|
-
expr: RelationExpression;
|
|
152
|
-
condition: WhereOperator<string, string>;
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
declare function isRelationWhere(expr: Expression): expr is RelationWhereExpr;
|
|
156
|
-
interface CustomRelationExpr extends Omit<BaseExpr, 'customRelation'> {
|
|
157
|
-
customRelation: {
|
|
158
|
-
relation: RelationExpression | RelationWhereExpr;
|
|
159
|
-
title?: string;
|
|
160
|
-
description?: string;
|
|
161
|
-
technology?: string;
|
|
162
|
-
notation?: string;
|
|
163
|
-
navigateTo?: ViewId;
|
|
164
|
-
notes?: string;
|
|
165
|
-
color?: Color;
|
|
166
|
-
line?: RelationshipLineType;
|
|
167
|
-
head?: RelationshipArrowType;
|
|
168
|
-
tail?: RelationshipArrowType;
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
declare function isCustomRelationExpr(expr: Expression): expr is CustomRelationExpr;
|
|
172
|
-
type RelationPredicateExpression = RelationExpression | RelationWhereExpr | CustomRelationExpr;
|
|
173
|
-
declare function isRelationPredicateExpr(expr: Expression): expr is RelationPredicateExpression;
|
|
174
|
-
type Expression = ElementPredicateExpression | RelationPredicateExpression;
|
|
175
|
-
|
|
176
|
-
type expression_CustomElementExpr = CustomElementExpr;
|
|
177
|
-
type expression_CustomRelationExpr = CustomRelationExpr;
|
|
178
|
-
type expression_DirectRelationExpr = DirectRelationExpr;
|
|
179
|
-
type expression_ElementExpression = ElementExpression;
|
|
180
|
-
type expression_ElementKindExpr = ElementKindExpr;
|
|
181
|
-
type expression_ElementPredicateExpression = ElementPredicateExpression;
|
|
182
|
-
type expression_ElementRefExpr = ElementRefExpr;
|
|
183
|
-
type expression_ElementTagExpr = ElementTagExpr;
|
|
184
|
-
type expression_ElementWhereExpr = ElementWhereExpr;
|
|
185
|
-
type expression_ExpandedElementExpr = ExpandedElementExpr;
|
|
186
|
-
type expression_Expression = Expression;
|
|
187
|
-
type expression_InOutExpr = InOutExpr;
|
|
188
|
-
type expression_IncomingExpr = IncomingExpr;
|
|
189
|
-
type expression_NonWilcard = NonWilcard;
|
|
190
|
-
type expression_OutgoingExpr = OutgoingExpr;
|
|
191
|
-
type expression_RelationExpression = RelationExpression;
|
|
192
|
-
type expression_RelationPredicateExpression = RelationPredicateExpression;
|
|
193
|
-
type expression_RelationWhereExpr = RelationWhereExpr;
|
|
194
|
-
type expression_WildcardExpr = WildcardExpr;
|
|
195
|
-
declare const expression_isCustomElement: typeof isCustomElement;
|
|
196
|
-
declare const expression_isCustomRelationExpr: typeof isCustomRelationExpr;
|
|
197
|
-
declare const expression_isElement: typeof isElement;
|
|
198
|
-
declare const expression_isElementKindExpr: typeof isElementKindExpr;
|
|
199
|
-
declare const expression_isElementPredicateExpr: typeof isElementPredicateExpr;
|
|
200
|
-
declare const expression_isElementRef: typeof isElementRef;
|
|
201
|
-
declare const expression_isElementTagExpr: typeof isElementTagExpr;
|
|
202
|
-
declare const expression_isElementWhere: typeof isElementWhere;
|
|
203
|
-
declare const expression_isExpandedElementExpr: typeof isExpandedElementExpr;
|
|
204
|
-
declare const expression_isInOut: typeof isInOut;
|
|
205
|
-
declare const expression_isIncoming: typeof isIncoming;
|
|
206
|
-
declare const expression_isOutgoing: typeof isOutgoing;
|
|
207
|
-
declare const expression_isRelation: typeof isRelation;
|
|
208
|
-
declare const expression_isRelationExpression: typeof isRelationExpression;
|
|
209
|
-
declare const expression_isRelationPredicateExpr: typeof isRelationPredicateExpr;
|
|
210
|
-
declare const expression_isRelationWhere: typeof isRelationWhere;
|
|
211
|
-
declare const expression_isWildcard: typeof isWildcard;
|
|
212
|
-
declare namespace expression {
|
|
213
|
-
export { type expression_CustomElementExpr as CustomElementExpr, type expression_CustomRelationExpr as CustomRelationExpr, type expression_DirectRelationExpr as DirectRelationExpr, type expression_ElementExpression as ElementExpression, type expression_ElementKindExpr as ElementKindExpr, type expression_ElementPredicateExpression as ElementPredicateExpression, type expression_ElementRefExpr as ElementRefExpr, type expression_ElementTagExpr as ElementTagExpr, type expression_ElementWhereExpr as ElementWhereExpr, type expression_ExpandedElementExpr as ExpandedElementExpr, type expression_Expression as Expression, type expression_InOutExpr as InOutExpr, type expression_IncomingExpr as IncomingExpr, type expression_NonWilcard as NonWilcard, type expression_OutgoingExpr as OutgoingExpr, type expression_RelationExpression as RelationExpression, type expression_RelationPredicateExpression as RelationPredicateExpression, type expression_RelationWhereExpr as RelationWhereExpr, type expression_WildcardExpr as WildcardExpr, expression_isCustomElement as isCustomElement, expression_isCustomRelationExpr as isCustomRelationExpr, expression_isElement as isElement, expression_isElementKindExpr as isElementKindExpr, expression_isElementPredicateExpr as isElementPredicateExpr, expression_isElementRef as isElementRef, expression_isElementTagExpr as isElementTagExpr, expression_isElementWhere as isElementWhere, expression_isExpandedElementExpr as isExpandedElementExpr, expression_isInOut as isInOut, expression_isIncoming as isIncoming, expression_isOutgoing as isOutgoing, expression_isRelation as isRelation, expression_isRelationExpression as isRelationExpression, expression_isRelationPredicateExpr as isRelationPredicateExpr, expression_isRelationWhere as isRelationWhere, expression_isWildcard as isWildcard };
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
declare namespace FqnRef {
|
|
217
|
-
/**
|
|
218
|
-
* Represents a reference to an instance within a deployment.
|
|
219
|
-
*
|
|
220
|
-
* @template D - The type representing the deployment fqn. Defaults to `Fqn`.
|
|
221
|
-
* @template M - The type representing the model fqn. Defaults to `Fqn`.
|
|
222
|
-
*
|
|
223
|
-
* @property {D} deployment - TThe fully qualified name (FQN) of the deployed instance.
|
|
224
|
-
* @property {M} element - The element reference within the deployment.
|
|
225
|
-
*/
|
|
226
|
-
type InsideInstanceRef<D = Fqn, M = Fqn> = {
|
|
227
|
-
deployment: D;
|
|
228
|
-
element: M;
|
|
229
|
-
};
|
|
230
|
-
const isInsideInstanceRef: (ref: FqnRef) => ref is InsideInstanceRef;
|
|
231
|
-
/**
|
|
232
|
-
* Represents a reference to a deployment element.
|
|
233
|
-
*
|
|
234
|
-
* @template F - The type of the fully qualified name (FQN) of the deployment element. Defaults to `Fqn`.
|
|
235
|
-
* @property {F} deployment - The fully qualified name (FQN) of the deployment element.
|
|
236
|
-
*/
|
|
237
|
-
type DeploymentElementRef<F = Fqn> = {
|
|
238
|
-
deployment: F;
|
|
239
|
-
};
|
|
240
|
-
const isDeploymentElementRef: (ref: FqnRef) => ref is DeploymentElementRef;
|
|
241
|
-
type DeploymentRef<D = Fqn, M = Fqn> = DeploymentElementRef<D> | InsideInstanceRef<D, M>;
|
|
242
|
-
const isDeploymentRef: (ref: FqnRef) => ref is DeploymentRef;
|
|
243
|
-
/**
|
|
244
|
-
* Reference to logical model element
|
|
245
|
-
*/
|
|
246
|
-
type ModelRef<F = Fqn> = {
|
|
247
|
-
model: F;
|
|
248
|
-
};
|
|
249
|
-
const isModelRef: (ref: FqnRef) => ref is ModelRef;
|
|
250
|
-
const toDeploymentRef: (ref: FqnRef) => DeploymentRef;
|
|
251
|
-
}
|
|
252
|
-
type FqnRef<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
253
|
-
InsideInstanceRef: FqnRef.InsideInstanceRef<D, M>;
|
|
254
|
-
DeploymentRef: FqnRef.DeploymentRef<D>;
|
|
255
|
-
ModelRef: FqnRef.ModelRef<M>;
|
|
256
|
-
}>;
|
|
257
|
-
declare namespace FqnExpr {
|
|
258
|
-
type Wildcard = {
|
|
259
|
-
wildcard: true;
|
|
260
|
-
};
|
|
261
|
-
const isWildcard: (expr: ExpressionV2) => expr is Wildcard;
|
|
262
|
-
type ModelRef<M = Fqn> = {
|
|
263
|
-
ref: FqnRef.ModelRef<M>;
|
|
264
|
-
selector?: PredicateSelector;
|
|
265
|
-
};
|
|
266
|
-
const isModelRef: (ref: ExpressionV2) => ref is ModelRef;
|
|
267
|
-
type DeploymentRef<D = Fqn, M = Fqn> = {
|
|
268
|
-
ref: FqnRef.DeploymentRef<D> | FqnRef.InsideInstanceRef<D, M>;
|
|
269
|
-
selector?: PredicateSelector;
|
|
270
|
-
};
|
|
271
|
-
const isDeploymentRef: (ref: ExpressionV2) => ref is FqnExpr.DeploymentRef;
|
|
272
|
-
type NonWildcard<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
273
|
-
ModelRef: ModelRef<M>;
|
|
274
|
-
DeploymentRef: DeploymentRef<D, M>;
|
|
275
|
-
}>;
|
|
276
|
-
}
|
|
277
|
-
type FqnExpr<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
278
|
-
Wildcard: FqnExpr.Wildcard;
|
|
279
|
-
ModelRef: FqnExpr.ModelRef<M>;
|
|
280
|
-
DeploymentRef: FqnExpr.DeploymentRef<D, M>;
|
|
281
|
-
}>;
|
|
282
|
-
declare namespace RelationExpr {
|
|
283
|
-
type Direct<D = Fqn, M = Fqn> = {
|
|
284
|
-
source: FqnExpr<D, M>;
|
|
285
|
-
target: FqnExpr<D, M>;
|
|
286
|
-
isBidirectional?: boolean;
|
|
287
|
-
};
|
|
288
|
-
const isDirect: (expr: ExpressionV2) => expr is Direct;
|
|
289
|
-
type Incoming<D = Fqn, M = Fqn> = {
|
|
290
|
-
incoming: FqnExpr<D, M>;
|
|
291
|
-
};
|
|
292
|
-
const isIncoming: (expr: ExpressionV2) => expr is Incoming;
|
|
293
|
-
type Outgoing<D = Fqn, M = Fqn> = {
|
|
294
|
-
outgoing: FqnExpr<D, M>;
|
|
295
|
-
};
|
|
296
|
-
const isOutgoing: (expr: ExpressionV2) => expr is Outgoing;
|
|
297
|
-
type InOut<D = Fqn, M = Fqn> = {
|
|
298
|
-
inout: FqnExpr<D, M>;
|
|
299
|
-
};
|
|
300
|
-
const isInOut: (expr: ExpressionV2) => expr is InOut;
|
|
301
|
-
type Where<D = Fqn, M = Fqn> = {
|
|
302
|
-
where: {
|
|
303
|
-
expr: ExpressionV2<D, M>;
|
|
304
|
-
condition: WhereOperator<string, string>;
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
|
-
const isWhere: (expr: ExpressionV2) => expr is Where;
|
|
308
|
-
}
|
|
309
|
-
type RelationExpr<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
310
|
-
Direct: RelationExpr.Direct<D, M>;
|
|
311
|
-
Incoming: RelationExpr.Incoming<D, M>;
|
|
312
|
-
Outgoing: RelationExpr.Outgoing<D, M>;
|
|
313
|
-
InOut: RelationExpr.InOut<D, M>;
|
|
314
|
-
Where: RelationExpr.Where<D, M>;
|
|
315
|
-
}>;
|
|
316
|
-
/**
|
|
317
|
-
* Represents a version 2 expression which can be one of several types.
|
|
318
|
-
*
|
|
319
|
-
* @template D - The type for the deployment FQN, defaults to `Fqn`.
|
|
320
|
-
* @template M - The type for the model FQN, defaults to `Fqn`.
|
|
321
|
-
*/
|
|
322
|
-
type ExpressionV2<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
323
|
-
Wildcard: FqnExpr.Wildcard;
|
|
324
|
-
ModelRef: FqnExpr.ModelRef<M>;
|
|
325
|
-
DeploymentRef: FqnExpr.DeploymentRef<D, M>;
|
|
326
|
-
Direct: RelationExpr.Direct<D, M>;
|
|
327
|
-
Incoming: RelationExpr.Incoming<D, M>;
|
|
328
|
-
Outgoing: RelationExpr.Outgoing<D, M>;
|
|
329
|
-
InOut: RelationExpr.InOut<D, M>;
|
|
330
|
-
RelationPredicateOrWhere: RelationExpr.Where<D, M>;
|
|
331
|
-
}>;
|
|
332
|
-
declare namespace ExpressionV2 {
|
|
333
|
-
const isFqnExpr: (expr: ExpressionV2) => expr is FqnExpr;
|
|
334
|
-
const isRelation: (expr: ExpressionV2) => expr is RelationExpr;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
|
|
338
|
-
type GlobalPredicates = NonEmptyArray<ViewRulePredicate>;
|
|
339
|
-
type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>;
|
|
340
|
-
type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
|
|
341
|
-
type GlobalStyles = NonEmptyTuple<ViewRuleStyle>;
|
|
342
|
-
interface ModelGlobals {
|
|
343
|
-
readonly predicates: Record<GlobalPredicateId, GlobalPredicates>;
|
|
344
|
-
readonly dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
|
|
345
|
-
readonly styles: Record<GlobalStyleID, GlobalStyles>;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
type ElementNotation = {
|
|
349
|
-
kinds: string[];
|
|
350
|
-
shape: ElementShape;
|
|
351
|
-
color: Color;
|
|
352
|
-
title: string;
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
type ViewId<Id extends string = string> = Tagged<Id, 'ViewID'>;
|
|
356
|
-
type ViewRulePredicate = {
|
|
357
|
-
include: Expression[];
|
|
358
|
-
exclude?: never;
|
|
359
|
-
} | {
|
|
360
|
-
include?: never;
|
|
361
|
-
exclude: Expression[];
|
|
362
|
-
};
|
|
363
|
-
declare function isViewRulePredicate(rule: DeploymentViewRule): rule is DeploymentViewRulePredicate;
|
|
364
|
-
declare function isViewRulePredicate(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
|
|
365
|
-
declare function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate;
|
|
366
|
-
interface ViewRuleGlobalPredicateRef {
|
|
367
|
-
predicateId: GlobalPredicateId;
|
|
368
|
-
}
|
|
369
|
-
declare function isViewRuleGlobalPredicateRef(rule: ViewRule): rule is ViewRuleGlobalPredicateRef;
|
|
370
|
-
interface ViewRuleStyle {
|
|
371
|
-
targets: ElementExpression[];
|
|
372
|
-
notation?: string;
|
|
373
|
-
style: ElementStyle & {
|
|
374
|
-
color?: Color;
|
|
375
|
-
shape?: ElementShape;
|
|
376
|
-
icon?: IconUrl;
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
declare function isViewRuleStyle(rule: DeploymentViewRule): rule is DeploymentViewRuleStyle;
|
|
380
|
-
declare function isViewRuleStyle(rule: ViewRule): rule is ViewRuleStyle;
|
|
381
|
-
interface ViewRuleGlobalStyle {
|
|
382
|
-
styleId: GlobalStyleID;
|
|
383
|
-
}
|
|
384
|
-
declare function isViewRuleGlobalStyle(rule: ViewRule): rule is ViewRuleGlobalStyle;
|
|
385
|
-
type ViewRuleStyleOrGlobalRef = ViewRuleStyle | ViewRuleGlobalStyle;
|
|
386
|
-
type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
|
|
387
|
-
declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
|
|
388
|
-
interface ViewRuleAutoLayout {
|
|
389
|
-
direction: AutoLayoutDirection;
|
|
390
|
-
nodeSep?: number;
|
|
391
|
-
rankSep?: number;
|
|
392
|
-
}
|
|
393
|
-
declare function isViewRuleAutoLayout(rule: DeploymentViewRule | DynamicViewRule | ViewRule): rule is ViewRuleAutoLayout;
|
|
394
|
-
interface ViewRuleGroup {
|
|
395
|
-
groupRules: Array<ViewRulePredicate | ViewRuleGroup>;
|
|
396
|
-
title: string | null;
|
|
397
|
-
color?: Color;
|
|
398
|
-
border?: BorderStyle;
|
|
399
|
-
opacity?: number;
|
|
400
|
-
multiple?: boolean;
|
|
401
|
-
size?: ShapeSize;
|
|
402
|
-
padding?: SpacingSize;
|
|
403
|
-
textSize?: TextSize;
|
|
404
|
-
}
|
|
405
|
-
declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
|
|
406
|
-
type ViewRule = ViewRulePredicate | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
|
|
407
|
-
interface BasicView<ViewType extends 'element' | 'dynamic' | 'deployment', ViewIDs extends string, Tags extends string> {
|
|
408
|
-
readonly __?: ViewType;
|
|
409
|
-
readonly id: ViewId<ViewIDs>;
|
|
410
|
-
readonly title: string | null;
|
|
411
|
-
readonly description: string | null;
|
|
412
|
-
readonly tags: NonEmptyArray<Tag<Tags>> | null;
|
|
413
|
-
readonly links: NonEmptyArray<Link> | null;
|
|
414
|
-
/**
|
|
415
|
-
* URI to the source file of this view.
|
|
416
|
-
* Undefined if the view is auto-generated.
|
|
417
|
-
*/
|
|
418
|
-
readonly docUri?: string;
|
|
419
|
-
/**
|
|
420
|
-
* For all views we find common ancestor path.
|
|
421
|
-
* This is used to generate relative paths, i.e.:
|
|
422
|
-
* - "/home/project/index.c4" becomes "index.c4"
|
|
423
|
-
* - "/home/project/subdir/views.c4" becomes "subdir/views.c4"
|
|
424
|
-
*
|
|
425
|
-
* Undefined if the view is auto-generated.
|
|
426
|
-
*/
|
|
427
|
-
readonly relativePath?: string;
|
|
428
|
-
/**
|
|
429
|
-
* If the view is changed manually this field contains the layout data.
|
|
430
|
-
*/
|
|
431
|
-
readonly manualLayout?: ViewManualLayout | undefined;
|
|
432
|
-
readonly customColorDefinitions: CustomColorDefinitions;
|
|
433
|
-
}
|
|
434
|
-
interface BasicElementView<ViewIDs extends string, Tags extends string> extends BasicView<'element', ViewIDs, Tags> {
|
|
435
|
-
readonly viewOf?: Fqn;
|
|
436
|
-
readonly rules: ViewRule[];
|
|
437
|
-
}
|
|
438
|
-
interface ScopedElementView<ViewIDs extends string, Tags extends string> extends BasicElementView<ViewIDs, Tags> {
|
|
439
|
-
readonly viewOf: Fqn;
|
|
440
|
-
}
|
|
441
|
-
interface ExtendsElementView<ViewIDs extends string, Tags extends string> extends BasicElementView<ViewIDs, Tags> {
|
|
442
|
-
readonly extends: ViewId<ViewIDs>;
|
|
443
|
-
}
|
|
444
|
-
type ElementView<ViewIDs extends string = string, Tags extends string = string> = ScopedElementView<ViewIDs, Tags> | ExtendsElementView<ViewIDs, Tags> | BasicElementView<ViewIDs, Tags>;
|
|
445
|
-
interface DynamicViewStep {
|
|
446
|
-
readonly source: Fqn;
|
|
447
|
-
readonly target: Fqn;
|
|
448
|
-
readonly title: string | null;
|
|
449
|
-
readonly description?: string;
|
|
450
|
-
readonly technology?: string;
|
|
451
|
-
readonly notation?: string;
|
|
452
|
-
readonly notes?: string;
|
|
453
|
-
readonly color?: Color;
|
|
454
|
-
readonly line?: RelationshipLineType;
|
|
455
|
-
readonly head?: RelationshipArrowType;
|
|
456
|
-
readonly tail?: RelationshipArrowType;
|
|
457
|
-
readonly isBackward?: boolean;
|
|
458
|
-
readonly navigateTo?: ViewId;
|
|
459
|
-
__parallel?: never;
|
|
460
|
-
}
|
|
461
|
-
interface DynamicViewParallelSteps {
|
|
462
|
-
readonly __parallel: DynamicViewStep[];
|
|
463
|
-
}
|
|
464
|
-
type DynamicViewStepOrParallel = DynamicViewStep | DynamicViewParallelSteps;
|
|
465
|
-
type DynamicViewIncludeRule = {
|
|
466
|
-
include: ElementPredicateExpression[];
|
|
467
|
-
};
|
|
468
|
-
type DynamicViewRule = DynamicViewIncludeRule | ViewRuleGlobalPredicateRef | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
|
|
469
|
-
interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'dynamic', ViewIDs, Tags> {
|
|
470
|
-
readonly __: 'dynamic';
|
|
471
|
-
readonly steps: DynamicViewStepOrParallel[];
|
|
472
|
-
readonly rules: DynamicViewRule[];
|
|
473
|
-
}
|
|
474
|
-
declare function isDynamicViewParallelSteps(step: DynamicViewStepOrParallel): step is DynamicViewParallelSteps;
|
|
475
|
-
type CustomColorDefinitions = {
|
|
476
|
-
[key: string]: ThemeColorValues;
|
|
477
|
-
};
|
|
478
|
-
type DeploymentViewRulePredicate = {
|
|
479
|
-
include: ExpressionV2[];
|
|
480
|
-
exclude?: never;
|
|
481
|
-
} | {
|
|
482
|
-
include?: never;
|
|
483
|
-
exclude: ExpressionV2[];
|
|
484
|
-
};
|
|
485
|
-
type DeploymentViewRuleStyle = {
|
|
486
|
-
targets: FqnExpr[];
|
|
487
|
-
notation?: string;
|
|
488
|
-
style: ElementStyle & {
|
|
489
|
-
color?: Color;
|
|
490
|
-
shape?: ElementShape;
|
|
491
|
-
icon?: IconUrl;
|
|
492
|
-
};
|
|
493
|
-
};
|
|
494
|
-
type DeploymentViewRule = DeploymentViewRulePredicate | ViewRuleAutoLayout | DeploymentViewRuleStyle;
|
|
495
|
-
interface DeploymentView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'deployment', ViewIDs, Tags> {
|
|
496
|
-
readonly __: 'deployment';
|
|
497
|
-
readonly rules: DeploymentViewRule[];
|
|
498
|
-
}
|
|
499
|
-
type LikeC4View<ViewIDs extends string = string, Tags extends string = string> = ElementView<ViewIDs, Tags> | DynamicView<ViewIDs, Tags> | DeploymentView<ViewIDs, Tags>;
|
|
500
|
-
declare function isDeploymentView(view: LikeC4View): view is DeploymentView;
|
|
501
|
-
declare function isDeploymentView<V extends {
|
|
502
|
-
__?: string;
|
|
503
|
-
}>(view: V): boolean;
|
|
504
|
-
declare function isDynamicView(view: LikeC4View): view is DynamicView;
|
|
505
|
-
declare function isElementView(view: LikeC4View): view is ElementView;
|
|
506
|
-
declare function isExtendsElementView(view: LikeC4View): view is ExtendsElementView<string, string>;
|
|
507
|
-
declare function isScopedElementView(view: LikeC4View): view is ScopedElementView<string, string>;
|
|
508
|
-
type NodeId<IDs extends string = string> = Tagged<IDs, 'Fqn'>;
|
|
509
|
-
type EdgeId = Tagged<string, 'EdgeId'>;
|
|
510
|
-
type StepEdgeIdLiteral = `step-${number}` | `step-${number}.${number}`;
|
|
511
|
-
type StepEdgeId = Tagged<StepEdgeIdLiteral, 'EdgeId'>;
|
|
512
|
-
declare function stepEdgeId(step: number, parallelStep?: number): StepEdgeId;
|
|
513
|
-
declare function isStepEdgeId(id: string): id is StepEdgeId;
|
|
514
|
-
declare function extractStep(id: EdgeId): number;
|
|
515
|
-
declare function getParallelStepsPrefix(id: string): string | null;
|
|
516
|
-
interface ComputedNode {
|
|
517
|
-
id: NodeId;
|
|
518
|
-
kind: string;
|
|
519
|
-
parent: NodeId | null;
|
|
520
|
-
/**
|
|
521
|
-
* Reference to model element
|
|
522
|
-
* If 1 - node id is a reference
|
|
523
|
-
*/
|
|
524
|
-
modelRef?: 1 | Fqn;
|
|
525
|
-
/**
|
|
526
|
-
* Reference to deployment element
|
|
527
|
-
* If 1 - node id is a reference
|
|
528
|
-
*/
|
|
529
|
-
deploymentRef?: 1 | Fqn;
|
|
530
|
-
title: string;
|
|
531
|
-
description: string | null;
|
|
532
|
-
technology: string | null;
|
|
533
|
-
notation?: string;
|
|
534
|
-
tags: NonEmptyArray<Tag> | null;
|
|
535
|
-
links: NonEmptyArray<Link> | null;
|
|
536
|
-
children: NodeId[];
|
|
537
|
-
inEdges: EdgeId[];
|
|
538
|
-
outEdges: EdgeId[];
|
|
539
|
-
shape: ElementShape;
|
|
540
|
-
color: Color;
|
|
541
|
-
/**
|
|
542
|
-
* @deprecated Use `style` instead
|
|
543
|
-
*/
|
|
544
|
-
icon?: IconUrl;
|
|
545
|
-
style: ElementStyle;
|
|
546
|
-
navigateTo?: ViewId | null;
|
|
547
|
-
level: number;
|
|
548
|
-
depth?: number;
|
|
549
|
-
/**
|
|
550
|
-
* If this node was customized in the view
|
|
551
|
-
*/
|
|
552
|
-
isCustomized?: boolean;
|
|
553
|
-
}
|
|
554
|
-
declare namespace ComputedNode {
|
|
555
|
-
function modelRef(node: ComputedNode): Fqn | null;
|
|
556
|
-
function deploymentRef(node: ComputedNode): Fqn | null;
|
|
557
|
-
/**
|
|
558
|
-
* Nodes group is a special kind of node, exisiting only in view
|
|
559
|
-
*/
|
|
560
|
-
function isNodesGroup(node: ComputedNode): boolean;
|
|
561
|
-
}
|
|
562
|
-
interface ComputedEdge {
|
|
563
|
-
id: EdgeId;
|
|
564
|
-
parent: NodeId | null;
|
|
565
|
-
source: NodeId;
|
|
566
|
-
target: NodeId;
|
|
567
|
-
label: string | null;
|
|
568
|
-
description?: string;
|
|
569
|
-
technology?: string;
|
|
570
|
-
relations: RelationId[];
|
|
571
|
-
kind?: RelationshipKind;
|
|
572
|
-
notation?: string;
|
|
573
|
-
notes?: string;
|
|
574
|
-
color?: Color;
|
|
575
|
-
line?: RelationshipLineType;
|
|
576
|
-
head?: RelationshipArrowType;
|
|
577
|
-
tail?: RelationshipArrowType;
|
|
578
|
-
tags?: NonEmptyArray<Tag>;
|
|
579
|
-
navigateTo?: ViewId;
|
|
580
|
-
/**
|
|
581
|
-
* If this edge is derived from custom relationship predicate
|
|
582
|
-
*/
|
|
583
|
-
isCustomized?: boolean;
|
|
584
|
-
/**
|
|
585
|
-
* For layouting purposes
|
|
586
|
-
* @default 'forward'
|
|
587
|
-
*/
|
|
588
|
-
dir?: 'forward' | 'back' | 'both';
|
|
589
|
-
}
|
|
590
|
-
interface ViewWithHash {
|
|
591
|
-
/**
|
|
592
|
-
* Hash of the view object.
|
|
593
|
-
* This is used to detect changes in layout
|
|
594
|
-
*/
|
|
595
|
-
hash: string;
|
|
596
|
-
}
|
|
597
|
-
interface ViewWithNotation {
|
|
598
|
-
notation?: {
|
|
599
|
-
elements: ElementNotation[];
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
interface ViewAutoLayout {
|
|
603
|
-
direction: ViewRuleAutoLayout['direction'];
|
|
604
|
-
rankSep?: number;
|
|
605
|
-
nodeSep?: number;
|
|
606
|
-
}
|
|
607
|
-
interface ComputedElementView<ViewIDs extends string = string, Tags extends string = string> extends Omit<ElementView<ViewIDs, Tags>, 'rules' | 'docUri'>, ViewWithHash, ViewWithNotation {
|
|
608
|
-
readonly extends?: ViewId<ViewIDs>;
|
|
609
|
-
readonly autoLayout: ViewAutoLayout;
|
|
610
|
-
readonly nodes: ComputedNode[];
|
|
611
|
-
readonly edges: ComputedEdge[];
|
|
612
|
-
rules?: never;
|
|
613
|
-
docUri?: never;
|
|
614
|
-
}
|
|
615
|
-
interface ComputedDynamicView<ViewIDs extends string = string, Tags extends string = string> extends Omit<DynamicView<ViewIDs, Tags>, 'rules' | 'steps' | 'docUri'>, ViewWithHash, ViewWithNotation {
|
|
616
|
-
readonly autoLayout: ViewAutoLayout;
|
|
617
|
-
readonly nodes: ComputedNode[];
|
|
618
|
-
readonly edges: ComputedEdge[];
|
|
619
|
-
steps?: never;
|
|
620
|
-
rules?: never;
|
|
621
|
-
docUri?: never;
|
|
622
|
-
}
|
|
623
|
-
interface ComputedDeploymentView<ViewIDs extends string = string, Tags extends string = string> extends Omit<DeploymentView<ViewIDs, Tags>, 'rules' | 'docUri'>, ViewWithHash, ViewWithNotation {
|
|
624
|
-
readonly autoLayout: ViewAutoLayout;
|
|
625
|
-
readonly nodes: ComputedNode[];
|
|
626
|
-
readonly edges: ComputedEdge[];
|
|
627
|
-
rules?: never;
|
|
628
|
-
docUri?: never;
|
|
629
|
-
}
|
|
630
|
-
type ComputedView<ViewIDs extends string = string, Tags extends string = string> = ComputedElementView<ViewIDs, Tags> | ComputedDynamicView<ViewIDs, Tags> | ComputedDeploymentView<ViewIDs, Tags>;
|
|
631
|
-
declare namespace ComputedView {
|
|
632
|
-
function isDeployment(view: ComputedView): view is ComputedDeploymentView;
|
|
633
|
-
function isDynamic(view: ComputedView): view is ComputedDynamicView;
|
|
634
|
-
function isElement(view: ComputedView): view is ComputedElementView;
|
|
635
|
-
}
|
|
636
|
-
type BBox = {
|
|
637
|
-
x: number;
|
|
638
|
-
y: number;
|
|
639
|
-
width: number;
|
|
640
|
-
height: number;
|
|
641
|
-
};
|
|
642
|
-
declare function getBBoxCenter({ x, y, width, height, }: BBox): XYPoint;
|
|
643
|
-
interface DiagramNode extends ComputedNode {
|
|
644
|
-
width: number;
|
|
645
|
-
height: number;
|
|
646
|
-
position: Point;
|
|
647
|
-
labelBBox: BBox;
|
|
648
|
-
}
|
|
649
|
-
declare namespace DiagramNode {
|
|
650
|
-
function modelRef(node: DiagramNode): Fqn | null;
|
|
651
|
-
function deploymentRef(node: DiagramNode): Fqn | null;
|
|
652
|
-
/**
|
|
653
|
-
* Nodes group is a special kind of node, exisiting only in view
|
|
654
|
-
*/
|
|
655
|
-
function isNodesGroup(node: DiagramNode): boolean;
|
|
656
|
-
}
|
|
657
|
-
interface DiagramEdge extends ComputedEdge {
|
|
658
|
-
points: NonEmptyArray<Point>;
|
|
659
|
-
controlPoints?: NonEmptyArray<XYPoint>;
|
|
660
|
-
labelBBox?: BBox | null;
|
|
661
|
-
dotpos?: string;
|
|
662
|
-
}
|
|
663
|
-
interface DiagramView<ViewIDs extends string = string, Tags extends string = string> extends Omit<ComputedView<ViewIDs, Tags>, 'nodes' | 'edges' | 'manualLayout'> {
|
|
664
|
-
readonly nodes: DiagramNode[];
|
|
665
|
-
readonly edges: DiagramEdge[];
|
|
666
|
-
readonly bounds: BBox;
|
|
667
|
-
/**
|
|
668
|
-
* If diagram has manual layout
|
|
669
|
-
* But was changed and layout should be recalculated
|
|
670
|
-
*/
|
|
671
|
-
hasLayoutDrift?: boolean;
|
|
672
|
-
manualLayout?: never;
|
|
673
|
-
}
|
|
674
|
-
type ViewManualLayout = {
|
|
675
|
-
readonly hash: string;
|
|
676
|
-
readonly x: number;
|
|
677
|
-
readonly y: number;
|
|
678
|
-
readonly width: number;
|
|
679
|
-
readonly height: number;
|
|
680
|
-
readonly autoLayout: ViewAutoLayout;
|
|
681
|
-
readonly nodes: Record<string, {
|
|
682
|
-
isCompound: boolean;
|
|
683
|
-
x: number;
|
|
684
|
-
y: number;
|
|
685
|
-
width: number;
|
|
686
|
-
height: number;
|
|
687
|
-
}>;
|
|
688
|
-
readonly edges: Record<string, {
|
|
689
|
-
dotpos?: string;
|
|
690
|
-
points: NonEmptyArray<Point>;
|
|
691
|
-
controlPoints?: NonEmptyArray<XYPoint>;
|
|
692
|
-
labelBBox?: BBox;
|
|
693
|
-
}>;
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
type RelationId = Tagged<string, 'RelationID'>;
|
|
697
|
-
type RelationshipKind<Kinds extends string = string> = Tagged<Kinds, 'RelationshipKind'>;
|
|
698
|
-
type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
|
|
699
|
-
type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'dot' | 'odot' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
|
|
700
|
-
declare const DefaultLineStyle: RelationshipLineType;
|
|
701
|
-
declare const DefaultArrowType: RelationshipArrowType;
|
|
702
|
-
declare const DefaultRelationshipColor: ThemeColor;
|
|
703
|
-
interface AbstractRelation {
|
|
704
|
-
readonly id: RelationId;
|
|
705
|
-
readonly title?: string;
|
|
706
|
-
readonly description?: string;
|
|
707
|
-
readonly technology?: string;
|
|
708
|
-
readonly tags?: NonEmptyArray<Tag> | null;
|
|
709
|
-
readonly kind?: RelationshipKind;
|
|
710
|
-
readonly color?: Color;
|
|
711
|
-
readonly line?: RelationshipLineType;
|
|
712
|
-
readonly head?: RelationshipArrowType;
|
|
713
|
-
readonly tail?: RelationshipArrowType;
|
|
714
|
-
readonly links?: NonEmptyArray<Link> | null;
|
|
715
|
-
readonly navigateTo?: ViewId;
|
|
716
|
-
readonly metadata?: {
|
|
717
|
-
[key: string]: string;
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
interface ModelRelation extends AbstractRelation {
|
|
721
|
-
readonly source: Fqn;
|
|
722
|
-
readonly target: Fqn;
|
|
723
|
-
readonly title: string;
|
|
724
|
-
}
|
|
725
|
-
interface RelationshipKindSpecification {
|
|
726
|
-
readonly technology?: string;
|
|
727
|
-
readonly notation?: string;
|
|
728
|
-
readonly color?: Color;
|
|
729
|
-
readonly line?: RelationshipLineType;
|
|
730
|
-
readonly head?: RelationshipArrowType;
|
|
731
|
-
readonly tail?: RelationshipArrowType;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
type DeploymentNodeKind<Kinds extends string = string> = Tagged<Kinds, 'DeploymentNodeKind'>;
|
|
735
|
-
type DeploymentElementStyle = ElementStyle & {
|
|
736
|
-
readonly icon?: IconUrl;
|
|
737
|
-
readonly shape?: ElementShape;
|
|
738
|
-
readonly color?: Color;
|
|
739
|
-
};
|
|
740
|
-
interface DeploymentNodeKindSpecification {
|
|
741
|
-
readonly technology?: string;
|
|
742
|
-
readonly notation?: string;
|
|
743
|
-
readonly style: DeploymentElementStyle;
|
|
744
|
-
}
|
|
745
|
-
interface DeploymentNode {
|
|
746
|
-
readonly id: Fqn;
|
|
747
|
-
readonly kind: DeploymentNodeKind;
|
|
748
|
-
readonly title: string;
|
|
749
|
-
readonly description?: string | null;
|
|
750
|
-
readonly technology?: string | null;
|
|
751
|
-
readonly tags?: NonEmptyArray<Tag> | null;
|
|
752
|
-
readonly links?: NonEmptyArray<Link> | null;
|
|
753
|
-
readonly style?: DeploymentElementStyle;
|
|
754
|
-
readonly notation?: string;
|
|
755
|
-
readonly metadata?: Record<string, string>;
|
|
756
|
-
}
|
|
757
|
-
interface DeployedInstance {
|
|
758
|
-
/**
|
|
759
|
-
* Format: `<DeploymentNode Fqn>.<Instance Id>`
|
|
760
|
-
* i.e parent fqn is deployment target
|
|
761
|
-
*/
|
|
762
|
-
readonly id: Fqn;
|
|
763
|
-
readonly element: Fqn;
|
|
764
|
-
readonly title?: string;
|
|
765
|
-
readonly description?: string | null;
|
|
766
|
-
readonly technology?: string | null;
|
|
767
|
-
readonly tags?: NonEmptyArray<Tag> | null;
|
|
768
|
-
readonly links?: NonEmptyArray<Link> | null;
|
|
769
|
-
readonly style?: DeploymentElementStyle;
|
|
770
|
-
readonly notation?: string;
|
|
771
|
-
readonly metadata?: Record<string, string>;
|
|
772
|
-
}
|
|
773
|
-
type DeploymentElement = Simplify<MergeExclusive<DeploymentNode, DeployedInstance>>;
|
|
774
|
-
declare namespace DeploymentElement {
|
|
775
|
-
const isDeploymentNode: (el: DeploymentElement) => el is DeploymentNode;
|
|
776
|
-
const isInstance: (el: DeploymentElement) => el is DeployedInstance;
|
|
777
|
-
}
|
|
778
|
-
type PredicateSelector = 'children' | 'expanded' | 'descendants';
|
|
779
|
-
interface DeploymentRef {
|
|
780
|
-
readonly id: Fqn;
|
|
781
|
-
readonly element?: Fqn;
|
|
782
|
-
}
|
|
783
|
-
/**
|
|
784
|
-
* NOTE:
|
|
785
|
-
*/
|
|
786
|
-
interface DeploymentRelation extends AbstractRelation {
|
|
787
|
-
readonly id: RelationId;
|
|
788
|
-
readonly source: DeploymentRef;
|
|
789
|
-
readonly target: DeploymentRef;
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
/**
|
|
793
|
-
* Represents a LikeC4 model with customizable type parameters,
|
|
794
|
-
* parsed from DSL or result from Builder
|
|
795
|
-
*
|
|
796
|
-
* !IMPORTANT: This is a low-level type, use `LikeC4Model` instead.
|
|
797
|
-
* !NOTE: Views are not computed yet.
|
|
798
|
-
*
|
|
799
|
-
* @typeParam ElementKinds - Types of elements in the model (defaults to string)
|
|
800
|
-
* @typeParam RelationKinds - Types of relationships (defaults to string)
|
|
801
|
-
* @typeParam Tags - Types of tags that can be applied (defaults to string)
|
|
802
|
-
* @typeParam Fqns - Fully Qualified Names for elements (defaults to string)
|
|
803
|
-
* @typeParam Views - Types of views in the model (defaults to string)
|
|
804
|
-
* @typeParam DeploymentFqns - Fully Qualified Names for deployment nodes (defaults to string)
|
|
805
|
-
*/
|
|
806
|
-
interface ParsedLikeC4ModelData<ElementKinds extends string = string, RelationKinds extends string = string, Tags extends string = string, Fqns extends string = string, Views extends string = string, DeploymentFqns extends string = string> {
|
|
807
|
-
__?: never;
|
|
808
|
-
specification: {
|
|
809
|
-
tags: Tag<Tags>[];
|
|
810
|
-
elements: Record<ElementKinds, ElementKindSpecification>;
|
|
811
|
-
deployments: Record<DeploymentNodeKind, DeploymentNodeKindSpecification>;
|
|
812
|
-
relationships: Record<RelationKinds, RelationshipKindSpecification>;
|
|
813
|
-
};
|
|
814
|
-
elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
|
|
815
|
-
relations: Record<RelationId, ModelRelation>;
|
|
816
|
-
globals: ModelGlobals;
|
|
817
|
-
views: Record<Views, LikeC4View<Views, Tags>>;
|
|
818
|
-
/**
|
|
819
|
-
* Deployment Model.
|
|
820
|
-
*/
|
|
821
|
-
deployments: {
|
|
822
|
-
elements: Record<DeploymentFqns, DeploymentElement>;
|
|
823
|
-
relations: Record<RelationId, DeploymentRelation>;
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
type AnyParsedLikeC4ModelData = ParsedLikeC4ModelData<any, any, any, any, any, any>;
|
|
827
|
-
/**
|
|
828
|
-
* Hook to get types from dump
|
|
829
|
-
*/
|
|
830
|
-
type LikeC4ModelDump = {
|
|
831
|
-
elements: {
|
|
832
|
-
[kind: string]: object;
|
|
833
|
-
};
|
|
834
|
-
deployments: {
|
|
835
|
-
elements: {
|
|
836
|
-
[kind: string]: object;
|
|
837
|
-
};
|
|
838
|
-
};
|
|
839
|
-
views: {
|
|
840
|
-
[kind: string]: object;
|
|
841
|
-
};
|
|
842
|
-
};
|
|
843
|
-
/**
|
|
844
|
-
* Same as {@link ParsedLikeC4ModelData}, but with computed views or layouted views.
|
|
845
|
-
*/
|
|
846
|
-
interface GenericLikeC4ModelData<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string, T = 'computed' | 'layouted'> extends Omit<ParsedLikeC4ModelData<string, string, Tags, Fqns, Views, DeploymentFqns>, 'views' | '__'> {
|
|
847
|
-
__?: T;
|
|
848
|
-
views: Record<Views, ComputedView<Views> | DiagramView<Views>>;
|
|
849
|
-
}
|
|
850
|
-
interface ComputedLikeC4ModelData<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string> extends Omit<GenericLikeC4ModelData<Fqns, DeploymentFqns, Views, Tags, 'computed'>, 'views'> {
|
|
851
|
-
views: Record<Views, ComputedView<Views>>;
|
|
852
|
-
}
|
|
853
|
-
interface LayoutedLikeC4ModelData<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string> extends Omit<GenericLikeC4ModelData<Fqns, DeploymentFqns, Views, Tags, 'layouted'>, 'views'> {
|
|
854
|
-
__: 'layouted';
|
|
855
|
-
views: Record<Views, DiagramView<Views, Tags>>;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
export { type GlobalDynamicPredicates as $, type CustomElementExpr as A, type CustomRelationExpr as B, type ComputedLikeC4ModelData as C, DeploymentElement as D, type DirectRelationExpr as E, type ElementExpression as F, type ElementKindExpr as G, type ElementPredicateExpression as H, type ElementRefExpr as I, type ElementTagExpr as J, type ElementWhereExpr as K, type LikeC4View as L, type ExpandedElementExpr as M, type Expression as N, type IncomingExpr as O, type PredicateSelector as P, type InOutExpr as Q, type NonWilcard as R, type OutgoingExpr as S, type RelationExpression as T, type RelationPredicateExpression as U, type RelationWhereExpr as V, type WildcardExpr as W, ExpressionV2 as X, FqnExpr as Y, FqnRef as Z, RelationExpr as _, ComputedView as a, type ComputedDeploymentView as a$, type GlobalPredicateId as a0, type GlobalPredicates as a1, type GlobalStyleID as a2, type GlobalStyles as a3, type ModelGlobals as a4, type AnyParsedLikeC4ModelData as a5, type GenericLikeC4ModelData as a6, type LayoutedLikeC4ModelData as a7, type LikeC4ModelDump as a8, type ParsedLikeC4ModelData as a9, type RelationshipKind as aA, type RelationshipKindSpecification as aB, type RelationshipLineType as aC, ComputedNode as aD, DiagramNode as aE, extractStep as aF, getBBoxCenter as aG, getParallelStepsPrefix as aH, isAutoLayoutDirection as aI, isDeploymentView as aJ, isDynamicView as aK, isDynamicViewParallelSteps as aL, isElementView as aM, isExtendsElementView as aN, isScopedElementView as aO, isStepEdgeId as aP, isViewRuleAutoLayout as aQ, isViewRuleGlobalPredicateRef as aR, isViewRuleGlobalStyle as aS, isViewRuleGroup as aT, isViewRulePredicate as aU, isViewRuleStyle as aV, stepEdgeId as aW, type AutoLayoutDirection as aX, type BasicElementView as aY, type BasicView as aZ, type BBox as a_, isAndOperator as aa, isKindEqual as ab, isNotOperator as ac, isOrOperator as ad, isParticipantOperator as ae, isTagEqual as af, whereOperatorAsPredicate as ag, type AllNever as ah, type AndOperator as ai, type EqualOperator as aj, type Filterable as ak, type KindEqual as al, type NotOperator as am, type OperatorPredicate as an, type OrOperator as ao, type Participant as ap, type ParticipantOperator as aq, type TagEqual as ar, type WhereOperator as as, DefaultArrowType as at, DefaultLineStyle as au, DefaultRelationshipColor as av, type AbstractRelation as aw, type ModelRelation as ax, type RelationId as ay, type RelationshipArrowType as az, type DeployedInstance as b, type ComputedDynamicView as b0, type ComputedEdge as b1, type ComputedElementView as b2, type CustomColorDefinitions as b3, type DeploymentView as b4, type DeploymentViewRule as b5, type DeploymentViewRulePredicate as b6, type DeploymentViewRuleStyle as b7, type DiagramEdge as b8, type DiagramView as b9, type ElementNotation as bA, type DynamicView as ba, type DynamicViewIncludeRule as bb, type DynamicViewParallelSteps as bc, type DynamicViewRule as bd, type DynamicViewStep as be, type DynamicViewStepOrParallel as bf, type EdgeId as bg, type ElementView as bh, type ExtendsElementView as bi, type NodeId as bj, type ScopedElementView as bk, type StepEdgeId as bl, type StepEdgeIdLiteral as bm, type ViewAutoLayout as bn, type ViewId as bo, type ViewManualLayout as bp, type ViewRule as bq, type ViewRuleAutoLayout as br, type ViewRuleGlobalPredicateRef as bs, type ViewRuleGlobalStyle as bt, type ViewRuleGroup as bu, type ViewRulePredicate as bv, type ViewRuleStyle as bw, type ViewRuleStyleOrGlobalRef as bx, type ViewWithHash as by, type ViewWithNotation as bz, type DeploymentElementStyle as c, type DeploymentNode as d, expression as e, type DeploymentNodeKind as f, type DeploymentNodeKindSpecification as g, type DeploymentRef as h, type DeploymentRelation as i, isCustomElement as j, isCustomRelationExpr as k, isElement as l, isElementKindExpr as m, isElementPredicateExpr as n, isElementRef as o, isElementTagExpr as p, isElementWhere as q, isExpandedElementExpr as r, isIncoming as s, isInOut as t, isOutgoing as u, isRelation as v, isRelationExpression as w, isRelationPredicateExpr as x, isRelationWhere as y, isWildcard as z };
|