@likec4/core 1.41.0 → 1.42.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/builder/package.json +4 -0
- package/compute-view/package.json +4 -0
- package/compute-view/relationships/package.json +4 -0
- package/dist/builder/index.d.mts +13 -11
- package/dist/builder/index.mjs +111 -91
- package/dist/compute-view/index.d.mts +8 -7
- package/dist/compute-view/index.mjs +14 -11
- package/dist/compute-view/relationships-view/index.d.mts +9 -8
- package/dist/compute-view/relationships-view/index.mjs +6 -6
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +11 -11
- package/dist/model/connection/deployment/index.d.mts +11 -10
- package/dist/model/connection/deployment/index.mjs +2 -2
- package/dist/model/connection/index.d.mts +12 -11
- package/dist/model/connection/index.mjs +3 -3
- package/dist/model/connection/model/index.d.mts +11 -10
- package/dist/model/connection/model/index.mjs +2 -2
- package/dist/model/index.d.mts +14 -14
- package/dist/model/index.mjs +4 -5
- package/dist/shared/{core.Ae86Y3tB.mjs → core.01VTr9qu.mjs} +8 -26
- package/dist/shared/core.1vX5a9AY.mjs +86 -0
- package/dist/shared/{core.BVNaR17u.mjs → core.B7KhhkRY.mjs} +1 -1
- package/dist/shared/core.B85MJLTf.mjs +5 -0
- package/dist/shared/{core.DA5vzwZ9.mjs → core.BIqHjQiH.mjs} +56 -42
- package/dist/shared/core.BKlholso.mjs +3 -0
- package/dist/shared/core.BR4zXDH-.mjs +13 -0
- package/dist/shared/{core.CXy1NLUG.mjs → core.BYNkXQ8A.mjs} +21 -12
- package/dist/shared/{core.BuoXfSMj.mjs → core.BbE4y-yl.mjs} +1 -1
- package/dist/shared/core.BoYfZOBm.mjs +3 -0
- package/dist/shared/core.BsSXS-_R.mjs +7 -0
- package/dist/shared/{core.DJp8fgok.mjs → core.BzTakU3I.mjs} +14 -10
- package/dist/shared/{core.4u1dVmfX.mjs → core.C2TiyjI6.mjs} +2 -2
- package/dist/shared/{core.DLpidoWc.mjs → core.C3JowhaZ.mjs} +3 -3
- package/dist/shared/{core.CNGyqkJh.mjs → core.C4x8aaWa.mjs} +3 -1
- package/dist/shared/{core.BB6zA-UU.mjs → core.C8YY6Uub.mjs} +38 -9
- package/dist/shared/{core.Asc11Mjy.mjs → core.C8sl5Y8Z.mjs} +122 -58
- package/dist/shared/{core.BvMRMo7Z.mjs → core.CNgZvKb8.mjs} +3 -5198
- package/dist/shared/{core.CUG6vpyL.d.mts → core.CQngdcuj.d.mts} +85 -4
- package/dist/shared/{core.Be1n9a0i.mjs → core.C_Ni6yHl.mjs} +5 -4
- package/dist/shared/core.CbT8JVYL.mjs +5 -0
- package/dist/shared/core.CqAJJpK_.mjs +3 -0
- package/dist/shared/{core.BXsxn-hf.d.mts → core.D0PjZzIS.d.mts} +27 -15
- package/dist/shared/{core.DgesAwC8.d.mts → core.D5fzJWbF.d.mts} +2 -2
- package/dist/shared/{core.hfOE3RfK.d.mts → core.DACpKp35.d.mts} +5 -5
- package/dist/shared/core.DFi2dOTl.mjs +39548 -0
- package/dist/shared/{core.xSQO0XYD.d.mts → core.DIol3syK.d.mts} +2 -2
- package/dist/shared/{core.DlG1xWt2.mjs → core.DMMOWQqc.mjs} +3 -2
- package/dist/shared/core.DNbUPnve.mjs +3990 -0
- package/dist/shared/{core.CCD1ID81.mjs → core.DRJma0Ol.mjs} +4 -3
- package/dist/shared/{core.DgttqsJc.mjs → core.DRhg-gVU.mjs} +9 -9
- package/dist/shared/core.DSO_rTC2.mjs +5322 -0
- package/dist/shared/{core.FUPplpae.d.mts → core.D_vkffV4.d.mts} +4 -2
- package/dist/shared/core.DdMJk7nx.d.mts +476 -0
- package/dist/shared/{core.BhpgpOep.d.mts → core.Dgs6-nuz.d.mts} +2 -2
- package/dist/shared/{core.Be4Jy9Qx.mjs → core.FZ305VYd.mjs} +2 -2
- package/dist/shared/core.OHD4KXm9.mjs +5 -0
- package/dist/shared/{core.GTgsmXS_.mjs → core.QJD_fcrc.mjs} +2 -2
- package/dist/shared/core.RfnaEmgA.mjs +7 -0
- package/dist/shared/core.fHR_8Tnq.d.mts +450 -0
- package/dist/shared/{core.D0EgVMQK.mjs → core.lRvxPoao.mjs} +14 -12
- package/dist/shared/{core.CaT0SUUK.mjs → core.rCeaAqgW.mjs} +1 -84
- package/dist/shared/{core.zxTBF_PD.d.mts → core.s9uwOt60.d.mts} +4 -4
- package/dist/shared/core.yna0OdV5.d.mts +98 -0
- package/dist/styles/index.d.mts +106 -0
- package/dist/styles/index.mjs +1 -0
- package/dist/types/_aux.d.mts +2 -2
- package/dist/types/expression-model.d.mts +3 -4
- package/dist/types/expression.d.mts +3 -4
- package/dist/types/fqnRef.d.mts +2 -2
- package/dist/types/fqnRef.mjs +3 -3
- package/dist/types/index.d.mts +8 -8
- package/dist/types/index.mjs +150 -5
- package/dist/types/scalar.mjs +3 -2
- package/dist/utils/graphology/index.d.mts +1864 -0
- package/dist/utils/graphology/index.mjs +1 -0
- package/dist/utils/index.d.mts +11 -6
- package/dist/utils/index.mjs +21 -37
- package/dist/utils/iterable/index.d.mts +1 -1
- package/dist/utils/iterable/index.mjs +45 -7
- package/model/package.json +4 -0
- package/package.json +42 -24
- package/styles/package.json +4 -0
- package/types/package.json +4 -0
- package/utils/graphology/package.json +4 -0
- package/utils/package.json +4 -0
- package/dist/shared/core.6_Vp2iiN.mjs +0 -172
- package/dist/shared/core.CUw_2J9j.mjs +0 -47
- package/dist/shared/core.CzdwsPmY.d.mts +0 -69
- package/dist/shared/core.D-ZGWDDt.d.mts +0 -831
- package/dist/shared/core.DoM6aM9N.mjs +0 -7
- package/dist/shared/core.ILwny7BV.mjs +0 -38
- package/dist/theme/index.d.mts +0 -11
- package/dist/theme/index.mjs +0 -232
- package/src/builder/Builder.deployment.ts +0 -224
- package/src/builder/Builder.deploymentModel.ts +0 -449
- package/src/builder/Builder.element.ts +0 -241
- package/src/builder/Builder.model.ts +0 -494
- package/src/builder/Builder.ts +0 -946
- package/src/builder/Builder.view-common.ts +0 -273
- package/src/builder/Builder.view-deployment.ts +0 -135
- package/src/builder/Builder.view-element.ts +0 -202
- package/src/builder/Builder.views.ts +0 -399
- package/src/builder/Builder.with.ts +0 -156
- package/src/builder/_types.ts +0 -324
- package/src/builder/index.ts +0 -11
- package/src/compute-view/compute-view.ts +0 -80
- package/src/compute-view/deployment-view/_types.ts +0 -38
- package/src/compute-view/deployment-view/clean-connections.ts +0 -236
- package/src/compute-view/deployment-view/compute.ts +0 -94
- package/src/compute-view/deployment-view/memory/index.ts +0 -9
- package/src/compute-view/deployment-view/memory/memory.ts +0 -96
- package/src/compute-view/deployment-view/predicates/deploymentRefs-where.ts +0 -18
- package/src/compute-view/deployment-view/predicates/deploymentRefs.ts +0 -154
- package/src/compute-view/deployment-view/predicates/index.ts +0 -8
- package/src/compute-view/deployment-view/predicates/relation-direct.ts +0 -243
- package/src/compute-view/deployment-view/predicates/relation-in-out.ts +0 -70
- package/src/compute-view/deployment-view/predicates/relation-incoming.ts +0 -101
- package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +0 -95
- package/src/compute-view/deployment-view/predicates/relation-where.ts +0 -18
- package/src/compute-view/deployment-view/predicates/utils.ts +0 -282
- package/src/compute-view/deployment-view/predicates/wildcard.ts +0 -41
- package/src/compute-view/deployment-view/stages/stage-exclude.ts +0 -5
- package/src/compute-view/deployment-view/stages/stage-final.ts +0 -245
- package/src/compute-view/deployment-view/stages/stage-include.ts +0 -95
- package/src/compute-view/deployment-view/utils.ts +0 -297
- package/src/compute-view/dynamic-view/compute.ts +0 -312
- package/src/compute-view/element-view/_types.ts +0 -47
- package/src/compute-view/element-view/clean-connections.ts +0 -117
- package/src/compute-view/element-view/compute.ts +0 -324
- package/src/compute-view/element-view/memory/NodeGroup.ts +0 -31
- package/src/compute-view/element-view/memory/index.ts +0 -10
- package/src/compute-view/element-view/memory/memory.ts +0 -178
- package/src/compute-view/element-view/memory/stage-exclude.ts +0 -59
- package/src/compute-view/element-view/memory/stage-final.ts +0 -129
- package/src/compute-view/element-view/memory/stage-include.ts +0 -130
- package/src/compute-view/element-view/predicates/_utils.ts +0 -91
- package/src/compute-view/element-view/predicates/element-expand.ts +0 -29
- package/src/compute-view/element-view/predicates/element-kind-tag.ts +0 -27
- package/src/compute-view/element-view/predicates/element-ref.ts +0 -24
- package/src/compute-view/element-view/predicates/relation-direct.ts +0 -321
- package/src/compute-view/element-view/predicates/relation-in-out.ts +0 -64
- package/src/compute-view/element-view/predicates/relation-in.ts +0 -115
- package/src/compute-view/element-view/predicates/relation-out.ts +0 -119
- package/src/compute-view/element-view/predicates/wildcard.ts +0 -88
- package/src/compute-view/element-view/utils.ts +0 -65
- package/src/compute-view/index.ts +0 -4
- package/src/compute-view/memory/AbstractMemory.ts +0 -45
- package/src/compute-view/memory/AbstractStageExclude.ts +0 -215
- package/src/compute-view/memory/AbstractStageInclude.ts +0 -200
- package/src/compute-view/memory/_types.ts +0 -148
- package/src/compute-view/memory/index.ts +0 -5
- package/src/compute-view/memory/ops.ts +0 -43
- package/src/compute-view/relationships-view/_types.ts +0 -16
- package/src/compute-view/relationships-view/compute.ts +0 -159
- package/src/compute-view/relationships-view/index.ts +0 -3
- package/src/compute-view/relationships-view/layout.ts +0 -358
- package/src/compute-view/relationships-view/utils.ts +0 -73
- package/src/compute-view/utils/ancestorsOfNode.ts +0 -19
- package/src/compute-view/utils/applyCustomElementProperties.ts +0 -107
- package/src/compute-view/utils/applyCustomRelationProperties.ts +0 -58
- package/src/compute-view/utils/applyViewRuleStyles.ts +0 -73
- package/src/compute-view/utils/buildComputedNodes.ts +0 -166
- package/src/compute-view/utils/buildElementNotations.ts +0 -64
- package/src/compute-view/utils/elementExpressionToPredicate.ts +0 -50
- package/src/compute-view/utils/link-nodes-with-edges.ts +0 -56
- package/src/compute-view/utils/merge-props-from-relationships.ts +0 -161
- package/src/compute-view/utils/relationExpressionToPredicates.ts +0 -55
- package/src/compute-view/utils/resolve-extended-views.ts +0 -85
- package/src/compute-view/utils/resolve-global-rules.ts +0 -88
- package/src/compute-view/utils/topological-sort.ts +0 -256
- package/src/compute-view/utils/view-hash.ts +0 -45
- package/src/compute-view/utils/with-readable-edges.ts +0 -40
- package/src/index.ts +0 -32
- package/src/model/DeploymentElementModel.ts +0 -712
- package/src/model/DeploymentModel.ts +0 -393
- package/src/model/ElementModel.ts +0 -316
- package/src/model/LikeC4Model.ts +0 -882
- package/src/model/RelationModel.ts +0 -152
- package/src/model/connection/Connection.ts +0 -72
- package/src/model/connection/deployment/DeploymentConnectionModel.ts +0 -185
- package/src/model/connection/deployment/find.ts +0 -120
- package/src/model/connection/deployment/index.ts +0 -8
- package/src/model/connection/index.ts +0 -22
- package/src/model/connection/model/ConnectionModel.ts +0 -158
- package/src/model/connection/model/find.ts +0 -117
- package/src/model/connection/model/index.ts +0 -8
- package/src/model/connection/ops.ts +0 -276
- package/src/model/guards.ts +0 -77
- package/src/model/index.ts +0 -72
- package/src/model/types.ts +0 -67
- package/src/model/utils.ts +0 -66
- package/src/model/view/EdgeModel.ts +0 -121
- package/src/model/view/LikeC4ViewModel.ts +0 -361
- package/src/model/view/LikeC4ViewsFolder.ts +0 -151
- package/src/model/view/NodeModel.ts +0 -247
- package/src/theme/element.ts +0 -61
- package/src/theme/index.ts +0 -127
- package/src/theme/relationships.ts +0 -54
- package/src/types/RichText.ts +0 -205
- package/src/types/_aux.ts +0 -317
- package/src/types/_common.ts +0 -102
- package/src/types/const.ts +0 -34
- package/src/types/expression-model.ts +0 -294
- package/src/types/expression.ts +0 -313
- package/src/types/fqnRef.ts +0 -91
- package/src/types/geometry.ts +0 -159
- package/src/types/global.ts +0 -21
- package/src/types/index.ts +0 -44
- package/src/types/model-data.ts +0 -77
- package/src/types/model-deployment.ts +0 -78
- package/src/types/model-dump.ts +0 -79
- package/src/types/model-logical.ts +0 -126
- package/src/types/model-spec.ts +0 -88
- package/src/types/operators.ts +0 -156
- package/src/types/project.ts +0 -14
- package/src/types/scalar.ts +0 -162
- package/src/types/styles.ts +0 -122
- package/src/types/view-changes.ts +0 -32
- package/src/types/view-common.ts +0 -157
- package/src/types/view-computed.ts +0 -126
- package/src/types/view-layouted.ts +0 -94
- package/src/types/view-parsed.deployment.ts +0 -39
- package/src/types/view-parsed.dynamic.ts +0 -89
- package/src/types/view-parsed.element.ts +0 -65
- package/src/types/view.ts +0 -113
- package/src/utils/common-head.ts +0 -22
- package/src/utils/compare-natural.ts +0 -60
- package/src/utils/const.ts +0 -1
- package/src/utils/fqn.ts +0 -302
- package/src/utils/getOrCreate.ts +0 -8
- package/src/utils/guards.ts +0 -9
- package/src/utils/index.ts +0 -68
- package/src/utils/invariant.ts +0 -29
- package/src/utils/iterable/_types.ts +0 -5
- package/src/utils/iterable/filter.ts +0 -55
- package/src/utils/iterable/find.ts +0 -38
- package/src/utils/iterable/first.ts +0 -48
- package/src/utils/iterable/flat.ts +0 -17
- package/src/utils/iterable/head.ts +0 -22
- package/src/utils/iterable/index.ts +0 -15
- package/src/utils/iterable/map.ts +0 -40
- package/src/utils/iterable/reduce.ts +0 -24
- package/src/utils/iterable/some.ts +0 -36
- package/src/utils/iterable/to.ts +0 -19
- package/src/utils/iterable/unique.ts +0 -23
- package/src/utils/markdown/index.ts +0 -2
- package/src/utils/markdown/to-html.ts +0 -32
- package/src/utils/markdown/to-text.ts +0 -14
- package/src/utils/memoize-prop.ts +0 -30
- package/src/utils/mnemonist.ts +0 -9
- package/src/utils/object-hash.ts +0 -14
- package/src/utils/promises.ts +0 -24
- package/src/utils/relations.ts +0 -36
- package/src/utils/set.ts +0 -83
- package/src/utils/string-hash.ts +0 -16
|
@@ -1,831 +0,0 @@
|
|
|
1
|
-
import { Simplify, MergeExclusive, Tagged, NonEmptyTuple, IsNever, IsAny } from 'type-fest';
|
|
2
|
-
import { A as Any, W as WithOptionalTags, C as WithOptionalLinks, h as StrictViewId, f as _stage, g as _type, F as Fqn, G as WithDescriptionAndTech, H as WithMetadata, I as WithNotation, j as ElementKind, R as RelationKind, V as ViewId, U as Unknown, u as DeploymentFqn, q as DeploymentKind, T as Tag, o as MetadataKey, J as WithTags, E as ExtractOnStage, M as ModelStage, P as ProjectId$1, k as ElementId, D as DeploymentId, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted, S as SpecAux, a as Aux, N as Never } from './core.BhpgpOep.mjs';
|
|
3
|
-
import { N as NonEmptyArray, E as ExclusiveUnion, L as Link, K as KeysOf } from './core.DgesAwC8.mjs';
|
|
4
|
-
import { ModelExpression, ModelFqnExpr } from '../types/expression-model.mjs';
|
|
5
|
-
import { I as Icon, M as MarkdownOrString, d as RelationId, T as Tag$1, P as ProjectId, N as NodeId, j as EdgeId, m as StepEdgeKind } from './core.DX-WYEPA.mjs';
|
|
6
|
-
import { b as BorderStyle, a as ShapeSize, S as SpacingSize, T as TextSize, i as Color, c as ElementShape, R as RelationshipLineType, f as RelationshipArrowType, h as ThemeColor, C as ColorLiteral, e as CustomColorDefinitions } from './core.CzdwsPmY.mjs';
|
|
7
|
-
import { FqnRef } from '../types/fqnRef.mjs';
|
|
8
|
-
import { E as Expression, F as FqnExpr } from './core.CUG6vpyL.mjs';
|
|
9
|
-
|
|
10
|
-
type Point = readonly [x: number, y: number];
|
|
11
|
-
interface XYPoint {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
}
|
|
15
|
-
interface BBox {
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
|
-
width: number;
|
|
19
|
-
height: number;
|
|
20
|
-
}
|
|
21
|
-
declare namespace BBox {
|
|
22
|
-
function center({ x, y, width, height }: BBox): XYPoint;
|
|
23
|
-
function fromPoints(points: Point[]): BBox;
|
|
24
|
-
function merge(...boxes: BBox[]): BBox;
|
|
25
|
-
function toRectBox(box: BBox): RectBox;
|
|
26
|
-
function expand(box: BBox, plus: number): BBox;
|
|
27
|
-
function shrink(box: BBox, minus: number): BBox;
|
|
28
|
-
}
|
|
29
|
-
interface RectBox {
|
|
30
|
-
x1: number;
|
|
31
|
-
y1: number;
|
|
32
|
-
x2: number;
|
|
33
|
-
y2: number;
|
|
34
|
-
}
|
|
35
|
-
declare namespace RectBox {
|
|
36
|
-
function center({ x1, y1, x2, y2 }: RectBox): XYPoint;
|
|
37
|
-
function fromPoints(points: Point[]): RectBox;
|
|
38
|
-
function merge(...boxes: RectBox[]): RectBox;
|
|
39
|
-
function toBBox(box: RectBox): BBox;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
interface AnyIncludePredicate<Expr> {
|
|
43
|
-
include: Expr[];
|
|
44
|
-
exclude?: never;
|
|
45
|
-
}
|
|
46
|
-
interface AnyExcludePredicate<Expr> {
|
|
47
|
-
include?: never;
|
|
48
|
-
exclude: Expr[];
|
|
49
|
-
}
|
|
50
|
-
interface AnyViewRuleStyle<Expr> {
|
|
51
|
-
targets: Expr[];
|
|
52
|
-
notation?: string;
|
|
53
|
-
style: {
|
|
54
|
-
border?: BorderStyle;
|
|
55
|
-
opacity?: number;
|
|
56
|
-
multiple?: boolean;
|
|
57
|
-
size?: ShapeSize;
|
|
58
|
-
padding?: SpacingSize;
|
|
59
|
-
textSize?: TextSize;
|
|
60
|
-
color?: Color;
|
|
61
|
-
shape?: ElementShape;
|
|
62
|
-
icon?: Icon;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
interface ViewRuleGlobalStyle {
|
|
66
|
-
styleId: GlobalStyleID;
|
|
67
|
-
}
|
|
68
|
-
declare function isViewRuleGlobalStyle(rule: object): rule is ViewRuleGlobalStyle;
|
|
69
|
-
interface ViewRuleGlobalPredicateRef {
|
|
70
|
-
predicateId: GlobalPredicateId;
|
|
71
|
-
}
|
|
72
|
-
declare function isViewRuleGlobalPredicateRef(rule: object): rule is ViewRuleGlobalPredicateRef;
|
|
73
|
-
type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
|
|
74
|
-
declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
|
|
75
|
-
interface ViewRuleAutoLayout {
|
|
76
|
-
direction: AutoLayoutDirection;
|
|
77
|
-
nodeSep?: number;
|
|
78
|
-
rankSep?: number;
|
|
79
|
-
}
|
|
80
|
-
declare function isViewRuleAutoLayout(rule: object): rule is ViewRuleAutoLayout;
|
|
81
|
-
interface ViewAutoLayout {
|
|
82
|
-
direction: ViewRuleAutoLayout['direction'];
|
|
83
|
-
rankSep?: number;
|
|
84
|
-
nodeSep?: number;
|
|
85
|
-
}
|
|
86
|
-
type ViewManualLayout = {
|
|
87
|
-
readonly hash: string;
|
|
88
|
-
readonly x: number;
|
|
89
|
-
readonly y: number;
|
|
90
|
-
readonly width: number;
|
|
91
|
-
readonly height: number;
|
|
92
|
-
readonly autoLayout: ViewAutoLayout;
|
|
93
|
-
readonly nodes: Record<string, {
|
|
94
|
-
isCompound: boolean;
|
|
95
|
-
x: number;
|
|
96
|
-
y: number;
|
|
97
|
-
width: number;
|
|
98
|
-
height: number;
|
|
99
|
-
}>;
|
|
100
|
-
readonly edges: Record<string, {
|
|
101
|
-
dotpos?: string;
|
|
102
|
-
points: NonEmptyArray<Point>;
|
|
103
|
-
controlPoints?: NonEmptyArray<XYPoint>;
|
|
104
|
-
labelBBox?: BBox;
|
|
105
|
-
}>;
|
|
106
|
-
};
|
|
107
|
-
type ViewType = 'element' | 'dynamic' | 'deployment';
|
|
108
|
-
interface BaseViewProperties<A extends Any> extends WithOptionalTags<A>, WithOptionalLinks {
|
|
109
|
-
readonly id: StrictViewId<A>;
|
|
110
|
-
readonly title: string | null;
|
|
111
|
-
readonly description: MarkdownOrString | null;
|
|
112
|
-
/**
|
|
113
|
-
* For all views we find common ancestor path.
|
|
114
|
-
* This is used to generate relative paths, i.e.:
|
|
115
|
-
* - "/home/project/index.c4" becomes "index.c4"
|
|
116
|
-
* - "/home/project/subdir/views.c4" becomes "subdir/views.c4"
|
|
117
|
-
*
|
|
118
|
-
* Undefined if the view is auto-generated.
|
|
119
|
-
*/
|
|
120
|
-
readonly relativePath?: string | undefined;
|
|
121
|
-
}
|
|
122
|
-
interface BaseParsedViewProperties<A extends Any> extends BaseViewProperties<A> {
|
|
123
|
-
/**
|
|
124
|
-
* Internal field to identify the stage of the view.
|
|
125
|
-
* This is used to create the correct type of the view.
|
|
126
|
-
*/
|
|
127
|
-
readonly [_stage]: 'parsed';
|
|
128
|
-
/**
|
|
129
|
-
* URI to the source file of this view.
|
|
130
|
-
* Undefined if the view is auto-generated.
|
|
131
|
-
*/
|
|
132
|
-
readonly docUri?: string | undefined;
|
|
133
|
-
/**
|
|
134
|
-
* If the view is changed manually this field contains the layout data.
|
|
135
|
-
*/
|
|
136
|
-
readonly manualLayout?: ViewManualLayout | undefined;
|
|
137
|
-
}
|
|
138
|
-
type NodeNotation = {
|
|
139
|
-
kinds: string[];
|
|
140
|
-
shape: ElementShape;
|
|
141
|
-
color: Color;
|
|
142
|
-
title: string;
|
|
143
|
-
};
|
|
144
|
-
interface ViewWithNotation {
|
|
145
|
-
notation?: {
|
|
146
|
-
nodes: NodeNotation[];
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
interface ViewWithHash {
|
|
150
|
-
/**
|
|
151
|
-
* Hash of the view object.
|
|
152
|
-
* This is used to detect changes in layout
|
|
153
|
-
*/
|
|
154
|
-
hash: string;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Predicates scoped to logical model
|
|
159
|
-
*/
|
|
160
|
-
interface ElementViewIncludePredicate<A extends Any = Any> extends AnyIncludePredicate<ModelExpression<A>> {
|
|
161
|
-
}
|
|
162
|
-
interface ElementViewExcludePredicate<A extends Any = Any> extends AnyExcludePredicate<ModelExpression<A>> {
|
|
163
|
-
}
|
|
164
|
-
type ElementViewPredicate<A extends Any = Any> = ElementViewIncludePredicate<A> | ElementViewExcludePredicate<A>;
|
|
165
|
-
interface ElementViewRuleGroup<A extends Any = Any> {
|
|
166
|
-
groupRules: Array<ElementViewPredicate<A> | ElementViewRuleGroup<A>>;
|
|
167
|
-
title: string | null;
|
|
168
|
-
color?: Color;
|
|
169
|
-
border?: BorderStyle;
|
|
170
|
-
opacity?: number;
|
|
171
|
-
multiple?: boolean;
|
|
172
|
-
size?: ShapeSize;
|
|
173
|
-
padding?: SpacingSize;
|
|
174
|
-
textSize?: TextSize;
|
|
175
|
-
}
|
|
176
|
-
declare function isViewRuleGroup<A extends Any>(rule: ElementViewRule<A>): rule is ElementViewRuleGroup<A>;
|
|
177
|
-
interface ElementViewRuleStyle<A extends Any = Any> extends AnyViewRuleStyle<ModelFqnExpr<A>> {
|
|
178
|
-
}
|
|
179
|
-
type ElementViewRule<A extends Any = Any> = ExclusiveUnion<{
|
|
180
|
-
IncludePredicate: ElementViewIncludePredicate<A>;
|
|
181
|
-
ExcludePredicate: ElementViewExcludePredicate<A>;
|
|
182
|
-
Group: ElementViewRuleGroup<A>;
|
|
183
|
-
Style: ElementViewRuleStyle<A>;
|
|
184
|
-
GlobalStyle: ViewRuleGlobalStyle;
|
|
185
|
-
GlobalPredicateRef: ViewRuleGlobalPredicateRef;
|
|
186
|
-
AutoLayout: ViewRuleAutoLayout;
|
|
187
|
-
}>;
|
|
188
|
-
interface ParsedElementView<A extends Any = Any> extends BaseParsedViewProperties<A> {
|
|
189
|
-
[_type]: 'element';
|
|
190
|
-
readonly rules: ElementViewRule<A>[];
|
|
191
|
-
readonly viewOf?: Fqn<A>;
|
|
192
|
-
readonly extends?: StrictViewId<A>;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
interface DynamicViewStep<A extends Any = Any> {
|
|
196
|
-
readonly source: Fqn<A>;
|
|
197
|
-
readonly target: Fqn<A>;
|
|
198
|
-
readonly title: string | null;
|
|
199
|
-
readonly description?: string;
|
|
200
|
-
readonly technology?: string;
|
|
201
|
-
readonly notation?: string;
|
|
202
|
-
readonly notes?: MarkdownOrString;
|
|
203
|
-
readonly color?: Color;
|
|
204
|
-
readonly line?: RelationshipLineType;
|
|
205
|
-
readonly head?: RelationshipArrowType;
|
|
206
|
-
readonly tail?: RelationshipArrowType;
|
|
207
|
-
readonly isBackward?: boolean;
|
|
208
|
-
readonly navigateTo?: StrictViewId<A>;
|
|
209
|
-
}
|
|
210
|
-
interface DynamicViewParallelSteps<A extends Any = Any> {
|
|
211
|
-
readonly __parallel: DynamicViewStep<A>[];
|
|
212
|
-
}
|
|
213
|
-
declare function getParallelStepsPrefix(id: string): string | null;
|
|
214
|
-
type DynamicViewStepOrParallel<A extends Any = Any> = Simplify<MergeExclusive<DynamicViewStep<A>, DynamicViewParallelSteps<A>>>;
|
|
215
|
-
interface DynamicViewIncludeRule<A extends Any = Any> {
|
|
216
|
-
include: ModelFqnExpr.Any<A>[];
|
|
217
|
-
}
|
|
218
|
-
type DynamicViewRule<A extends Any = Any> = ExclusiveUnion<{
|
|
219
|
-
Include: DynamicViewIncludeRule<A>;
|
|
220
|
-
GlobalPredicateRef: ViewRuleGlobalPredicateRef;
|
|
221
|
-
ElementViewRuleStyle: ElementViewRuleStyle<A>;
|
|
222
|
-
GlobalStyle: ViewRuleGlobalStyle;
|
|
223
|
-
AutoLayout: ViewRuleAutoLayout;
|
|
224
|
-
}>;
|
|
225
|
-
type DynamicViewDisplayVariant = 'diagram' | 'sequence';
|
|
226
|
-
interface ParsedDynamicView<A extends Any = Any> extends BaseParsedViewProperties<A> {
|
|
227
|
-
[_type]: 'dynamic';
|
|
228
|
-
/**
|
|
229
|
-
* How to display the dynamic view
|
|
230
|
-
* - `diagram`: display as a regular likec4 view
|
|
231
|
-
* - `sequence`: display as a sequence diagram
|
|
232
|
-
*
|
|
233
|
-
* @default 'diagram'
|
|
234
|
-
*/
|
|
235
|
-
readonly variant?: DynamicViewDisplayVariant;
|
|
236
|
-
readonly steps: DynamicViewStepOrParallel<A>[];
|
|
237
|
-
readonly rules: DynamicViewRule<A>[];
|
|
238
|
-
}
|
|
239
|
-
declare function isDynamicViewParallelSteps<A extends Any>(step: DynamicViewStepOrParallel<A>): step is DynamicViewParallelSteps<A>;
|
|
240
|
-
|
|
241
|
-
type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
|
|
242
|
-
type GlobalPredicates<A extends Any = Any> = NonEmptyArray<ElementViewPredicate<A>>;
|
|
243
|
-
type GlobalDynamicPredicates<A extends Any = Any> = NonEmptyArray<DynamicViewIncludeRule<A>>;
|
|
244
|
-
type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
|
|
245
|
-
type GlobalStyles<A extends Any = Any> = NonEmptyTuple<ElementViewRuleStyle<A>>;
|
|
246
|
-
interface ModelGlobals<A extends Any = Any> {
|
|
247
|
-
readonly predicates: Record<GlobalPredicateId, GlobalPredicates<A>>;
|
|
248
|
-
readonly dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates<A>>;
|
|
249
|
-
readonly styles: Record<GlobalStyleID, GlobalStyles<A>>;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
declare const DefaultThemeColor: ThemeColor;
|
|
253
|
-
declare const DefaultElementShape: ElementShape;
|
|
254
|
-
declare const DefaultSize = "md";
|
|
255
|
-
declare const DefaultShapeSize: ShapeSize;
|
|
256
|
-
declare const DefaultPaddingSize: SpacingSize;
|
|
257
|
-
declare const DefaultTextSize: TextSize;
|
|
258
|
-
interface ElementStyle {
|
|
259
|
-
readonly border?: BorderStyle;
|
|
260
|
-
/**
|
|
261
|
-
* In percentage 0-100, 0 is fully transparent
|
|
262
|
-
*
|
|
263
|
-
* @default 100
|
|
264
|
-
*/
|
|
265
|
-
readonly opacity?: number;
|
|
266
|
-
/**
|
|
267
|
-
* If true, the element is rendered as multiple shapes
|
|
268
|
-
* @default false
|
|
269
|
-
*/
|
|
270
|
-
readonly multiple?: boolean;
|
|
271
|
-
/**
|
|
272
|
-
* Shape size
|
|
273
|
-
*
|
|
274
|
-
* @default 'md'
|
|
275
|
-
*/
|
|
276
|
-
readonly size?: ShapeSize;
|
|
277
|
-
readonly padding?: SpacingSize;
|
|
278
|
-
readonly textSize?: TextSize;
|
|
279
|
-
}
|
|
280
|
-
type WithSizes = Pick<ElementStyle, 'size' | 'padding' | 'textSize'>;
|
|
281
|
-
/**
|
|
282
|
-
* Ensures that the sizes are set to default values if they are not set
|
|
283
|
-
*/
|
|
284
|
-
declare function ensureSizes<S extends WithSizes>({ size, padding, textSize, ...rest }: S): Omit<S, 'size' | 'padding' | 'textSize'> & Required<WithSizes>;
|
|
285
|
-
interface Element<A extends Any = Any> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A>, WithNotation {
|
|
286
|
-
readonly id: Fqn<A>;
|
|
287
|
-
readonly kind: ElementKind<A>;
|
|
288
|
-
readonly title: string;
|
|
289
|
-
readonly icon?: Icon;
|
|
290
|
-
readonly shape?: ElementShape;
|
|
291
|
-
readonly color?: Color;
|
|
292
|
-
readonly style?: ElementStyle;
|
|
293
|
-
}
|
|
294
|
-
declare const DefaultLineStyle: RelationshipLineType;
|
|
295
|
-
declare const DefaultArrowType: RelationshipArrowType;
|
|
296
|
-
declare const DefaultRelationshipColor: ThemeColor;
|
|
297
|
-
interface AbstractRelationship<A extends Any> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A> {
|
|
298
|
-
readonly id: RelationId;
|
|
299
|
-
readonly title?: string | null;
|
|
300
|
-
readonly kind?: RelationKind<A>;
|
|
301
|
-
readonly color?: Color;
|
|
302
|
-
readonly line?: RelationshipLineType;
|
|
303
|
-
readonly head?: RelationshipArrowType;
|
|
304
|
-
readonly tail?: RelationshipArrowType;
|
|
305
|
-
readonly navigateTo?: ViewId<A>;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Relationship between two model elements
|
|
309
|
-
*/
|
|
310
|
-
interface Relationship<A extends Any = Any> extends AbstractRelationship<A> {
|
|
311
|
-
readonly source: FqnRef.ModelRef<A>;
|
|
312
|
-
readonly target: FqnRef.ModelRef<A>;
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Backward compatibility alias
|
|
316
|
-
* @deprecated Use {@link Relationship} instead
|
|
317
|
-
*/
|
|
318
|
-
type ModelRelation<A extends Any = Any> = Relationship<A>;
|
|
319
|
-
|
|
320
|
-
interface DeploymentElementStyle extends ElementStyle {
|
|
321
|
-
readonly icon?: Icon;
|
|
322
|
-
readonly shape?: ElementShape;
|
|
323
|
-
readonly color?: Color;
|
|
324
|
-
}
|
|
325
|
-
interface DeploymentNode<A extends Any = Unknown> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A>, WithNotation {
|
|
326
|
-
element?: never;
|
|
327
|
-
readonly id: DeploymentFqn<A>;
|
|
328
|
-
readonly kind: DeploymentKind<A>;
|
|
329
|
-
readonly title: string;
|
|
330
|
-
readonly style: DeploymentElementStyle;
|
|
331
|
-
}
|
|
332
|
-
interface DeployedInstance<A extends Any = Unknown> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A>, WithNotation {
|
|
333
|
-
kind?: never;
|
|
334
|
-
/**
|
|
335
|
-
* Format: `<DeploymentNode Fqn>.<Instance Id>`
|
|
336
|
-
* i.e parent fqn is deployment target
|
|
337
|
-
*/
|
|
338
|
-
readonly id: DeploymentFqn<A>;
|
|
339
|
-
readonly element: Fqn<A>;
|
|
340
|
-
readonly title?: string;
|
|
341
|
-
readonly style?: DeploymentElementStyle;
|
|
342
|
-
}
|
|
343
|
-
type DeploymentElement<A extends Any = Unknown> = DeploymentNode<A> | DeployedInstance<A>;
|
|
344
|
-
type DeploymentElementRef<A extends Any = Unknown> = {
|
|
345
|
-
readonly id: DeploymentFqn<A>;
|
|
346
|
-
readonly element?: Fqn<A>;
|
|
347
|
-
};
|
|
348
|
-
declare function isDeploymentNode<A extends Any>(el: DeploymentElement<A>): el is DeploymentNode<A>;
|
|
349
|
-
declare function isDeployedInstance<A extends Any>(el: DeploymentElement<A>): el is DeployedInstance<A>;
|
|
350
|
-
/**
|
|
351
|
-
* Relationship in deployment model
|
|
352
|
-
*/
|
|
353
|
-
interface DeploymentRelationship<A extends Any = Unknown> extends AbstractRelationship<A> {
|
|
354
|
-
readonly source: FqnRef.DeploymentRef<A>;
|
|
355
|
-
readonly target: FqnRef.DeploymentRef<A>;
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Backward compatibility alias
|
|
359
|
-
* @deprecated Use {@link DeploymentRelationship} instead
|
|
360
|
-
*/
|
|
361
|
-
type DeploymentRelation<A extends Any = Unknown> = DeploymentRelationship<A>;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Element and deployment kind specification
|
|
365
|
-
*/
|
|
366
|
-
interface ElementSpecification {
|
|
367
|
-
tags?: Tag$1[];
|
|
368
|
-
title?: string;
|
|
369
|
-
summary?: MarkdownOrString;
|
|
370
|
-
description?: MarkdownOrString;
|
|
371
|
-
technology?: string;
|
|
372
|
-
notation?: string;
|
|
373
|
-
links?: NonEmptyArray<Link>;
|
|
374
|
-
style: {
|
|
375
|
-
shape?: ElementShape;
|
|
376
|
-
icon?: Icon;
|
|
377
|
-
color?: Color;
|
|
378
|
-
border?: BorderStyle;
|
|
379
|
-
opacity?: number;
|
|
380
|
-
size?: ShapeSize;
|
|
381
|
-
padding?: SpacingSize;
|
|
382
|
-
textSize?: TextSize;
|
|
383
|
-
multiple?: boolean;
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
interface TagSpecification {
|
|
387
|
-
color: ThemeColor | ColorLiteral;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Checks if tag color is defined in the specification
|
|
391
|
-
* Expects HEX, `rgb(...)` or `rgba(...)` color
|
|
392
|
-
*/
|
|
393
|
-
declare function isTagColorSpecified(spec: string | TagSpecification): spec is {
|
|
394
|
-
color: ColorLiteral;
|
|
395
|
-
};
|
|
396
|
-
interface RelationshipSpecification {
|
|
397
|
-
technology?: string;
|
|
398
|
-
notation?: string;
|
|
399
|
-
color?: Color;
|
|
400
|
-
line?: RelationshipLineType;
|
|
401
|
-
head?: RelationshipArrowType;
|
|
402
|
-
tail?: RelationshipArrowType;
|
|
403
|
-
}
|
|
404
|
-
type Specification<A> = A extends Any ? {
|
|
405
|
-
tags: {
|
|
406
|
-
[key in Tag<A>]: TagSpecification;
|
|
407
|
-
};
|
|
408
|
-
elements: {
|
|
409
|
-
[key in ElementKind<A>]: Partial<ElementSpecification>;
|
|
410
|
-
};
|
|
411
|
-
deployments: {
|
|
412
|
-
[key in DeploymentKind<A>]: Partial<ElementSpecification>;
|
|
413
|
-
};
|
|
414
|
-
relationships: {
|
|
415
|
-
[key in RelationKind<A>]: Partial<RelationshipSpecification>;
|
|
416
|
-
};
|
|
417
|
-
metadataKeys?: IsNever<MetadataKey<A>> extends true ? never : MetadataKey<A>[];
|
|
418
|
-
customColors?: CustomColorDefinitions;
|
|
419
|
-
} : never;
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Configuration of the project, as read from the config file.
|
|
423
|
-
* LikeC4 projects encapsulate models, and can import from each other
|
|
424
|
-
*/
|
|
425
|
-
interface LikeC4Project {
|
|
426
|
-
/**
|
|
427
|
-
* ID of the project, casted to {@link scalar.ProjectId}
|
|
428
|
-
*/
|
|
429
|
-
readonly id: ProjectId;
|
|
430
|
-
title?: string;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
interface ComputedNode<A extends Any = Any> extends WithTags<A>, WithOptionalLinks {
|
|
434
|
-
id: NodeId;
|
|
435
|
-
kind: ElementKind<A> | DeploymentKind<A> | '@group';
|
|
436
|
-
parent: NodeId | null;
|
|
437
|
-
/**
|
|
438
|
-
* Reference to model element
|
|
439
|
-
*/
|
|
440
|
-
modelRef?: Fqn<A>;
|
|
441
|
-
/**
|
|
442
|
-
* Reference to deployment element
|
|
443
|
-
*/
|
|
444
|
-
deploymentRef?: DeploymentFqn<A>;
|
|
445
|
-
title: string;
|
|
446
|
-
/**
|
|
447
|
-
* Description of the node
|
|
448
|
-
* either summary or description
|
|
449
|
-
*/
|
|
450
|
-
description?: MarkdownOrString | null;
|
|
451
|
-
technology?: string | null;
|
|
452
|
-
children: NodeId[];
|
|
453
|
-
inEdges: EdgeId[];
|
|
454
|
-
outEdges: EdgeId[];
|
|
455
|
-
shape: ElementShape;
|
|
456
|
-
color: Color;
|
|
457
|
-
icon?: Icon;
|
|
458
|
-
style: ElementStyle;
|
|
459
|
-
navigateTo?: StrictViewId<A> | null;
|
|
460
|
-
level: number;
|
|
461
|
-
depth?: number | null;
|
|
462
|
-
/**
|
|
463
|
-
* If this node was customized in the view
|
|
464
|
-
*/
|
|
465
|
-
isCustomized?: boolean;
|
|
466
|
-
notation?: string | null;
|
|
467
|
-
}
|
|
468
|
-
interface ComputedEdge<A extends Any = Any> extends WithOptionalTags<A> {
|
|
469
|
-
id: EdgeId;
|
|
470
|
-
parent: NodeId | null;
|
|
471
|
-
source: NodeId;
|
|
472
|
-
target: NodeId;
|
|
473
|
-
label: string | null;
|
|
474
|
-
description?: MarkdownOrString | null;
|
|
475
|
-
technology?: string | null;
|
|
476
|
-
relations: RelationId[];
|
|
477
|
-
kind?: RelationKind<A> | typeof StepEdgeKind;
|
|
478
|
-
notation?: string;
|
|
479
|
-
notes?: MarkdownOrString;
|
|
480
|
-
color?: Color;
|
|
481
|
-
line?: RelationshipLineType;
|
|
482
|
-
head?: RelationshipArrowType;
|
|
483
|
-
tail?: RelationshipArrowType;
|
|
484
|
-
navigateTo?: StrictViewId<A> | null;
|
|
485
|
-
/**
|
|
486
|
-
* If this edge is derived from custom relationship predicate
|
|
487
|
-
*/
|
|
488
|
-
isCustomized?: boolean;
|
|
489
|
-
/**
|
|
490
|
-
* For layouting purposes
|
|
491
|
-
* @default 'forward'
|
|
492
|
-
*/
|
|
493
|
-
dir?: 'forward' | 'back' | 'both';
|
|
494
|
-
}
|
|
495
|
-
interface BaseComputedViewProperties<A extends Any> extends BaseViewProperties<A>, ViewWithHash, ViewWithNotation {
|
|
496
|
-
readonly [_stage]: 'computed';
|
|
497
|
-
readonly autoLayout: ViewAutoLayout;
|
|
498
|
-
readonly nodes: ComputedNode<A>[];
|
|
499
|
-
readonly edges: ComputedEdge<A>[];
|
|
500
|
-
/**
|
|
501
|
-
* If the view is changed manually this field contains the layout data.
|
|
502
|
-
*/
|
|
503
|
-
readonly manualLayout?: ViewManualLayout | undefined;
|
|
504
|
-
}
|
|
505
|
-
interface ComputedElementView<A extends Any = Any> extends BaseComputedViewProperties<A> {
|
|
506
|
-
readonly [_type]: 'element';
|
|
507
|
-
readonly viewOf?: Fqn<A>;
|
|
508
|
-
readonly extends?: StrictViewId<A>;
|
|
509
|
-
}
|
|
510
|
-
interface ComputedDeploymentView<A extends Any = Any> extends BaseComputedViewProperties<A> {
|
|
511
|
-
readonly [_type]: 'deployment';
|
|
512
|
-
}
|
|
513
|
-
interface ComputedDynamicView<A extends Any = Any> extends BaseComputedViewProperties<A> {
|
|
514
|
-
readonly [_type]: 'dynamic';
|
|
515
|
-
/**
|
|
516
|
-
* How to display the dynamic view
|
|
517
|
-
* - `diagram`: display as a regular likec4 view
|
|
518
|
-
* - `sequence`: display as a sequence diagram
|
|
519
|
-
*/
|
|
520
|
-
readonly variant: DynamicViewDisplayVariant;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
interface DiagramNode<A extends Any = Any> extends ComputedNode<A>, BBox {
|
|
524
|
-
x: number;
|
|
525
|
-
y: number;
|
|
526
|
-
width: number;
|
|
527
|
-
height: number;
|
|
528
|
-
/**
|
|
529
|
-
* Absolute position, top left
|
|
530
|
-
* @deprecated Use `x` and `y` instead
|
|
531
|
-
*/
|
|
532
|
-
position: Point;
|
|
533
|
-
/**
|
|
534
|
-
* Bounding box of label
|
|
535
|
-
* (Absolute coordinates)
|
|
536
|
-
*/
|
|
537
|
-
labelBBox: BBox;
|
|
538
|
-
}
|
|
539
|
-
interface DiagramEdge<A extends Any = Any> extends ComputedEdge<A> {
|
|
540
|
-
/**
|
|
541
|
-
* Bezier points
|
|
542
|
-
* (Absolute coordinates)
|
|
543
|
-
*/
|
|
544
|
-
points: NonEmptyArray<Point>;
|
|
545
|
-
/**
|
|
546
|
-
* Control points to adjust the edge
|
|
547
|
-
* (Absolute coordinates)
|
|
548
|
-
*/
|
|
549
|
-
controlPoints?: NonEmptyArray<XYPoint>;
|
|
550
|
-
/**
|
|
551
|
-
* Bounding box of label
|
|
552
|
-
* (Absolute coordinates)
|
|
553
|
-
*/
|
|
554
|
-
labelBBox?: BBox | null;
|
|
555
|
-
/**
|
|
556
|
-
* Graphviz edge POS
|
|
557
|
-
*
|
|
558
|
-
* TODO: temporary solution, should be moved out
|
|
559
|
-
* @deprecated
|
|
560
|
-
*/
|
|
561
|
-
dotpos?: string;
|
|
562
|
-
}
|
|
563
|
-
interface BaseLayoutedViewProperties<A extends Any> extends BaseViewProperties<A>, ViewWithHash, ViewWithNotation {
|
|
564
|
-
readonly [_stage]: 'layouted';
|
|
565
|
-
readonly autoLayout: ViewAutoLayout;
|
|
566
|
-
readonly nodes: DiagramNode<A>[];
|
|
567
|
-
readonly edges: DiagramEdge<A>[];
|
|
568
|
-
readonly bounds: BBox;
|
|
569
|
-
/**
|
|
570
|
-
* If diagram has manual layout
|
|
571
|
-
* But was changed and layout should be recalculated
|
|
572
|
-
*/
|
|
573
|
-
hasLayoutDrift?: boolean;
|
|
574
|
-
}
|
|
575
|
-
interface LayoutedElementView<A extends Any = Any> extends BaseLayoutedViewProperties<A> {
|
|
576
|
-
readonly [_type]: 'element';
|
|
577
|
-
readonly viewOf?: Fqn<A>;
|
|
578
|
-
readonly extends?: StrictViewId<A>;
|
|
579
|
-
}
|
|
580
|
-
interface LayoutedDeploymentView<A extends Any = Any> extends BaseLayoutedViewProperties<A> {
|
|
581
|
-
readonly [_type]: 'deployment';
|
|
582
|
-
}
|
|
583
|
-
interface LayoutedDynamicView<A extends Any = Any> extends BaseLayoutedViewProperties<A> {
|
|
584
|
-
readonly [_type]: 'dynamic';
|
|
585
|
-
/**
|
|
586
|
-
* How to display the dynamic view
|
|
587
|
-
* - `diagram`: display as a regular likec4 view
|
|
588
|
-
* - `sequence`: display as a sequence diagram
|
|
589
|
-
*/
|
|
590
|
-
readonly variant: DynamicViewDisplayVariant;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* Predicates scoped to deployment model
|
|
595
|
-
*/
|
|
596
|
-
interface DeploymentViewIncludePredicate<A extends Any = Unknown> extends AnyIncludePredicate<Expression<A>> {
|
|
597
|
-
}
|
|
598
|
-
interface DeploymentViewExcludePredicate<A extends Any = Unknown> extends AnyExcludePredicate<Expression<A>> {
|
|
599
|
-
}
|
|
600
|
-
type DeploymentViewPredicate<A extends Any = Unknown> = DeploymentViewIncludePredicate<A> | DeploymentViewExcludePredicate<A>;
|
|
601
|
-
interface DeploymentViewRuleStyle<A extends Any = Unknown> extends AnyViewRuleStyle<FqnExpr<A>> {
|
|
602
|
-
}
|
|
603
|
-
type DeploymentViewRule<A extends Any = Unknown> = ExclusiveUnion<{
|
|
604
|
-
Include: DeploymentViewIncludePredicate<A>;
|
|
605
|
-
Exclude: DeploymentViewExcludePredicate<A>;
|
|
606
|
-
Style: DeploymentViewRuleStyle<A>;
|
|
607
|
-
AutoLayout: ViewRuleAutoLayout;
|
|
608
|
-
}>;
|
|
609
|
-
interface ParsedDeploymentView<A extends Any = Unknown> extends BaseParsedViewProperties<A> {
|
|
610
|
-
[_type]: 'deployment';
|
|
611
|
-
readonly rules: DeploymentViewRule<A>[];
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
type ParsedView<A extends Any = Any> = ParsedElementView<A> | ParsedDeploymentView<A> | ParsedDynamicView<A>;
|
|
615
|
-
|
|
616
|
-
type ComputedView<A extends Any = Any> = ComputedElementView<A> | ComputedDeploymentView<A> | ComputedDynamicView<A>;
|
|
617
|
-
type LayoutedView<A extends Any = Any> = LayoutedElementView<A> | LayoutedDeploymentView<A> | LayoutedDynamicView<A>;
|
|
618
|
-
type ProcessedView<A extends Any = Any> = ComputedView<A> | LayoutedView<A>;
|
|
619
|
-
|
|
620
|
-
type AnyView<A extends Any = Any> = ParsedElementView<A> | ParsedDeploymentView<A> | ParsedDynamicView<A> | ComputedElementView<A> | ComputedDeploymentView<A> | ComputedDynamicView<A> | LayoutedElementView<A> | LayoutedDeploymentView<A> | LayoutedDynamicView<A>;
|
|
621
|
-
type ViewOnStage<V extends AnyView<Any>, T extends ModelStage> = Extract<V, {
|
|
622
|
-
[_stage]: T;
|
|
623
|
-
}>;
|
|
624
|
-
type ViewWithType<V extends AnyView<Any>, T extends ViewType> = Extract<V, {
|
|
625
|
-
[_type]: T;
|
|
626
|
-
}>;
|
|
627
|
-
type ViewRule<A extends Any = Any> = ParsedView<A>['rules'][number];
|
|
628
|
-
type ViewRulePredicate<A extends Any = Any> = Extract<ViewRule<A>, {
|
|
629
|
-
include: any[];
|
|
630
|
-
} | {
|
|
631
|
-
exclude: any[];
|
|
632
|
-
}>;
|
|
633
|
-
declare function isViewRulePredicate<V extends ViewRule<any>>(rule: V): rule is Extract<V, {
|
|
634
|
-
include: any[];
|
|
635
|
-
} | {
|
|
636
|
-
exclude: any[];
|
|
637
|
-
}>;
|
|
638
|
-
declare function isViewRuleStyle<V extends ViewRule<any>>(rule: V): rule is Extract<V, {
|
|
639
|
-
targets: any[];
|
|
640
|
-
style: {};
|
|
641
|
-
}>;
|
|
642
|
-
declare function isComputedView<V extends AnyView<any>>(view: V): view is ExtractOnStage<V, 'computed'>;
|
|
643
|
-
declare function isDiagramView<V extends AnyView<any>>(view: V): view is ExtractOnStage<V, 'layouted'>;
|
|
644
|
-
|
|
645
|
-
declare function isElementView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'element'>;
|
|
646
|
-
declare function isScopedElementView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'element'> & {
|
|
647
|
-
viewOf: Fqn<Any>;
|
|
648
|
-
};
|
|
649
|
-
declare function isExtendsElementView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'element'> & {
|
|
650
|
-
extends: StrictViewId<Any>;
|
|
651
|
-
};
|
|
652
|
-
declare function isDeploymentView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'deployment'>;
|
|
653
|
-
declare function isDynamicView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'dynamic'>;
|
|
654
|
-
|
|
655
|
-
interface BaseLikeC4ModelData<A extends Any> {
|
|
656
|
-
projectId: ProjectId$1<A>;
|
|
657
|
-
project: LikeC4Project;
|
|
658
|
-
specification: Specification<A>;
|
|
659
|
-
elements: Record<ElementId<A>, Element<A>>;
|
|
660
|
-
deployments: {
|
|
661
|
-
elements: Record<DeploymentId<A>, DeploymentElement<A>>;
|
|
662
|
-
relations: Record<RelationId, DeploymentRelationship<A>>;
|
|
663
|
-
};
|
|
664
|
-
relations: Record<RelationId, Relationship<A>>;
|
|
665
|
-
globals: ModelGlobals;
|
|
666
|
-
imports: Record<string, NonEmptyArray<Element<A>>>;
|
|
667
|
-
}
|
|
668
|
-
type AuxFromLikeC4ModelData<D> = D extends BaseLikeC4ModelData<infer A extends Any> ? IsAny<A> extends true ? never : A : never;
|
|
669
|
-
/**
|
|
670
|
-
* Represents a LikeC4 model with customizable type parameters,
|
|
671
|
-
* parsed from DSL or result from Builder
|
|
672
|
-
*
|
|
673
|
-
* !IMPORTANT: This is a low-level type, use `LikeC4Model` instead.
|
|
674
|
-
* !NOTE: Views are not computed yet.
|
|
675
|
-
*
|
|
676
|
-
* @typeParam ElementKinds - Types of elements in the model (defaults to string)
|
|
677
|
-
* @typeParam RelationKinds - Types of relationships (defaults to string)
|
|
678
|
-
* @typeParam Tags - Types of tags that can be applied (defaults to string)
|
|
679
|
-
* @typeParam Fqns - Fully Qualified Names for elements (defaults to string)
|
|
680
|
-
* @typeParam Views - Types of views in the model (defaults to string)
|
|
681
|
-
* @typeParam DeploymentFqns - Fully Qualified Names for deployment nodes (defaults to string)
|
|
682
|
-
*/
|
|
683
|
-
interface ParsedLikeC4ModelData<A extends Any = UnknownParsed> extends BaseLikeC4ModelData<A> {
|
|
684
|
-
[_stage]: 'parsed';
|
|
685
|
-
views: Record<ViewId<A>, ParsedView<A>>;
|
|
686
|
-
}
|
|
687
|
-
interface ComputedLikeC4ModelData<A extends Any = UnknownComputed> extends BaseLikeC4ModelData<A> {
|
|
688
|
-
[_stage]: 'computed';
|
|
689
|
-
views: Record<ViewId<A>, ComputedView<A>>;
|
|
690
|
-
}
|
|
691
|
-
interface LayoutedLikeC4ModelData<A extends Any = UnknownLayouted> extends BaseLikeC4ModelData<A> {
|
|
692
|
-
[_stage]: 'layouted';
|
|
693
|
-
views: Record<ViewId<A>, LayoutedView<A>>;
|
|
694
|
-
}
|
|
695
|
-
type LikeC4ModelData<A extends Any> = ParsedLikeC4ModelData<A> | ComputedLikeC4ModelData<A> | LayoutedLikeC4ModelData<A>;
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* JSON representation of {@link Specification}
|
|
699
|
-
*/
|
|
700
|
-
interface SpecificationDump {
|
|
701
|
-
elements: {
|
|
702
|
-
[kind: string]: object;
|
|
703
|
-
};
|
|
704
|
-
tags?: {
|
|
705
|
-
[tag: string]: object;
|
|
706
|
-
};
|
|
707
|
-
deployments?: {
|
|
708
|
-
[kind: string]: object;
|
|
709
|
-
};
|
|
710
|
-
relationships?: {
|
|
711
|
-
[kind: string]: object;
|
|
712
|
-
};
|
|
713
|
-
metadataKeys?: string[];
|
|
714
|
-
customColors?: {
|
|
715
|
-
[kind: string]: object;
|
|
716
|
-
};
|
|
717
|
-
}
|
|
718
|
-
type SpecTypesFromDump<J> = J extends SpecificationDump ? SpecAux<KeysOf<J['elements']>, KeysOf<J['deployments']>, KeysOf<J['relationships']>, KeysOf<J['tags']>, J['metadataKeys'] extends readonly [string, ...string[]] ? J['metadataKeys'][number] : never> : SpecAux<never, never, never, never, never>;
|
|
719
|
-
/**
|
|
720
|
-
* Dump differs from {@link ParsedLikeC4ModelData} by the fact that it is computed or layouted
|
|
721
|
-
*/
|
|
722
|
-
type LikeC4ModelDump = {
|
|
723
|
-
[_stage]?: 'computed' | 'layouted';
|
|
724
|
-
projectId?: string;
|
|
725
|
-
project?: ProjectDump;
|
|
726
|
-
specification: SpecificationDump;
|
|
727
|
-
elements?: {
|
|
728
|
-
[kind: string]: object;
|
|
729
|
-
};
|
|
730
|
-
deployments: {
|
|
731
|
-
elements?: {
|
|
732
|
-
[kind: string]: object;
|
|
733
|
-
};
|
|
734
|
-
relations?: {};
|
|
735
|
-
};
|
|
736
|
-
views?: {
|
|
737
|
-
[kind: string]: object;
|
|
738
|
-
};
|
|
739
|
-
relations?: {};
|
|
740
|
-
globals?: {
|
|
741
|
-
predicates?: {};
|
|
742
|
-
dynamicPredicates?: {};
|
|
743
|
-
styles?: {};
|
|
744
|
-
};
|
|
745
|
-
imports?: {};
|
|
746
|
-
};
|
|
747
|
-
type ProjectDump = {
|
|
748
|
-
id: string;
|
|
749
|
-
name?: string;
|
|
750
|
-
title?: string | undefined;
|
|
751
|
-
};
|
|
752
|
-
type AuxFromDump<D> = D extends LikeC4ModelDump ? Aux<D[_stage] extends infer S extends string & 'computed' | 'layouted' ? S : 'computed' | 'layouted' | 'parsed', KeysOf<D['elements']>, KeysOf<D['deployments']['elements']>, KeysOf<D['views']>, D['projectId'] extends infer PID extends string ? PID : never, SpecTypesFromDump<D['specification']>> : Never;
|
|
753
|
-
|
|
754
|
-
interface RichTextEmpty {
|
|
755
|
-
readonly isEmpty: true;
|
|
756
|
-
readonly isMarkdown: false;
|
|
757
|
-
readonly nonEmpty: false;
|
|
758
|
-
readonly $source: null;
|
|
759
|
-
readonly text: null;
|
|
760
|
-
readonly md: null;
|
|
761
|
-
readonly html: null;
|
|
762
|
-
equals(other: unknown): boolean;
|
|
763
|
-
}
|
|
764
|
-
interface RichTextNonEmpty {
|
|
765
|
-
readonly isEmpty: false;
|
|
766
|
-
readonly nonEmpty: true;
|
|
767
|
-
readonly isMarkdown: boolean;
|
|
768
|
-
readonly $source: MarkdownOrString;
|
|
769
|
-
readonly text: string;
|
|
770
|
-
readonly md: string;
|
|
771
|
-
readonly html: string;
|
|
772
|
-
equals(other: unknown): boolean;
|
|
773
|
-
}
|
|
774
|
-
type RichTextOrEmpty = RichTextNonEmpty | RichTextEmpty;
|
|
775
|
-
/**
|
|
776
|
-
* RichText is a class that represents a potentially markdown string.
|
|
777
|
-
* It can be either a plain text or a markdown.
|
|
778
|
-
* It is used to represent the content of a node or a link.
|
|
779
|
-
*/
|
|
780
|
-
declare class RichText {
|
|
781
|
-
private static _cache;
|
|
782
|
-
/**
|
|
783
|
-
* Creates and memoizes a RichText instance.
|
|
784
|
-
* @see ElementModel.description
|
|
785
|
-
* @example
|
|
786
|
-
*
|
|
787
|
-
* get description(): RichTextOrEmpty {
|
|
788
|
-
* return RichText.memoize(this, this.$element.description)
|
|
789
|
-
* }
|
|
790
|
-
*/
|
|
791
|
-
static memoize(obj: object, tag: symbol | string, source: MarkdownOrString | null | undefined): RichTextOrEmpty;
|
|
792
|
-
/**
|
|
793
|
-
* Creates a RichText instance from a source.
|
|
794
|
-
*/
|
|
795
|
-
static from(source: RichTextOrEmpty | MarkdownOrString | string | null | undefined): RichTextOrEmpty;
|
|
796
|
-
/**
|
|
797
|
-
* This is a workaround for the fact that we need instance of RichText for `instanceof` checks
|
|
798
|
-
* It is invalid inheritance (returning `null` from getters), and we cast to @see RichTextEmpty
|
|
799
|
-
*/
|
|
800
|
-
static EMPTY: RichTextEmpty;
|
|
801
|
-
readonly $source: Readonly<MarkdownOrString> | null;
|
|
802
|
-
readonly isEmpty: boolean;
|
|
803
|
-
readonly nonEmpty: boolean;
|
|
804
|
-
readonly isMarkdown: boolean;
|
|
805
|
-
/**
|
|
806
|
-
* Private constructor to prevent direct instantiation.
|
|
807
|
-
* Use {@link RichText.from} or {@link RichText.memoize} instead.
|
|
808
|
-
*/
|
|
809
|
-
private constructor();
|
|
810
|
-
/**
|
|
811
|
-
* Returns the text content of the rich text.
|
|
812
|
-
* If the source is a string, it returns the string.
|
|
813
|
-
* If the source is a markdown, it returns the markdown.
|
|
814
|
-
*/
|
|
815
|
-
get text(): string;
|
|
816
|
-
/**
|
|
817
|
-
* Returns the markdown content of the rich text.
|
|
818
|
-
* If the source is a string, it returns the string.
|
|
819
|
-
* If the source is a markdown, it returns the markdown.
|
|
820
|
-
*/
|
|
821
|
-
get md(): string;
|
|
822
|
-
/**
|
|
823
|
-
* Returns the html content of the rich text.
|
|
824
|
-
* If the source is a string, it returns the string.
|
|
825
|
-
* If the source is a markdown, it returns the HTML.
|
|
826
|
-
*/
|
|
827
|
-
get html(): string;
|
|
828
|
-
equals(other: unknown): boolean;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
export { type ParsedView as $, type AuxFromLikeC4ModelData as A, BBox as B, type ComputedLikeC4ModelData as C, type DeploymentElementStyle as D, DefaultTextSize as E, type ElementStyle as F, type GlobalPredicateId as G, ensureSizes as H, type Element as I, DefaultLineStyle as J, DefaultArrowType as K, type LayoutedLikeC4ModelData as L, type ModelGlobals as M, DefaultRelationshipColor as N, type AbstractRelationship as O, type Point as P, type Relationship as Q, RichText as R, type SpecificationDump as S, type ModelRelation as T, type ElementSpecification as U, type TagSpecification as V, isTagColorSpecified as W, type XYPoint as X, type RelationshipSpecification as Y, type Specification as Z, type LikeC4Project as _, type RichTextEmpty as a, type ElementViewPredicate as a$, type LayoutedView as a0, isDiagramView as a1, type ComputedView as a2, type ProcessedView as a3, type AnyView as a4, type ViewOnStage as a5, type ViewWithType as a6, type ViewRule as a7, type ViewRulePredicate as a8, isViewRulePredicate as a9, type ComputedNode as aA, type ComputedEdge as aB, type ComputedElementView as aC, type ComputedDeploymentView as aD, type ComputedDynamicView as aE, type DiagramNode as aF, type DiagramEdge as aG, type LayoutedElementView as aH, type LayoutedDeploymentView as aI, type LayoutedDynamicView as aJ, type DeploymentViewIncludePredicate as aK, type DeploymentViewExcludePredicate as aL, type DeploymentViewPredicate as aM, type DeploymentViewRuleStyle as aN, type DeploymentViewRule as aO, type ParsedDeploymentView as aP, type DynamicViewStep as aQ, type DynamicViewParallelSteps as aR, getParallelStepsPrefix as aS, type DynamicViewStepOrParallel as aT, type DynamicViewIncludeRule as aU, type DynamicViewRule as aV, type DynamicViewDisplayVariant as aW, type ParsedDynamicView as aX, isDynamicViewParallelSteps as aY, type ElementViewIncludePredicate as aZ, type ElementViewExcludePredicate as a_, isViewRuleStyle as aa, isComputedView as ab, isElementView as ac, isScopedElementView as ad, isExtendsElementView as ae, isDeploymentView as af, isDynamicView as ag, type AnyIncludePredicate as ah, type AnyExcludePredicate as ai, type AnyViewRuleStyle as aj, type ViewRuleGlobalStyle as ak, isViewRuleGlobalStyle as al, type ViewRuleGlobalPredicateRef as am, isViewRuleGlobalPredicateRef as an, type AutoLayoutDirection as ao, isAutoLayoutDirection as ap, type ViewRuleAutoLayout as aq, isViewRuleAutoLayout as ar, type ViewAutoLayout as as, type ViewManualLayout as at, type ViewType as au, type BaseViewProperties as av, type BaseParsedViewProperties as aw, type NodeNotation as ax, type ViewWithNotation as ay, type ViewWithHash as az, type RichTextOrEmpty as b, type ElementViewRuleGroup as b0, isViewRuleGroup as b1, type ElementViewRuleStyle as b2, type ElementViewRule as b3, type ParsedElementView as b4, RectBox as c, type GlobalPredicates as d, type GlobalDynamicPredicates as e, type GlobalStyleID as f, type GlobalStyles as g, type ParsedLikeC4ModelData as h, type LikeC4ModelData as i, type DeploymentNode as j, type DeployedInstance as k, type DeploymentElement as l, type DeploymentElementRef as m, isDeploymentNode as n, isDeployedInstance as o, type DeploymentRelationship as p, type DeploymentRelation as q, type SpecTypesFromDump as r, type LikeC4ModelDump as s, type ProjectDump as t, type AuxFromDump as u, DefaultThemeColor as v, DefaultElementShape as w, DefaultSize as x, DefaultShapeSize as y, DefaultPaddingSize as z };
|