@likec4/core 1.18.0 → 1.19.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/LICENSE +1 -1
- package/dist/builder/index.d.mts +502 -0
- package/dist/builder/index.d.ts +502 -0
- package/dist/builder/index.js +871 -0
- package/dist/compute-view/index.d.mts +9 -78
- package/dist/compute-view/index.d.ts +9 -78
- package/dist/compute-view/index.js +78 -0
- package/dist/index.d.mts +9 -730
- package/dist/index.d.ts +9 -730
- package/dist/{index.mjs → index.js} +7 -784
- package/dist/model/index.d.mts +218 -606
- package/dist/model/index.d.ts +218 -606
- package/dist/model/index.js +1 -0
- package/dist/shared/chunk-RAAYCPUM.M-JWF7SS.js +21 -0
- package/dist/shared/core.BIfgabEw.d.ts +719 -0
- package/dist/shared/core.BZ9Msq7w.d.mts +719 -0
- package/dist/shared/{core.DMYY7C8s.d.mts → core.C05RDLhi.d.ts} +179 -230
- package/dist/shared/{core.DMYY7C8s.d.ts → core.CmYMqgha.d.mts} +179 -230
- package/dist/shared/core.D6-fWbM3.d.ts +127 -0
- package/dist/shared/core.D74xkKkG.d.mts +148 -0
- package/dist/shared/core.D74xkKkG.d.ts +148 -0
- package/dist/shared/core.sLaWHBjR.d.mts +127 -0
- package/dist/shared/index.-BdzdI2C.js +7443 -0
- package/dist/shared/object_hash.CE_oF3I3.js +1222 -0
- package/dist/shared/view.CyZrG8BJ.js +354 -0
- package/dist/types/index.d.mts +4 -2
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.js +20 -0
- package/dist/utils/index.d.mts +404 -0
- package/dist/utils/index.d.ts +404 -0
- package/dist/utils/index.js +330 -0
- package/package.json +47 -33
- package/src/builder/Builder-style1.test-d.ts +190 -0
- package/src/builder/Builder-style2.test-d.ts +175 -0
- package/src/builder/Builder.deployment.ts +25 -20
- package/src/builder/Builder.deploymentModel.ts +80 -55
- package/src/builder/Builder.element.ts +2 -0
- package/src/builder/Builder.model.ts +57 -43
- package/src/builder/Builder.ts +412 -431
- package/src/builder/Builder.view-common.ts +234 -0
- package/src/builder/Builder.view-deployment.ts +135 -0
- package/src/builder/Builder.view-element.ts +189 -0
- package/src/builder/Builder.views.ts +109 -33
- package/src/builder/Builder.with.ts +475 -0
- package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +374 -0
- package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +183 -0
- package/src/builder/__snapshots__/Builder.spec.ts.snap +374 -0
- package/src/builder/_types.ts +28 -5
- package/src/builder/index.ts +10 -4
- package/src/colors/index.ts +2 -2
- package/src/compute-view/compute-view.ts +45 -54
- package/src/compute-view/deployment-view/__test__/TestHelper.ts +236 -0
- package/src/compute-view/deployment-view/__test__/fixture.ts +50 -62
- package/src/compute-view/deployment-view/_types.ts +26 -18
- package/src/compute-view/deployment-view/clean-connections.ts +173 -164
- package/src/compute-view/deployment-view/compute.ts +51 -37
- package/src/compute-view/deployment-view/memory/index.ts +9 -0
- package/src/compute-view/deployment-view/memory/memory.ts +97 -0
- package/src/compute-view/deployment-view/predicates/elements.ts +144 -0
- package/src/compute-view/deployment-view/predicates/relation-direct.ts +183 -76
- package/src/compute-view/deployment-view/predicates/relation-in-out.ts +38 -20
- package/src/compute-view/deployment-view/predicates/relation-incoming.ts +72 -23
- package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +61 -22
- package/src/compute-view/deployment-view/predicates/wildcard.ts +15 -15
- package/src/compute-view/deployment-view/stages/stage-exclude.ts +5 -0
- package/src/compute-view/deployment-view/stages/stage-final.ts +245 -0
- package/src/compute-view/deployment-view/stages/stage-include.ts +95 -0
- package/src/compute-view/deployment-view/utils.ts +95 -31
- package/src/compute-view/dynamic-view/__test__/fixture.ts +4 -4
- package/src/compute-view/dynamic-view/compute.ts +59 -45
- package/src/compute-view/element-view/__test__/TestHelper.ts +258 -0
- package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +64 -62
- package/src/compute-view/element-view/__test__/fixture.ts +147 -117
- package/src/compute-view/element-view/_types.ts +48 -0
- package/src/compute-view/element-view/clean-connections.ts +113 -0
- package/src/compute-view/element-view/compute.ts +264 -683
- package/src/compute-view/element-view/memory/NodeGroup.ts +31 -0
- package/src/compute-view/element-view/memory/index.ts +10 -0
- package/src/compute-view/element-view/memory/memory.ts +177 -0
- package/src/compute-view/element-view/memory/stage-exclude.ts +59 -0
- package/src/compute-view/element-view/memory/stage-final.ts +129 -0
- package/src/compute-view/element-view/memory/stage-include.ts +128 -0
- package/src/compute-view/element-view/predicates/_utils.ts +86 -0
- package/src/compute-view/element-view/predicates/element-expand.ts +33 -0
- package/src/compute-view/element-view/predicates/element-kind-tag.ts +26 -0
- package/src/compute-view/element-view/predicates/element-ref.ts +37 -0
- package/src/compute-view/element-view/predicates/relation-direct.ts +309 -0
- package/src/compute-view/element-view/predicates/relation-in-out.ts +66 -0
- package/src/compute-view/element-view/predicates/relation-in.ts +118 -0
- package/src/compute-view/element-view/predicates/relation-out.ts +116 -0
- package/src/compute-view/element-view/predicates/wildcard.ts +88 -0
- package/src/compute-view/element-view/utils.ts +59 -0
- package/src/compute-view/index.ts +3 -4
- package/src/compute-view/memory/AbstractMemory.ts +45 -0
- package/src/compute-view/memory/AbstractStageExclude.ts +216 -0
- package/src/compute-view/memory/AbstractStageInclude.ts +200 -0
- package/src/compute-view/memory/_types.ts +147 -0
- package/src/compute-view/memory/index.ts +5 -0
- package/src/compute-view/memory/ops.ts +43 -0
- package/src/compute-view/utils/buildComputedNodes.ts +4 -4
- package/src/compute-view/utils/elementExpressionToPredicate.ts +1 -3
- package/src/compute-view/utils/link-nodes-with-edges.ts +3 -7
- package/src/compute-view/utils/{derive-edge-props-from-relationships.ts → merge-props-from-relationships.ts} +54 -23
- package/src/compute-view/utils/relationExpressionToPredicates.ts +2 -2
- package/src/compute-view/utils/resolve-extended-views.ts +44 -40
- package/src/compute-view/utils/resolve-global-rules.ts +6 -6
- package/src/compute-view/utils/topological-sort.ts +167 -71
- package/src/compute-view/utils/with-readable-edges.ts +14 -9
- package/src/index.ts +22 -16
- package/src/model/DeploymentElementModel.ts +150 -85
- package/src/model/DeploymentModel.ts +27 -21
- package/src/model/ElementModel.ts +51 -25
- package/src/model/LikeC4Model.test-d.ts +4 -3
- package/src/model/LikeC4Model.ts +98 -42
- package/src/model/RelationModel.ts +5 -4
- package/src/model/__test__/fixture.ts +5 -9
- package/src/model/connection/Connection.ts +72 -0
- package/src/model/connection/deployment/DeploymentConnectionModel.ts +178 -0
- package/src/model/connection/{deployment.ts → deployment/find.ts} +14 -18
- package/src/model/connection/deployment/index.ts +8 -0
- package/src/model/connection/index.ts +22 -0
- package/src/model/connection/model/ConnectionModel.ts +157 -0
- package/src/model/connection/{model.ts → model/find.ts} +43 -49
- package/src/model/connection/model/index.ts +8 -0
- package/src/model/connection/ops.ts +274 -0
- package/src/model/guards.ts +9 -0
- package/src/model/index.ts +45 -3
- package/src/model/types.ts +35 -18
- package/src/model/view/EdgeModel.ts +6 -6
- package/src/model/view/LikeC4ViewModel.ts +14 -8
- package/src/model/view/NodeModel.ts +6 -5
- package/src/types/_common.ts +53 -1
- package/src/types/deployments.ts +88 -156
- package/src/types/element.ts +2 -2
- package/src/types/expression-v2.ts +172 -0
- package/src/types/expression.ts +9 -5
- package/src/types/global.ts +3 -3
- package/src/types/index.ts +220 -13
- package/src/types/model.ts +28 -24
- package/src/types/operators.ts +1 -1
- package/src/types/relation.ts +14 -10
- package/src/types/theme.ts +0 -1
- package/src/types/view.ts +20 -18
- package/src/utils/const.ts +1 -0
- package/src/utils/fqn.ts +140 -49
- package/src/utils/getOrCreate.ts +1 -1
- package/src/utils/index.ts +74 -9
- package/src/utils/iterable/_types.ts +5 -0
- package/src/utils/iterable/filter.ts +55 -0
- package/src/utils/iterable/flat.ts +17 -0
- package/src/utils/iterable/index.ts +12 -0
- package/src/utils/iterable/map.ts +40 -0
- package/src/utils/iterable/reduce.ts +24 -0
- package/src/utils/iterable/some.ts +36 -0
- package/src/utils/iterable/to.ts +19 -0
- package/src/utils/iterable/unique.ts +29 -0
- package/src/utils/relations.ts +3 -64
- package/src/utils/set.ts +11 -9
- package/src/utils/string-hash.ts +1 -1
- package/dist/compute-view/index.mjs +0 -79
- package/dist/model/index.mjs +0 -2
- package/dist/shared/core.BBgiAAv1.mjs +0 -144
- package/dist/shared/core.BPyJvuMU.mjs +0 -2420
- package/dist/shared/core.BQ4AbfvB.mjs +0 -9228
- package/dist/shared/core.k12s_keD.mjs +0 -203
- package/dist/types/index.mjs +0 -21
- package/src/builder/Builder.test-d.ts +0 -124
- package/src/builder/Builder.view.ts +0 -543
- package/src/compute-view/LikeC4ModelGraph.ts +0 -330
- package/src/compute-view/deployment-view/Memory.ts +0 -108
- package/src/compute-view/deployment-view/Stage.ts +0 -145
- package/src/compute-view/deployment-view/predicates/deployment-ref.ts +0 -146
- package/src/compute-view/element-view/predicates.ts +0 -517
- package/src/compute-view/utils/sortNodes.ts +0 -101
- package/src/model/connection/ConnectionModel.ts +0 -94
- package/src/model/connection/DeploymentConnectionModel.ts +0 -99
|
@@ -1,110 +1,5 @@
|
|
|
1
|
-
import { Tagged,
|
|
2
|
-
|
|
3
|
-
type NonEmptyArray<T> = [T, ...T[]];
|
|
4
|
-
type NonEmptyReadonlyArray<T> = readonly [T, ...T[]];
|
|
5
|
-
type IconUrl = Tagged<string, 'IconUrl'> | 'none';
|
|
6
|
-
type CustomColor = string;
|
|
7
|
-
type Point = readonly [x: number, y: number];
|
|
8
|
-
interface XYPoint {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
}
|
|
12
|
-
type KeysOf<T> = keyof T extends infer K extends string ? K : never;
|
|
13
|
-
|
|
14
|
-
declare const ThemeColors: readonly ["amber", "blue", "gray", "slate", "green", "indigo", "muted", "primary", "red", "secondary", "sky"];
|
|
15
|
-
type ThemeColor = typeof ThemeColors[number];
|
|
16
|
-
type HexColorLiteral = `#${string}`;
|
|
17
|
-
type ColorLiteral = HexColorLiteral;
|
|
18
|
-
type Color = LiteralUnion<ThemeColor, string>;
|
|
19
|
-
declare function isThemeColor(color: Color): color is ThemeColor;
|
|
20
|
-
interface ElementThemeColorValues {
|
|
21
|
-
fill: ColorLiteral;
|
|
22
|
-
stroke: ColorLiteral;
|
|
23
|
-
hiContrast: ColorLiteral;
|
|
24
|
-
loContrast: ColorLiteral;
|
|
25
|
-
}
|
|
26
|
-
type ElementThemeColors = {
|
|
27
|
-
[key in ThemeColor]: ElementThemeColorValues;
|
|
28
|
-
};
|
|
29
|
-
interface RelationshipThemeColorValues {
|
|
30
|
-
lineColor: ColorLiteral;
|
|
31
|
-
labelBgColor: ColorLiteral;
|
|
32
|
-
labelColor: ColorLiteral;
|
|
33
|
-
}
|
|
34
|
-
interface ThemeColorValues {
|
|
35
|
-
elements: ElementThemeColorValues;
|
|
36
|
-
relationships: RelationshipThemeColorValues;
|
|
37
|
-
}
|
|
38
|
-
type RelationshipThemeColors = {
|
|
39
|
-
[key in ThemeColor]: RelationshipThemeColorValues;
|
|
40
|
-
};
|
|
41
|
-
interface LikeC4Theme {
|
|
42
|
-
font: 'Arial';
|
|
43
|
-
shadow: ColorLiteral;
|
|
44
|
-
relationships: RelationshipThemeColors;
|
|
45
|
-
elements: ElementThemeColors;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type Fqn<Id extends string = string> = Tagged<Id, 'Fqn'>;
|
|
49
|
-
declare function AsFqn(name: string, parent?: Fqn | null): Fqn;
|
|
50
|
-
declare const BorderStyles: readonly ["solid", "dashed", "dotted", "none"];
|
|
51
|
-
type BorderStyle = TupleToUnion<typeof BorderStyles>;
|
|
52
|
-
type ElementKind<Kinds extends string = string> = Tagged<Kinds, 'ElementKind'>;
|
|
53
|
-
declare namespace ElementKind {
|
|
54
|
-
const Group: ElementKind;
|
|
55
|
-
}
|
|
56
|
-
declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile", "cylinder", "storage", "queue"];
|
|
57
|
-
type ElementShape = TupleToUnion<typeof ElementShapes>;
|
|
58
|
-
declare const DefaultThemeColor = "primary";
|
|
59
|
-
declare const DefaultElementShape = "rectangle";
|
|
60
|
-
interface ElementStyle {
|
|
61
|
-
readonly border?: BorderStyle;
|
|
62
|
-
/**
|
|
63
|
-
* In percentage 0-100, 0 is fully transparent
|
|
64
|
-
*
|
|
65
|
-
* @default 100
|
|
66
|
-
*/
|
|
67
|
-
readonly opacity?: number;
|
|
68
|
-
}
|
|
69
|
-
type Tag<Tags extends string = string> = Tagged<Tags, 'Tag'>;
|
|
70
|
-
interface TagSpec {
|
|
71
|
-
readonly id: Tag;
|
|
72
|
-
readonly style: ElementStyle;
|
|
73
|
-
}
|
|
74
|
-
interface Link {
|
|
75
|
-
readonly title?: string;
|
|
76
|
-
readonly url: string;
|
|
77
|
-
readonly relative?: string;
|
|
78
|
-
}
|
|
79
|
-
interface TypedElement<Ids extends string, Kinds extends string, Tags extends string, MetadataKeys extends string = never> {
|
|
80
|
-
readonly id: Fqn<Ids>;
|
|
81
|
-
readonly kind: ElementKind<Kinds>;
|
|
82
|
-
readonly title: string;
|
|
83
|
-
readonly description: string | null;
|
|
84
|
-
readonly technology: string | null;
|
|
85
|
-
readonly tags: NonEmptyArray<Tag<Tags>> | null;
|
|
86
|
-
readonly links: NonEmptyArray<Link> | null;
|
|
87
|
-
readonly icon?: IconUrl;
|
|
88
|
-
readonly shape?: ElementShape;
|
|
89
|
-
readonly color?: Color;
|
|
90
|
-
readonly style?: ElementStyle;
|
|
91
|
-
readonly notation?: string;
|
|
92
|
-
readonly metadata?: Record<MetadataKeys, string>;
|
|
93
|
-
}
|
|
94
|
-
interface Element extends TypedElement<string, string, string, string> {
|
|
95
|
-
}
|
|
96
|
-
interface ElementKindSpecificationStyle {
|
|
97
|
-
shape?: ElementShape;
|
|
98
|
-
icon?: IconUrl;
|
|
99
|
-
color?: Color;
|
|
100
|
-
border?: BorderStyle;
|
|
101
|
-
opacity?: number;
|
|
102
|
-
}
|
|
103
|
-
interface ElementKindSpecification {
|
|
104
|
-
readonly technology?: string;
|
|
105
|
-
readonly notation?: string;
|
|
106
|
-
readonly style: ElementKindSpecificationStyle;
|
|
107
|
-
}
|
|
1
|
+
import { Tagged, NonEmptyTuple, Simplify, MergeExclusive } from 'type-fest';
|
|
2
|
+
import { N as NonEmptyArray, F as Fqn, l as ElementShape, s as Color, I as IconUrl, h as BorderStyle, f as ElementKind, o as Tag, E as ExclusiveUnion, m as ElementStyle, n as Link, T as ThemeColorValues, X as XYPoint, P as Point, x as ThemeColor, j as ElementKindSpecification, q as TypedElement } from './core.D74xkKkG.mjs';
|
|
108
3
|
|
|
109
4
|
type EqualOperator<V> = {
|
|
110
5
|
eq: V;
|
|
@@ -113,36 +8,36 @@ type EqualOperator<V> = {
|
|
|
113
8
|
eq?: never;
|
|
114
9
|
neq: V;
|
|
115
10
|
};
|
|
116
|
-
type AllNever
|
|
11
|
+
type AllNever = {
|
|
117
12
|
not?: never;
|
|
118
13
|
and?: never;
|
|
119
14
|
or?: never;
|
|
120
15
|
tag?: never;
|
|
121
16
|
kind?: never;
|
|
122
17
|
};
|
|
123
|
-
type TagEqual<Tag> = Omit<AllNever
|
|
18
|
+
type TagEqual<Tag> = Omit<AllNever, 'tag'> & {
|
|
124
19
|
tag: EqualOperator<Tag>;
|
|
125
20
|
};
|
|
126
21
|
declare const isTagEqual: <Tag>(operator: WhereOperator<Tag, any>) => operator is TagEqual<Tag>;
|
|
127
|
-
type KindEqual<Kind> = Omit<AllNever
|
|
22
|
+
type KindEqual<Kind> = Omit<AllNever, 'kind'> & {
|
|
128
23
|
kind: EqualOperator<Kind>;
|
|
129
24
|
};
|
|
130
25
|
declare const isKindEqual: <Kind>(operator: WhereOperator<any, Kind>) => operator is KindEqual<Kind>;
|
|
131
|
-
type NotOperator<Tag, Kind> = Omit<AllNever
|
|
26
|
+
type NotOperator<Tag, Kind> = Omit<AllNever, 'not'> & {
|
|
132
27
|
not: WhereOperator<Tag, Kind>;
|
|
133
28
|
};
|
|
134
29
|
declare const isNotOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is NotOperator<Tag, Kind>;
|
|
135
|
-
type AndOperator<Tag, Kind> = Omit<AllNever
|
|
30
|
+
type AndOperator<Tag, Kind> = Omit<AllNever, 'and'> & {
|
|
136
31
|
and: NonEmptyArray<WhereOperator<Tag, Kind>>;
|
|
137
32
|
};
|
|
138
33
|
declare const isAndOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is AndOperator<Tag, Kind>;
|
|
139
|
-
type OrOperator<Tag, Kind> = Omit<AllNever
|
|
34
|
+
type OrOperator<Tag, Kind> = Omit<AllNever, 'or'> & {
|
|
140
35
|
or: NonEmptyArray<WhereOperator<Tag, Kind>>;
|
|
141
36
|
};
|
|
142
37
|
declare const isOrOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is OrOperator<Tag, Kind>;
|
|
143
38
|
type WhereOperator<Tag, Kind> = TagEqual<Tag> | KindEqual<Kind> | NotOperator<Tag, Kind> | AndOperator<Tag, Kind> | OrOperator<Tag, Kind>;
|
|
144
39
|
type Filterable<FTag extends string = string, FKind extends string = string> = {
|
|
145
|
-
tags?: FTag[] | null;
|
|
40
|
+
tags?: readonly FTag[] | null;
|
|
146
41
|
kind?: FKind;
|
|
147
42
|
};
|
|
148
43
|
type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
|
|
@@ -206,7 +101,8 @@ interface ElementTagExpr extends Omit<BaseExpr, 'elementTag' | 'isEqual'> {
|
|
|
206
101
|
isEqual: boolean;
|
|
207
102
|
}
|
|
208
103
|
declare function isElementTagExpr(expr: Expression): expr is ElementTagExpr;
|
|
209
|
-
type
|
|
104
|
+
type NonWilcard = ElementRefExpr | ElementKindExpr | ElementTagExpr | ExpandedElementExpr;
|
|
105
|
+
type ElementExpression = NonWilcard | WildcardExpr;
|
|
210
106
|
declare function isElement(expr: Expression): expr is ElementExpression;
|
|
211
107
|
interface ElementWhereExpr extends Omit<BaseExpr, 'where'> {
|
|
212
108
|
where: {
|
|
@@ -217,12 +113,12 @@ interface ElementWhereExpr extends Omit<BaseExpr, 'where'> {
|
|
|
217
113
|
declare function isElementWhere(expr: Expression): expr is ElementWhereExpr;
|
|
218
114
|
type ElementPredicateExpression = ElementExpression | ElementWhereExpr | CustomElementExpr;
|
|
219
115
|
declare function isElementPredicateExpr(expr: Expression): expr is ElementPredicateExpression;
|
|
220
|
-
interface
|
|
116
|
+
interface DirectRelationExpr extends Omit<BaseExpr, 'source' | 'target'> {
|
|
221
117
|
source: ElementExpression;
|
|
222
118
|
target: ElementExpression;
|
|
223
119
|
isBidirectional?: boolean;
|
|
224
120
|
}
|
|
225
|
-
declare function isRelation(expr: Expression): expr is
|
|
121
|
+
declare function isRelation(expr: Expression): expr is DirectRelationExpr;
|
|
226
122
|
interface InOutExpr extends Omit<BaseExpr, 'inout'> {
|
|
227
123
|
inout: ElementExpression;
|
|
228
124
|
}
|
|
@@ -235,7 +131,7 @@ interface OutgoingExpr extends Omit<BaseExpr, 'outgoing'> {
|
|
|
235
131
|
outgoing: ElementExpression;
|
|
236
132
|
}
|
|
237
133
|
declare function isOutgoing(expr: Expression): expr is OutgoingExpr;
|
|
238
|
-
type RelationExpression =
|
|
134
|
+
type RelationExpression = DirectRelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
|
|
239
135
|
declare function isRelationExpression(expr: Expression): expr is RelationExpression;
|
|
240
136
|
interface RelationWhereExpr extends Omit<BaseExpr, 'where'> {
|
|
241
137
|
where: {
|
|
@@ -266,6 +162,7 @@ type Expression = ElementPredicateExpression | RelationPredicateExpression;
|
|
|
266
162
|
|
|
267
163
|
type expression_CustomElementExpr = CustomElementExpr;
|
|
268
164
|
type expression_CustomRelationExpr = CustomRelationExpr;
|
|
165
|
+
type expression_DirectRelationExpr = DirectRelationExpr;
|
|
269
166
|
type expression_ElementExpression = ElementExpression;
|
|
270
167
|
type expression_ElementKindExpr = ElementKindExpr;
|
|
271
168
|
type expression_ElementPredicateExpression = ElementPredicateExpression;
|
|
@@ -276,8 +173,8 @@ type expression_ExpandedElementExpr = ExpandedElementExpr;
|
|
|
276
173
|
type expression_Expression = Expression;
|
|
277
174
|
type expression_InOutExpr = InOutExpr;
|
|
278
175
|
type expression_IncomingExpr = IncomingExpr;
|
|
176
|
+
type expression_NonWilcard = NonWilcard;
|
|
279
177
|
type expression_OutgoingExpr = OutgoingExpr;
|
|
280
|
-
type expression_RelationExpr = RelationExpr;
|
|
281
178
|
type expression_RelationExpression = RelationExpression;
|
|
282
179
|
type expression_RelationPredicateExpression = RelationPredicateExpression;
|
|
283
180
|
type expression_RelationWhereExpr = RelationWhereExpr;
|
|
@@ -300,7 +197,119 @@ declare const expression_isRelationPredicateExpr: typeof isRelationPredicateExpr
|
|
|
300
197
|
declare const expression_isRelationWhere: typeof isRelationWhere;
|
|
301
198
|
declare const expression_isWildcard: typeof isWildcard;
|
|
302
199
|
declare namespace expression {
|
|
303
|
-
export { type expression_CustomElementExpr as CustomElementExpr, type expression_CustomRelationExpr as CustomRelationExpr, 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
|
|
200
|
+
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 };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare namespace FqnRef {
|
|
204
|
+
/**
|
|
205
|
+
* Represents a reference to an instance within a deployment.
|
|
206
|
+
*
|
|
207
|
+
* @template D - The type representing the deployment fqn. Defaults to `Fqn`.
|
|
208
|
+
* @template M - The type representing the model fqn. Defaults to `Fqn`.
|
|
209
|
+
*
|
|
210
|
+
* @property {D} deployment - TThe fully qualified name (FQN) of the deployed instance.
|
|
211
|
+
* @property {M} element - The element reference within the deployment.
|
|
212
|
+
*/
|
|
213
|
+
type InsideInstanceRef<D = Fqn, M = Fqn> = {
|
|
214
|
+
deployment: D;
|
|
215
|
+
element: M;
|
|
216
|
+
};
|
|
217
|
+
const isInsideInstanceRef: (ref: FqnRef) => ref is InsideInstanceRef;
|
|
218
|
+
/**
|
|
219
|
+
* Represents a reference to a deployment element.
|
|
220
|
+
*
|
|
221
|
+
* @template F - The type of the fully qualified name (FQN) of the deployment element. Defaults to `Fqn`.
|
|
222
|
+
* @property {F} deployment - The fully qualified name (FQN) of the deployment element.
|
|
223
|
+
*/
|
|
224
|
+
type DeploymentElementRef<F = Fqn> = {
|
|
225
|
+
deployment: F;
|
|
226
|
+
};
|
|
227
|
+
const isDeploymentElementRef: (ref: FqnRef) => ref is DeploymentElementRef;
|
|
228
|
+
type DeploymentRef<D = Fqn, M = Fqn> = DeploymentElementRef<D> | InsideInstanceRef<D, M>;
|
|
229
|
+
const isDeploymentRef: (ref: FqnRef) => ref is DeploymentRef;
|
|
230
|
+
/**
|
|
231
|
+
* Reference to logical model element
|
|
232
|
+
*/
|
|
233
|
+
type ModelRef<F = Fqn> = {
|
|
234
|
+
model: F;
|
|
235
|
+
};
|
|
236
|
+
const isModelRef: (ref: FqnRef) => ref is ModelRef;
|
|
237
|
+
const toDeploymentRef: (ref: FqnRef) => DeploymentRef;
|
|
238
|
+
}
|
|
239
|
+
type FqnRef<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
240
|
+
InsideInstanceRef: FqnRef.InsideInstanceRef<D, M>;
|
|
241
|
+
DeploymentRef: FqnRef.DeploymentRef<D>;
|
|
242
|
+
ModelRef: FqnRef.ModelRef<M>;
|
|
243
|
+
}>;
|
|
244
|
+
declare namespace FqnExpr {
|
|
245
|
+
type Wildcard = {
|
|
246
|
+
wildcard: true;
|
|
247
|
+
};
|
|
248
|
+
const isWildcard: (expr: ExpressionV2) => expr is Wildcard;
|
|
249
|
+
type ModelRef<M = Fqn> = {
|
|
250
|
+
ref: FqnRef.ModelRef<M>;
|
|
251
|
+
selector?: PredicateSelector;
|
|
252
|
+
};
|
|
253
|
+
const isModelRef: (ref: ExpressionV2) => ref is ModelRef;
|
|
254
|
+
type DeploymentRef<D = Fqn, M = Fqn> = {
|
|
255
|
+
ref: FqnRef.DeploymentRef<D> | FqnRef.InsideInstanceRef<D, M>;
|
|
256
|
+
selector?: PredicateSelector;
|
|
257
|
+
};
|
|
258
|
+
const isDeploymentRef: (ref: ExpressionV2) => ref is FqnExpr.DeploymentRef;
|
|
259
|
+
type NonWildcard<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
260
|
+
ModelRef: ModelRef<M>;
|
|
261
|
+
DeploymentRef: DeploymentRef<D, M>;
|
|
262
|
+
}>;
|
|
263
|
+
}
|
|
264
|
+
type FqnExpr<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
265
|
+
Wildcard: FqnExpr.Wildcard;
|
|
266
|
+
ModelRef: FqnExpr.ModelRef<M>;
|
|
267
|
+
DeploymentRef: FqnExpr.DeploymentRef<D, M>;
|
|
268
|
+
}>;
|
|
269
|
+
declare namespace RelationExpr {
|
|
270
|
+
type Direct<D = Fqn, M = Fqn> = {
|
|
271
|
+
source: FqnExpr<D, M>;
|
|
272
|
+
target: FqnExpr<D, M>;
|
|
273
|
+
isBidirectional?: boolean;
|
|
274
|
+
};
|
|
275
|
+
const isDirect: (expr: ExpressionV2) => expr is Direct;
|
|
276
|
+
type Incoming<D = Fqn, M = Fqn> = {
|
|
277
|
+
incoming: FqnExpr<D, M>;
|
|
278
|
+
};
|
|
279
|
+
const isIncoming: (expr: ExpressionV2) => expr is Incoming;
|
|
280
|
+
type Outgoing<D = Fqn, M = Fqn> = {
|
|
281
|
+
outgoing: FqnExpr<D, M>;
|
|
282
|
+
};
|
|
283
|
+
const isOutgoing: (expr: ExpressionV2) => expr is Outgoing;
|
|
284
|
+
type InOut<D = Fqn, M = Fqn> = {
|
|
285
|
+
inout: FqnExpr<D, M>;
|
|
286
|
+
};
|
|
287
|
+
const isInOut: (expr: ExpressionV2) => expr is InOut;
|
|
288
|
+
}
|
|
289
|
+
type RelationExpr<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
290
|
+
Direct: RelationExpr.Direct<D, M>;
|
|
291
|
+
Incoming: RelationExpr.Incoming<D, M>;
|
|
292
|
+
Outgoing: RelationExpr.Outgoing<D, M>;
|
|
293
|
+
InOut: RelationExpr.InOut<D, M>;
|
|
294
|
+
}>;
|
|
295
|
+
/**
|
|
296
|
+
* Represents a version 2 expression which can be one of several types.
|
|
297
|
+
*
|
|
298
|
+
* @template D - The type for the deployment FQN, defaults to `Fqn`.
|
|
299
|
+
* @template M - The type for the model FQN, defaults to `Fqn`.
|
|
300
|
+
*/
|
|
301
|
+
type ExpressionV2<D = Fqn, M = Fqn> = ExclusiveUnion<{
|
|
302
|
+
Wildcard: FqnExpr.Wildcard;
|
|
303
|
+
ModelRef: FqnExpr.ModelRef<M>;
|
|
304
|
+
DeploymentRef: FqnExpr.DeploymentRef<D, M>;
|
|
305
|
+
Direct: RelationExpr.Direct<D, M>;
|
|
306
|
+
Incoming: RelationExpr.Incoming<D, M>;
|
|
307
|
+
Outgoing: RelationExpr.Outgoing<D, M>;
|
|
308
|
+
InOut: RelationExpr.InOut<D, M>;
|
|
309
|
+
}>;
|
|
310
|
+
declare namespace ExpressionV2 {
|
|
311
|
+
const isFqnExpr: (expr: ExpressionV2) => expr is FqnExpr;
|
|
312
|
+
const isRelation: (expr: ExpressionV2) => expr is RelationExpr;
|
|
304
313
|
}
|
|
305
314
|
|
|
306
315
|
type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
|
|
@@ -309,9 +318,9 @@ type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>;
|
|
|
309
318
|
type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
|
|
310
319
|
type GlobalStyles = NonEmptyTuple<ViewRuleStyle>;
|
|
311
320
|
interface ModelGlobals {
|
|
312
|
-
predicates: Record<GlobalPredicateId, GlobalPredicates>;
|
|
313
|
-
dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
|
|
314
|
-
styles: Record<GlobalStyleID, GlobalStyles>;
|
|
321
|
+
readonly predicates: Record<GlobalPredicateId, GlobalPredicates>;
|
|
322
|
+
readonly dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
|
|
323
|
+
readonly styles: Record<GlobalStyleID, GlobalStyles>;
|
|
315
324
|
}
|
|
316
325
|
|
|
317
326
|
type ElementNotation = {
|
|
@@ -441,14 +450,14 @@ type CustomColorDefinitions = {
|
|
|
441
450
|
[key: string]: ThemeColorValues;
|
|
442
451
|
};
|
|
443
452
|
type DeploymentViewRulePredicate = {
|
|
444
|
-
include:
|
|
453
|
+
include: ExpressionV2[];
|
|
445
454
|
exclude?: never;
|
|
446
455
|
} | {
|
|
447
456
|
include?: never;
|
|
448
|
-
exclude:
|
|
457
|
+
exclude: ExpressionV2[];
|
|
449
458
|
};
|
|
450
459
|
type DeploymentViewRuleStyle = {
|
|
451
|
-
targets:
|
|
460
|
+
targets: FqnExpr[];
|
|
452
461
|
notation?: string;
|
|
453
462
|
style: ElementStyle & {
|
|
454
463
|
color?: Color;
|
|
@@ -604,7 +613,7 @@ type BBox = {
|
|
|
604
613
|
width: number;
|
|
605
614
|
height: number;
|
|
606
615
|
};
|
|
607
|
-
declare function getBBoxCenter({ x, y, width, height }: BBox): XYPoint;
|
|
616
|
+
declare function getBBoxCenter({ x, y, width, height, }: BBox): XYPoint;
|
|
608
617
|
interface DiagramNode extends ComputedNode {
|
|
609
618
|
width: number;
|
|
610
619
|
height: number;
|
|
@@ -662,28 +671,31 @@ type RelationId = Tagged<string, 'RelationID'>;
|
|
|
662
671
|
type RelationshipKind<Kinds extends string = string> = Tagged<Kinds, 'RelationshipKind'>;
|
|
663
672
|
type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
|
|
664
673
|
type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'dot' | 'odot' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
|
|
665
|
-
declare const DefaultLineStyle
|
|
666
|
-
declare const DefaultArrowType
|
|
667
|
-
declare const DefaultRelationshipColor
|
|
668
|
-
interface
|
|
674
|
+
declare const DefaultLineStyle: RelationshipLineType;
|
|
675
|
+
declare const DefaultArrowType: RelationshipArrowType;
|
|
676
|
+
declare const DefaultRelationshipColor: ThemeColor;
|
|
677
|
+
interface AbstractRelation {
|
|
669
678
|
readonly id: RelationId;
|
|
670
|
-
readonly
|
|
671
|
-
readonly target: Fqn;
|
|
672
|
-
readonly title: string;
|
|
679
|
+
readonly title?: string;
|
|
673
680
|
readonly description?: string;
|
|
674
681
|
readonly technology?: string;
|
|
675
|
-
readonly tags?: NonEmptyArray<Tag
|
|
682
|
+
readonly tags?: NonEmptyArray<Tag> | null;
|
|
676
683
|
readonly kind?: RelationshipKind;
|
|
677
684
|
readonly color?: Color;
|
|
678
685
|
readonly line?: RelationshipLineType;
|
|
679
686
|
readonly head?: RelationshipArrowType;
|
|
680
687
|
readonly tail?: RelationshipArrowType;
|
|
681
|
-
readonly links?: NonEmptyArray<Link
|
|
688
|
+
readonly links?: NonEmptyArray<Link> | null;
|
|
682
689
|
readonly navigateTo?: ViewId;
|
|
683
690
|
readonly metadata?: {
|
|
684
691
|
[key: string]: string;
|
|
685
692
|
};
|
|
686
693
|
}
|
|
694
|
+
interface ModelRelation extends AbstractRelation {
|
|
695
|
+
readonly source: Fqn;
|
|
696
|
+
readonly target: Fqn;
|
|
697
|
+
readonly title: string;
|
|
698
|
+
}
|
|
687
699
|
interface RelationshipKindSpecification {
|
|
688
700
|
readonly technology?: string;
|
|
689
701
|
readonly notation?: string;
|
|
@@ -694,7 +706,7 @@ interface RelationshipKindSpecification {
|
|
|
694
706
|
}
|
|
695
707
|
|
|
696
708
|
type DeploymentNodeKind<Kinds extends string = string> = Tagged<Kinds, 'DeploymentNodeKind'>;
|
|
697
|
-
type
|
|
709
|
+
type DeploymentElementStyle = ElementStyle & {
|
|
698
710
|
readonly icon?: IconUrl;
|
|
699
711
|
readonly shape?: ElementShape;
|
|
700
712
|
readonly color?: Color;
|
|
@@ -702,7 +714,7 @@ type PhysicalElementStyle = ElementStyle & {
|
|
|
702
714
|
interface DeploymentNodeKindSpecification {
|
|
703
715
|
readonly technology?: string;
|
|
704
716
|
readonly notation?: string;
|
|
705
|
-
readonly style:
|
|
717
|
+
readonly style: DeploymentElementStyle;
|
|
706
718
|
}
|
|
707
719
|
interface DeploymentNode {
|
|
708
720
|
readonly id: Fqn;
|
|
@@ -712,7 +724,7 @@ interface DeploymentNode {
|
|
|
712
724
|
readonly technology?: string | null;
|
|
713
725
|
readonly tags?: NonEmptyArray<Tag> | null;
|
|
714
726
|
readonly links?: NonEmptyArray<Link> | null;
|
|
715
|
-
readonly style?:
|
|
727
|
+
readonly style?: DeploymentElementStyle;
|
|
716
728
|
readonly notation?: string;
|
|
717
729
|
readonly metadata?: Record<string, string>;
|
|
718
730
|
}
|
|
@@ -728,7 +740,7 @@ interface DeployedInstance {
|
|
|
728
740
|
readonly technology?: string | null;
|
|
729
741
|
readonly tags?: NonEmptyArray<Tag> | null;
|
|
730
742
|
readonly links?: NonEmptyArray<Link> | null;
|
|
731
|
-
readonly style?:
|
|
743
|
+
readonly style?: DeploymentElementStyle;
|
|
732
744
|
readonly notation?: string;
|
|
733
745
|
readonly metadata?: Record<string, string>;
|
|
734
746
|
}
|
|
@@ -737,6 +749,7 @@ declare namespace DeploymentElement {
|
|
|
737
749
|
const isDeploymentNode: (el: DeploymentElement) => el is DeploymentNode;
|
|
738
750
|
const isInstance: (el: DeploymentElement) => el is DeployedInstance;
|
|
739
751
|
}
|
|
752
|
+
type PredicateSelector = 'children' | 'expanded' | 'descendants';
|
|
740
753
|
interface DeploymentRef {
|
|
741
754
|
readonly id: Fqn;
|
|
742
755
|
readonly element?: Fqn;
|
|
@@ -744,89 +757,28 @@ interface DeploymentRef {
|
|
|
744
757
|
/**
|
|
745
758
|
* NOTE:
|
|
746
759
|
*/
|
|
747
|
-
interface DeploymentRelation {
|
|
760
|
+
interface DeploymentRelation extends AbstractRelation {
|
|
748
761
|
readonly id: RelationId;
|
|
749
762
|
readonly source: DeploymentRef;
|
|
750
763
|
readonly target: DeploymentRef;
|
|
751
|
-
readonly title?: string;
|
|
752
|
-
readonly tags?: NonEmptyArray<Tag> | null;
|
|
753
|
-
readonly description?: string;
|
|
754
|
-
readonly technology?: string;
|
|
755
|
-
readonly kind?: RelationshipKind;
|
|
756
|
-
readonly color?: Color;
|
|
757
|
-
readonly line?: RelationshipLineType;
|
|
758
|
-
readonly head?: RelationshipArrowType;
|
|
759
|
-
readonly tail?: RelationshipArrowType;
|
|
760
|
-
readonly links?: NonEmptyArray<Link> | null;
|
|
761
|
-
readonly navigateTo?: ViewId;
|
|
762
|
-
readonly metadata?: {
|
|
763
|
-
[key: string]: string;
|
|
764
|
-
};
|
|
765
|
-
}
|
|
766
|
-
type AllNever<Expressions> = UnionToIntersection<{
|
|
767
|
-
[Name in keyof Expressions]: {
|
|
768
|
-
-readonly [Key in keyof Expressions[Name]]?: never;
|
|
769
|
-
};
|
|
770
|
-
}[keyof Expressions]>;
|
|
771
|
-
type ExclusiveUnion<Expressions> = Expressions extends object ? {
|
|
772
|
-
[Name in keyof Expressions]: Simplify<Omit<AllNever<Expressions>, keyof Expressions[Name]> & Expressions[Name]>;
|
|
773
|
-
}[keyof Expressions] : Expressions;
|
|
774
|
-
declare namespace DeploymentRelationExpression {
|
|
775
|
-
type Direct = {
|
|
776
|
-
source: DeploymentElementExpression;
|
|
777
|
-
target: DeploymentElementExpression;
|
|
778
|
-
isBidirectional?: boolean;
|
|
779
|
-
};
|
|
780
|
-
const isDirect: (expr: DeploymentExpression) => expr is Direct;
|
|
781
|
-
type Incoming = {
|
|
782
|
-
incoming: DeploymentElementExpression;
|
|
783
|
-
};
|
|
784
|
-
const isIncoming: (expr: DeploymentExpression) => expr is Incoming;
|
|
785
|
-
type Outgoing = {
|
|
786
|
-
outgoing: DeploymentElementExpression;
|
|
787
|
-
};
|
|
788
|
-
const isOutgoing: (expr: DeploymentExpression) => expr is Outgoing;
|
|
789
|
-
type InOut = {
|
|
790
|
-
inout: DeploymentElementExpression;
|
|
791
|
-
};
|
|
792
|
-
const isInOut: (expr: DeploymentExpression) => expr is InOut;
|
|
793
|
-
}
|
|
794
|
-
type DeploymentRelationExpression = ExclusiveUnion<{
|
|
795
|
-
Direct: DeploymentRelationExpression.Direct;
|
|
796
|
-
Incoming: DeploymentRelationExpression.Incoming;
|
|
797
|
-
Outgoing: DeploymentRelationExpression.Outgoing;
|
|
798
|
-
InOut: DeploymentRelationExpression.InOut;
|
|
799
|
-
}>;
|
|
800
|
-
declare namespace DeploymentElementExpression {
|
|
801
|
-
type Ref = {
|
|
802
|
-
ref: DeploymentRef;
|
|
803
|
-
selector?: 'children' | 'expanded' | 'descendants';
|
|
804
|
-
};
|
|
805
|
-
const isRef: (expr: DeploymentExpression) => expr is Ref;
|
|
806
|
-
type Wildcard = {
|
|
807
|
-
wildcard: true;
|
|
808
|
-
};
|
|
809
|
-
const isWildcard: (expr: DeploymentExpression) => expr is Wildcard;
|
|
810
|
-
}
|
|
811
|
-
type DeploymentElementExpression = ExclusiveUnion<{
|
|
812
|
-
DeploymentRef: DeploymentElementExpression.Ref;
|
|
813
|
-
Wildcard: DeploymentElementExpression.Wildcard;
|
|
814
|
-
}>;
|
|
815
|
-
type DeploymentExpression = ExclusiveUnion<{
|
|
816
|
-
Element: DeploymentElementExpression;
|
|
817
|
-
Relation: DeploymentRelationExpression;
|
|
818
|
-
}>;
|
|
819
|
-
declare namespace DeploymentExpression {
|
|
820
|
-
type Element = DeploymentElementExpression;
|
|
821
|
-
type Relation = DeploymentRelationExpression;
|
|
822
|
-
const isElement: (expr: DeploymentExpression) => expr is DeploymentElementExpression;
|
|
823
|
-
const isRelation: (expr: DeploymentExpression) => expr is DeploymentRelationExpression;
|
|
824
764
|
}
|
|
825
765
|
|
|
826
766
|
/**
|
|
827
|
-
*
|
|
767
|
+
* Represents a LikeC4 model with customizable type parameters,
|
|
768
|
+
* parsed from DSL or result from Builder
|
|
769
|
+
*
|
|
770
|
+
* !IMPORTANT: This is a low-level type, use `LikeC4Model` instead.
|
|
771
|
+
* !NOTE: Views are not computed yet.
|
|
772
|
+
*
|
|
773
|
+
* @typeParam ElementKinds - Types of elements in the model (defaults to string)
|
|
774
|
+
* @typeParam RelationKinds - Types of relationships (defaults to string)
|
|
775
|
+
* @typeParam Tags - Types of tags that can be applied (defaults to string)
|
|
776
|
+
* @typeParam Fqns - Fully Qualified Names for elements (defaults to string)
|
|
777
|
+
* @typeParam Views - Types of views in the model (defaults to string)
|
|
778
|
+
* @typeParam DeploymentFqns - Fully Qualified Names for deployment nodes (defaults to string)
|
|
828
779
|
*/
|
|
829
780
|
interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds extends string = string, Tags extends string = string, Fqns extends string = string, Views extends string = string, DeploymentFqns extends string = string> {
|
|
781
|
+
__?: never;
|
|
830
782
|
specification: {
|
|
831
783
|
tags: Tag<Tags>[];
|
|
832
784
|
elements: Record<ElementKinds, ElementKindSpecification>;
|
|
@@ -834,7 +786,7 @@ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds
|
|
|
834
786
|
relationships: Record<RelationKinds, RelationshipKindSpecification>;
|
|
835
787
|
};
|
|
836
788
|
elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
|
|
837
|
-
relations: Record<RelationId,
|
|
789
|
+
relations: Record<RelationId, ModelRelation>;
|
|
838
790
|
globals: ModelGlobals;
|
|
839
791
|
views: Record<Views, LikeC4View<Views, Tags>>;
|
|
840
792
|
/**
|
|
@@ -845,10 +797,11 @@ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds
|
|
|
845
797
|
relations: Record<RelationId, DeploymentRelation>;
|
|
846
798
|
};
|
|
847
799
|
}
|
|
800
|
+
type AnyParsedLikeC4Model = ParsedLikeC4Model<any, any, any, any, any, any>;
|
|
848
801
|
/**
|
|
849
802
|
* Hook to get types from dump
|
|
850
803
|
*/
|
|
851
|
-
type
|
|
804
|
+
type LikeC4ModelDump = {
|
|
852
805
|
elements: {
|
|
853
806
|
[kind: string]: object;
|
|
854
807
|
};
|
|
@@ -861,23 +814,19 @@ type ParsedLikeC4ModelDump = {
|
|
|
861
814
|
[kind: string]: object;
|
|
862
815
|
};
|
|
863
816
|
};
|
|
864
|
-
interface AnyLikeC4Model<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string, T = 'computed' | 'layouted'> extends Omit<ParsedLikeC4Model<string, string, Tags, Fqns, Views, DeploymentFqns>, 'views'> {
|
|
865
|
-
__?: T;
|
|
866
|
-
views: Record<Views, ComputedView | DiagramView>;
|
|
867
|
-
}
|
|
868
817
|
/**
|
|
869
|
-
* Same as
|
|
818
|
+
* Same as {@link ParsedLikeC4Model}, but with computed views or layouted views.
|
|
870
819
|
*/
|
|
871
|
-
interface
|
|
872
|
-
|
|
820
|
+
interface GenericLikeC4Model<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string, T = 'computed' | 'layouted'> extends Omit<ParsedLikeC4Model<string, string, Tags, Fqns, Views, DeploymentFqns>, 'views' | '__'> {
|
|
821
|
+
__?: T;
|
|
822
|
+
views: Record<Views, ComputedView<Views> | DiagramView<Views>>;
|
|
873
823
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
interface LayoutedLikeC4Model<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string> extends Omit<AnyLikeC4Model<Fqns, DeploymentFqns, Views, Tags, 'layouted'>, 'views'> {
|
|
824
|
+
interface ComputedLikeC4Model<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string> extends Omit<GenericLikeC4Model<Fqns, DeploymentFqns, Views, Tags, 'computed'>, 'views'> {
|
|
825
|
+
views: Record<Views, ComputedView<Views>>;
|
|
826
|
+
}
|
|
827
|
+
interface LayoutedLikeC4Model<Fqns extends string = string, DeploymentFqns extends string = string, Views extends string = string, Tags extends string = string> extends Omit<GenericLikeC4Model<Fqns, DeploymentFqns, Views, Tags, 'layouted'>, 'views'> {
|
|
879
828
|
__: 'layouted';
|
|
880
829
|
views: Record<Views, DiagramView<Views, Tags>>;
|
|
881
830
|
}
|
|
882
831
|
|
|
883
|
-
export { type
|
|
832
|
+
export { type GlobalDynamicPredicates as $, type CustomElementExpr as A, type CustomRelationExpr as B, ComputedView 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 _, type ComputedLikeC4Model as a, type DeploymentView as a$, type GlobalPredicateId as a0, type GlobalPredicates as a1, type GlobalStyleID as a2, type GlobalStyles as a3, type ModelGlobals as a4, type AnyParsedLikeC4Model as a5, type GenericLikeC4Model as a6, type LayoutedLikeC4Model as a7, type LikeC4ModelDump as a8, type ParsedLikeC4Model as a9, extractStep as aA, getBBoxCenter as aB, getParallelStepsPrefix as aC, isAutoLayoutDirection as aD, isDeploymentView as aE, isDynamicView as aF, isDynamicViewParallelSteps as aG, isElementView as aH, isExtendsElementView as aI, isScopedElementView as aJ, isStepEdgeId as aK, isViewRuleAutoLayout as aL, isViewRuleGlobalPredicateRef as aM, isViewRuleGlobalStyle as aN, isViewRuleGroup as aO, isViewRulePredicate as aP, isViewRuleStyle as aQ, stepEdgeId as aR, type AutoLayoutDirection as aS, type BasicElementView as aT, type BasicView as aU, type BBox as aV, type ComputedDeploymentView as aW, type ComputedDynamicView as aX, type ComputedEdge as aY, type ComputedElementView as aZ, type CustomColorDefinitions as a_, isAndOperator as aa, isKindEqual as ab, isNotOperator as ac, isOrOperator as ad, isTagEqual as ae, whereOperatorAsPredicate as af, type AndOperator as ag, type EqualOperator as ah, type Filterable as ai, type KindEqual as aj, type NotOperator as ak, type OrOperator as al, type TagEqual as am, type WhereOperator as an, DefaultArrowType as ao, DefaultLineStyle as ap, DefaultRelationshipColor as aq, type AbstractRelation as ar, type ModelRelation as as, type RelationId as at, type RelationshipArrowType as au, type RelationshipKind as av, type RelationshipKindSpecification as aw, type RelationshipLineType as ax, ComputedNode as ay, DiagramNode as az, type DeployedInstance as b, type DeploymentViewRule as b0, type DeploymentViewRulePredicate as b1, type DeploymentViewRuleStyle as b2, type DiagramEdge as b3, type DiagramView as b4, type DynamicView as b5, type DynamicViewIncludeRule as b6, type DynamicViewParallelSteps as b7, type DynamicViewRule as b8, type DynamicViewStep as b9, type DynamicViewStepOrParallel as ba, type EdgeId as bb, type ElementView as bc, type ExtendsElementView as bd, type NodeId as be, type ScopedElementView as bf, type StepEdgeId as bg, type StepEdgeIdLiteral as bh, type ViewAutoLayout as bi, type ViewId as bj, type ViewManualLayout as bk, type ViewRule as bl, type ViewRuleAutoLayout as bm, type ViewRuleGlobalPredicateRef as bn, type ViewRuleGlobalStyle as bo, type ViewRuleGroup as bp, type ViewRulePredicate as bq, type ViewRuleStyle as br, type ViewRuleStyleOrGlobalRef as bs, type ViewWithHash as bt, type ViewWithNotation as bu, type ElementNotation as bv, 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 };
|