@likec4/core 1.17.1 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compute-view/index.d.mts +91 -0
- package/dist/compute-view/index.d.ts +91 -0
- package/dist/compute-view/index.mjs +79 -0
- package/dist/index.d.mts +246 -434
- package/dist/index.d.ts +246 -434
- package/dist/index.mjs +418 -1322
- package/dist/model/index.d.mts +642 -0
- package/dist/model/index.d.ts +642 -0
- package/dist/model/index.mjs +2 -0
- package/dist/shared/core.BBgiAAv1.mjs +144 -0
- package/dist/shared/core.BPyJvuMU.mjs +2420 -0
- package/dist/shared/core.BQ4AbfvB.mjs +9228 -0
- package/dist/shared/{core.CoLQkcYL.d.mts → core.DMYY7C8s.d.mts} +398 -249
- package/dist/shared/{core.CoLQkcYL.d.ts → core.DMYY7C8s.d.ts} +398 -249
- package/dist/shared/core.k12s_keD.mjs +203 -0
- package/dist/types/index.d.mts +69 -1
- package/dist/types/index.d.ts +69 -1
- package/dist/types/index.mjs +21 -1
- package/package.json +38 -40
- package/src/builder/Builder.deployment.ts +219 -0
- package/src/builder/Builder.deploymentModel.ts +360 -0
- package/src/builder/Builder.element.ts +17 -19
- package/src/builder/Builder.model.ts +13 -2
- package/src/builder/Builder.test-d.ts +59 -4
- package/src/builder/Builder.ts +238 -53
- package/src/builder/Builder.view.ts +238 -53
- package/src/builder/_types.ts +87 -15
- package/src/compute-view/LikeC4ModelGraph.ts +330 -0
- package/src/compute-view/compute-view.ts +92 -0
- package/src/compute-view/deployment-view/Memory.ts +108 -0
- package/src/compute-view/deployment-view/Stage.ts +145 -0
- package/src/compute-view/deployment-view/__test__/fixture.ts +210 -0
- package/src/compute-view/deployment-view/_types.ts +29 -0
- package/src/compute-view/deployment-view/clean-connections.ts +229 -0
- package/src/compute-view/deployment-view/compute.ts +111 -0
- package/src/compute-view/deployment-view/predicates/deployment-ref.ts +146 -0
- package/src/compute-view/deployment-view/predicates/relation-direct.ts +130 -0
- package/src/compute-view/deployment-view/predicates/relation-in-out.ts +43 -0
- package/src/compute-view/deployment-view/predicates/relation-incoming.ts +46 -0
- package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +49 -0
- package/src/compute-view/deployment-view/predicates/wildcard.ts +29 -0
- package/src/compute-view/deployment-view/utils.ts +212 -0
- package/src/compute-view/dynamic-view/__test__/fixture.ts +58 -0
- package/src/compute-view/dynamic-view/compute.ts +310 -0
- package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +456 -0
- package/src/compute-view/element-view/__test__/fixture.ts +645 -0
- package/src/compute-view/element-view/compute.ts +734 -0
- package/src/compute-view/element-view/predicates.ts +517 -0
- package/src/compute-view/index.ts +5 -0
- package/src/compute-view/utils/__snapshots__/sortNodes.spec.ts.snap +113 -0
- package/src/compute-view/utils/ancestorsOfNode.ts +19 -0
- package/src/compute-view/utils/applyCustomElementProperties.ts +66 -0
- package/src/compute-view/utils/applyCustomRelationProperties.ts +41 -0
- package/src/compute-view/utils/applyViewRuleStyles.ts +53 -0
- package/src/compute-view/utils/buildComputedNodes.ts +148 -0
- package/src/compute-view/utils/buildElementNotations.ts +63 -0
- package/src/compute-view/utils/derive-edge-props-from-relationships.ts +97 -0
- package/src/compute-view/utils/elementExpressionToPredicate.ts +52 -0
- package/src/compute-view/utils/link-nodes-with-edges.ts +58 -0
- package/src/compute-view/utils/relationExpressionToPredicates.ts +55 -0
- package/src/compute-view/utils/resolve-extended-views.ts +65 -0
- package/src/compute-view/utils/resolve-global-rules.ts +83 -0
- package/src/compute-view/utils/sortNodes.ts +101 -0
- package/src/compute-view/utils/topological-sort.ts +160 -0
- package/src/compute-view/utils/uniqueTags.test.ts +42 -0
- package/src/compute-view/utils/uniqueTags.ts +21 -0
- package/src/compute-view/utils/view-hash.ts +27 -0
- package/src/compute-view/utils/with-readable-edges.ts +31 -0
- package/src/index.ts +5 -1
- package/src/model/DeploymentElementModel.ts +534 -0
- package/src/model/DeploymentModel.ts +364 -0
- package/src/model/ElementModel.ts +195 -0
- package/src/model/LikeC4Model.test-d.ts +151 -0
- package/src/model/LikeC4Model.ts +280 -457
- package/src/model/RelationModel.ts +84 -0
- package/src/model/__test__/fixture.ts +153 -338
- package/src/model/connection/ConnectionModel.ts +94 -0
- package/src/model/connection/DeploymentConnectionModel.ts +99 -0
- package/src/model/connection/deployment.ts +124 -0
- package/src/model/connection/model.ts +123 -0
- package/src/model/index.ts +4 -2
- package/src/model/types.ts +95 -15
- package/src/model/view/EdgeModel.ts +103 -0
- package/src/model/view/LikeC4ViewModel.ts +220 -0
- package/src/model/view/NodeModel.ts +228 -0
- package/src/types/_common.ts +2 -0
- package/src/types/deployments.ts +237 -0
- package/src/types/element.ts +7 -3
- package/src/types/expression.ts +8 -6
- package/src/types/index.ts +1 -0
- package/src/types/model.ts +68 -9
- package/src/types/overview-graph.ts +2 -2
- package/src/types/relation.ts +4 -4
- package/src/types/view-notation.ts +2 -2
- package/src/types/view.ts +104 -30
- package/src/utils/{commonHead.ts → common-head.ts} +2 -0
- package/src/utils/fqn.ts +83 -27
- package/src/utils/getOrCreate.ts +42 -0
- package/src/utils/graphlib.ts +10 -0
- package/src/utils/index.ts +4 -1
- package/src/utils/object-hash.ts +3 -0
- package/src/utils/set.ts +76 -0
- package/src/utils/string-hash.ts +16 -0
- package/dist/index.cjs +0 -5452
- package/dist/index.d.cts +0 -1053
- package/dist/shared/core.BXTs-8n7.mjs +0 -293
- package/dist/shared/core.CoLQkcYL.d.cts +0 -734
- package/dist/shared/core.DIYZvpVg.cjs +0 -353
- package/dist/types/index.cjs +0 -70
- package/dist/types/index.d.cts +0 -2
- package/src/model/LikeC4DiagramModel.ts +0 -338
- package/src/model/LikeC4ViewModel.ts +0 -320
|
@@ -1,734 +0,0 @@
|
|
|
1
|
-
import { Tagged, LiteralUnion, TupleToUnion, NonEmptyTuple } from 'type-fest';
|
|
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
|
-
|
|
13
|
-
declare const ThemeColors: readonly ["amber", "blue", "gray", "slate", "green", "indigo", "muted", "primary", "red", "secondary", "sky"];
|
|
14
|
-
type ThemeColor = typeof ThemeColors[number];
|
|
15
|
-
type HexColorLiteral = `#${string}`;
|
|
16
|
-
type ColorLiteral = HexColorLiteral;
|
|
17
|
-
type Color = LiteralUnion<ThemeColor, string>;
|
|
18
|
-
declare function isThemeColor(color: Color): color is ThemeColor;
|
|
19
|
-
interface ElementThemeColorValues {
|
|
20
|
-
fill: ColorLiteral;
|
|
21
|
-
stroke: ColorLiteral;
|
|
22
|
-
hiContrast: ColorLiteral;
|
|
23
|
-
loContrast: ColorLiteral;
|
|
24
|
-
}
|
|
25
|
-
type ElementThemeColors = {
|
|
26
|
-
[key in ThemeColor]: ElementThemeColorValues;
|
|
27
|
-
};
|
|
28
|
-
interface RelationshipThemeColorValues {
|
|
29
|
-
lineColor: ColorLiteral;
|
|
30
|
-
labelBgColor: ColorLiteral;
|
|
31
|
-
labelColor: ColorLiteral;
|
|
32
|
-
}
|
|
33
|
-
interface ThemeColorValues {
|
|
34
|
-
elements: ElementThemeColorValues;
|
|
35
|
-
relationships: RelationshipThemeColorValues;
|
|
36
|
-
}
|
|
37
|
-
type RelationshipThemeColors = {
|
|
38
|
-
[key in ThemeColor]: RelationshipThemeColorValues;
|
|
39
|
-
};
|
|
40
|
-
interface LikeC4Theme {
|
|
41
|
-
font: 'Arial';
|
|
42
|
-
shadow: ColorLiteral;
|
|
43
|
-
relationships: RelationshipThemeColors;
|
|
44
|
-
elements: ElementThemeColors;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
type Fqn<Id extends string = string> = Tagged<Id, 'Fqn'>;
|
|
48
|
-
declare function AsFqn(name: string, parent?: Fqn | null): Fqn;
|
|
49
|
-
declare const BorderStyles: readonly ["solid", "dashed", "dotted", "none"];
|
|
50
|
-
type BorderStyle = TupleToUnion<typeof BorderStyles>;
|
|
51
|
-
type ElementKind<Kinds extends string = string> = Tagged<Kinds, 'ElementKind'>;
|
|
52
|
-
declare namespace ElementKind {
|
|
53
|
-
const Group: ElementKind;
|
|
54
|
-
}
|
|
55
|
-
declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile", "cylinder", "storage", "queue"];
|
|
56
|
-
type ElementShape = TupleToUnion<typeof ElementShapes>;
|
|
57
|
-
declare const DefaultThemeColor = "primary";
|
|
58
|
-
declare const DefaultElementShape = "rectangle";
|
|
59
|
-
interface ElementStyle {
|
|
60
|
-
border?: BorderStyle;
|
|
61
|
-
opacity?: number;
|
|
62
|
-
}
|
|
63
|
-
type Tag<Tags extends string = string> = Tagged<Tags, 'Tag'>;
|
|
64
|
-
interface TagSpec {
|
|
65
|
-
readonly id: Tag;
|
|
66
|
-
readonly style: ElementStyle;
|
|
67
|
-
}
|
|
68
|
-
interface Link {
|
|
69
|
-
readonly title?: string;
|
|
70
|
-
readonly url: string;
|
|
71
|
-
readonly relative?: string;
|
|
72
|
-
}
|
|
73
|
-
interface TypedElement<Ids extends string, Kinds extends string, Tags extends string, MetadataKeys extends string = never> {
|
|
74
|
-
readonly id: Fqn<Ids>;
|
|
75
|
-
readonly kind: ElementKind<Kinds>;
|
|
76
|
-
readonly title: string;
|
|
77
|
-
readonly description: string | null;
|
|
78
|
-
readonly technology: string | null;
|
|
79
|
-
readonly tags: NonEmptyArray<Tag<Tags>> | null;
|
|
80
|
-
readonly links: NonEmptyArray<Link> | null;
|
|
81
|
-
readonly icon?: IconUrl;
|
|
82
|
-
readonly shape?: ElementShape;
|
|
83
|
-
readonly color?: Color;
|
|
84
|
-
readonly style?: ElementStyle;
|
|
85
|
-
readonly notation?: string;
|
|
86
|
-
readonly metadata?: Record<MetadataKeys, string>;
|
|
87
|
-
}
|
|
88
|
-
interface Element extends TypedElement<string, string, string, string> {
|
|
89
|
-
}
|
|
90
|
-
interface ElementKindSpecificationStyle {
|
|
91
|
-
shape?: ElementShape;
|
|
92
|
-
icon?: IconUrl;
|
|
93
|
-
color?: Color;
|
|
94
|
-
border?: BorderStyle;
|
|
95
|
-
opacity?: number;
|
|
96
|
-
}
|
|
97
|
-
interface ElementKindSpecification {
|
|
98
|
-
readonly technology?: string;
|
|
99
|
-
readonly notation?: string;
|
|
100
|
-
readonly style: ElementKindSpecificationStyle;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
type EqualOperator<V> = {
|
|
104
|
-
eq: V;
|
|
105
|
-
neq?: never;
|
|
106
|
-
} | {
|
|
107
|
-
eq?: never;
|
|
108
|
-
neq: V;
|
|
109
|
-
};
|
|
110
|
-
type AllNever = {
|
|
111
|
-
not?: never;
|
|
112
|
-
and?: never;
|
|
113
|
-
or?: never;
|
|
114
|
-
tag?: never;
|
|
115
|
-
kind?: never;
|
|
116
|
-
};
|
|
117
|
-
type TagEqual<Tag> = Omit<AllNever, 'tag'> & {
|
|
118
|
-
tag: EqualOperator<Tag>;
|
|
119
|
-
};
|
|
120
|
-
declare const isTagEqual: <Tag>(operator: WhereOperator<Tag, any>) => operator is TagEqual<Tag>;
|
|
121
|
-
type KindEqual<Kind> = Omit<AllNever, 'kind'> & {
|
|
122
|
-
kind: EqualOperator<Kind>;
|
|
123
|
-
};
|
|
124
|
-
declare const isKindEqual: <Kind>(operator: WhereOperator<any, Kind>) => operator is KindEqual<Kind>;
|
|
125
|
-
type NotOperator<Tag, Kind> = Omit<AllNever, 'not'> & {
|
|
126
|
-
not: WhereOperator<Tag, Kind>;
|
|
127
|
-
};
|
|
128
|
-
declare const isNotOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is NotOperator<Tag, Kind>;
|
|
129
|
-
type AndOperator<Tag, Kind> = Omit<AllNever, 'and'> & {
|
|
130
|
-
and: NonEmptyArray<WhereOperator<Tag, Kind>>;
|
|
131
|
-
};
|
|
132
|
-
declare const isAndOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is AndOperator<Tag, Kind>;
|
|
133
|
-
type OrOperator<Tag, Kind> = Omit<AllNever, 'or'> & {
|
|
134
|
-
or: NonEmptyArray<WhereOperator<Tag, Kind>>;
|
|
135
|
-
};
|
|
136
|
-
declare const isOrOperator: <Tag, Kind>(operator: WhereOperator<Tag, Kind>) => operator is OrOperator<Tag, Kind>;
|
|
137
|
-
type WhereOperator<Tag, Kind> = TagEqual<Tag> | KindEqual<Kind> | NotOperator<Tag, Kind> | AndOperator<Tag, Kind> | OrOperator<Tag, Kind>;
|
|
138
|
-
type Filterable<FTag extends string = string, FKind extends string = string> = {
|
|
139
|
-
tags?: FTag[] | null;
|
|
140
|
-
kind?: FKind;
|
|
141
|
-
};
|
|
142
|
-
type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
|
|
143
|
-
declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
|
|
144
|
-
|
|
145
|
-
type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
|
|
146
|
-
type GlobalPredicates = NonEmptyArray<ViewRulePredicate>;
|
|
147
|
-
type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>;
|
|
148
|
-
type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
|
|
149
|
-
type GlobalStyles = NonEmptyTuple<ViewRuleStyle>;
|
|
150
|
-
interface ModelGlobals {
|
|
151
|
-
predicates: Record<GlobalPredicateId, GlobalPredicates>;
|
|
152
|
-
dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
|
|
153
|
-
styles: Record<GlobalStyleID, GlobalStyles>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
type ElementNotation = {
|
|
157
|
-
kinds: ElementKind[];
|
|
158
|
-
shape: ElementShape;
|
|
159
|
-
color: Color;
|
|
160
|
-
title: string;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
type ViewID<Id extends string = string> = Tagged<Id, 'ViewID'>;
|
|
164
|
-
type ViewRulePredicate = {
|
|
165
|
-
include: Expression[];
|
|
166
|
-
exclude?: never;
|
|
167
|
-
} | {
|
|
168
|
-
include?: never;
|
|
169
|
-
exclude: Expression[];
|
|
170
|
-
};
|
|
171
|
-
declare function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate;
|
|
172
|
-
interface ViewRuleGlobalPredicateRef {
|
|
173
|
-
predicateId: GlobalPredicateId;
|
|
174
|
-
}
|
|
175
|
-
declare function isViewRuleGlobalPredicateRef(rule: ViewRule): rule is ViewRuleGlobalPredicateRef;
|
|
176
|
-
interface ViewRuleStyle {
|
|
177
|
-
targets: ElementExpression[];
|
|
178
|
-
notation?: string;
|
|
179
|
-
style: ElementStyle & {
|
|
180
|
-
color?: Color;
|
|
181
|
-
shape?: ElementShape;
|
|
182
|
-
icon?: IconUrl;
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
declare function isViewRuleStyle(rule: ViewRule): rule is ViewRuleStyle;
|
|
186
|
-
interface ViewRuleGlobalStyle {
|
|
187
|
-
styleId: GlobalStyleID;
|
|
188
|
-
}
|
|
189
|
-
declare function isViewRuleGlobalStyle(rule: ViewRule): rule is ViewRuleGlobalStyle;
|
|
190
|
-
type ViewRuleStyleOrGlobalRef = ViewRuleStyle | ViewRuleGlobalStyle;
|
|
191
|
-
type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
|
|
192
|
-
declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
|
|
193
|
-
interface ViewRuleAutoLayout {
|
|
194
|
-
direction: AutoLayoutDirection;
|
|
195
|
-
nodeSep?: number;
|
|
196
|
-
rankSep?: number;
|
|
197
|
-
}
|
|
198
|
-
declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
|
|
199
|
-
interface ViewRuleGroup {
|
|
200
|
-
groupRules: Array<ViewRulePredicate | ViewRuleGroup>;
|
|
201
|
-
title: string | null;
|
|
202
|
-
color?: Color;
|
|
203
|
-
border?: BorderStyle;
|
|
204
|
-
opacity?: number;
|
|
205
|
-
}
|
|
206
|
-
declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
|
|
207
|
-
type ViewRule = ViewRulePredicate | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
|
|
208
|
-
interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
|
|
209
|
-
readonly __?: ViewType;
|
|
210
|
-
readonly id: ViewID<ViewIDs>;
|
|
211
|
-
readonly title: string | null;
|
|
212
|
-
readonly description: string | null;
|
|
213
|
-
readonly tags: NonEmptyArray<Tag<Tags>> | null;
|
|
214
|
-
readonly links: NonEmptyArray<Link> | null;
|
|
215
|
-
/**
|
|
216
|
-
* URI to the source file of this view.
|
|
217
|
-
* Undefined if the view is auto-generated.
|
|
218
|
-
*/
|
|
219
|
-
readonly docUri?: string;
|
|
220
|
-
/**
|
|
221
|
-
* For all views we find common ancestor path.
|
|
222
|
-
* This is used to generate relative paths, i.e.:
|
|
223
|
-
* - "/home/project/index.c4" becomes "index.c4"
|
|
224
|
-
* - "/home/project/subdir/views.c4" becomes "subdir/views.c4"
|
|
225
|
-
*
|
|
226
|
-
* Undefined if the view is auto-generated.
|
|
227
|
-
*/
|
|
228
|
-
readonly relativePath?: string;
|
|
229
|
-
/**
|
|
230
|
-
* If the view is changed manually this field contains the layout data.
|
|
231
|
-
*/
|
|
232
|
-
readonly manualLayout?: ViewManualLayout | undefined;
|
|
233
|
-
readonly customColorDefinitions: CustomColorDefinitions;
|
|
234
|
-
}
|
|
235
|
-
interface BasicElementView<ViewIDs extends string, Tags extends string> extends BasicView<'element', ViewIDs, Tags> {
|
|
236
|
-
readonly viewOf?: Fqn;
|
|
237
|
-
readonly rules: ViewRule[];
|
|
238
|
-
}
|
|
239
|
-
interface ScopedElementView<ViewIDs extends string, Tags extends string> extends BasicElementView<ViewIDs, Tags> {
|
|
240
|
-
readonly viewOf: Fqn;
|
|
241
|
-
}
|
|
242
|
-
interface ExtendsElementView<ViewIDs extends string, Tags extends string> extends BasicElementView<ViewIDs, Tags> {
|
|
243
|
-
readonly extends: ViewID<ViewIDs>;
|
|
244
|
-
}
|
|
245
|
-
type ElementView<ViewIDs extends string = string, Tags extends string = string> = ScopedElementView<ViewIDs, Tags> | ExtendsElementView<ViewIDs, Tags> | BasicElementView<ViewIDs, Tags>;
|
|
246
|
-
interface DynamicViewStep {
|
|
247
|
-
readonly source: Fqn;
|
|
248
|
-
readonly target: Fqn;
|
|
249
|
-
readonly title: string | null;
|
|
250
|
-
readonly description?: string;
|
|
251
|
-
readonly technology?: string;
|
|
252
|
-
readonly notation?: string;
|
|
253
|
-
readonly notes?: string;
|
|
254
|
-
readonly color?: Color;
|
|
255
|
-
readonly line?: RelationshipLineType;
|
|
256
|
-
readonly head?: RelationshipArrowType;
|
|
257
|
-
readonly tail?: RelationshipArrowType;
|
|
258
|
-
readonly isBackward?: boolean;
|
|
259
|
-
readonly navigateTo?: ViewID;
|
|
260
|
-
__parallel?: never;
|
|
261
|
-
}
|
|
262
|
-
interface DynamicViewParallelSteps {
|
|
263
|
-
readonly __parallel: DynamicViewStep[];
|
|
264
|
-
}
|
|
265
|
-
type DynamicViewStepOrParallel = DynamicViewStep | DynamicViewParallelSteps;
|
|
266
|
-
type DynamicViewIncludeRule = {
|
|
267
|
-
include: ElementPredicateExpression[];
|
|
268
|
-
};
|
|
269
|
-
declare function isDynamicViewIncludeRule(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
|
|
270
|
-
type DynamicViewRule = DynamicViewIncludeRule | ViewRuleGlobalPredicateRef | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
|
|
271
|
-
interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'dynamic', ViewIDs, Tags> {
|
|
272
|
-
readonly __: 'dynamic';
|
|
273
|
-
readonly steps: DynamicViewStepOrParallel[];
|
|
274
|
-
readonly rules: DynamicViewRule[];
|
|
275
|
-
}
|
|
276
|
-
declare function isDynamicViewParallelSteps(step: DynamicViewStepOrParallel): step is DynamicViewParallelSteps;
|
|
277
|
-
type CustomColorDefinitions = {
|
|
278
|
-
[key: string]: ThemeColorValues;
|
|
279
|
-
};
|
|
280
|
-
type LikeC4View<ViewIDs extends string = string, Tags extends string = string> = ElementView<ViewIDs, Tags> | DynamicView<ViewIDs, Tags>;
|
|
281
|
-
declare function isDynamicView(view: LikeC4View): view is DynamicView;
|
|
282
|
-
declare function isElementView(view: LikeC4View): view is ElementView;
|
|
283
|
-
declare function isExtendsElementView(view: LikeC4View): view is ExtendsElementView<string, string>;
|
|
284
|
-
declare function isScopedElementView(view: LikeC4View): view is ScopedElementView<string, string>;
|
|
285
|
-
type NodeId<IDs extends string = string> = Tagged<IDs, 'Fqn'>;
|
|
286
|
-
type EdgeId = Tagged<string, 'EdgeId'>;
|
|
287
|
-
type StepEdgeIdLiteral = `step-${number}` | `step-${number}.${number}`;
|
|
288
|
-
type StepEdgeId = Tagged<StepEdgeIdLiteral, 'EdgeId'>;
|
|
289
|
-
declare function StepEdgeId(step: number, parallelStep?: number): StepEdgeId;
|
|
290
|
-
declare function isStepEdgeId(id: string): id is StepEdgeId;
|
|
291
|
-
declare function extractStep(id: EdgeId): number;
|
|
292
|
-
declare function getParallelStepsPrefix(id: string): string | null;
|
|
293
|
-
interface ComputedNode {
|
|
294
|
-
id: NodeId;
|
|
295
|
-
kind: ElementKind;
|
|
296
|
-
parent: NodeId | null;
|
|
297
|
-
title: string;
|
|
298
|
-
description: string | null;
|
|
299
|
-
technology: string | null;
|
|
300
|
-
notation?: string;
|
|
301
|
-
tags: NonEmptyArray<Tag> | null;
|
|
302
|
-
links: NonEmptyArray<Link> | null;
|
|
303
|
-
children: NodeId[];
|
|
304
|
-
inEdges: EdgeId[];
|
|
305
|
-
outEdges: EdgeId[];
|
|
306
|
-
shape: ElementShape;
|
|
307
|
-
/**
|
|
308
|
-
* @deprecated Use `style` instead
|
|
309
|
-
*/
|
|
310
|
-
color: Color;
|
|
311
|
-
/**
|
|
312
|
-
* @deprecated Use `style` instead
|
|
313
|
-
*/
|
|
314
|
-
icon?: IconUrl;
|
|
315
|
-
style: ElementStyle;
|
|
316
|
-
navigateTo?: ViewID;
|
|
317
|
-
level: number;
|
|
318
|
-
depth?: number;
|
|
319
|
-
/**
|
|
320
|
-
* If this node was customized in the view
|
|
321
|
-
*/
|
|
322
|
-
isCustomized?: boolean;
|
|
323
|
-
}
|
|
324
|
-
declare namespace ComputedNode {
|
|
325
|
-
/**
|
|
326
|
-
* Nodes group is a special kind of node, exisiting only in view
|
|
327
|
-
*/
|
|
328
|
-
function isNodesGroup(node: ComputedNode): boolean;
|
|
329
|
-
}
|
|
330
|
-
interface ComputedEdge {
|
|
331
|
-
id: EdgeId;
|
|
332
|
-
parent: NodeId | null;
|
|
333
|
-
source: NodeId;
|
|
334
|
-
target: NodeId;
|
|
335
|
-
label: string | null;
|
|
336
|
-
description?: string;
|
|
337
|
-
technology?: string;
|
|
338
|
-
relations: RelationID[];
|
|
339
|
-
kind?: RelationshipKind;
|
|
340
|
-
notation?: string;
|
|
341
|
-
notes?: string;
|
|
342
|
-
color?: Color;
|
|
343
|
-
line?: RelationshipLineType;
|
|
344
|
-
head?: RelationshipArrowType;
|
|
345
|
-
tail?: RelationshipArrowType;
|
|
346
|
-
tags?: NonEmptyArray<Tag>;
|
|
347
|
-
navigateTo?: ViewID;
|
|
348
|
-
/**
|
|
349
|
-
* If this edge is derived from custom relationship predicate
|
|
350
|
-
*/
|
|
351
|
-
isCustomized?: boolean;
|
|
352
|
-
/**
|
|
353
|
-
* For layouting purposes
|
|
354
|
-
* @default 'forward'
|
|
355
|
-
*/
|
|
356
|
-
dir?: 'forward' | 'back';
|
|
357
|
-
}
|
|
358
|
-
interface ViewWithHash {
|
|
359
|
-
/**
|
|
360
|
-
* Hash of the view object.
|
|
361
|
-
* This is used to detect changes in layout
|
|
362
|
-
*/
|
|
363
|
-
hash: string;
|
|
364
|
-
}
|
|
365
|
-
interface ViewWithNotation {
|
|
366
|
-
notation?: {
|
|
367
|
-
elements: ElementNotation[];
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
interface ViewAutoLayout {
|
|
371
|
-
direction: ViewRuleAutoLayout['direction'];
|
|
372
|
-
rankSep?: number;
|
|
373
|
-
nodeSep?: number;
|
|
374
|
-
}
|
|
375
|
-
interface ComputedElementView<ViewIDs extends string = string, Tags extends string = string> extends Omit<ElementView<ViewIDs, Tags>, 'rules' | 'docUri'>, ViewWithHash, ViewWithNotation {
|
|
376
|
-
readonly extends?: ViewID<ViewIDs>;
|
|
377
|
-
readonly autoLayout: ViewAutoLayout;
|
|
378
|
-
readonly nodes: ComputedNode[];
|
|
379
|
-
readonly edges: ComputedEdge[];
|
|
380
|
-
rules?: never;
|
|
381
|
-
docUri?: never;
|
|
382
|
-
}
|
|
383
|
-
interface ComputedDynamicView<ViewIDs extends string = string, Tags extends string = string> extends Omit<DynamicView<ViewIDs, Tags>, 'rules' | 'steps' | 'docUri'>, ViewWithHash, ViewWithNotation {
|
|
384
|
-
readonly autoLayout: ViewAutoLayout;
|
|
385
|
-
readonly nodes: ComputedNode[];
|
|
386
|
-
readonly edges: ComputedEdge[];
|
|
387
|
-
steps?: never;
|
|
388
|
-
rules?: never;
|
|
389
|
-
docUri?: never;
|
|
390
|
-
}
|
|
391
|
-
declare function isComputedDynamicView(view: ComputedView): view is ComputedDynamicView;
|
|
392
|
-
type ComputedView<ViewIDs extends string = string, Tags extends string = string> = ComputedElementView<ViewIDs, Tags> | ComputedDynamicView<ViewIDs, Tags>;
|
|
393
|
-
declare function isComputedElementView(view: ComputedView): view is ComputedElementView;
|
|
394
|
-
type BBox = {
|
|
395
|
-
x: number;
|
|
396
|
-
y: number;
|
|
397
|
-
width: number;
|
|
398
|
-
height: number;
|
|
399
|
-
};
|
|
400
|
-
declare function getBBoxCenter({ x, y, width, height }: BBox): XYPoint;
|
|
401
|
-
interface DiagramNode extends ComputedNode {
|
|
402
|
-
width: number;
|
|
403
|
-
height: number;
|
|
404
|
-
position: Point;
|
|
405
|
-
labelBBox: BBox;
|
|
406
|
-
}
|
|
407
|
-
declare namespace DiagramNode {
|
|
408
|
-
/**
|
|
409
|
-
* Nodes group is a special kind of node, exisiting only in view
|
|
410
|
-
*/
|
|
411
|
-
function isNodesGroup(node: DiagramNode): boolean;
|
|
412
|
-
}
|
|
413
|
-
interface DiagramEdge extends ComputedEdge {
|
|
414
|
-
points: NonEmptyArray<Point>;
|
|
415
|
-
controlPoints?: NonEmptyArray<XYPoint>;
|
|
416
|
-
labelBBox?: BBox | null;
|
|
417
|
-
dotpos?: string;
|
|
418
|
-
}
|
|
419
|
-
interface DiagramView<ViewIDs extends string = string, Tags extends string = string> extends Omit<ComputedView<ViewIDs, Tags>, 'nodes' | 'edges' | 'manualLayout'> {
|
|
420
|
-
readonly nodes: DiagramNode[];
|
|
421
|
-
readonly edges: DiagramEdge[];
|
|
422
|
-
readonly bounds: BBox;
|
|
423
|
-
/**
|
|
424
|
-
* If diagram has manual layout
|
|
425
|
-
* But was changed and layout should be recalculated
|
|
426
|
-
*/
|
|
427
|
-
hasLayoutDrift?: boolean;
|
|
428
|
-
manualLayout?: never;
|
|
429
|
-
}
|
|
430
|
-
type ViewManualLayout = {
|
|
431
|
-
readonly hash: string;
|
|
432
|
-
readonly x: number;
|
|
433
|
-
readonly y: number;
|
|
434
|
-
readonly width: number;
|
|
435
|
-
readonly height: number;
|
|
436
|
-
readonly autoLayout: ViewAutoLayout;
|
|
437
|
-
readonly nodes: Record<string, {
|
|
438
|
-
isCompound: boolean;
|
|
439
|
-
x: number;
|
|
440
|
-
y: number;
|
|
441
|
-
width: number;
|
|
442
|
-
height: number;
|
|
443
|
-
}>;
|
|
444
|
-
readonly edges: Record<string, {
|
|
445
|
-
dotpos?: string;
|
|
446
|
-
points: NonEmptyArray<Point>;
|
|
447
|
-
controlPoints?: NonEmptyArray<XYPoint>;
|
|
448
|
-
labelBBox?: BBox;
|
|
449
|
-
}>;
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
type RelationID = Tagged<string, 'RelationID'>;
|
|
453
|
-
type RelationshipKind<Kinds extends string = string> = Tagged<Kinds, 'RelationshipKind'>;
|
|
454
|
-
type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
|
|
455
|
-
type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'dot' | 'odot' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
|
|
456
|
-
declare const DefaultLineStyle = "dashed";
|
|
457
|
-
declare const DefaultArrowType = "normal";
|
|
458
|
-
declare const DefaultRelationshipColor = "gray";
|
|
459
|
-
interface Relation {
|
|
460
|
-
readonly id: RelationID;
|
|
461
|
-
readonly source: Fqn;
|
|
462
|
-
readonly target: Fqn;
|
|
463
|
-
readonly title: string;
|
|
464
|
-
readonly description?: string;
|
|
465
|
-
readonly technology?: string;
|
|
466
|
-
readonly tags?: NonEmptyArray<Tag>;
|
|
467
|
-
readonly kind?: RelationshipKind;
|
|
468
|
-
readonly color?: Color;
|
|
469
|
-
readonly line?: RelationshipLineType;
|
|
470
|
-
readonly head?: RelationshipArrowType;
|
|
471
|
-
readonly tail?: RelationshipArrowType;
|
|
472
|
-
readonly links?: NonEmptyArray<Link>;
|
|
473
|
-
readonly navigateTo?: ViewID;
|
|
474
|
-
readonly metadata?: {
|
|
475
|
-
[key: string]: string;
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
interface RelationshipKindSpecification {
|
|
479
|
-
readonly technology?: string;
|
|
480
|
-
readonly notation?: string;
|
|
481
|
-
readonly color?: Color;
|
|
482
|
-
readonly line?: RelationshipLineType;
|
|
483
|
-
readonly head?: RelationshipArrowType;
|
|
484
|
-
readonly tail?: RelationshipArrowType;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
interface BaseExpr {
|
|
488
|
-
where?: never;
|
|
489
|
-
element?: never;
|
|
490
|
-
custom?: never;
|
|
491
|
-
expanded?: never;
|
|
492
|
-
elementKind?: never;
|
|
493
|
-
elementTag?: never;
|
|
494
|
-
isEqual?: never;
|
|
495
|
-
isDescedants?: never;
|
|
496
|
-
wildcard?: never;
|
|
497
|
-
source?: never;
|
|
498
|
-
target?: never;
|
|
499
|
-
inout?: never;
|
|
500
|
-
incoming?: never;
|
|
501
|
-
outgoing?: never;
|
|
502
|
-
customRelation?: never;
|
|
503
|
-
}
|
|
504
|
-
interface ElementRefExpr extends Omit<BaseExpr, 'element' | 'isDescedants'> {
|
|
505
|
-
element: Fqn;
|
|
506
|
-
isDescedants?: boolean;
|
|
507
|
-
}
|
|
508
|
-
declare function isElementRef(expr: Expression): expr is ElementRefExpr;
|
|
509
|
-
interface ExpandedElementExpr extends Omit<BaseExpr, 'expanded'> {
|
|
510
|
-
expanded: Fqn;
|
|
511
|
-
}
|
|
512
|
-
declare function isExpandedElementExpr(expr: Expression): expr is ExpandedElementExpr;
|
|
513
|
-
interface CustomElementExpr extends Omit<BaseExpr, 'custom'> {
|
|
514
|
-
custom: {
|
|
515
|
-
expr: ElementExpression | ElementWhereExpr;
|
|
516
|
-
title?: string;
|
|
517
|
-
description?: string;
|
|
518
|
-
technology?: string;
|
|
519
|
-
notation?: string;
|
|
520
|
-
shape?: ElementShape;
|
|
521
|
-
color?: Color;
|
|
522
|
-
icon?: IconUrl;
|
|
523
|
-
border?: BorderStyle;
|
|
524
|
-
opacity?: number;
|
|
525
|
-
navigateTo?: ViewID;
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
declare function isCustomElement(expr: Expression): expr is CustomElementExpr;
|
|
529
|
-
interface WildcardExpr extends Omit<BaseExpr, 'wildcard'> {
|
|
530
|
-
wildcard: true;
|
|
531
|
-
}
|
|
532
|
-
declare function isWildcard(expr: Expression): expr is WildcardExpr;
|
|
533
|
-
interface ElementKindExpr extends Omit<BaseExpr, 'elementKind' | 'isEqual'> {
|
|
534
|
-
elementKind: ElementKind;
|
|
535
|
-
isEqual: boolean;
|
|
536
|
-
}
|
|
537
|
-
declare function isElementKindExpr(expr: Expression): expr is ElementKindExpr;
|
|
538
|
-
interface ElementTagExpr extends Omit<BaseExpr, 'elementTag' | 'isEqual'> {
|
|
539
|
-
elementTag: Tag;
|
|
540
|
-
isEqual: boolean;
|
|
541
|
-
}
|
|
542
|
-
declare function isElementTagExpr(expr: Expression): expr is ElementTagExpr;
|
|
543
|
-
type ElementExpression = ElementRefExpr | WildcardExpr | ElementKindExpr | ElementTagExpr | ExpandedElementExpr;
|
|
544
|
-
declare function isElement(expr: Expression): expr is ElementExpression;
|
|
545
|
-
interface ElementWhereExpr extends Omit<BaseExpr, 'where'> {
|
|
546
|
-
where: {
|
|
547
|
-
expr: ElementExpression;
|
|
548
|
-
condition: WhereOperator<string, string>;
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
declare function isElementWhere(expr: Expression): expr is ElementWhereExpr;
|
|
552
|
-
type ElementPredicateExpression = ElementExpression | ElementWhereExpr | CustomElementExpr;
|
|
553
|
-
declare function isElementPredicateExpr(expr: Expression): expr is ElementPredicateExpression;
|
|
554
|
-
interface RelationExpr extends Omit<BaseExpr, 'source' | 'target'> {
|
|
555
|
-
source: ElementExpression;
|
|
556
|
-
target: ElementExpression;
|
|
557
|
-
isBidirectional?: boolean;
|
|
558
|
-
}
|
|
559
|
-
declare function isRelation(expr: Expression): expr is RelationExpr;
|
|
560
|
-
interface InOutExpr extends Omit<BaseExpr, 'inout'> {
|
|
561
|
-
inout: ElementExpression;
|
|
562
|
-
}
|
|
563
|
-
declare function isInOut(expr: Expression): expr is InOutExpr;
|
|
564
|
-
interface IncomingExpr extends Omit<BaseExpr, 'incoming'> {
|
|
565
|
-
incoming: ElementExpression;
|
|
566
|
-
}
|
|
567
|
-
declare function isIncoming(expr: Expression): expr is IncomingExpr;
|
|
568
|
-
interface OutgoingExpr extends Omit<BaseExpr, 'outgoing'> {
|
|
569
|
-
outgoing: ElementExpression;
|
|
570
|
-
}
|
|
571
|
-
declare function isOutgoing(expr: Expression): expr is OutgoingExpr;
|
|
572
|
-
type RelationExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
|
|
573
|
-
declare function isRelationExpression(expr: Expression): expr is RelationExpression;
|
|
574
|
-
interface RelationWhereExpr extends Omit<BaseExpr, 'where'> {
|
|
575
|
-
where: {
|
|
576
|
-
expr: RelationExpression;
|
|
577
|
-
condition: WhereOperator<string, string>;
|
|
578
|
-
};
|
|
579
|
-
}
|
|
580
|
-
declare function isRelationWhere(expr: Expression): expr is RelationWhereExpr;
|
|
581
|
-
interface CustomRelationExpr extends Omit<BaseExpr, 'customRelation'> {
|
|
582
|
-
customRelation: {
|
|
583
|
-
relation: RelationExpression | RelationWhereExpr;
|
|
584
|
-
title?: string;
|
|
585
|
-
description?: string;
|
|
586
|
-
technology?: string;
|
|
587
|
-
notation?: string;
|
|
588
|
-
navigateTo?: ViewID;
|
|
589
|
-
notes?: string;
|
|
590
|
-
color?: Color;
|
|
591
|
-
line?: RelationshipLineType;
|
|
592
|
-
head?: RelationshipArrowType;
|
|
593
|
-
tail?: RelationshipArrowType;
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
declare function isCustomRelationExpr(expr: Expression): expr is CustomRelationExpr;
|
|
597
|
-
type RelationPredicateExpression = RelationExpression | RelationWhereExpr | CustomRelationExpr;
|
|
598
|
-
declare function isRelationPredicateExpr(expr: Expression): expr is RelationPredicateExpression;
|
|
599
|
-
type Expression = ElementPredicateExpression | RelationPredicateExpression;
|
|
600
|
-
|
|
601
|
-
type expression_CustomElementExpr = CustomElementExpr;
|
|
602
|
-
type expression_CustomRelationExpr = CustomRelationExpr;
|
|
603
|
-
type expression_ElementExpression = ElementExpression;
|
|
604
|
-
type expression_ElementKindExpr = ElementKindExpr;
|
|
605
|
-
type expression_ElementPredicateExpression = ElementPredicateExpression;
|
|
606
|
-
type expression_ElementRefExpr = ElementRefExpr;
|
|
607
|
-
type expression_ElementTagExpr = ElementTagExpr;
|
|
608
|
-
type expression_ElementWhereExpr = ElementWhereExpr;
|
|
609
|
-
type expression_ExpandedElementExpr = ExpandedElementExpr;
|
|
610
|
-
type expression_Expression = Expression;
|
|
611
|
-
type expression_InOutExpr = InOutExpr;
|
|
612
|
-
type expression_IncomingExpr = IncomingExpr;
|
|
613
|
-
type expression_OutgoingExpr = OutgoingExpr;
|
|
614
|
-
type expression_RelationExpr = RelationExpr;
|
|
615
|
-
type expression_RelationExpression = RelationExpression;
|
|
616
|
-
type expression_RelationPredicateExpression = RelationPredicateExpression;
|
|
617
|
-
type expression_RelationWhereExpr = RelationWhereExpr;
|
|
618
|
-
type expression_WildcardExpr = WildcardExpr;
|
|
619
|
-
declare const expression_isCustomElement: typeof isCustomElement;
|
|
620
|
-
declare const expression_isCustomRelationExpr: typeof isCustomRelationExpr;
|
|
621
|
-
declare const expression_isElement: typeof isElement;
|
|
622
|
-
declare const expression_isElementKindExpr: typeof isElementKindExpr;
|
|
623
|
-
declare const expression_isElementPredicateExpr: typeof isElementPredicateExpr;
|
|
624
|
-
declare const expression_isElementRef: typeof isElementRef;
|
|
625
|
-
declare const expression_isElementTagExpr: typeof isElementTagExpr;
|
|
626
|
-
declare const expression_isElementWhere: typeof isElementWhere;
|
|
627
|
-
declare const expression_isExpandedElementExpr: typeof isExpandedElementExpr;
|
|
628
|
-
declare const expression_isInOut: typeof isInOut;
|
|
629
|
-
declare const expression_isIncoming: typeof isIncoming;
|
|
630
|
-
declare const expression_isOutgoing: typeof isOutgoing;
|
|
631
|
-
declare const expression_isRelation: typeof isRelation;
|
|
632
|
-
declare const expression_isRelationExpression: typeof isRelationExpression;
|
|
633
|
-
declare const expression_isRelationPredicateExpr: typeof isRelationPredicateExpr;
|
|
634
|
-
declare const expression_isRelationWhere: typeof isRelationWhere;
|
|
635
|
-
declare const expression_isWildcard: typeof isWildcard;
|
|
636
|
-
declare namespace expression {
|
|
637
|
-
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 expression_OutgoingExpr as OutgoingExpr, type expression_RelationExpr as RelationExpr, 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 };
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* Parsed elements, relations, and views.
|
|
642
|
-
*/
|
|
643
|
-
interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds extends string = string, Tags extends string = string, Fqns extends string = string, Views extends string = string> {
|
|
644
|
-
specification: {
|
|
645
|
-
tags: Tag<Tags>[];
|
|
646
|
-
elements: Record<ElementKinds, ElementKindSpecification>;
|
|
647
|
-
relationships: Record<RelationKinds, RelationshipKindSpecification>;
|
|
648
|
-
};
|
|
649
|
-
elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
|
|
650
|
-
relations: Record<RelationID, Relation>;
|
|
651
|
-
globals: ModelGlobals;
|
|
652
|
-
views: Record<Views, LikeC4View<Views, Tags>>;
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* Same as `ParsedLikeC4Model` but with computed views.
|
|
656
|
-
*/
|
|
657
|
-
interface ComputedLikeC4Model extends Omit<ParsedLikeC4Model, 'views'> {
|
|
658
|
-
__?: never;
|
|
659
|
-
views: Record<ViewID, ComputedView>;
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* Same as `ParsedLikeC4Model` but with layouted views (DiagramView)
|
|
663
|
-
*/
|
|
664
|
-
interface LayoutedLikeC4Model extends Omit<ParsedLikeC4Model, 'views'> {
|
|
665
|
-
__: 'layouted';
|
|
666
|
-
views: Record<ViewID, DiagramView>;
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* OverviewGraph is a graph representation of all views in a model
|
|
671
|
-
*/
|
|
672
|
-
declare namespace OverviewGraph {
|
|
673
|
-
type Node = {
|
|
674
|
-
id: string;
|
|
675
|
-
type: 'folder' | 'file';
|
|
676
|
-
path: string;
|
|
677
|
-
label: string;
|
|
678
|
-
parentId: string | null;
|
|
679
|
-
position: XYPoint;
|
|
680
|
-
width: number;
|
|
681
|
-
height: number;
|
|
682
|
-
} | {
|
|
683
|
-
id: string;
|
|
684
|
-
type: 'view';
|
|
685
|
-
viewId: ViewID;
|
|
686
|
-
label: string;
|
|
687
|
-
parentId: string | null;
|
|
688
|
-
position: XYPoint;
|
|
689
|
-
width: number;
|
|
690
|
-
height: number;
|
|
691
|
-
};
|
|
692
|
-
/**
|
|
693
|
-
* Edge represents a navigational link from one view to another
|
|
694
|
-
*/
|
|
695
|
-
type Edge = {
|
|
696
|
-
id: string;
|
|
697
|
-
source: string;
|
|
698
|
-
target: string;
|
|
699
|
-
points: NonEmptyArray<Point>;
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
interface OverviewGraph {
|
|
703
|
-
nodes: OverviewGraph.Node[];
|
|
704
|
-
edges: OverviewGraph.Edge[];
|
|
705
|
-
bounds: BBox;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
declare namespace ViewChange {
|
|
709
|
-
interface ChangeElementStyle {
|
|
710
|
-
op: 'change-element-style';
|
|
711
|
-
style: {
|
|
712
|
-
border?: BorderStyle;
|
|
713
|
-
opacity?: number;
|
|
714
|
-
shape?: ElementShape;
|
|
715
|
-
color?: ThemeColor;
|
|
716
|
-
};
|
|
717
|
-
targets: NonEmptyArray<Fqn>;
|
|
718
|
-
}
|
|
719
|
-
interface SaveManualLayout {
|
|
720
|
-
op: 'save-manual-layout';
|
|
721
|
-
layout: ViewManualLayout;
|
|
722
|
-
}
|
|
723
|
-
interface ChangeAutoLayout {
|
|
724
|
-
op: 'change-autolayout';
|
|
725
|
-
layout: {
|
|
726
|
-
direction: AutoLayoutDirection;
|
|
727
|
-
nodeSep?: number | null;
|
|
728
|
-
rankSep?: number | null;
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
|
|
733
|
-
|
|
734
|
-
export { type ExpandedElementExpr as $, type AutoLayoutDirection as A, type BorderStyle as B, type Color as C, type DiagramView as D, type ElementKindSpecification as E, type Fqn as F, AsFqn as G, type HexColorLiteral as H, type IconUrl as I, BorderStyles as J, ElementShapes as K, type LikeC4View as L, DefaultThemeColor as M, type NonEmptyArray as N, DefaultElementShape as O, type ParsedLikeC4Model as P, type ElementStyle as Q, type RelationshipKindSpecification as R, type TagSpec as S, type ThemeColorValues as T, type Link as U, type ViewRuleStyle as V, type TypedElement as W, type XYPoint as X, type ElementKindSpecificationStyle as Y, type ElementRefExpr as Z, isElementRef as _, type ElementShape as a, type ViewRuleGlobalPredicateRef as a$, isExpandedElementExpr as a0, isCustomElement as a1, type WildcardExpr as a2, isWildcard as a3, type ElementKindExpr as a4, isElementKindExpr as a5, type ElementTagExpr as a6, isElementTagExpr as a7, type ElementExpression as a8, isElement as a9, type TagEqual as aA, isTagEqual as aB, type KindEqual as aC, isKindEqual as aD, type NotOperator as aE, isNotOperator as aF, type AndOperator as aG, isAndOperator as aH, type OrOperator as aI, isOrOperator as aJ, type WhereOperator as aK, type Filterable as aL, whereOperatorAsPredicate as aM, OverviewGraph as aN, DefaultLineStyle as aO, DefaultArrowType as aP, DefaultRelationshipColor as aQ, type ThemeColor as aR, type ColorLiteral as aS, isThemeColor as aT, type ElementThemeColorValues as aU, type ElementThemeColors as aV, type RelationshipThemeColorValues as aW, type RelationshipThemeColors as aX, type LikeC4Theme as aY, type ViewRulePredicate as aZ, isViewRulePredicate as a_, type ElementWhereExpr as aa, isElementWhere as ab, type ElementPredicateExpression as ac, isElementPredicateExpr as ad, type RelationExpr as ae, isRelation as af, type InOutExpr as ag, isInOut as ah, type IncomingExpr as ai, isIncoming as aj, type OutgoingExpr as ak, isOutgoing as al, type RelationExpression as am, isRelationExpression as an, type RelationWhereExpr as ao, isRelationWhere as ap, isCustomRelationExpr as aq, type RelationPredicateExpression as ar, isRelationPredicateExpr as as, type GlobalPredicateId as at, type GlobalPredicates as au, type GlobalDynamicPredicates as av, type GlobalStyleID as aw, type GlobalStyles as ax, type ModelGlobals as ay, type EqualOperator as az, type RelationshipArrowType as b, isViewRuleGlobalPredicateRef as b0, isViewRuleStyle as b1, type ViewRuleGlobalStyle as b2, isViewRuleGlobalStyle as b3, type ViewRuleStyleOrGlobalRef as b4, isAutoLayoutDirection as b5, type ViewRuleAutoLayout as b6, isViewRuleAutoLayout as b7, type ViewRuleGroup as b8, isViewRuleGroup as b9, type ViewAutoLayout as bA, type ComputedElementView as bB, type ComputedDynamicView as bC, isComputedDynamicView as bD, isComputedElementView as bE, type BBox as bF, getBBoxCenter as bG, type ViewManualLayout as bH, ViewChange as bI, type ElementNotation as bJ, type ViewRule as ba, type BasicView as bb, type BasicElementView as bc, type ScopedElementView as bd, type ExtendsElementView as be, type ElementView as bf, type DynamicViewStep as bg, type DynamicViewParallelSteps as bh, type DynamicViewStepOrParallel as bi, type DynamicViewIncludeRule as bj, isDynamicViewIncludeRule as bk, type DynamicViewRule as bl, type DynamicView as bm, isDynamicViewParallelSteps as bn, type CustomColorDefinitions as bo, isDynamicView as bp, isElementView as bq, isExtendsElementView as br, isScopedElementView as bs, type StepEdgeIdLiteral as bt, StepEdgeId as bu, isStepEdgeId as bv, extractStep as bw, getParallelStepsPrefix as bx, type ViewWithHash as by, type ViewWithNotation as bz, type RelationshipLineType as c, type Element as d, type Relation as e, type Expression as f, type CustomElementExpr as g, type CustomRelationExpr as h, type RelationID as i, type ViewID as j, type EdgeId as k, type ComputedView as l, type Tag as m, ComputedNode as n, type NodeId as o, ElementKind as p, type ComputedEdge as q, type ComputedLikeC4Model as r, type LayoutedLikeC4Model as s, type RelationshipKind as t, DiagramNode as u, type DiagramEdge as v, expression as w, type NonEmptyReadonlyArray as x, type CustomColor as y, type Point as z };
|