@likec4/core 1.10.1 → 1.12.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.
@@ -1,168 +1,4 @@
1
- /**
2
- Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
3
-
4
- @category Type
5
- */
6
- type Primitive =
7
- | null
8
- | undefined
9
- | string
10
- | number
11
- | boolean
12
- | symbol
13
- | bigint;
14
-
15
- declare global {
16
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
17
- interface SymbolConstructor {
18
- readonly observable: symbol;
19
- }
20
- }
21
-
22
- /**
23
- Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
24
-
25
- Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
26
-
27
- This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
28
-
29
- @example
30
- ```
31
- import type {LiteralUnion} from 'type-fest';
32
-
33
- // Before
34
-
35
- type Pet = 'dog' | 'cat' | string;
36
-
37
- const pet: Pet = '';
38
- // Start typing in your TypeScript-enabled IDE.
39
- // You **will not** get auto-completion for `dog` and `cat` literals.
40
-
41
- // After
42
-
43
- type Pet2 = LiteralUnion<'dog' | 'cat', string>;
44
-
45
- const pet: Pet2 = '';
46
- // You **will** get auto-completion for `dog` and `cat` literals.
47
- ```
48
-
49
- @category Type
50
- */
51
- type LiteralUnion<
52
- LiteralType,
53
- BaseType extends Primitive,
54
- > = LiteralType | (BaseType & Record<never, never>);
55
-
56
- declare const tag: unique symbol;
57
-
58
- type TagContainer<Token> = {
59
- readonly [tag]: Token;
60
- };
61
-
62
- type Tag$1<Token extends PropertyKey, TagMetadata> = TagContainer<{[K in Token]: TagMetadata}>;
63
-
64
- /**
65
- Attach a "tag" to an arbitrary type. This allows you to create distinct types, that aren't assignable to one another, for distinct concepts in your program that should not be interchangeable, even if their runtime values have the same type. (See examples.)
66
-
67
- A type returned by `Tagged` can be passed to `Tagged` again, to create a type with multiple tags.
68
-
69
- [Read more about tagged types.](https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d)
70
-
71
- A tag's name is usually a string (and must be a string, number, or symbol), but each application of a tag can also contain an arbitrary type as its "metadata". See {@link GetTagMetadata} for examples and explanation.
72
-
73
- A type `A` returned by `Tagged` is assignable to another type `B` returned by `Tagged` if and only if:
74
- - the underlying (untagged) type of `A` is assignable to the underlying type of `B`;
75
- - `A` contains at least all the tags `B` has;
76
- - and the metadata type for each of `A`'s tags is assignable to the metadata type of `B`'s corresponding tag.
77
-
78
- There have been several discussions about adding similar features to TypeScript. Unfortunately, nothing has (yet) moved forward:
79
- - [Microsoft/TypeScript#202](https://github.com/microsoft/TypeScript/issues/202)
80
- - [Microsoft/TypeScript#4895](https://github.com/microsoft/TypeScript/issues/4895)
81
- - [Microsoft/TypeScript#33290](https://github.com/microsoft/TypeScript/pull/33290)
82
-
83
- @example
84
- ```
85
- import type {Tagged} from 'type-fest';
86
-
87
- type AccountNumber = Tagged<number, 'AccountNumber'>;
88
- type AccountBalance = Tagged<number, 'AccountBalance'>;
89
-
90
- function createAccountNumber(): AccountNumber {
91
- // As you can see, casting from a `number` (the underlying type being tagged) is allowed.
92
- return 2 as AccountNumber;
93
- }
94
-
95
- function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance {
96
- return 4 as AccountBalance;
97
- }
98
-
99
- // This will compile successfully.
100
- getMoneyForAccount(createAccountNumber());
101
-
102
- // But this won't, because it has to be explicitly passed as an `AccountNumber` type!
103
- // Critically, you could not accidentally use an `AccountBalance` as an `AccountNumber`.
104
- getMoneyForAccount(2);
105
-
106
- // You can also use tagged values like their underlying, untagged type.
107
- // I.e., this will compile successfully because an `AccountNumber` can be used as a regular `number`.
108
- // In this sense, the underlying base type is not hidden, which differentiates tagged types from opaque types in other languages.
109
- const accountNumber = createAccountNumber() + 2;
110
- ```
111
-
112
- @example
113
- ```
114
- import type {Tagged} from 'type-fest';
115
-
116
- // You can apply multiple tags to a type by using `Tagged` repeatedly.
117
- type Url = Tagged<string, 'URL'>;
118
- type SpecialCacheKey = Tagged<Url, 'SpecialCacheKey'>;
119
-
120
- // You can also pass a union of tag names, so this is equivalent to the above, although it doesn't give you the ability to assign distinct metadata to each tag.
121
- type SpecialCacheKey2 = Tagged<string, 'URL' | 'SpecialCacheKey'>;
122
- ```
123
-
124
- @category Type
125
- */
126
- type Tagged<Type, TagName extends PropertyKey, TagMetadata = never> = Type & Tag$1<TagName, TagMetadata>;
127
-
128
- /**
129
- Revert a tagged type back to its original type by removing all tags.
130
-
131
- Why is this necessary?
132
-
133
- 1. Use a `Tagged` type as object keys
134
- 2. Prevent TS4058 error: "Return type of exported function has or is using name X from external module Y but cannot be named"
135
-
136
- @example
137
- ```
138
- import type {Tagged, UnwrapTagged} from 'type-fest';
139
-
140
- type AccountType = Tagged<'SAVINGS' | 'CHECKING', 'AccountType'>;
141
-
142
- const moneyByAccountType: Record<UnwrapTagged<AccountType>, number> = {
143
- SAVINGS: 99,
144
- CHECKING: 0.1
145
- };
146
-
147
- // Without UnwrapTagged, the following expression would throw a type error.
148
- const money = moneyByAccountType.SAVINGS; // TS error: Property 'SAVINGS' does not exist
149
-
150
- // Attempting to pass an non-Tagged type to UnwrapTagged will raise a type error.
151
- type WontWork = UnwrapTagged<string>;
152
- ```
153
-
154
- @category Type
155
- */
156
- type UnwrapTagged<TaggedType extends Tag$1<PropertyKey, any>> =
157
- RemoveAllTags<TaggedType>;
158
-
159
- type RemoveAllTags<T> = T extends Tag$1<PropertyKey, any>
160
- ? {
161
- [ThisTag in keyof T[typeof tag]]: T extends Tagged<infer Type, ThisTag, T[typeof tag][ThisTag]>
162
- ? RemoveAllTags<Type>
163
- : never
164
- }[keyof T[typeof tag]]
165
- : T;
1
+ import { LiteralUnion, Tagged, UnwrapTagged } from 'type-fest';
166
2
 
167
3
  declare const ThemeColors: readonly ["amber", "blue", "gray", "slate", "green", "indigo", "muted", "primary", "red", "secondary", "sky"];
168
4
  type ThemeColor = typeof ThemeColors[number];
@@ -303,6 +139,194 @@ type Filterable<FTag extends string = string, FKind extends string = string> = {
303
139
  type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
304
140
  declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
305
141
 
142
+ type RelationID = Tagged<string, 'RelationID'>;
143
+ type RelationshipKind = Tagged<string, 'RelationshipKind'>;
144
+ type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
145
+ type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'dot' | 'odot' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
146
+ declare const DefaultLineStyle = "dashed";
147
+ declare const DefaultArrowType = "normal";
148
+ declare const DefaultRelationshipColor = "gray";
149
+ interface Relation {
150
+ readonly id: RelationID;
151
+ readonly source: Fqn;
152
+ readonly target: Fqn;
153
+ readonly title: string;
154
+ readonly description?: string;
155
+ readonly technology?: string;
156
+ readonly tags?: NonEmptyArray<Tag>;
157
+ readonly kind?: RelationshipKind;
158
+ readonly color?: Color;
159
+ readonly line?: RelationshipLineType;
160
+ readonly head?: RelationshipArrowType;
161
+ readonly tail?: RelationshipArrowType;
162
+ readonly links?: NonEmptyArray<Link>;
163
+ readonly navigateTo?: ViewID;
164
+ readonly metadata?: {
165
+ [key: string]: string;
166
+ };
167
+ }
168
+ interface RelationshipKindSpecification {
169
+ readonly technology?: string;
170
+ readonly notation?: string;
171
+ readonly color?: Color;
172
+ readonly line?: RelationshipLineType;
173
+ readonly head?: RelationshipArrowType;
174
+ readonly tail?: RelationshipArrowType;
175
+ }
176
+
177
+ interface BaseExpr {
178
+ where?: never;
179
+ element?: never;
180
+ custom?: never;
181
+ expanded?: never;
182
+ elementKind?: never;
183
+ elementTag?: never;
184
+ isEqual?: never;
185
+ isDescedants?: never;
186
+ wildcard?: never;
187
+ source?: never;
188
+ target?: never;
189
+ inout?: never;
190
+ incoming?: never;
191
+ outgoing?: never;
192
+ customRelation?: never;
193
+ }
194
+ interface ElementRefExpr extends Omit<BaseExpr, 'element' | 'isDescedants'> {
195
+ element: Fqn;
196
+ isDescedants?: boolean;
197
+ }
198
+ declare function isElementRef(expr: Expression): expr is ElementRefExpr;
199
+ interface ExpandedElementExpr extends Omit<BaseExpr, 'expanded'> {
200
+ expanded: Fqn;
201
+ }
202
+ declare function isExpandedElementExpr(expr: Expression): expr is ExpandedElementExpr;
203
+ interface CustomElementExpr extends Omit<BaseExpr, 'custom'> {
204
+ custom: {
205
+ expr: ElementExpression | ElementWhereExpr;
206
+ title?: string;
207
+ description?: string;
208
+ technology?: string;
209
+ notation?: string;
210
+ shape?: ElementShape;
211
+ color?: Color;
212
+ icon?: IconUrl;
213
+ border?: BorderStyle;
214
+ opacity?: number;
215
+ navigateTo?: ViewID;
216
+ };
217
+ }
218
+ declare function isCustomElement(expr: Expression): expr is CustomElementExpr;
219
+ interface WildcardExpr extends Omit<BaseExpr, 'wildcard'> {
220
+ wildcard: true;
221
+ }
222
+ declare function isWildcard(expr: Expression): expr is WildcardExpr;
223
+ interface ElementKindExpr extends Omit<BaseExpr, 'elementKind' | 'isEqual'> {
224
+ elementKind: ElementKind;
225
+ isEqual: boolean;
226
+ }
227
+ declare function isElementKindExpr(expr: Expression): expr is ElementKindExpr;
228
+ interface ElementTagExpr extends Omit<BaseExpr, 'elementTag' | 'isEqual'> {
229
+ elementTag: Tag;
230
+ isEqual: boolean;
231
+ }
232
+ declare function isElementTagExpr(expr: Expression): expr is ElementTagExpr;
233
+ type ElementExpression = ElementRefExpr | WildcardExpr | ElementKindExpr | ElementTagExpr | ExpandedElementExpr;
234
+ declare function isElement(expr: Expression): expr is ElementExpression;
235
+ interface ElementWhereExpr extends Omit<BaseExpr, 'where'> {
236
+ where: {
237
+ expr: ElementExpression;
238
+ condition: WhereOperator<string, string>;
239
+ };
240
+ }
241
+ declare function isElementWhere(expr: Expression): expr is ElementWhereExpr;
242
+ type ElementPredicateExpression = ElementExpression | ElementWhereExpr | CustomElementExpr;
243
+ declare function isElementPredicateExpr(expr: Expression): expr is ElementPredicateExpression;
244
+ interface RelationExpr extends Omit<BaseExpr, 'source' | 'target'> {
245
+ source: ElementExpression;
246
+ target: ElementExpression;
247
+ isBidirectional?: boolean;
248
+ }
249
+ declare function isRelation(expr: Expression): expr is RelationExpr;
250
+ interface InOutExpr extends Omit<BaseExpr, 'inout'> {
251
+ inout: ElementExpression;
252
+ }
253
+ declare function isInOut(expr: Expression): expr is InOutExpr;
254
+ interface IncomingExpr extends Omit<BaseExpr, 'incoming'> {
255
+ incoming: ElementExpression;
256
+ }
257
+ declare function isIncoming(expr: Expression): expr is IncomingExpr;
258
+ interface OutgoingExpr extends Omit<BaseExpr, 'outgoing'> {
259
+ outgoing: ElementExpression;
260
+ }
261
+ declare function isOutgoing(expr: Expression): expr is OutgoingExpr;
262
+ type RelationExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
263
+ declare function isRelationExpression(expr: Expression): expr is RelationExpression;
264
+ interface RelationWhereExpr extends Omit<BaseExpr, 'where'> {
265
+ where: {
266
+ expr: RelationExpression;
267
+ condition: WhereOperator<string, string>;
268
+ };
269
+ }
270
+ declare function isRelationWhere(expr: Expression): expr is RelationWhereExpr;
271
+ interface CustomRelationExpr extends Omit<BaseExpr, 'customRelation'> {
272
+ customRelation: {
273
+ relation: RelationExpression | RelationWhereExpr;
274
+ title?: string;
275
+ description?: string;
276
+ technology?: string;
277
+ notation?: string;
278
+ navigateTo?: ViewID;
279
+ notes?: string;
280
+ color?: Color;
281
+ line?: RelationshipLineType;
282
+ head?: RelationshipArrowType;
283
+ tail?: RelationshipArrowType;
284
+ };
285
+ }
286
+ declare function isCustomRelationExpr(expr: Expression): expr is CustomRelationExpr;
287
+ type RelationPredicateExpression = RelationExpression | RelationWhereExpr | CustomRelationExpr;
288
+ declare function isRelationPredicateExpr(expr: Expression): expr is RelationPredicateExpression;
289
+ type Expression = ElementPredicateExpression | RelationPredicateExpression;
290
+
291
+ type expression_CustomElementExpr = CustomElementExpr;
292
+ type expression_CustomRelationExpr = CustomRelationExpr;
293
+ type expression_ElementExpression = ElementExpression;
294
+ type expression_ElementKindExpr = ElementKindExpr;
295
+ type expression_ElementPredicateExpression = ElementPredicateExpression;
296
+ type expression_ElementRefExpr = ElementRefExpr;
297
+ type expression_ElementTagExpr = ElementTagExpr;
298
+ type expression_ElementWhereExpr = ElementWhereExpr;
299
+ type expression_ExpandedElementExpr = ExpandedElementExpr;
300
+ type expression_Expression = Expression;
301
+ type expression_InOutExpr = InOutExpr;
302
+ type expression_IncomingExpr = IncomingExpr;
303
+ type expression_OutgoingExpr = OutgoingExpr;
304
+ type expression_RelationExpr = RelationExpr;
305
+ type expression_RelationExpression = RelationExpression;
306
+ type expression_RelationPredicateExpression = RelationPredicateExpression;
307
+ type expression_RelationWhereExpr = RelationWhereExpr;
308
+ type expression_WildcardExpr = WildcardExpr;
309
+ declare const expression_isCustomElement: typeof isCustomElement;
310
+ declare const expression_isCustomRelationExpr: typeof isCustomRelationExpr;
311
+ declare const expression_isElement: typeof isElement;
312
+ declare const expression_isElementKindExpr: typeof isElementKindExpr;
313
+ declare const expression_isElementPredicateExpr: typeof isElementPredicateExpr;
314
+ declare const expression_isElementRef: typeof isElementRef;
315
+ declare const expression_isElementTagExpr: typeof isElementTagExpr;
316
+ declare const expression_isElementWhere: typeof isElementWhere;
317
+ declare const expression_isExpandedElementExpr: typeof isExpandedElementExpr;
318
+ declare const expression_isInOut: typeof isInOut;
319
+ declare const expression_isIncoming: typeof isIncoming;
320
+ declare const expression_isOutgoing: typeof isOutgoing;
321
+ declare const expression_isRelation: typeof isRelation;
322
+ declare const expression_isRelationExpression: typeof isRelationExpression;
323
+ declare const expression_isRelationPredicateExpr: typeof isRelationPredicateExpr;
324
+ declare const expression_isRelationWhere: typeof isRelationWhere;
325
+ declare const expression_isWildcard: typeof isWildcard;
326
+ declare namespace expression {
327
+ 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 };
328
+ }
329
+
306
330
  type ElementNotation = {
307
331
  kinds: ElementKind[];
308
332
  shape: ElementShape;
@@ -330,8 +354,11 @@ interface ViewRuleStyle {
330
354
  }
331
355
  declare function isViewRuleStyle(rule: ViewRule): rule is ViewRuleStyle;
332
356
  type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
357
+ declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
333
358
  interface ViewRuleAutoLayout {
334
- autoLayout: AutoLayoutDirection;
359
+ direction: AutoLayoutDirection;
360
+ nodeSep?: number;
361
+ rankSep?: number;
335
362
  }
336
363
  declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
337
364
  type ViewRule = ViewRulePredicate | ViewRuleStyle | ViewRuleAutoLayout;
@@ -491,16 +518,21 @@ interface ViewWithNotation {
491
518
  elements: ElementNotation[];
492
519
  };
493
520
  }
521
+ interface ViewAutoLayout {
522
+ direction: ViewRuleAutoLayout['direction'];
523
+ rankSep?: number;
524
+ nodeSep?: number;
525
+ }
494
526
  interface ComputedElementView extends Omit<ElementView, 'rules' | 'docUri'>, ViewWithHash, ViewWithNotation {
495
527
  readonly extends?: ViewID;
496
- readonly autoLayout: ViewRuleAutoLayout['autoLayout'];
528
+ readonly autoLayout: ViewAutoLayout;
497
529
  readonly nodes: ComputedNode[];
498
530
  readonly edges: ComputedEdge[];
499
531
  rules?: never;
500
532
  docUri?: never;
501
533
  }
502
534
  interface ComputedDynamicView extends Omit<DynamicView, 'rules' | 'steps' | 'docUri'>, ViewWithHash, ViewWithNotation {
503
- readonly autoLayout: ViewRuleAutoLayout['autoLayout'];
535
+ readonly autoLayout: ViewAutoLayout;
504
536
  readonly nodes: ComputedNode[];
505
537
  readonly edges: ComputedEdge[];
506
538
  steps?: never;
@@ -546,7 +578,7 @@ type ViewManualLayout = {
546
578
  readonly y: number;
547
579
  readonly width: number;
548
580
  readonly height: number;
549
- readonly autoLayout: AutoLayoutDirection;
581
+ readonly autoLayout: ViewAutoLayout;
550
582
  readonly nodes: Record<string, {
551
583
  isCompound: boolean;
552
584
  x: number;
@@ -562,194 +594,6 @@ type ViewManualLayout = {
562
594
  }>;
563
595
  };
564
596
 
565
- type RelationID = Tagged<string, 'RelationID'>;
566
- type RelationshipKind = Tagged<string, 'RelationshipKind'>;
567
- type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
568
- type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'dot' | 'odot' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
569
- declare const DefaultLineStyle = "dashed";
570
- declare const DefaultArrowType = "normal";
571
- declare const DefaultRelationshipColor = "gray";
572
- interface Relation {
573
- readonly id: RelationID;
574
- readonly source: Fqn;
575
- readonly target: Fqn;
576
- readonly title: string;
577
- readonly description?: string;
578
- readonly technology?: string;
579
- readonly tags?: NonEmptyArray<Tag>;
580
- readonly kind?: RelationshipKind;
581
- readonly color?: Color;
582
- readonly line?: RelationshipLineType;
583
- readonly head?: RelationshipArrowType;
584
- readonly tail?: RelationshipArrowType;
585
- readonly links?: NonEmptyArray<Link>;
586
- readonly navigateTo?: ViewID;
587
- readonly metadata?: {
588
- [key: string]: string;
589
- };
590
- }
591
- interface RelationshipKindSpecification {
592
- readonly technology?: string;
593
- readonly notation?: string;
594
- readonly color?: Color;
595
- readonly line?: RelationshipLineType;
596
- readonly head?: RelationshipArrowType;
597
- readonly tail?: RelationshipArrowType;
598
- }
599
-
600
- interface BaseExpr {
601
- where?: never;
602
- element?: never;
603
- custom?: never;
604
- expanded?: never;
605
- elementKind?: never;
606
- elementTag?: never;
607
- isEqual?: never;
608
- isDescedants?: never;
609
- wildcard?: never;
610
- source?: never;
611
- target?: never;
612
- inout?: never;
613
- incoming?: never;
614
- outgoing?: never;
615
- customRelation?: never;
616
- }
617
- interface ElementRefExpr extends Omit<BaseExpr, 'element' | 'isDescedants'> {
618
- element: Fqn;
619
- isDescedants?: boolean;
620
- }
621
- declare function isElementRef(expr: Expression): expr is ElementRefExpr;
622
- interface ExpandedElementExpr extends Omit<BaseExpr, 'expanded'> {
623
- expanded: Fqn;
624
- }
625
- declare function isExpandedElementExpr(expr: Expression): expr is ExpandedElementExpr;
626
- interface CustomElementExpr extends Omit<BaseExpr, 'custom'> {
627
- custom: {
628
- expr: ElementExpression | ElementWhereExpr;
629
- title?: string;
630
- description?: string;
631
- technology?: string;
632
- notation?: string;
633
- shape?: ElementShape;
634
- color?: Color;
635
- icon?: IconUrl;
636
- border?: BorderStyle;
637
- opacity?: number;
638
- navigateTo?: ViewID;
639
- };
640
- }
641
- declare function isCustomElement(expr: Expression): expr is CustomElementExpr;
642
- interface WildcardExpr extends Omit<BaseExpr, 'wildcard'> {
643
- wildcard: true;
644
- }
645
- declare function isWildcard(expr: Expression): expr is WildcardExpr;
646
- interface ElementKindExpr extends Omit<BaseExpr, 'elementKind' | 'isEqual'> {
647
- elementKind: ElementKind;
648
- isEqual: boolean;
649
- }
650
- declare function isElementKindExpr(expr: Expression): expr is ElementKindExpr;
651
- interface ElementTagExpr extends Omit<BaseExpr, 'elementTag' | 'isEqual'> {
652
- elementTag: Tag;
653
- isEqual: boolean;
654
- }
655
- declare function isElementTagExpr(expr: Expression): expr is ElementTagExpr;
656
- type ElementExpression = ElementRefExpr | WildcardExpr | ElementKindExpr | ElementTagExpr | ExpandedElementExpr;
657
- declare function isElement(expr: Expression): expr is ElementExpression;
658
- interface ElementWhereExpr extends Omit<BaseExpr, 'where'> {
659
- where: {
660
- expr: ElementExpression;
661
- condition: WhereOperator<string, string>;
662
- };
663
- }
664
- declare function isElementWhere(expr: Expression): expr is ElementWhereExpr;
665
- type ElementPredicateExpression = ElementExpression | ElementWhereExpr | CustomElementExpr;
666
- declare function isElementPredicateExpr(expr: Expression): expr is ElementPredicateExpression;
667
- interface RelationExpr extends Omit<BaseExpr, 'source' | 'target'> {
668
- source: ElementExpression;
669
- target: ElementExpression;
670
- isBidirectional?: boolean;
671
- }
672
- declare function isRelation(expr: Expression): expr is RelationExpr;
673
- interface InOutExpr extends Omit<BaseExpr, 'inout'> {
674
- inout: ElementExpression;
675
- }
676
- declare function isInOut(expr: Expression): expr is InOutExpr;
677
- interface IncomingExpr extends Omit<BaseExpr, 'incoming'> {
678
- incoming: ElementExpression;
679
- }
680
- declare function isIncoming(expr: Expression): expr is IncomingExpr;
681
- interface OutgoingExpr extends Omit<BaseExpr, 'outgoing'> {
682
- outgoing: ElementExpression;
683
- }
684
- declare function isOutgoing(expr: Expression): expr is OutgoingExpr;
685
- type RelationExpression = RelationExpr | InOutExpr | IncomingExpr | OutgoingExpr;
686
- declare function isRelationExpression(expr: Expression): expr is RelationExpression;
687
- interface RelationWhereExpr extends Omit<BaseExpr, 'where'> {
688
- where: {
689
- expr: RelationExpression;
690
- condition: WhereOperator<string, string>;
691
- };
692
- }
693
- declare function isRelationWhere(expr: Expression): expr is RelationWhereExpr;
694
- interface CustomRelationExpr extends Omit<BaseExpr, 'customRelation'> {
695
- customRelation: {
696
- relation: RelationExpression | RelationWhereExpr;
697
- title?: string;
698
- description?: string;
699
- technology?: string;
700
- notation?: string;
701
- navigateTo?: ViewID;
702
- notes?: string;
703
- color?: Color;
704
- line?: RelationshipLineType;
705
- head?: RelationshipArrowType;
706
- tail?: RelationshipArrowType;
707
- };
708
- }
709
- declare function isCustomRelationExpr(expr: Expression): expr is CustomRelationExpr;
710
- type RelationPredicateExpression = RelationExpression | RelationWhereExpr | CustomRelationExpr;
711
- declare function isRelationPredicateExpr(expr: Expression): expr is RelationPredicateExpression;
712
- type Expression = ElementPredicateExpression | RelationPredicateExpression;
713
-
714
- type expression_CustomElementExpr = CustomElementExpr;
715
- type expression_CustomRelationExpr = CustomRelationExpr;
716
- type expression_ElementExpression = ElementExpression;
717
- type expression_ElementKindExpr = ElementKindExpr;
718
- type expression_ElementPredicateExpression = ElementPredicateExpression;
719
- type expression_ElementRefExpr = ElementRefExpr;
720
- type expression_ElementTagExpr = ElementTagExpr;
721
- type expression_ElementWhereExpr = ElementWhereExpr;
722
- type expression_ExpandedElementExpr = ExpandedElementExpr;
723
- type expression_Expression = Expression;
724
- type expression_InOutExpr = InOutExpr;
725
- type expression_IncomingExpr = IncomingExpr;
726
- type expression_OutgoingExpr = OutgoingExpr;
727
- type expression_RelationExpr = RelationExpr;
728
- type expression_RelationExpression = RelationExpression;
729
- type expression_RelationPredicateExpression = RelationPredicateExpression;
730
- type expression_RelationWhereExpr = RelationWhereExpr;
731
- type expression_WildcardExpr = WildcardExpr;
732
- declare const expression_isCustomElement: typeof isCustomElement;
733
- declare const expression_isCustomRelationExpr: typeof isCustomRelationExpr;
734
- declare const expression_isElement: typeof isElement;
735
- declare const expression_isElementKindExpr: typeof isElementKindExpr;
736
- declare const expression_isElementPredicateExpr: typeof isElementPredicateExpr;
737
- declare const expression_isElementRef: typeof isElementRef;
738
- declare const expression_isElementTagExpr: typeof isElementTagExpr;
739
- declare const expression_isElementWhere: typeof isElementWhere;
740
- declare const expression_isExpandedElementExpr: typeof isExpandedElementExpr;
741
- declare const expression_isInOut: typeof isInOut;
742
- declare const expression_isIncoming: typeof isIncoming;
743
- declare const expression_isOutgoing: typeof isOutgoing;
744
- declare const expression_isRelation: typeof isRelation;
745
- declare const expression_isRelationExpression: typeof isRelationExpression;
746
- declare const expression_isRelationPredicateExpr: typeof isRelationPredicateExpr;
747
- declare const expression_isRelationWhere: typeof isRelationWhere;
748
- declare const expression_isWildcard: typeof isWildcard;
749
- declare namespace expression {
750
- 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 };
751
- }
752
-
753
597
  /**
754
598
  * Parsed elements, relations, and views.
755
599
  */
@@ -767,8 +611,16 @@ interface ParsedLikeC4Model {
767
611
  * Same as `ParsedLikeC4Model` but with computed views.
768
612
  */
769
613
  interface ComputedLikeC4Model extends Omit<ParsedLikeC4Model, 'views'> {
614
+ __?: never;
770
615
  views: Record<ViewID, ComputedView>;
771
616
  }
617
+ /**
618
+ * Same as `ParsedLikeC4Model` but with layouted views (DiagramView)
619
+ */
620
+ interface LayoutedLikeC4Model extends Omit<ParsedLikeC4Model, 'views'> {
621
+ __: 'layouted';
622
+ views: Record<ViewID, DiagramView>;
623
+ }
772
624
 
773
625
  /**
774
626
  * OverviewGraph is a graph representation of all views in a model
@@ -831,4 +683,4 @@ declare namespace ViewChange {
831
683
  }
832
684
  type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
833
685
 
834
- export { type ElementPredicateExpression as $, AsFqn as A, BorderStyles as B, type ComputedView as C, DefaultThemeColor as D, type EdgeId as E, type Fqn as F, type CustomElementExpr as G, type HexColorLiteral as H, type IconUrl as I, isCustomElement as J, isWildcard as K, type LiteralUnion as L, type ElementKindExpr as M, type NodeId as N, isElementKindExpr as O, type Point as P, type ElementTagExpr as Q, type RelationID as R, isElementTagExpr as S, type ThemeColorValues as T, type ElementExpression as U, type ViewID as V, type WildcardExpr as W, type XYPoint as X, isElement as Y, type ElementWhereExpr as Z, isElementWhere as _, type Tag as a, type DynamicViewIncludeRule as a$, isElementPredicateExpr as a0, type RelationExpr as a1, isRelation as a2, type InOutExpr as a3, isInOut as a4, type IncomingExpr as a5, isIncoming as a6, type OutgoingExpr as a7, isOutgoing as a8, type RelationExpression as a9, DefaultArrowType as aA, DefaultRelationshipColor as aB, type RelationshipKindSpecification as aC, type ThemeColor as aD, type ColorLiteral as aE, isThemeColor as aF, type ElementThemeColorValues as aG, type ElementThemeColors as aH, type RelationshipThemeColorValues as aI, type RelationshipThemeColors as aJ, type LikeC4Theme as aK, type ViewRulePredicate as aL, isViewRulePredicate as aM, type ViewRuleStyle as aN, isViewRuleStyle as aO, type AutoLayoutDirection as aP, type ViewRuleAutoLayout as aQ, isViewRuleAutoLayout as aR, type ViewRule as aS, type BasicView as aT, type BasicElementView as aU, type ScopedElementView as aV, type ExtendsElementView as aW, type ElementView as aX, type DynamicViewStep as aY, type DynamicViewParallelSteps as aZ, type DynamicViewStepOrParallel as a_, isRelationExpression as aa, type RelationWhereExpr as ab, isRelationWhere as ac, type CustomRelationExpr as ad, isCustomRelationExpr as ae, type RelationPredicateExpression as af, isRelationPredicateExpr as ag, type Expression as ah, type ParsedLikeC4Model as ai, type EqualOperator as aj, type TagEqual as ak, isTagEqual as al, type KindEqual as am, isKindEqual as an, type NotOperator as ao, isNotOperator as ap, type AndOperator as aq, isAndOperator as ar, type OrOperator as as, isOrOperator as at, type WhereOperator as au, whereOperatorAsPredicate as av, OverviewGraph as aw, type RelationshipLineType as ax, type RelationshipArrowType as ay, DefaultLineStyle as az, type ComputedNode as b, isDynamicViewIncludeRule as b0, type DynamicViewRule as b1, type DynamicView as b2, isDynamicViewParallelSteps as b3, type CustomColorDefinitions as b4, type LikeC4View as b5, isDynamicView as b6, isElementView as b7, isExtendsElementView as b8, isScopedElementView as b9, type StepEdgeIdLiteral as ba, StepEdgeId as bb, isStepEdgeId as bc, extractStep as bd, getParallelStepsPrefix as be, type ViewWithHash as bf, type ViewWithNotation as bg, type ComputedElementView as bh, type ComputedDynamicView as bi, isComputedDynamicView as bj, isComputedElementView as bk, type BBox as bl, getBBoxCenter as bm, type DiagramNode as bn, type DiagramEdge as bo, type DiagramView as bp, type ViewManualLayout as bq, ViewChange as br, type ElementNotation as bs, type ElementKind as c, type ElementShape as d, type Color as e, type ComputedEdge as f, type ComputedLikeC4Model as g, type Element as h, type Relation as i, type RelationshipKind as j, type NonEmptyArray as k, expression as l, type NonEmptyReadonlyArray as m, type CustomColor as n, type BorderStyle as o, ElementShapes as p, DefaultElementShape as q, type ElementStyle as r, type TagSpec as s, type Link as t, type ElementKindSpecificationStyle as u, type ElementKindSpecification as v, type ElementRefExpr as w, isElementRef as x, type ExpandedElementExpr as y, isExpandedElementExpr as z };
686
+ export { isElement as $, AsFqn as A, BorderStyles as B, type ComputedView as C, type DiagramView as D, type EdgeId as E, type Fqn as F, isElementRef as G, type HexColorLiteral as H, type IconUrl as I, type ExpandedElementExpr as J, isExpandedElementExpr as K, type LayoutedLikeC4Model as L, type CustomElementExpr as M, type NodeId as N, isCustomElement as O, type Point as P, isWildcard as Q, type RelationID as R, type ElementKindExpr as S, type ThemeColorValues as T, isElementKindExpr as U, type ViewID as V, type WildcardExpr as W, type XYPoint as X, type ElementTagExpr as Y, isElementTagExpr as Z, type ElementExpression as _, type Tag as a, type ElementView as a$, type ElementWhereExpr as a0, isElementWhere as a1, type ElementPredicateExpression as a2, isElementPredicateExpr as a3, type RelationExpr as a4, isRelation as a5, type InOutExpr as a6, isInOut as a7, type IncomingExpr as a8, isIncoming as a9, type RelationshipLineType as aA, type RelationshipArrowType as aB, DefaultLineStyle as aC, DefaultArrowType as aD, DefaultRelationshipColor as aE, type RelationshipKindSpecification as aF, type ThemeColor as aG, type ColorLiteral as aH, isThemeColor as aI, type ElementThemeColorValues as aJ, type ElementThemeColors as aK, type RelationshipThemeColorValues as aL, type RelationshipThemeColors as aM, type LikeC4Theme as aN, type ViewRulePredicate as aO, isViewRulePredicate as aP, type ViewRuleStyle as aQ, isViewRuleStyle as aR, type AutoLayoutDirection as aS, isAutoLayoutDirection as aT, type ViewRuleAutoLayout as aU, isViewRuleAutoLayout as aV, type ViewRule as aW, type BasicView as aX, type BasicElementView as aY, type ScopedElementView as aZ, type ExtendsElementView as a_, type OutgoingExpr as aa, isOutgoing as ab, type RelationExpression as ac, isRelationExpression as ad, type RelationWhereExpr as ae, isRelationWhere as af, type CustomRelationExpr as ag, isCustomRelationExpr as ah, type RelationPredicateExpression as ai, isRelationPredicateExpr as aj, type Expression as ak, type ParsedLikeC4Model as al, type EqualOperator as am, type TagEqual as an, isTagEqual as ao, type KindEqual as ap, isKindEqual as aq, type NotOperator as ar, isNotOperator as as, type AndOperator as at, isAndOperator as au, type OrOperator as av, isOrOperator as aw, type WhereOperator as ax, whereOperatorAsPredicate as ay, OverviewGraph as az, type ComputedNode as b, type DynamicViewStep as b0, type DynamicViewParallelSteps as b1, type DynamicViewStepOrParallel as b2, type DynamicViewIncludeRule as b3, isDynamicViewIncludeRule as b4, type DynamicViewRule as b5, type DynamicView as b6, isDynamicViewParallelSteps as b7, type CustomColorDefinitions as b8, type LikeC4View as b9, isDynamicView as ba, isElementView as bb, isExtendsElementView as bc, isScopedElementView as bd, type StepEdgeIdLiteral as be, StepEdgeId as bf, isStepEdgeId as bg, extractStep as bh, getParallelStepsPrefix as bi, type ViewWithHash as bj, type ViewWithNotation as bk, type ViewAutoLayout as bl, type ComputedElementView as bm, type ComputedDynamicView as bn, isComputedDynamicView as bo, isComputedElementView as bp, type BBox as bq, getBBoxCenter as br, type ViewManualLayout as bs, ViewChange as bt, type ElementNotation as bu, type ElementKind as c, type ElementShape as d, type Color as e, type ComputedEdge as f, type ComputedLikeC4Model as g, type Element as h, type Relation as i, type RelationshipKind as j, type DiagramNode as k, type DiagramEdge as l, type NonEmptyArray as m, expression as n, type NonEmptyReadonlyArray as o, type CustomColor as p, type BorderStyle as q, ElementShapes as r, DefaultThemeColor as s, DefaultElementShape as t, type ElementStyle as u, type TagSpec as v, type Link as w, type ElementKindSpecificationStyle as x, type ElementKindSpecification as y, type ElementRefExpr as z };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types_index = require('../shared/core.Db3ntVII.cjs');
3
+ const types_index = require('../shared/core.CTiE4teS.cjs');
4
4
 
5
5
 
6
6
 
@@ -12,12 +12,12 @@ exports.DefaultLineStyle = types_index.DefaultLineStyle;
12
12
  exports.DefaultRelationshipColor = types_index.DefaultRelationshipColor;
13
13
  exports.DefaultThemeColor = types_index.DefaultThemeColor;
14
14
  exports.ElementShapes = types_index.ElementShapes;
15
- exports.Expr = types_index.expression;
16
15
  exports.StepEdgeId = types_index.StepEdgeId;
17
16
  exports.extractStep = types_index.extractStep;
18
17
  exports.getBBoxCenter = types_index.getBBoxCenter;
19
18
  exports.getParallelStepsPrefix = types_index.getParallelStepsPrefix;
20
19
  exports.isAndOperator = types_index.isAndOperator;
20
+ exports.isAutoLayoutDirection = types_index.isAutoLayoutDirection;
21
21
  exports.isComputedDynamicView = types_index.isComputedDynamicView;
22
22
  exports.isComputedElementView = types_index.isComputedElementView;
23
23
  exports.isCustomElement = types_index.isCustomElement;