likec4 1.9.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
3
3
 
4
4
  @category Type
5
5
  */
6
- type Primitive =
6
+ type Primitive$1 =
7
7
  | null
8
8
  | undefined
9
9
  | string
@@ -50,7 +50,7 @@ const pet: Pet2 = '';
50
50
  */
51
51
  type LiteralUnion<
52
52
  LiteralType,
53
- BaseType extends Primitive,
53
+ BaseType extends Primitive$1,
54
54
  > = LiteralType | (BaseType & Record<never, never>);
55
55
 
56
56
  declare const tag$1: unique symbol;
@@ -208,6 +208,7 @@ type Tag$2 = Tagged$1<string, 'Tag'>;
208
208
  interface Link {
209
209
  readonly title?: string;
210
210
  readonly url: string;
211
+ readonly relative?: string;
211
212
  }
212
213
  interface Element$1 {
213
214
  readonly id: Fqn$1;
@@ -270,37 +271,6 @@ type OrOperator<Tag, Kind> = Omit<AllNever, 'or'> & {
270
271
  };
271
272
  type WhereOperator<Tag, Kind> = TagEqual<Tag> | KindEqual<Kind> | NotOperator<Tag, Kind> | AndOperator<Tag, Kind> | OrOperator<Tag, Kind>;
272
273
 
273
- type RelationID$1 = Tagged$1<string, 'RelationID'>;
274
- type RelationshipKind$1 = Tagged$1<string, 'RelationshipKind'>;
275
- type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
276
- type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'dot' | 'odot' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
277
- interface Relation$1 {
278
- readonly id: RelationID$1;
279
- readonly source: Fqn$1;
280
- readonly target: Fqn$1;
281
- readonly title: string;
282
- readonly description?: string;
283
- readonly technology?: string;
284
- readonly tags?: NonEmptyArray<Tag$2>;
285
- readonly kind?: RelationshipKind$1;
286
- readonly color?: Color$1;
287
- readonly line?: RelationshipLineType;
288
- readonly head?: RelationshipArrowType;
289
- readonly tail?: RelationshipArrowType;
290
- readonly links?: NonEmptyArray<Link>;
291
- readonly metadata?: {
292
- [key: string]: string;
293
- };
294
- }
295
- interface RelationshipKindSpecification {
296
- readonly technology?: string;
297
- readonly notation?: string;
298
- readonly color?: Color$1;
299
- readonly line?: RelationshipLineType;
300
- readonly head?: RelationshipArrowType;
301
- readonly tail?: RelationshipArrowType;
302
- }
303
-
304
274
  type ElementNotation = {
305
275
  kinds: ElementKind$1[];
306
276
  shape: ElementShape$1;
@@ -375,31 +345,37 @@ interface DynamicViewStep$1 {
375
345
  readonly description?: string;
376
346
  readonly technology?: string;
377
347
  readonly notation?: string;
348
+ readonly notes?: string;
378
349
  readonly color?: Color$1;
379
350
  readonly line?: RelationshipLineType;
380
351
  readonly head?: RelationshipArrowType;
381
352
  readonly tail?: RelationshipArrowType;
382
353
  readonly isBackward?: boolean;
354
+ readonly navigateTo?: ViewID$1;
355
+ __parallel?: never;
383
356
  }
357
+ interface DynamicViewParallelSteps$1 {
358
+ readonly __parallel: DynamicViewStep$1[];
359
+ }
360
+ type DynamicViewStepOrParallel = DynamicViewStep$1 | DynamicViewParallelSteps$1;
384
361
  type DynamicViewIncludeRule = {
385
362
  include: ElementPredicateExpression[];
386
363
  };
387
364
  type DynamicViewRule$1 = DynamicViewIncludeRule | ViewRuleStyle$1 | ViewRuleAutoLayout$1;
388
365
  interface DynamicView$1 extends BasicView<'dynamic'> {
389
366
  readonly __: 'dynamic';
390
- readonly steps: DynamicViewStep$1[];
367
+ readonly steps: DynamicViewStepOrParallel[];
391
368
  readonly rules: DynamicViewRule$1[];
392
369
  }
393
370
  type CustomColorDefinitions = {
394
371
  [key: string]: ThemeColorValues;
395
372
  };
396
373
  type LikeC4View$1 = ElementView$1 | DynamicView$1;
397
- declare function isDynamicView(view: LikeC4View$1): view is DynamicView$1;
398
374
  type NodeId = Tagged$1<string, 'Fqn'>;
399
375
  type EdgeId$1 = Tagged$1<string, 'EdgeId'>;
400
- type StepEdgeIdLiteral = `step-${number}`;
376
+ type StepEdgeIdLiteral = `step-${number}` | `step-${number}.${number}`;
401
377
  type StepEdgeId = Tagged$1<StepEdgeIdLiteral, 'EdgeId'>;
402
- declare function StepEdgeId(step: number): StepEdgeId;
378
+ declare function StepEdgeId(step: number, parallelStep?: number): StepEdgeId;
403
379
  declare function isStepEdgeId(id: string): id is StepEdgeId;
404
380
  declare function extractStep(id: EdgeId$1): number;
405
381
  interface ComputedNode {
@@ -443,11 +419,14 @@ interface ComputedEdge {
443
419
  technology?: string;
444
420
  relations: RelationID$1[];
445
421
  kind?: RelationshipKind$1;
422
+ notation?: string;
423
+ notes?: string;
446
424
  color?: Color$1;
447
425
  line?: RelationshipLineType;
448
426
  head?: RelationshipArrowType;
449
427
  tail?: RelationshipArrowType;
450
428
  tags?: NonEmptyArray<Tag$2>;
429
+ navigateTo?: ViewID$1;
451
430
  /**
452
431
  * If this edge is derived from custom relationship predicate
453
432
  */
@@ -539,6 +518,38 @@ type ViewManualLayout = {
539
518
  }>;
540
519
  };
541
520
 
521
+ type RelationID$1 = Tagged$1<string, 'RelationID'>;
522
+ type RelationshipKind$1 = Tagged$1<string, 'RelationshipKind'>;
523
+ type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
524
+ type RelationshipArrowType = 'none' | 'normal' | 'onormal' | 'dot' | 'odot' | 'diamond' | 'odiamond' | 'crow' | 'open' | 'vee';
525
+ interface Relation$1 {
526
+ readonly id: RelationID$1;
527
+ readonly source: Fqn$1;
528
+ readonly target: Fqn$1;
529
+ readonly title: string;
530
+ readonly description?: string;
531
+ readonly technology?: string;
532
+ readonly tags?: NonEmptyArray<Tag$2>;
533
+ readonly kind?: RelationshipKind$1;
534
+ readonly color?: Color$1;
535
+ readonly line?: RelationshipLineType;
536
+ readonly head?: RelationshipArrowType;
537
+ readonly tail?: RelationshipArrowType;
538
+ readonly links?: NonEmptyArray<Link>;
539
+ readonly navigateTo?: ViewID$1;
540
+ readonly metadata?: {
541
+ [key: string]: string;
542
+ };
543
+ }
544
+ interface RelationshipKindSpecification {
545
+ readonly technology?: string;
546
+ readonly notation?: string;
547
+ readonly color?: Color$1;
548
+ readonly line?: RelationshipLineType;
549
+ readonly head?: RelationshipArrowType;
550
+ readonly tail?: RelationshipArrowType;
551
+ }
552
+
542
553
  interface BaseExpr {
543
554
  where?: never;
544
555
  element?: never;
@@ -625,6 +636,8 @@ interface CustomRelationExpr extends Omit<BaseExpr, 'customRelation'> {
625
636
  description?: string;
626
637
  technology?: string;
627
638
  notation?: string;
639
+ navigateTo?: ViewID$1;
640
+ notes?: string;
628
641
  color?: Color$1;
629
642
  line?: RelationshipLineType;
630
643
  head?: RelationshipArrowType;
@@ -715,158 +728,6 @@ declare namespace ViewChange {
715
728
  }
716
729
  type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
717
730
 
718
- type Numeric = number | bigint;
719
-
720
- /**
721
- Returns a boolean for whether the given type is `never`.
722
-
723
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
724
- @link https://stackoverflow.com/a/53984913/10292952
725
- @link https://www.zhenghao.io/posts/ts-never
726
-
727
- Useful in type utilities, such as checking if something does not occur.
728
-
729
- @example
730
- ```
731
- import type {IsNever, And} from 'type-fest';
732
-
733
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
734
- type AreStringsEqual<A extends string, B extends string> =
735
- And<
736
- IsNever<Exclude<A, B>> extends true ? true : false,
737
- IsNever<Exclude<B, A>> extends true ? true : false
738
- >;
739
-
740
- type EndIfEqual<I extends string, O extends string> =
741
- AreStringsEqual<I, O> extends true
742
- ? never
743
- : void;
744
-
745
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
746
- if (input === output) {
747
- process.exit(0);
748
- }
749
- }
750
-
751
- endIfEqual('abc', 'abc');
752
- //=> never
753
-
754
- endIfEqual('abc', '123');
755
- //=> void
756
- ```
757
-
758
- @category Type Guard
759
- @category Utilities
760
- */
761
- type IsNever$1<T> = [T] extends [never] ? true : false;
762
-
763
- /**
764
- Returns a boolean for whether the given type `T` is the specified `LiteralType`.
765
-
766
- @link https://stackoverflow.com/a/52806744/10292952
767
-
768
- @example
769
- ```
770
- LiteralCheck<1, number>
771
- //=> true
772
-
773
- LiteralCheck<number, number>
774
- //=> false
775
-
776
- LiteralCheck<1, string>
777
- //=> false
778
- ```
779
- */
780
- type LiteralCheck<T, LiteralType extends Primitive> = (
781
- IsNever$1<T> extends false // Must be wider than `never`
782
- ? [T] extends [LiteralType & infer U] // Remove any branding
783
- ? [U] extends [LiteralType] // Must be narrower than `LiteralType`
784
- ? [LiteralType] extends [U] // Cannot be wider than `LiteralType`
785
- ? false
786
- : true
787
- : false
788
- : false
789
- : false
790
- );
791
-
792
- /**
793
- Returns a boolean for whether the given type `T` is one of the specified literal types in `LiteralUnionType`.
794
-
795
- @example
796
- ```
797
- LiteralChecks<1, Numeric>
798
- //=> true
799
-
800
- LiteralChecks<1n, Numeric>
801
- //=> true
802
-
803
- LiteralChecks<bigint, Numeric>
804
- //=> false
805
- ```
806
- */
807
- type LiteralChecks<T, LiteralUnionType> = (
808
- // Conditional type to force union distribution.
809
- // If `T` is none of the literal types in the union `LiteralUnionType`, then `LiteralCheck<T, LiteralType>` will evaluate to `false` for the whole union.
810
- // If `T` is one of the literal types in the union, it will evaluate to `boolean` (i.e. `true | false`)
811
- IsNotFalse<LiteralUnionType extends Primitive
812
- ? LiteralCheck<T, LiteralUnionType>
813
- : never
814
- >
815
- );
816
-
817
- /**
818
- Returns a boolean for whether the given type is a `number` or `bigint` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
819
-
820
- Useful for:
821
- - providing strongly-typed functions when given literal arguments
822
- - type utilities, such as when constructing parsers and ASTs
823
-
824
- @example
825
- ```
826
- import type {IsNumericLiteral} from 'type-fest';
827
-
828
- // https://github.com/inocan-group/inferred-types/blob/master/src/types/boolean-logic/EndsWith.ts
829
- type EndsWith<TValue, TEndsWith extends string> =
830
- TValue extends string
831
- ? IsStringLiteral<TEndsWith> extends true
832
- ? IsStringLiteral<TValue> extends true
833
- ? TValue extends `${string}${TEndsWith}`
834
- ? true
835
- : false
836
- : boolean
837
- : boolean
838
- : TValue extends number
839
- ? IsNumericLiteral<TValue> extends true
840
- ? EndsWith<`${TValue}`, TEndsWith>
841
- : false
842
- : false;
843
-
844
- function endsWith<Input extends string | number, End extends string>(input: Input, end: End) {
845
- return `${input}`.endsWith(end) as EndsWith<Input, End>;
846
- }
847
-
848
- endsWith('abc', 'c');
849
- //=> true
850
-
851
- endsWith(123456, '456');
852
- //=> true
853
-
854
- const end = '123' as string;
855
-
856
- endsWith('abc123', end);
857
- //=> boolean
858
- ```
859
-
860
- @category Type Guard
861
- @category Utilities
862
- */
863
- type IsNumericLiteral<T> = LiteralChecks<T, Numeric>;
864
-
865
- /**
866
- Returns a boolean for whether the given `boolean` is not `false`.
867
- */
868
- type IsNotFalse<T extends boolean> = [T] extends [false] ? false : true;
869
-
870
731
  declare const ElementColors: {
871
732
  readonly primary: {
872
733
  fill: "#3b82f6";
@@ -1390,49 +1251,222 @@ declare function ancestorsFqn(fqn: Fqn$1): Fqn$1[];
1390
1251
  * - Positive number if a is deeper than b.
1391
1252
  * - Negative number if b is deeper than a.
1392
1253
  */
1393
- declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
1254
+ declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): -1 | 0 | 1;
1394
1255
  declare function compareByFqnHierarchically<T extends {
1395
1256
  id: string;
1396
- }>(a: T, b: T): number;
1257
+ }>(a: T, b: T): 0 | 1 | -1;
1397
1258
 
1398
1259
  /**
1399
- * This should only be used for defining generics which extend any kind of JS
1400
- * array under the hood, this includes arrays *AND* tuples (of the form [x, y],
1401
- * and of the form [x, ...y[]], etc...), and their readonly equivalent. This
1402
- * allows us to be more inclusive to what functions can process.
1403
- *
1404
- * @example map<T extends ArrayLike>(items: T) { ... }
1405
- *
1406
- * We would've named this `ArrayLike`, but that's already used by typescript...
1407
- * @see This was inspired by the type-definition of Promise.all (https://github.com/microsoft/TypeScript/blob/1df5717b120cddd325deab8b0f2b2c3eecaf2b01/src/lib/es2015.promise.d.ts#L21)
1408
- */
1409
- type IterableContainer<T = unknown> = ReadonlyArray<T> | readonly [];
1260
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
1410
1261
 
1411
- type ArraySetRequired<T extends IterableContainer, Min extends number, Iteration extends ReadonlyArray<unknown> = []> = number extends Min ? never : Iteration["length"] extends Min ? T : T extends readonly [] ? never : T extends [infer Head, ...infer Rest] ? [
1412
- Head,
1413
- ...ArraySetRequired<Rest, Min, [unknown, ...Iteration]>
1414
- ] : T extends readonly [infer Head, ...infer Rest] ? readonly [
1415
- Head,
1416
- ...ArraySetRequired<Rest, Min, [unknown, ...Iteration]>
1417
- ] : T extends Array<infer Item> ? [
1418
- Item,
1419
- ...ArraySetRequired<T, Min, [unknown, ...Iteration]>
1420
- ] : T extends ReadonlyArray<infer Item> ? readonly [
1421
- Item,
1422
- ...ArraySetRequired<T, Min, [unknown, ...Iteration]>
1423
- ] : never;
1424
- /**
1425
- * Checks if the given array has at least the defined number of elements. When
1426
- * the minimum used is a literal (e.g. `3`) the output is refined accordingly so
1427
- * that those indices are defined when accessing the array even when using
1428
- * typescript's 'noUncheckedIndexAccess'.
1429
- *
1430
- * @param data - The input array.
1431
- * @param minimum - The minimum number of elements the array must have.
1432
- * @returns True if the array's length is *at least* `minimum`. When `minimum`
1433
- * is a literal value, the output is narrowed to ensure the first items are
1434
- * guaranteed.
1435
- * @signature
1262
+ @category Type
1263
+ */
1264
+ type Primitive =
1265
+ | null
1266
+ | undefined
1267
+ | string
1268
+ | number
1269
+ | boolean
1270
+ | symbol
1271
+ | bigint;
1272
+
1273
+ declare global {
1274
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1275
+ interface SymbolConstructor {
1276
+ readonly observable: symbol;
1277
+ }
1278
+ }
1279
+
1280
+ type Numeric = number | bigint;
1281
+
1282
+ /**
1283
+ Returns a boolean for whether the given type is `never`.
1284
+
1285
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
1286
+ @link https://stackoverflow.com/a/53984913/10292952
1287
+ @link https://www.zhenghao.io/posts/ts-never
1288
+
1289
+ Useful in type utilities, such as checking if something does not occur.
1290
+
1291
+ @example
1292
+ ```
1293
+ import type {IsNever, And} from 'type-fest';
1294
+
1295
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
1296
+ type AreStringsEqual<A extends string, B extends string> =
1297
+ And<
1298
+ IsNever<Exclude<A, B>> extends true ? true : false,
1299
+ IsNever<Exclude<B, A>> extends true ? true : false
1300
+ >;
1301
+
1302
+ type EndIfEqual<I extends string, O extends string> =
1303
+ AreStringsEqual<I, O> extends true
1304
+ ? never
1305
+ : void;
1306
+
1307
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
1308
+ if (input === output) {
1309
+ process.exit(0);
1310
+ }
1311
+ }
1312
+
1313
+ endIfEqual('abc', 'abc');
1314
+ //=> never
1315
+
1316
+ endIfEqual('abc', '123');
1317
+ //=> void
1318
+ ```
1319
+
1320
+ @category Type Guard
1321
+ @category Utilities
1322
+ */
1323
+ type IsNever$1<T> = [T] extends [never] ? true : false;
1324
+
1325
+ /**
1326
+ Returns a boolean for whether the given type `T` is the specified `LiteralType`.
1327
+
1328
+ @link https://stackoverflow.com/a/52806744/10292952
1329
+
1330
+ @example
1331
+ ```
1332
+ LiteralCheck<1, number>
1333
+ //=> true
1334
+
1335
+ LiteralCheck<number, number>
1336
+ //=> false
1337
+
1338
+ LiteralCheck<1, string>
1339
+ //=> false
1340
+ ```
1341
+ */
1342
+ type LiteralCheck<T, LiteralType extends Primitive> = (
1343
+ IsNever$1<T> extends false // Must be wider than `never`
1344
+ ? [T] extends [LiteralType & infer U] // Remove any branding
1345
+ ? [U] extends [LiteralType] // Must be narrower than `LiteralType`
1346
+ ? [LiteralType] extends [U] // Cannot be wider than `LiteralType`
1347
+ ? false
1348
+ : true
1349
+ : false
1350
+ : false
1351
+ : false
1352
+ );
1353
+
1354
+ /**
1355
+ Returns a boolean for whether the given type `T` is one of the specified literal types in `LiteralUnionType`.
1356
+
1357
+ @example
1358
+ ```
1359
+ LiteralChecks<1, Numeric>
1360
+ //=> true
1361
+
1362
+ LiteralChecks<1n, Numeric>
1363
+ //=> true
1364
+
1365
+ LiteralChecks<bigint, Numeric>
1366
+ //=> false
1367
+ ```
1368
+ */
1369
+ type LiteralChecks<T, LiteralUnionType> = (
1370
+ // Conditional type to force union distribution.
1371
+ // If `T` is none of the literal types in the union `LiteralUnionType`, then `LiteralCheck<T, LiteralType>` will evaluate to `false` for the whole union.
1372
+ // If `T` is one of the literal types in the union, it will evaluate to `boolean` (i.e. `true | false`)
1373
+ IsNotFalse<LiteralUnionType extends Primitive
1374
+ ? LiteralCheck<T, LiteralUnionType>
1375
+ : never
1376
+ >
1377
+ );
1378
+
1379
+ /**
1380
+ Returns a boolean for whether the given type is a `number` or `bigint` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
1381
+
1382
+ Useful for:
1383
+ - providing strongly-typed functions when given literal arguments
1384
+ - type utilities, such as when constructing parsers and ASTs
1385
+
1386
+ @example
1387
+ ```
1388
+ import type {IsNumericLiteral} from 'type-fest';
1389
+
1390
+ // https://github.com/inocan-group/inferred-types/blob/master/src/types/boolean-logic/EndsWith.ts
1391
+ type EndsWith<TValue, TEndsWith extends string> =
1392
+ TValue extends string
1393
+ ? IsStringLiteral<TEndsWith> extends true
1394
+ ? IsStringLiteral<TValue> extends true
1395
+ ? TValue extends `${string}${TEndsWith}`
1396
+ ? true
1397
+ : false
1398
+ : boolean
1399
+ : boolean
1400
+ : TValue extends number
1401
+ ? IsNumericLiteral<TValue> extends true
1402
+ ? EndsWith<`${TValue}`, TEndsWith>
1403
+ : false
1404
+ : false;
1405
+
1406
+ function endsWith<Input extends string | number, End extends string>(input: Input, end: End) {
1407
+ return `${input}`.endsWith(end) as EndsWith<Input, End>;
1408
+ }
1409
+
1410
+ endsWith('abc', 'c');
1411
+ //=> true
1412
+
1413
+ endsWith(123456, '456');
1414
+ //=> true
1415
+
1416
+ const end = '123' as string;
1417
+
1418
+ endsWith('abc123', end);
1419
+ //=> boolean
1420
+ ```
1421
+
1422
+ @category Type Guard
1423
+ @category Utilities
1424
+ */
1425
+ type IsNumericLiteral<T> = LiteralChecks<T, Numeric>;
1426
+
1427
+ /**
1428
+ Returns a boolean for whether the given `boolean` is not `false`.
1429
+ */
1430
+ type IsNotFalse<T extends boolean> = [T] extends [false] ? false : true;
1431
+
1432
+ /**
1433
+ * This should only be used for defining generics which extend any kind of JS
1434
+ * array under the hood, this includes arrays *AND* tuples (of the form [x, y],
1435
+ * and of the form [x, ...y[]], etc...), and their readonly equivalent. This
1436
+ * allows us to be more inclusive to what functions can process.
1437
+ *
1438
+ * @example map<T extends ArrayLike>(items: T) { ... }
1439
+ *
1440
+ * We would've named this `ArrayLike`, but that's already used by typescript...
1441
+ * @see This was inspired by the type-definition of Promise.all (https://github.com/microsoft/TypeScript/blob/1df5717b120cddd325deab8b0f2b2c3eecaf2b01/src/lib/es2015.promise.d.ts#L21)
1442
+ */
1443
+ type IterableContainer<T = unknown> = ReadonlyArray<T> | readonly [];
1444
+
1445
+ type ArraySetRequired<T extends IterableContainer, Min extends number, Iteration extends ReadonlyArray<unknown> = []> = number extends Min ? never : Iteration["length"] extends Min ? T : T extends readonly [] ? never : T extends [infer Head, ...infer Rest] ? [
1446
+ Head,
1447
+ ...ArraySetRequired<Rest, Min, [unknown, ...Iteration]>
1448
+ ] : T extends readonly [infer Head, ...infer Rest] ? readonly [
1449
+ Head,
1450
+ ...ArraySetRequired<Rest, Min, [unknown, ...Iteration]>
1451
+ ] : T extends Array<infer Item> ? [
1452
+ Item,
1453
+ ...ArraySetRequired<T, Min, [unknown, ...Iteration]>
1454
+ ] : T extends ReadonlyArray<infer Item> ? readonly [
1455
+ Item,
1456
+ ...ArraySetRequired<T, Min, [unknown, ...Iteration]>
1457
+ ] : never;
1458
+ /**
1459
+ * Checks if the given array has at least the defined number of elements. When
1460
+ * the minimum used is a literal (e.g. `3`) the output is refined accordingly so
1461
+ * that those indices are defined when accessing the array even when using
1462
+ * typescript's 'noUncheckedIndexAccess'.
1463
+ *
1464
+ * @param data - The input array.
1465
+ * @param minimum - The minimum number of elements the array must have.
1466
+ * @returns True if the array's length is *at least* `minimum`. When `minimum`
1467
+ * is a literal value, the output is narrowed to ensure the first items are
1468
+ * guaranteed.
1469
+ * @signature
1436
1470
  * R.hasAtLeast(data, minimum)
1437
1471
  * @example
1438
1472
  * R.hasAtLeast([], 4); // => false
@@ -1479,7 +1513,7 @@ declare function hasAtLeast(minimum: number): (data: IterableContainer) => boole
1479
1513
  declare const compareRelations: <T extends {
1480
1514
  source: string;
1481
1515
  target: string;
1482
- }>(a: T, b: T) => number;
1516
+ }>(a: T, b: T) => 0 | 1 | -1;
1483
1517
 
1484
1518
  /**
1485
1519
  * A tagging type for string properties that are actually document URIs.
@@ -6703,7 +6737,7 @@ interface UriComponents {
6703
6737
  }
6704
6738
 
6705
6739
  /******************************************************************************
6706
- * This file was generated by langium-cli 3.1.0.
6740
+ * This file was generated by langium-cli 3.2.0.
6707
6741
  * DO NOT EDIT MANUALLY!
6708
6742
  ******************************************************************************/
6709
6743
 
@@ -7156,28 +7190,284 @@ interface FileSystemProvider {
7156
7190
  }
7157
7191
 
7158
7192
  /******************************************************************************
7159
- * Copyright 2022 TypeFox GmbH
7193
+ * Copyright 2021 TypeFox GmbH
7160
7194
  * This program and the accompanying materials are made available under the
7161
7195
  * terms of the MIT License, which is available in the project root.
7162
7196
  ******************************************************************************/
7163
-
7164
- interface LexerResult {
7197
+ /**
7198
+ * A stream is a read-only sequence of values. While the contents of an array can be accessed
7199
+ * both sequentially and randomly (via index), a stream allows only sequential access.
7200
+ *
7201
+ * The advantage of this is that a stream can be evaluated lazily, so it does not require
7202
+ * to store intermediate values. This can boost performance when a large sequence is
7203
+ * processed via filtering, mapping etc. and accessed at most once. However, lazy
7204
+ * evaluation means that all processing is repeated when you access the sequence multiple
7205
+ * times; in such a case, it may be better to store the resulting sequence into an array.
7206
+ */
7207
+ interface Stream<T> extends Iterable<T> {
7165
7208
  /**
7166
- * A list of all tokens that were lexed from the input.
7209
+ * Returns an iterator for this stream. This is the same as calling the `Symbol.iterator` function property.
7210
+ */
7211
+ iterator(): IterableIterator<T>;
7212
+ /**
7213
+ * Determines whether this stream contains no elements.
7214
+ */
7215
+ isEmpty(): boolean;
7216
+ /**
7217
+ * Determines the number of elements in this stream.
7218
+ */
7219
+ count(): number;
7220
+ /**
7221
+ * Collects all elements of this stream into an array.
7222
+ */
7223
+ toArray(): T[];
7224
+ /**
7225
+ * Collects all elements of this stream into a Set.
7226
+ */
7227
+ toSet(): Set<T>;
7228
+ /**
7229
+ * Collects all elements of this stream into a Map, applying the provided functions to determine keys and values.
7167
7230
  *
7168
- * Note that Langium requires the optional properties
7169
- * `startLine`, `startColumn`, `endOffset`, `endLine` and `endColumn` to be set on each token.
7231
+ * @param keyFn The function to derive map keys. If omitted, the stream elements are used as keys.
7232
+ * @param valueFn The function to derive map values. If omitted, the stream elements are used as values.
7170
7233
  */
7171
- tokens: IToken[];
7234
+ toMap<K = T, V = T>(keyFn?: (e: T) => K, valueFn?: (e: T) => V): Map<K, V>;
7172
7235
  /**
7173
- * Contains hidden tokens, usually comments.
7236
+ * Returns a string representation of a stream.
7174
7237
  */
7175
- hidden: IToken[];
7176
- errors: ILexingError[];
7177
- }
7238
+ toString(): string;
7239
+ /**
7240
+ * Combines two streams by returning a new stream that yields all elements of this stream and the other stream.
7241
+ *
7242
+ * @param other Stream to be concatenated with this one.
7243
+ */
7244
+ concat<T2>(other: Iterable<T2>): Stream<T | T2>;
7245
+ /**
7246
+ * Adds all elements of the stream into a string, separated by the specified separator string.
7247
+ *
7248
+ * @param separator A string used to separate one element of the stream from the next in the resulting string.
7249
+ * If omitted, the steam elements are separated with a comma.
7250
+ */
7251
+ join(separator?: string): string;
7252
+ /**
7253
+ * Returns the index of the first occurrence of a value in the stream, or -1 if it is not present.
7254
+ *
7255
+ * @param searchElement The value to locate in the array.
7256
+ * @param fromIndex The stream index at which to begin the search. If fromIndex is omitted, the search
7257
+ * starts at index 0.
7258
+ */
7259
+ indexOf(searchElement: T, fromIndex?: number): number;
7260
+ /**
7261
+ * Determines whether all members of the stream satisfy the specified test.
7262
+ *
7263
+ * @param predicate This method calls the predicate function for each element in the stream until the
7264
+ * predicate returns a value which is coercible to the Boolean value `false`, or until the end
7265
+ * of the stream.
7266
+ */
7267
+ every<S extends T>(predicate: (value: T) => value is S): this is Stream<S>;
7268
+ every(predicate: (value: T) => unknown): boolean;
7269
+ /**
7270
+ * Determines whether any member of the stream satisfies the specified test.
7271
+ *
7272
+ * @param predicate This method calls the predicate function for each element in the stream until the
7273
+ * predicate returns a value which is coercible to the Boolean value `true`, or until the end
7274
+ * of the stream.
7275
+ */
7276
+ some(predicate: (value: T) => unknown): boolean;
7277
+ /**
7278
+ * Performs the specified action for each element in the stream.
7279
+ *
7280
+ * @param callbackfn Function called once for each element in the stream.
7281
+ */
7282
+ forEach(callbackfn: (value: T, index: number) => void): void;
7283
+ /**
7284
+ * Returns a stream that yields the results of calling the specified callback function on each element
7285
+ * of the stream. The function is called when the resulting stream elements are actually accessed, so
7286
+ * accessing the resulting stream multiple times means the function is also called multiple times for
7287
+ * each element of the stream.
7288
+ *
7289
+ * @param callbackfn Lazily evaluated function mapping stream elements.
7290
+ */
7291
+ map<U>(callbackfn: (value: T) => U): Stream<U>;
7292
+ /**
7293
+ * Returns the elements of the stream that meet the condition specified in a callback function.
7294
+ * The function is called when the resulting stream elements are actually accessed, so accessing the
7295
+ * resulting stream multiple times means the function is also called multiple times for each element
7296
+ * of the stream.
7297
+ *
7298
+ * @param predicate Lazily evaluated function checking a condition on stream elements.
7299
+ */
7300
+ filter<S extends T>(predicate: (value: T) => value is S): Stream<S>;
7301
+ filter(predicate: (value: T) => unknown): Stream<T>;
7302
+ /**
7303
+ * Returns the elements of the stream that are _non-nullable_, which means they are neither `undefined`
7304
+ * nor `null`.
7305
+ */
7306
+ nonNullable(): Stream<NonNullable<T>>;
7307
+ /**
7308
+ * Calls the specified callback function for all elements in the stream. The return value of the
7309
+ * callback function is the accumulated result, and is provided as an argument in the next call to
7310
+ * the callback function.
7311
+ *
7312
+ * @param callbackfn This method calls the function once for each element in the stream, providing
7313
+ * the previous and current values of the reduction.
7314
+ * @param initialValue If specified, `initialValue` is used as the initial value to start the
7315
+ * accumulation. The first call to the function provides this value as an argument instead
7316
+ * of a stream value.
7317
+ */
7318
+ reduce(callbackfn: (previousValue: T, currentValue: T) => T): T | undefined;
7319
+ reduce<U = T>(callbackfn: (previousValue: U, currentValue: T) => U, initialValue: U): U;
7320
+ /**
7321
+ * Calls the specified callback function for all elements in the stream, in descending order.
7322
+ * The return value of the callback function is the accumulated result, and is provided as an
7323
+ * argument in the next call to the callback function.
7324
+ *
7325
+ * @param callbackfn This method calls the function once for each element in the stream, providing
7326
+ * the previous and current values of the reduction.
7327
+ * @param initialValue If specified, `initialValue` is used as the initial value to start the
7328
+ * accumulation. The first call to the function provides this value as an argument instead
7329
+ * of an array value.
7330
+ */
7331
+ reduceRight(callbackfn: (previousValue: T, currentValue: T) => T): T | undefined;
7332
+ reduceRight<U = T>(callbackfn: (previousValue: U, currentValue: T) => U, initialValue: U): U;
7333
+ /**
7334
+ * Returns the value of the first element in the stream that meets the condition, or `undefined`
7335
+ * if there is no such element.
7336
+ *
7337
+ * @param predicate This method calls `predicate` once for each element of the stream, in ascending
7338
+ * order, until it finds one where `predicate` returns a value which is coercible to the
7339
+ * Boolean value `true`.
7340
+ */
7341
+ find<S extends T>(predicate: (value: T) => value is S): S | undefined;
7342
+ find(predicate: (value: T) => unknown): T | undefined;
7343
+ /**
7344
+ * Returns the index of the first element in the stream that meets the condition, or `-1`
7345
+ * if there is no such element.
7346
+ *
7347
+ * @param predicate This method calls `predicate` once for each element of the stream, in ascending
7348
+ * order, until it finds one where `predicate` returns a value which is coercible to the
7349
+ * Boolean value `true`.
7350
+ */
7351
+ findIndex(predicate: (value: T) => unknown): number;
7352
+ /**
7353
+ * Determines whether the stream includes a certain element, returning `true` or `false` as appropriate.
7354
+ *
7355
+ * @param searchElement The element to search for.
7356
+ */
7357
+ includes(searchElement: T): boolean;
7358
+ /**
7359
+ * Calls a defined callback function on each element of the stream and then flattens the result into
7360
+ * a new stream. This is identical to a `map` followed by `flat` with depth 1.
7361
+ *
7362
+ * @param callbackfn Lazily evaluated function mapping stream elements.
7363
+ */
7364
+ flatMap<U>(callbackfn: (value: T) => U | Iterable<U>): Stream<U>;
7365
+ /**
7366
+ * Returns a new stream with all sub-stream or sub-array elements concatenated into it recursively up
7367
+ * to the specified depth.
7368
+ *
7369
+ * @param depth The maximum recursion depth. Defaults to 1.
7370
+ */
7371
+ flat<D extends number = 1>(depth?: D): FlatStream<T, D>;
7372
+ /**
7373
+ * Returns the first element in the stream, or `undefined` if the stream is empty.
7374
+ */
7375
+ head(): T | undefined;
7376
+ /**
7377
+ * Returns a stream that skips the first `skipCount` elements from this stream.
7378
+ *
7379
+ * @param skipCount The number of elements to skip. If this is larger than the number of elements in
7380
+ * the stream, an empty stream is returned. Defaults to 1.
7381
+ */
7382
+ tail(skipCount?: number): Stream<T>;
7383
+ /**
7384
+ * Returns a stream consisting of the elements of this stream, truncated to be no longer than `maxSize`
7385
+ * in length.
7386
+ *
7387
+ * @param maxSize The number of elements the stream should be limited to
7388
+ */
7389
+ limit(maxSize: number): Stream<T>;
7390
+ /**
7391
+ * Returns a stream containing only the distinct elements from this stream.
7392
+ * Equality is determined with the same rules as a standard `Set`.
7393
+ *
7394
+ * @param by A function returning the key used to check equality with a previous stream element.
7395
+ * If omitted, the stream elements themselves are used for comparison.
7396
+ */
7397
+ distinct<Key = T>(by?: (element: T) => Key): Stream<T>;
7398
+ /**
7399
+ * Returns a stream that contains all elements that don't exist in the {@link other} iterable.
7400
+ * Equality is determined with the same rules as a standard `Set`.
7401
+ * @param other The elements that should be exluded from this stream.
7402
+ * @param key A function returning the key used to check quality.
7403
+ * If omitted, the stream elements themselves are used for comparison.
7404
+ */
7405
+ exclude<Key = T>(other: Iterable<T>, key?: (element: T) => Key): Stream<T>;
7406
+ }
7407
+ type FlatStream<T, Depth extends number> = {
7408
+ 'done': Stream<T>;
7409
+ 'recur': T extends Iterable<infer Content> ? FlatStream<Content, MinusOne<Depth>> : Stream<T>;
7410
+ }[Depth extends 0 ? 'done' : 'recur'];
7411
+ type MinusOne<N extends number> = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][N];
7412
+
7413
+ /******************************************************************************
7414
+ * Copyright 2021 TypeFox GmbH
7415
+ * This program and the accompanying materials are made available under the
7416
+ * terms of the MIT License, which is available in the project root.
7417
+ ******************************************************************************/
7418
+
7419
+ interface TokenBuilderOptions {
7420
+ caseInsensitive?: boolean;
7421
+ }
7422
+ interface TokenBuilder {
7423
+ buildTokens(grammar: Grammar, options?: TokenBuilderOptions): TokenVocabulary;
7424
+ /**
7425
+ * Produces a lexing report for the given text that was just tokenized using the tokens provided by this builder.
7426
+ *
7427
+ * @param text The text that was tokenized.
7428
+ */
7429
+ flushLexingReport?(text: string): LexingReport;
7430
+ }
7431
+ /**
7432
+ * A custom lexing report that can be produced by the token builder during the lexing process.
7433
+ * Adopters need to ensure that the any custom fields are serializable so they can be sent across worker threads.
7434
+ */
7435
+ interface LexingReport {
7436
+ diagnostics: LexingDiagnostic[];
7437
+ }
7438
+ type LexingDiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
7439
+ interface LexingDiagnostic extends ILexingError {
7440
+ severity?: LexingDiagnosticSeverity;
7441
+ }
7442
+
7443
+ /******************************************************************************
7444
+ * Copyright 2022 TypeFox GmbH
7445
+ * This program and the accompanying materials are made available under the
7446
+ * terms of the MIT License, which is available in the project root.
7447
+ ******************************************************************************/
7448
+
7449
+ interface LexerResult {
7450
+ /**
7451
+ * A list of all tokens that were lexed from the input.
7452
+ *
7453
+ * Note that Langium requires the optional properties
7454
+ * `startLine`, `startColumn`, `endOffset`, `endLine` and `endColumn` to be set on each token.
7455
+ */
7456
+ tokens: IToken[];
7457
+ /**
7458
+ * Contains hidden tokens, usually comments.
7459
+ */
7460
+ hidden: IToken[];
7461
+ errors: ILexingError[];
7462
+ report?: LexingReport;
7463
+ }
7464
+ type TokenizeMode = 'full' | 'partial';
7465
+ interface TokenizeOptions {
7466
+ mode?: TokenizeMode;
7467
+ }
7178
7468
  interface Lexer {
7179
7469
  readonly definition: TokenTypeDictionary;
7180
- tokenize(text: string): LexerResult;
7470
+ tokenize(text: string, options?: TokenizeOptions): LexerResult;
7181
7471
  }
7182
7472
 
7183
7473
  /******************************************************************************
@@ -7190,6 +7480,7 @@ type ParseResult<T = AstNode> = {
7190
7480
  value: T;
7191
7481
  parserErrors: IRecognitionException[];
7192
7482
  lexerErrors: ILexingError[];
7483
+ lexerReport?: LexingReport;
7193
7484
  };
7194
7485
  type RuleResult = (args: Args) => any;
7195
7486
  type Args = Record<string, boolean>;
@@ -7372,248 +7663,27 @@ declare class ChevrotainWrapper extends EmbeddedActionsParser {
7372
7663
 
7373
7664
  /**
7374
7665
  * The service registry provides access to the language-specific {@link LangiumCoreServices} optionally including LSP-related services.
7375
- * These are resolved via the URI of a text document.
7376
- */
7377
- interface ServiceRegistry {
7378
- /**
7379
- * Register a language via its injected services.
7380
- */
7381
- register(language: LangiumCoreServices): void;
7382
- /**
7383
- * Retrieve the language-specific services for the given URI. In case only one language is
7384
- * registered, it may be used regardless of the URI format.
7385
- */
7386
- getServices(uri: URI): LangiumCoreServices;
7387
- /**
7388
- * Check whether services are available for the given URI.
7389
- */
7390
- hasServices(uri: URI): boolean;
7391
- /**
7392
- * The full set of registered language services.
7393
- */
7394
- readonly all: readonly LangiumCoreServices[];
7395
- }
7396
-
7397
- /******************************************************************************
7398
- * Copyright 2021 TypeFox GmbH
7399
- * This program and the accompanying materials are made available under the
7400
- * terms of the MIT License, which is available in the project root.
7401
- ******************************************************************************/
7402
- /**
7403
- * A stream is a read-only sequence of values. While the contents of an array can be accessed
7404
- * both sequentially and randomly (via index), a stream allows only sequential access.
7405
- *
7406
- * The advantage of this is that a stream can be evaluated lazily, so it does not require
7407
- * to store intermediate values. This can boost performance when a large sequence is
7408
- * processed via filtering, mapping etc. and accessed at most once. However, lazy
7409
- * evaluation means that all processing is repeated when you access the sequence multiple
7410
- * times; in such a case, it may be better to store the resulting sequence into an array.
7411
- */
7412
- interface Stream<T> extends Iterable<T> {
7413
- /**
7414
- * Returns an iterator for this stream. This is the same as calling the `Symbol.iterator` function property.
7415
- */
7416
- iterator(): IterableIterator<T>;
7417
- /**
7418
- * Determines whether this stream contains no elements.
7419
- */
7420
- isEmpty(): boolean;
7421
- /**
7422
- * Determines the number of elements in this stream.
7423
- */
7424
- count(): number;
7425
- /**
7426
- * Collects all elements of this stream into an array.
7427
- */
7428
- toArray(): T[];
7429
- /**
7430
- * Collects all elements of this stream into a Set.
7431
- */
7432
- toSet(): Set<T>;
7433
- /**
7434
- * Collects all elements of this stream into a Map, applying the provided functions to determine keys and values.
7435
- *
7436
- * @param keyFn The function to derive map keys. If omitted, the stream elements are used as keys.
7437
- * @param valueFn The function to derive map values. If omitted, the stream elements are used as values.
7438
- */
7439
- toMap<K = T, V = T>(keyFn?: (e: T) => K, valueFn?: (e: T) => V): Map<K, V>;
7440
- /**
7441
- * Returns a string representation of a stream.
7442
- */
7443
- toString(): string;
7444
- /**
7445
- * Combines two streams by returning a new stream that yields all elements of this stream and the other stream.
7446
- *
7447
- * @param other Stream to be concatenated with this one.
7448
- */
7449
- concat<T2>(other: Iterable<T2>): Stream<T | T2>;
7450
- /**
7451
- * Adds all elements of the stream into a string, separated by the specified separator string.
7452
- *
7453
- * @param separator A string used to separate one element of the stream from the next in the resulting string.
7454
- * If omitted, the steam elements are separated with a comma.
7455
- */
7456
- join(separator?: string): string;
7457
- /**
7458
- * Returns the index of the first occurrence of a value in the stream, or -1 if it is not present.
7459
- *
7460
- * @param searchElement The value to locate in the array.
7461
- * @param fromIndex The stream index at which to begin the search. If fromIndex is omitted, the search
7462
- * starts at index 0.
7463
- */
7464
- indexOf(searchElement: T, fromIndex?: number): number;
7465
- /**
7466
- * Determines whether all members of the stream satisfy the specified test.
7467
- *
7468
- * @param predicate This method calls the predicate function for each element in the stream until the
7469
- * predicate returns a value which is coercible to the Boolean value `false`, or until the end
7470
- * of the stream.
7471
- */
7472
- every<S extends T>(predicate: (value: T) => value is S): this is Stream<S>;
7473
- every(predicate: (value: T) => unknown): boolean;
7474
- /**
7475
- * Determines whether any member of the stream satisfies the specified test.
7476
- *
7477
- * @param predicate This method calls the predicate function for each element in the stream until the
7478
- * predicate returns a value which is coercible to the Boolean value `true`, or until the end
7479
- * of the stream.
7480
- */
7481
- some(predicate: (value: T) => unknown): boolean;
7482
- /**
7483
- * Performs the specified action for each element in the stream.
7484
- *
7485
- * @param callbackfn Function called once for each element in the stream.
7486
- */
7487
- forEach(callbackfn: (value: T, index: number) => void): void;
7488
- /**
7489
- * Returns a stream that yields the results of calling the specified callback function on each element
7490
- * of the stream. The function is called when the resulting stream elements are actually accessed, so
7491
- * accessing the resulting stream multiple times means the function is also called multiple times for
7492
- * each element of the stream.
7493
- *
7494
- * @param callbackfn Lazily evaluated function mapping stream elements.
7495
- */
7496
- map<U>(callbackfn: (value: T) => U): Stream<U>;
7497
- /**
7498
- * Returns the elements of the stream that meet the condition specified in a callback function.
7499
- * The function is called when the resulting stream elements are actually accessed, so accessing the
7500
- * resulting stream multiple times means the function is also called multiple times for each element
7501
- * of the stream.
7502
- *
7503
- * @param predicate Lazily evaluated function checking a condition on stream elements.
7504
- */
7505
- filter<S extends T>(predicate: (value: T) => value is S): Stream<S>;
7506
- filter(predicate: (value: T) => unknown): Stream<T>;
7507
- /**
7508
- * Returns the elements of the stream that are _non-nullable_, which means they are neither `undefined`
7509
- * nor `null`.
7510
- */
7511
- nonNullable(): Stream<NonNullable<T>>;
7512
- /**
7513
- * Calls the specified callback function for all elements in the stream. The return value of the
7514
- * callback function is the accumulated result, and is provided as an argument in the next call to
7515
- * the callback function.
7516
- *
7517
- * @param callbackfn This method calls the function once for each element in the stream, providing
7518
- * the previous and current values of the reduction.
7519
- * @param initialValue If specified, `initialValue` is used as the initial value to start the
7520
- * accumulation. The first call to the function provides this value as an argument instead
7521
- * of a stream value.
7522
- */
7523
- reduce(callbackfn: (previousValue: T, currentValue: T) => T): T | undefined;
7524
- reduce<U = T>(callbackfn: (previousValue: U, currentValue: T) => U, initialValue: U): U;
7525
- /**
7526
- * Calls the specified callback function for all elements in the stream, in descending order.
7527
- * The return value of the callback function is the accumulated result, and is provided as an
7528
- * argument in the next call to the callback function.
7529
- *
7530
- * @param callbackfn This method calls the function once for each element in the stream, providing
7531
- * the previous and current values of the reduction.
7532
- * @param initialValue If specified, `initialValue` is used as the initial value to start the
7533
- * accumulation. The first call to the function provides this value as an argument instead
7534
- * of an array value.
7535
- */
7536
- reduceRight(callbackfn: (previousValue: T, currentValue: T) => T): T | undefined;
7537
- reduceRight<U = T>(callbackfn: (previousValue: U, currentValue: T) => U, initialValue: U): U;
7538
- /**
7539
- * Returns the value of the first element in the stream that meets the condition, or `undefined`
7540
- * if there is no such element.
7541
- *
7542
- * @param predicate This method calls `predicate` once for each element of the stream, in ascending
7543
- * order, until it finds one where `predicate` returns a value which is coercible to the
7544
- * Boolean value `true`.
7545
- */
7546
- find<S extends T>(predicate: (value: T) => value is S): S | undefined;
7547
- find(predicate: (value: T) => unknown): T | undefined;
7548
- /**
7549
- * Returns the index of the first element in the stream that meets the condition, or `-1`
7550
- * if there is no such element.
7551
- *
7552
- * @param predicate This method calls `predicate` once for each element of the stream, in ascending
7553
- * order, until it finds one where `predicate` returns a value which is coercible to the
7554
- * Boolean value `true`.
7555
- */
7556
- findIndex(predicate: (value: T) => unknown): number;
7557
- /**
7558
- * Determines whether the stream includes a certain element, returning `true` or `false` as appropriate.
7559
- *
7560
- * @param searchElement The element to search for.
7561
- */
7562
- includes(searchElement: T): boolean;
7563
- /**
7564
- * Calls a defined callback function on each element of the stream and then flattens the result into
7565
- * a new stream. This is identical to a `map` followed by `flat` with depth 1.
7566
- *
7567
- * @param callbackfn Lazily evaluated function mapping stream elements.
7568
- */
7569
- flatMap<U>(callbackfn: (value: T) => U | Iterable<U>): Stream<U>;
7570
- /**
7571
- * Returns a new stream with all sub-stream or sub-array elements concatenated into it recursively up
7572
- * to the specified depth.
7573
- *
7574
- * @param depth The maximum recursion depth. Defaults to 1.
7575
- */
7576
- flat<D extends number = 1>(depth?: D): FlatStream<T, D>;
7577
- /**
7578
- * Returns the first element in the stream, or `undefined` if the stream is empty.
7579
- */
7580
- head(): T | undefined;
7666
+ * These are resolved via the URI of a text document.
7667
+ */
7668
+ interface ServiceRegistry {
7581
7669
  /**
7582
- * Returns a stream that skips the first `skipCount` elements from this stream.
7583
- *
7584
- * @param skipCount The number of elements to skip. If this is larger than the number of elements in
7585
- * the stream, an empty stream is returned. Defaults to 1.
7670
+ * Register a language via its injected services.
7586
7671
  */
7587
- tail(skipCount?: number): Stream<T>;
7672
+ register(language: LangiumCoreServices): void;
7588
7673
  /**
7589
- * Returns a stream consisting of the elements of this stream, truncated to be no longer than `maxSize`
7590
- * in length.
7591
- *
7592
- * @param maxSize The number of elements the stream should be limited to
7674
+ * Retrieve the language-specific services for the given URI. In case only one language is
7675
+ * registered, it may be used regardless of the URI format.
7593
7676
  */
7594
- limit(maxSize: number): Stream<T>;
7677
+ getServices(uri: URI): LangiumCoreServices;
7595
7678
  /**
7596
- * Returns a stream containing only the distinct elements from this stream.
7597
- * Equality is determined with the same rules as a standard `Set`.
7598
- *
7599
- * @param by A function returning the key used to check equality with a previous stream element.
7600
- * If omitted, the stream elements themselves are used for comparison.
7679
+ * Check whether services are available for the given URI.
7601
7680
  */
7602
- distinct<Key = T>(by?: (element: T) => Key): Stream<T>;
7681
+ hasServices(uri: URI): boolean;
7603
7682
  /**
7604
- * Returns a stream that contains all elements that don't exist in the {@link other} iterable.
7605
- * Equality is determined with the same rules as a standard `Set`.
7606
- * @param other The elements that should be exluded from this stream.
7607
- * @param key A function returning the key used to check quality.
7608
- * If omitted, the stream elements themselves are used for comparison.
7683
+ * The full set of registered language services.
7609
7684
  */
7610
- exclude<Key = T>(other: Iterable<T>, key?: (element: T) => Key): Stream<T>;
7685
+ readonly all: readonly LangiumCoreServices[];
7611
7686
  }
7612
- type FlatStream<T, Depth extends number> = {
7613
- 'done': Stream<T>;
7614
- 'recur': T extends Iterable<infer Content> ? FlatStream<Content, MinusOne<Depth>> : Stream<T>;
7615
- }[Depth extends 0 ? 'done' : 'recur'];
7616
- type MinusOne<N extends number> = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][N];
7617
7687
 
7618
7688
  /******************************************************************************
7619
7689
  * Copyright 2021 TypeFox GmbH
@@ -7836,7 +7906,7 @@ interface DocumentSegment {
7836
7906
  * No implementation object is expected to be offered by `LangiumCoreServices`, but only by `LangiumLSPServices`.
7837
7907
  */
7838
7908
  type TextDocumentProvider = {
7839
- get(uri: string): TextDocument | undefined;
7909
+ get(uri: string | URI): TextDocument | undefined;
7840
7910
  };
7841
7911
  /**
7842
7912
  * Shared service for creating `LangiumDocument` instances.
@@ -8452,6 +8522,8 @@ interface Linker {
8452
8522
  *
8453
8523
  * @param document A LangiumDocument that shall be linked.
8454
8524
  * @param cancelToken A token for cancelling the operation.
8525
+ *
8526
+ * @throws `OperationCancelled` if a cancellation event is detected
8455
8527
  */
8456
8528
  link(document: LangiumDocument, cancelToken?: CancellationToken): Promise<void>;
8457
8529
  /**
@@ -8533,29 +8605,24 @@ declare class Deferred<T = void> {
8533
8605
  ******************************************************************************/
8534
8606
 
8535
8607
  /**
8536
- * Async parser that allows to cancel the current parsing process.
8537
- * The sync parser implementation is blocking the event loop, which can become quite problematic for large files.
8608
+ * Async parser that allows cancellation of the current parsing process.
8538
8609
  *
8539
- * Note that the default implementation is not actually async. It just wraps the sync parser in a promise.
8540
- * A real implementation would create worker threads or web workers to offload the parsing work.
8610
+ * @remark The sync parser implementation is blocking the event loop, which can become quite problematic for large files.
8611
+ * @remark The default implementation is not actually async. It just wraps the sync parser in a promise. A real implementation would create worker threads or web workers to offload the parsing work.
8541
8612
  */
8542
8613
  interface AsyncParser {
8614
+ /**
8615
+ * Parses the given text and returns the parse result.
8616
+ *
8617
+ * @param text The text to parse.
8618
+ * @param cancelToken A cancellation token that can be used to cancel the parsing process.
8619
+ * @returns A promise that resolves to the parse result.
8620
+ *
8621
+ * @throw `OperationCancelled` if the parsing process is cancelled.
8622
+ */
8543
8623
  parse<T extends AstNode>(text: string, cancelToken: CancellationToken): Promise<ParseResult<T>>;
8544
8624
  }
8545
8625
 
8546
- /******************************************************************************
8547
- * Copyright 2021 TypeFox GmbH
8548
- * This program and the accompanying materials are made available under the
8549
- * terms of the MIT License, which is available in the project root.
8550
- ******************************************************************************/
8551
-
8552
- interface TokenBuilderOptions {
8553
- caseInsensitive?: boolean;
8554
- }
8555
- interface TokenBuilder {
8556
- buildTokens(grammar: Grammar, options?: TokenBuilderOptions): TokenVocabulary;
8557
- }
8558
-
8559
8626
  /******************************************************************************
8560
8627
  * Copyright 2021 TypeFox GmbH
8561
8628
  * This program and the accompanying materials are made available under the
@@ -8693,7 +8760,7 @@ declare class DefaultScopeComputation implements ScopeComputation {
8693
8760
  * @param document The document containing the AST node to be exported.
8694
8761
  * @param children A function called with {@link parentNode} as single argument and returning an {@link Iterable} supplying the children to be visited, which must be directly or transitively contained in {@link parentNode}.
8695
8762
  * @param cancelToken Indicates when to cancel the current operation.
8696
- * @throws `OperationCanceled` if a user action occurs during execution.
8763
+ * @throws `OperationCancelled` if a user action occurs during execution.
8697
8764
  * @returns A list of {@link AstNodeDescription AstNodeDescriptions} to be published to index.
8698
8765
  */
8699
8766
  computeExportsForNode(parentNode: AstNode, document: LangiumDocument<AstNode>, children?: (root: AstNode) => Iterable<AstNode>, cancelToken?: CancellationToken): Promise<AstNodeDescription[]>;
@@ -8781,7 +8848,8 @@ type DiagnosticInfo<N extends AstNode, P extends string = Properties<N>> = {
8781
8848
  /** A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request. */
8782
8849
  data?: unknown;
8783
8850
  };
8784
- type ValidationAcceptor = <N extends AstNode>(severity: 'error' | 'warning' | 'info' | 'hint', message: string, info: DiagnosticInfo<N>) => void;
8851
+ type ValidationSeverity = 'error' | 'warning' | 'info' | 'hint';
8852
+ type ValidationAcceptor = <N extends AstNode>(severity: ValidationSeverity, message: string, info: DiagnosticInfo<N>) => void;
8785
8853
  type ValidationCheck<T extends AstNode = AstNode> = (node: T, accept: ValidationAcceptor, cancelToken: CancellationToken) => MaybePromise<void>;
8786
8854
  /**
8787
8855
  * A utility type for associating non-primitive AST types to corresponding validation checks. For example:
@@ -8875,6 +8943,9 @@ interface DocumentValidator {
8875
8943
  }
8876
8944
  declare namespace DocumentValidator {
8877
8945
  const LexingError = "lexing-error";
8946
+ const LexingWarning = "lexing-warning";
8947
+ const LexingInfo = "lexing-info";
8948
+ const LexingHint = "lexing-hint";
8878
8949
  const ParsingError = "parsing-error";
8879
8950
  const LinkingError = "linking-error";
8880
8951
  }
@@ -13535,6 +13606,9 @@ interface WorkspaceManager {
13535
13606
  * each language file and stores it locally.
13536
13607
  *
13537
13608
  * @param folders The set of workspace folders to be indexed.
13609
+ * @param cancelToken A cancellation token that can be used to cancel the operation.
13610
+ *
13611
+ * @throws OperationCancelled if a cancellation event has been detected
13538
13612
  */
13539
13613
  initializeWorkspace(folders: WorkspaceFolder[], cancelToken?: CancellationToken): Promise<void>;
13540
13614
  }
@@ -13591,51 +13665,51 @@ declare class DefaultWorkspaceManager implements WorkspaceManager {
13591
13665
  * grammar definition and the language configuration.
13592
13666
  */
13593
13667
  type LangiumGeneratedCoreServices = {
13594
- Grammar: Grammar;
13595
- LanguageMetaData: LanguageMetaData;
13596
- parser: {
13597
- ParserConfig?: IParserConfig;
13668
+ readonly Grammar: Grammar;
13669
+ readonly LanguageMetaData: LanguageMetaData;
13670
+ readonly parser: {
13671
+ readonly ParserConfig?: IParserConfig;
13598
13672
  };
13599
13673
  };
13600
13674
  /**
13601
13675
  * Core services for a specific language of which Langium provides default implementations.
13602
13676
  */
13603
13677
  type LangiumDefaultCoreServices = {
13604
- parser: {
13605
- AsyncParser: AsyncParser;
13606
- GrammarConfig: GrammarConfig;
13607
- ValueConverter: ValueConverter;
13608
- LangiumParser: LangiumParser;
13609
- ParserErrorMessageProvider: IParserErrorMessageProvider;
13610
- CompletionParser: LangiumCompletionParser;
13611
- TokenBuilder: TokenBuilder;
13612
- Lexer: Lexer;
13678
+ readonly parser: {
13679
+ readonly AsyncParser: AsyncParser;
13680
+ readonly GrammarConfig: GrammarConfig;
13681
+ readonly ValueConverter: ValueConverter;
13682
+ readonly LangiumParser: LangiumParser;
13683
+ readonly ParserErrorMessageProvider: IParserErrorMessageProvider;
13684
+ readonly CompletionParser: LangiumCompletionParser;
13685
+ readonly TokenBuilder: TokenBuilder;
13686
+ readonly Lexer: Lexer;
13613
13687
  };
13614
- documentation: {
13615
- CommentProvider: CommentProvider;
13616
- DocumentationProvider: DocumentationProvider;
13688
+ readonly documentation: {
13689
+ readonly CommentProvider: CommentProvider;
13690
+ readonly DocumentationProvider: DocumentationProvider;
13617
13691
  };
13618
- references: {
13619
- Linker: Linker;
13620
- NameProvider: NameProvider;
13621
- References: References;
13622
- ScopeProvider: ScopeProvider;
13623
- ScopeComputation: ScopeComputation;
13692
+ readonly references: {
13693
+ readonly Linker: Linker;
13694
+ readonly NameProvider: NameProvider;
13695
+ readonly References: References;
13696
+ readonly ScopeProvider: ScopeProvider;
13697
+ readonly ScopeComputation: ScopeComputation;
13624
13698
  };
13625
- serializer: {
13626
- Hydrator: Hydrator;
13627
- JsonSerializer: JsonSerializer;
13699
+ readonly serializer: {
13700
+ readonly Hydrator: Hydrator;
13701
+ readonly JsonSerializer: JsonSerializer;
13628
13702
  };
13629
- validation: {
13630
- DocumentValidator: DocumentValidator;
13631
- ValidationRegistry: ValidationRegistry;
13703
+ readonly validation: {
13704
+ readonly DocumentValidator: DocumentValidator;
13705
+ readonly ValidationRegistry: ValidationRegistry;
13632
13706
  };
13633
- workspace: {
13634
- AstNodeLocator: AstNodeLocator;
13635
- AstNodeDescriptionProvider: AstNodeDescriptionProvider;
13636
- ReferenceDescriptionProvider: ReferenceDescriptionProvider;
13707
+ readonly workspace: {
13708
+ readonly AstNodeLocator: AstNodeLocator;
13709
+ readonly AstNodeDescriptionProvider: AstNodeDescriptionProvider;
13710
+ readonly ReferenceDescriptionProvider: ReferenceDescriptionProvider;
13637
13711
  };
13638
- shared: LangiumSharedCoreServices;
13712
+ readonly shared: LangiumSharedCoreServices;
13639
13713
  };
13640
13714
  /**
13641
13715
  * The core set of services available for a language. These are either generated by `langium-cli`
@@ -13647,23 +13721,23 @@ type LangiumCoreServices = LangiumGeneratedCoreServices & LangiumDefaultCoreServ
13647
13721
  * derived from the grammar definition.
13648
13722
  */
13649
13723
  type LangiumGeneratedSharedCoreServices = {
13650
- AstReflection: AstReflection;
13724
+ readonly AstReflection: AstReflection;
13651
13725
  };
13652
13726
  /**
13653
13727
  * Core services shared between multiple languages where Langium provides default implementations.
13654
13728
  */
13655
13729
  type LangiumDefaultSharedCoreServices = {
13656
- ServiceRegistry: ServiceRegistry;
13657
- workspace: {
13658
- ConfigurationProvider: ConfigurationProvider;
13659
- DocumentBuilder: DocumentBuilder;
13660
- FileSystemProvider: FileSystemProvider;
13661
- IndexManager: IndexManager;
13662
- LangiumDocuments: LangiumDocuments;
13663
- LangiumDocumentFactory: LangiumDocumentFactory;
13664
- TextDocuments?: TextDocumentProvider;
13665
- WorkspaceLock: WorkspaceLock;
13666
- WorkspaceManager: WorkspaceManager;
13730
+ readonly ServiceRegistry: ServiceRegistry;
13731
+ readonly workspace: {
13732
+ readonly ConfigurationProvider: ConfigurationProvider;
13733
+ readonly DocumentBuilder: DocumentBuilder;
13734
+ readonly FileSystemProvider: FileSystemProvider;
13735
+ readonly IndexManager: IndexManager;
13736
+ readonly LangiumDocuments: LangiumDocuments;
13737
+ readonly LangiumDocumentFactory: LangiumDocumentFactory;
13738
+ readonly TextDocuments?: TextDocumentProvider;
13739
+ readonly WorkspaceLock: WorkspaceLock;
13740
+ readonly WorkspaceManager: WorkspaceManager;
13667
13741
  };
13668
13742
  };
13669
13743
  /**
@@ -13884,23 +13958,6 @@ interface DiagnosticFeatureShape {
13884
13958
  };
13885
13959
  }
13886
13960
 
13887
- /**
13888
- * We should use a mapped type to create this from Connection.
13889
- */
13890
- interface TextDocumentConnection {
13891
- onDidOpenTextDocument(handler: NotificationHandler<DidOpenTextDocumentParams>): Disposable$1;
13892
- onDidChangeTextDocument(handler: NotificationHandler<DidChangeTextDocumentParams>): Disposable$1;
13893
- onDidCloseTextDocument(handler: NotificationHandler<DidCloseTextDocumentParams>): Disposable$1;
13894
- onWillSaveTextDocument(handler: NotificationHandler<WillSaveTextDocumentParams>): Disposable$1;
13895
- onWillSaveTextDocumentWaitUntil(handler: RequestHandler<WillSaveTextDocumentParams, TextEdit$1[] | undefined | null, void>): Disposable$1;
13896
- onDidSaveTextDocument(handler: NotificationHandler<DidSaveTextDocumentParams>): Disposable$1;
13897
- }
13898
- interface TextDocumentsConfiguration<T extends {
13899
- uri: DocumentUri$1;
13900
- }> {
13901
- create(uri: DocumentUri$1, languageId: string, version: number, content: string): T;
13902
- update(document: T, changes: TextDocumentContentChangeEvent[], version: number): T;
13903
- }
13904
13961
  /**
13905
13962
  * Event to signal changes to a text document.
13906
13963
  */
@@ -13923,96 +13980,6 @@ interface TextDocumentWillSaveEvent<T> {
13923
13980
  */
13924
13981
  reason: TextDocumentSaveReason;
13925
13982
  }
13926
- /**
13927
- * A manager for simple text documents. The manager requires at a minimum that
13928
- * the server registered for the following text document sync events in the
13929
- * initialize handler or via dynamic registration:
13930
- *
13931
- * - open and close events.
13932
- * - change events.
13933
- *
13934
- * Registering for save and will save events is optional.
13935
- */
13936
- declare class TextDocuments<T extends {
13937
- uri: DocumentUri$1;
13938
- }> {
13939
- private readonly _configuration;
13940
- private readonly _syncedDocuments;
13941
- private readonly _onDidChangeContent;
13942
- private readonly _onDidOpen;
13943
- private readonly _onDidClose;
13944
- private readonly _onDidSave;
13945
- private readonly _onWillSave;
13946
- private _willSaveWaitUntil;
13947
- /**
13948
- * Create a new text document manager.
13949
- */
13950
- constructor(configuration: TextDocumentsConfiguration<T>);
13951
- /**
13952
- * An event that fires when a text document managed by this manager
13953
- * has been opened.
13954
- */
13955
- get onDidOpen(): Event<TextDocumentChangeEvent<T>>;
13956
- /**
13957
- * An event that fires when a text document managed by this manager
13958
- * has been opened or the content changes.
13959
- */
13960
- get onDidChangeContent(): Event<TextDocumentChangeEvent<T>>;
13961
- /**
13962
- * An event that fires when a text document managed by this manager
13963
- * will be saved.
13964
- */
13965
- get onWillSave(): Event<TextDocumentWillSaveEvent<T>>;
13966
- /**
13967
- * Sets a handler that will be called if a participant wants to provide
13968
- * edits during a text document save.
13969
- */
13970
- onWillSaveWaitUntil(handler: RequestHandler<TextDocumentWillSaveEvent<T>, TextEdit$1[], void>): void;
13971
- /**
13972
- * An event that fires when a text document managed by this manager
13973
- * has been saved.
13974
- */
13975
- get onDidSave(): Event<TextDocumentChangeEvent<T>>;
13976
- /**
13977
- * An event that fires when a text document managed by this manager
13978
- * has been closed.
13979
- */
13980
- get onDidClose(): Event<TextDocumentChangeEvent<T>>;
13981
- /**
13982
- * Returns the document for the given URI. Returns undefined if
13983
- * the document is not managed by this instance.
13984
- *
13985
- * @param uri The text document's URI to retrieve.
13986
- * @return the text document or `undefined`.
13987
- */
13988
- get(uri: string): T | undefined;
13989
- /**
13990
- * Returns all text documents managed by this instance.
13991
- *
13992
- * @return all text documents.
13993
- */
13994
- all(): T[];
13995
- /**
13996
- * Returns the URIs of all text documents managed by this instance.
13997
- *
13998
- * @return the URI's of all text documents.
13999
- */
14000
- keys(): string[];
14001
- /**
14002
- * Listens for `low level` notification on the given connection to
14003
- * update the text documents managed by this instance.
14004
- *
14005
- * Please note that the connection only provides handlers not an event model. Therefore
14006
- * listening on a connection will overwrite the following handlers on a connection:
14007
- * `onDidOpenTextDocument`, `onDidChangeTextDocument`, `onDidCloseTextDocument`,
14008
- * `onWillSaveTextDocument`, `onWillSaveTextDocumentWaitUntil` and `onDidSaveTextDocument`.
14009
- *
14010
- * Use the corresponding events on the TextDocuments instance instead.
14011
- *
14012
- * @param connection The connection to listen on.
14013
- */
14014
- listen(connection: TextDocumentConnection): Disposable$1;
14015
- }
14016
13983
 
14017
13984
  /**
14018
13985
  * Shape of the notebooks feature
@@ -14806,6 +14773,11 @@ interface DefinitionProvider {
14806
14773
  /**
14807
14774
  * Handle a go to definition request.
14808
14775
  *
14776
+ * @param document The document in which the request was triggered.
14777
+ * @param params The parameters of the request.
14778
+ * @param cancelToken A cancellation token that can be used to cancel the request.
14779
+ * @returns A list of location links to the definition(s) of the symbol at the given position.
14780
+ *
14809
14781
  * @throws `OperationCancelled` if cancellation is detected during execution
14810
14782
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
14811
14783
  */
@@ -14825,6 +14797,10 @@ interface DocumentHighlightProvider {
14825
14797
  /**
14826
14798
  * Handle a document highlight request.
14827
14799
  *
14800
+ * @param document The document in which the request was received.
14801
+ * @param params The parameters of the document highlight request.
14802
+ * @param cancelToken A cancellation token that can be used to cancel the request.
14803
+ * @returns The document highlights or `undefined` if no highlights are available.
14828
14804
  * @throws `OperationCancelled` if cancellation is detected during execution
14829
14805
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
14830
14806
  */
@@ -14835,7 +14811,7 @@ declare class DefaultDocumentHighlightProvider implements DocumentHighlightProvi
14835
14811
  protected readonly nameProvider: NameProvider;
14836
14812
  protected readonly grammarConfig: GrammarConfig;
14837
14813
  constructor(services: LangiumServices);
14838
- getDocumentHighlight(document: LangiumDocument, params: DocumentHighlightParams): MaybePromise<DocumentHighlight[] | undefined>;
14814
+ getDocumentHighlight(document: LangiumDocument, params: DocumentHighlightParams, _cancelToken?: CancellationToken): MaybePromise<DocumentHighlight[] | undefined>;
14839
14815
  /**
14840
14816
  * Override this method to determine the highlight kind of the given reference.
14841
14817
  */
@@ -14898,6 +14874,11 @@ interface DocumentSymbolProvider {
14898
14874
  /**
14899
14875
  * Handle a document symbols request.
14900
14876
  *
14877
+ * @param document The document in the workspace.
14878
+ * @param params The parameters of the request.
14879
+ * @param cancelToken A cancellation token that migh be used to cancel the request.
14880
+ * @returns The symbols for the given document.
14881
+ *
14901
14882
  * @throws `OperationCancelled` if cancellation is detected during execution
14902
14883
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
14903
14884
  */
@@ -14914,17 +14895,40 @@ interface DocumentSymbolProvider {
14914
14895
  * Shared service for handling text document changes and watching relevant files.
14915
14896
  */
14916
14897
  interface DocumentUpdateHandler {
14898
+ /**
14899
+ * A document open event was triggered by the `TextDocuments` service.
14900
+ * @param event The document change event.
14901
+ */
14917
14902
  didOpenDocument?(event: TextDocumentChangeEvent<TextDocument>): void;
14918
14903
  /**
14919
14904
  * A content change event was triggered by the `TextDocuments` service.
14905
+ * @param event The document change event.
14920
14906
  */
14921
14907
  didChangeContent?(event: TextDocumentChangeEvent<TextDocument>): void;
14908
+ /**
14909
+ * A document save event (initiated) was triggered by the `TextDocuments` service.
14910
+ * @param event The document change event.
14911
+ */
14922
14912
  willSaveDocument?(event: TextDocumentWillSaveEvent<TextDocument>): void;
14913
+ /**
14914
+ * A document save event (initiated) was triggered by the `TextDocuments` service.
14915
+ * @param event The document change event.
14916
+ * @returns An array of text edits which will be applied to the document before it is saved.
14917
+ */
14923
14918
  willSaveDocumentWaitUntil?(event: TextDocumentWillSaveEvent<TextDocument>): MaybePromise<TextEdit$1[]>;
14919
+ /**
14920
+ * A document save event (completed) was triggered by the `TextDocuments` service.
14921
+ * @param event The document change event.
14922
+ */
14924
14923
  didSaveDocument?(event: TextDocumentChangeEvent<TextDocument>): void;
14924
+ /**
14925
+ * A document close event was triggered by the `TextDocuments` service.
14926
+ * @param event The document change event.
14927
+ */
14925
14928
  didCloseDocument?(event: TextDocumentChangeEvent<TextDocument>): void;
14926
14929
  /**
14927
14930
  * The client detected changes to files and folders watched by the language client.
14931
+ * @param params The files/folders change event.
14928
14932
  */
14929
14933
  didChangeWatchedFiles?(params: DidChangeWatchedFilesParams): void;
14930
14934
  }
@@ -15006,6 +15010,11 @@ interface FoldingRangeProvider {
15006
15010
  /**
15007
15011
  * Handle a folding range request.
15008
15012
  *
15013
+ * @param document The document to compute folding ranges for
15014
+ * @param params The folding range parameters
15015
+ * @param cancelToken A cancellation token that can be used to cancel the request
15016
+ * @returns The computed folding ranges
15017
+ *
15009
15018
  * @throws `OperationCancelled` if cancellation is detected during execution
15010
15019
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
15011
15020
  */
@@ -15150,6 +15159,11 @@ interface ReferencesProvider {
15150
15159
  /**
15151
15160
  * Handle a find references request.
15152
15161
  *
15162
+ * @param document The document in which to search for references.
15163
+ * @param params The parameters of the find references request.
15164
+ * @param cancelToken A cancellation token that can be used to cancel the request.
15165
+ * @returns The locations of the references.
15166
+ *
15153
15167
  * @throws `OperationCancelled` if cancellation is detected during execution
15154
15168
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
15155
15169
  */
@@ -15169,6 +15183,11 @@ interface RenameProvider {
15169
15183
  /**
15170
15184
  * Handle a rename request.
15171
15185
  *
15186
+ * @param document The document in which the rename request was triggered.
15187
+ * @param params The rename parameters.
15188
+ * @param cancelToken A cancellation token that can be used to cancel the request.
15189
+ * @returns A workspace edit that describes the changes to be applied to the workspace.
15190
+ *
15172
15191
  * @throws `OperationCancelled` if cancellation is detected during execution
15173
15192
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
15174
15193
  */
@@ -15176,21 +15195,16 @@ interface RenameProvider {
15176
15195
  /**
15177
15196
  * Handle a prepare rename request.
15178
15197
  *
15198
+ * @param document The document in which the prepare rename request was triggered.
15199
+ * @param params The prepare rename parameters.
15200
+ * @param cancelToken A cancellation token that can be used to cancel the request.
15201
+ * @returns A range that describes the range of the symbol to be renamed.
15202
+ *
15179
15203
  * @throws `OperationCancelled` if cancellation is detected during execution
15180
15204
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
15181
15205
  */
15182
15206
  prepareRename(document: LangiumDocument, params: TextDocumentPositionParams, cancelToken?: CancellationToken): MaybePromise<Range$1 | undefined>;
15183
15207
  }
15184
- declare class DefaultRenameProvider implements RenameProvider {
15185
- protected readonly references: References;
15186
- protected readonly nameProvider: NameProvider;
15187
- protected readonly grammarConfig: GrammarConfig;
15188
- constructor(services: LangiumServices);
15189
- rename(document: LangiumDocument, params: RenameParams): Promise<WorkspaceEdit | undefined>;
15190
- prepareRename(document: LangiumDocument, params: TextDocumentPositionParams): MaybePromise<Range$1 | undefined>;
15191
- protected renameNodeRange(doc: LangiumDocument, position: Position$2): Range$1 | undefined;
15192
- protected isNameNode(leafNode: CstNode | undefined): boolean | undefined;
15193
- }
15194
15208
 
15195
15209
  /******************************************************************************
15196
15210
  * Copyright 2022 TypeFox GmbH
@@ -15202,6 +15216,9 @@ interface SemanticTokenProvider {
15202
15216
  semanticHighlight(document: LangiumDocument, params: SemanticTokensParams, cancelToken?: CancellationToken): MaybePromise<SemanticTokens>;
15203
15217
  semanticHighlightRange(document: LangiumDocument, params: SemanticTokensRangeParams, cancelToken?: CancellationToken): MaybePromise<SemanticTokens>;
15204
15218
  semanticHighlightDelta(document: LangiumDocument, params: SemanticTokensDeltaParams, cancelToken?: CancellationToken): MaybePromise<SemanticTokens | SemanticTokensDelta>;
15219
+ readonly tokenTypes: Record<string, number>;
15220
+ readonly tokenModifiers: Record<string, number>;
15221
+ readonly semanticTokensOptions: SemanticTokensOptions;
15205
15222
  }
15206
15223
  type SemanticTokenAcceptorOptions<N extends AstNode = AstNode> = ({
15207
15224
  line: number;
@@ -15277,6 +15294,9 @@ declare abstract class AbstractSemanticTokenProvider implements SemanticTokenPro
15277
15294
  protected clientCapabilities?: SemanticTokensClientCapabilities;
15278
15295
  constructor(services: LangiumServices);
15279
15296
  initialize(clientCapabilities?: SemanticTokensClientCapabilities): void;
15297
+ get tokenTypes(): Record<string, number>;
15298
+ get tokenModifiers(): Record<string, number>;
15299
+ get semanticTokensOptions(): SemanticTokensOptions;
15280
15300
  semanticHighlight(document: LangiumDocument, _params: SemanticTokensParams, cancelToken?: CancellationToken): Promise<SemanticTokens>;
15281
15301
  semanticHighlightRange(document: LangiumDocument, params: SemanticTokensRangeParams, cancelToken?: CancellationToken): Promise<SemanticTokens>;
15282
15302
  semanticHighlightDelta(document: LangiumDocument, params: SemanticTokensDeltaParams, cancelToken?: CancellationToken): Promise<SemanticTokens | SemanticTokensDelta>;
@@ -15357,6 +15377,10 @@ interface WorkspaceSymbolProvider$1 {
15357
15377
  /**
15358
15378
  * Handle a workspace symbols request.
15359
15379
  *
15380
+ * @param params workspaces symbols request parameters
15381
+ * @param cancelToken a cancellation token tha can be used to cancel the request
15382
+ * @returns a list of workspace symbols
15383
+ *
15360
15384
  * @throws `OperationCancelled` if cancellation is detected during execution
15361
15385
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
15362
15386
  */
@@ -15364,6 +15388,10 @@ interface WorkspaceSymbolProvider$1 {
15364
15388
  /**
15365
15389
  * Handle a resolve request for a workspace symbol.
15366
15390
  *
15391
+ * @param symbol the workspace symbol to resolve
15392
+ * @param cancelToken a cancellation token tha can be used to cancel the request
15393
+ * @returns the resolved workspace symbol
15394
+ *
15367
15395
  * @throws `OperationCancelled` if cancellation is detected during execution
15368
15396
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
15369
15397
  */
@@ -15378,6 +15406,96 @@ declare class DefaultWorkspaceSymbolProvider implements WorkspaceSymbolProvider$
15378
15406
  protected getWorkspaceSymbol(astDescription: AstNodeDescription): WorkspaceSymbol | undefined;
15379
15407
  }
15380
15408
 
15409
+ /******************************************************************************
15410
+ * Copyright 2024 TypeFox GmbH
15411
+ * This program and the accompanying materials are made available under the
15412
+ * terms of the MIT License, which is available in the project root.
15413
+ ******************************************************************************/
15414
+
15415
+ /**
15416
+ * A manager service that keeps track of all currently opened text documents.
15417
+ *
15418
+ * Designed to be compatible with the `TextDocuments` class in the `vscode-languageserver` package.
15419
+ */
15420
+ interface TextDocuments<T extends {
15421
+ uri: string;
15422
+ }> {
15423
+ /**
15424
+ * An event that fires when a text document managed by this manager
15425
+ * has been opened.
15426
+ */
15427
+ readonly onDidOpen: Event<TextDocumentChangeEvent<T>>;
15428
+ /**
15429
+ * An event that fires when a text document managed by this manager
15430
+ * has been opened or the content changes.
15431
+ */
15432
+ readonly onDidChangeContent: Event<TextDocumentChangeEvent<T>>;
15433
+ /**
15434
+ * An event that fires when a text document managed by this manager
15435
+ * will be saved.
15436
+ */
15437
+ readonly onWillSave: Event<TextDocumentWillSaveEvent<T>>;
15438
+ /**
15439
+ * Sets a handler that will be called if a participant wants to provide
15440
+ * edits during a text document save.
15441
+ */
15442
+ onWillSaveWaitUntil(handler: RequestHandler<TextDocumentWillSaveEvent<T>, TextEdit$1[], void>): void;
15443
+ /**
15444
+ * An event that fires when a text document managed by this manager
15445
+ * has been saved.
15446
+ */
15447
+ readonly onDidSave: Event<TextDocumentChangeEvent<T>>;
15448
+ /**
15449
+ * An event that fires when a text document managed by this manager
15450
+ * has been closed.
15451
+ */
15452
+ readonly onDidClose: Event<TextDocumentChangeEvent<T>>;
15453
+ /**
15454
+ * Returns the document for the given URI. Returns undefined if
15455
+ * the document is not managed by this instance.
15456
+ *
15457
+ * @param uri The text document's URI to retrieve.
15458
+ * @return the text document or `undefined`.
15459
+ */
15460
+ get(uri: string | URI): T | undefined;
15461
+ /**
15462
+ * Sets the text document managed by this instance.
15463
+ * @param document The text document to add.
15464
+ * @returns `true` if the document didn't exist yet, `false` if it was already present.
15465
+ */
15466
+ set(document: T): boolean;
15467
+ /**
15468
+ * Deletes a text document managed by this instance.
15469
+ */
15470
+ delete(uri: string | URI | T): void;
15471
+ /**
15472
+ * Returns all text documents managed by this instance.
15473
+ *
15474
+ * @return all text documents.
15475
+ */
15476
+ all(): T[];
15477
+ /**
15478
+ * Returns the URIs of all text documents managed by this instance.
15479
+ *
15480
+ * @return the URI's of all text documents.
15481
+ */
15482
+ keys(): string[];
15483
+ /**
15484
+ * Listens for `low level` notification on the given connection to
15485
+ * update the text documents managed by this instance.
15486
+ *
15487
+ * Please note that the connection only provides handlers not an event model. Therefore
15488
+ * listening on a connection will overwrite the following handlers on a connection:
15489
+ * `onDidOpenTextDocument`, `onDidChangeTextDocument`, `onDidCloseTextDocument`,
15490
+ * `onWillSaveTextDocument`, `onWillSaveTextDocumentWaitUntil` and `onDidSaveTextDocument`.
15491
+ *
15492
+ * Use the corresponding events on the TextDocuments instance instead.
15493
+ *
15494
+ * @param connection The connection to listen on.
15495
+ */
15496
+ listen(connection: Connection): Disposable$1;
15497
+ }
15498
+
15381
15499
  /******************************************************************************
15382
15500
  * Copyright 2023 TypeFox GmbH
15383
15501
  * This program and the accompanying materials are made available under the
@@ -15396,46 +15514,46 @@ type LangiumSharedServices = LangiumSharedCoreServices & LangiumSharedLSPService
15396
15514
  * LSP services for a specific language of which Langium provides default implementations.
15397
15515
  */
15398
15516
  type LangiumLSPServices = {
15399
- lsp: {
15400
- CompletionProvider?: CompletionProvider;
15401
- DocumentHighlightProvider?: DocumentHighlightProvider;
15402
- DocumentSymbolProvider?: DocumentSymbolProvider;
15403
- HoverProvider?: HoverProvider;
15404
- FoldingRangeProvider?: FoldingRangeProvider;
15405
- DefinitionProvider?: DefinitionProvider;
15406
- TypeProvider?: TypeDefinitionProvider;
15407
- ImplementationProvider?: ImplementationProvider;
15408
- ReferencesProvider?: ReferencesProvider;
15409
- CodeActionProvider?: CodeActionProvider;
15410
- SemanticTokenProvider?: SemanticTokenProvider;
15411
- RenameProvider?: RenameProvider;
15412
- Formatter?: Formatter;
15413
- SignatureHelp?: SignatureHelpProvider;
15414
- CallHierarchyProvider?: CallHierarchyProvider;
15415
- TypeHierarchyProvider?: TypeHierarchyProvider;
15416
- DeclarationProvider?: DeclarationProvider;
15417
- InlayHintProvider?: InlayHintProvider;
15418
- CodeLensProvider?: CodeLensProvider;
15419
- DocumentLinkProvider?: DocumentLinkProvider;
15517
+ readonly lsp: {
15518
+ readonly CompletionProvider?: CompletionProvider;
15519
+ readonly DocumentHighlightProvider?: DocumentHighlightProvider;
15520
+ readonly DocumentSymbolProvider?: DocumentSymbolProvider;
15521
+ readonly HoverProvider?: HoverProvider;
15522
+ readonly FoldingRangeProvider?: FoldingRangeProvider;
15523
+ readonly DefinitionProvider?: DefinitionProvider;
15524
+ readonly TypeProvider?: TypeDefinitionProvider;
15525
+ readonly ImplementationProvider?: ImplementationProvider;
15526
+ readonly ReferencesProvider?: ReferencesProvider;
15527
+ readonly CodeActionProvider?: CodeActionProvider;
15528
+ readonly SemanticTokenProvider?: SemanticTokenProvider;
15529
+ readonly RenameProvider?: RenameProvider;
15530
+ readonly Formatter?: Formatter;
15531
+ readonly SignatureHelp?: SignatureHelpProvider;
15532
+ readonly CallHierarchyProvider?: CallHierarchyProvider;
15533
+ readonly TypeHierarchyProvider?: TypeHierarchyProvider;
15534
+ readonly DeclarationProvider?: DeclarationProvider;
15535
+ readonly InlayHintProvider?: InlayHintProvider;
15536
+ readonly CodeLensProvider?: CodeLensProvider;
15537
+ readonly DocumentLinkProvider?: DocumentLinkProvider;
15420
15538
  };
15421
- shared: LangiumSharedServices;
15539
+ readonly shared: LangiumSharedServices;
15422
15540
  };
15423
15541
  /**
15424
15542
  * LSP services shared between multiple languages of which Langium provides default implementations.
15425
15543
  */
15426
15544
  type LangiumSharedLSPServices = {
15427
- lsp: {
15428
- Connection?: Connection;
15429
- DocumentUpdateHandler: DocumentUpdateHandler;
15430
- ExecuteCommandHandler?: ExecuteCommandHandler;
15431
- FileOperationHandler?: FileOperationHandler;
15432
- FuzzyMatcher: FuzzyMatcher;
15433
- LanguageServer: LanguageServer;
15434
- NodeKindProvider: NodeKindProvider$1;
15435
- WorkspaceSymbolProvider?: WorkspaceSymbolProvider$1;
15545
+ readonly lsp: {
15546
+ readonly Connection?: Connection;
15547
+ readonly DocumentUpdateHandler: DocumentUpdateHandler;
15548
+ readonly ExecuteCommandHandler?: ExecuteCommandHandler;
15549
+ readonly FileOperationHandler?: FileOperationHandler;
15550
+ readonly FuzzyMatcher: FuzzyMatcher;
15551
+ readonly LanguageServer: LanguageServer;
15552
+ readonly NodeKindProvider: NodeKindProvider$1;
15553
+ readonly WorkspaceSymbolProvider?: WorkspaceSymbolProvider$1;
15436
15554
  };
15437
- workspace: {
15438
- TextDocuments: TextDocuments<TextDocument>;
15555
+ readonly workspace: {
15556
+ readonly TextDocuments: TextDocuments<TextDocument>;
15439
15557
  };
15440
15558
  };
15441
15559
 
@@ -15530,6 +15648,10 @@ interface CompletionProvider {
15530
15648
  /**
15531
15649
  * Handle a completion request.
15532
15650
  *
15651
+ * @param document - the document for which the completion request was triggered
15652
+ * @param params - the completion parameters
15653
+ * @param cancelToken - a token that can be used to cancel the request
15654
+ *
15533
15655
  * @throws `OperationCancelled` if cancellation is detected during execution
15534
15656
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
15535
15657
  */
@@ -15552,8 +15674,9 @@ declare class DefaultCompletionProvider implements CompletionProvider {
15552
15674
  protected readonly fuzzyMatcher: FuzzyMatcher;
15553
15675
  protected readonly grammarConfig: GrammarConfig;
15554
15676
  protected readonly astReflection: AstReflection;
15677
+ readonly completionOptions?: CompletionProviderOptions;
15555
15678
  constructor(services: LangiumServices);
15556
- getCompletion(document: LangiumDocument, params: CompletionParams): Promise<CompletionList | undefined>;
15679
+ getCompletion(document: LangiumDocument, params: CompletionParams, _cancelToken?: CancellationToken): Promise<CompletionList | undefined>;
15557
15680
  /**
15558
15681
  * The completion algorithm could yield the same reference/keyword multiple times.
15559
15682
  *
@@ -15617,7 +15740,7 @@ interface ChangeViewRequestParams {
15617
15740
  }
15618
15741
 
15619
15742
  /******************************************************************************
15620
- * This file was generated by langium-cli 3.1.1.
15743
+ * This file was generated by langium-cli 3.2.0.
15621
15744
  * DO NOT EDIT MANUALLY!
15622
15745
  ******************************************************************************/
15623
15746
 
@@ -15651,11 +15774,11 @@ type RelationPredicate = RelationPredicateOrWhere | RelationPredicateWith;
15651
15774
  declare const RelationPredicate = "RelationPredicate";
15652
15775
  type RelationPredicateOrWhere = RelationExpression | RelationPredicateWhere;
15653
15776
  declare const RelationPredicateOrWhere = "RelationPredicateOrWhere";
15654
- type RelationProperty = LinkProperty | MetadataProperty | RelationStringProperty | RelationStyleProperty;
15777
+ type RelationProperty = LinkProperty | MetadataProperty | RelationNavigateToProperty | RelationStringProperty | RelationStyleProperty;
15655
15778
  declare const RelationProperty = "RelationProperty";
15656
15779
  type RelationshipStyleProperty = ArrowProperty | ColorProperty | LineProperty;
15657
15780
  declare const RelationshipStyleProperty = "RelationshipStyleProperty";
15658
- type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
15781
+ type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | NotesProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
15659
15782
  declare const StringProperty = "StringProperty";
15660
15783
  type StyleProperty = BorderProperty | ColorProperty | IconProperty | OpacityProperty | ShapeProperty;
15661
15784
  declare const StyleProperty = "StyleProperty";
@@ -15719,7 +15842,7 @@ declare const CustomElementProperties = "CustomElementProperties";
15719
15842
  interface CustomRelationProperties extends AstNode {
15720
15843
  readonly $container: DynamicViewStep | RelationPredicateWith;
15721
15844
  readonly $type: 'CustomRelationProperties';
15722
- props: Array<NotationProperty | RelationStringProperty | RelationshipStyleProperty>;
15845
+ props: Array<NotationProperty | NotesProperty | RelationNavigateToProperty | RelationStringProperty | RelationshipStyleProperty>;
15723
15846
  }
15724
15847
  declare const CustomRelationProperties = "CustomRelationProperties";
15725
15848
  interface DirectedRelationExpression extends AstNode {
@@ -15741,7 +15864,7 @@ interface DynamicViewBody extends AstNode {
15741
15864
  readonly $type: 'DynamicViewBody';
15742
15865
  props: Array<ViewProperty>;
15743
15866
  rules: Array<DynamicViewRule>;
15744
- steps: Array<DynamicViewStep>;
15867
+ steps: Array<DynamicViewParallelSteps | DynamicViewStep>;
15745
15868
  tags?: Tags;
15746
15869
  }
15747
15870
  declare const DynamicViewBody = "DynamicViewBody";
@@ -15751,6 +15874,12 @@ interface DynamicViewIncludePredicate extends AstNode {
15751
15874
  predicates: DynamicViewPredicateIterator;
15752
15875
  }
15753
15876
  declare const DynamicViewIncludePredicate = "DynamicViewIncludePredicate";
15877
+ interface DynamicViewParallelSteps extends AstNode {
15878
+ readonly $container: DynamicViewBody;
15879
+ readonly $type: 'DynamicViewParallelSteps';
15880
+ steps: Array<DynamicViewStep>;
15881
+ }
15882
+ declare const DynamicViewParallelSteps = "DynamicViewParallelSteps";
15754
15883
  interface DynamicViewPredicateIterator extends AstNode {
15755
15884
  readonly $container: DynamicViewIncludePredicate | DynamicViewPredicateIterator;
15756
15885
  readonly $type: 'DynamicViewPredicateIterator';
@@ -15758,8 +15887,14 @@ interface DynamicViewPredicateIterator extends AstNode {
15758
15887
  value: ElementPredicate;
15759
15888
  }
15760
15889
  declare const DynamicViewPredicateIterator = "DynamicViewPredicateIterator";
15890
+ interface DynamicViewRef extends AstNode {
15891
+ readonly $container: RelationNavigateToProperty;
15892
+ readonly $type: 'DynamicViewRef';
15893
+ view: Reference<DynamicView>;
15894
+ }
15895
+ declare const DynamicViewRef = "DynamicViewRef";
15761
15896
  interface DynamicViewStep extends AstNode {
15762
- readonly $container: DynamicViewBody;
15897
+ readonly $container: DynamicViewBody | DynamicViewParallelSteps;
15763
15898
  readonly $type: 'DynamicViewStep';
15764
15899
  custom?: CustomRelationProperties;
15765
15900
  isBackward: boolean;
@@ -16011,6 +16146,13 @@ interface NotationProperty extends AstNode {
16011
16146
  value: string;
16012
16147
  }
16013
16148
  declare const NotationProperty = "NotationProperty";
16149
+ interface NotesProperty extends AstNode {
16150
+ readonly $container: CustomRelationProperties;
16151
+ readonly $type: 'NotesProperty';
16152
+ key: 'notes';
16153
+ value: string;
16154
+ }
16155
+ declare const NotesProperty = "NotesProperty";
16014
16156
  interface OpacityProperty extends AstNode {
16015
16157
  readonly $container: CustomElementProperties | ElementStyleProperty | ViewRuleStyle;
16016
16158
  readonly $type: 'OpacityProperty';
@@ -16052,6 +16194,13 @@ interface RelationBody extends AstNode {
16052
16194
  tags?: Tags;
16053
16195
  }
16054
16196
  declare const RelationBody = "RelationBody";
16197
+ interface RelationNavigateToProperty extends AstNode {
16198
+ readonly $container: CustomRelationProperties | RelationBody;
16199
+ readonly $type: 'RelationNavigateToProperty';
16200
+ key: 'navigateTo';
16201
+ value: DynamicViewRef;
16202
+ }
16203
+ declare const RelationNavigateToProperty = "RelationNavigateToProperty";
16055
16204
  interface RelationPredicateWhere extends AstNode {
16056
16205
  readonly $container: Predicates | RelationPredicateWith;
16057
16206
  readonly $type: 'RelationPredicateWhere';
@@ -16252,7 +16401,9 @@ type LikeC4AstType = {
16252
16401
  DynamicView: DynamicView;
16253
16402
  DynamicViewBody: DynamicViewBody;
16254
16403
  DynamicViewIncludePredicate: DynamicViewIncludePredicate;
16404
+ DynamicViewParallelSteps: DynamicViewParallelSteps;
16255
16405
  DynamicViewPredicateIterator: DynamicViewPredicateIterator;
16406
+ DynamicViewRef: DynamicViewRef;
16256
16407
  DynamicViewRule: DynamicViewRule;
16257
16408
  DynamicViewStep: DynamicViewStep;
16258
16409
  Element: Element;
@@ -16296,6 +16447,7 @@ type LikeC4AstType = {
16296
16447
  ModelViews: ModelViews;
16297
16448
  NavigateToProperty: NavigateToProperty;
16298
16449
  NotationProperty: NotationProperty;
16450
+ NotesProperty: NotesProperty;
16299
16451
  OpacityProperty: OpacityProperty;
16300
16452
  OutgoingRelationExpression: OutgoingRelationExpression;
16301
16453
  Predicate: Predicate;
@@ -16303,6 +16455,7 @@ type LikeC4AstType = {
16303
16455
  Relation: Relation;
16304
16456
  RelationBody: RelationBody;
16305
16457
  RelationExpression: RelationExpression;
16458
+ RelationNavigateToProperty: RelationNavigateToProperty;
16306
16459
  RelationPredicate: RelationPredicate;
16307
16460
  RelationPredicateOrWhere: RelationPredicateOrWhere;
16308
16461
  RelationPredicateWhere: RelationPredicateWhere;
@@ -16415,6 +16568,7 @@ interface ParsedAstRelation {
16415
16568
  head?: RelationshipArrowType;
16416
16569
  tail?: RelationshipArrowType;
16417
16570
  links?: NonEmptyArray<ParsedLink>;
16571
+ navigateTo?: ViewID$1;
16418
16572
  metadata?: {
16419
16573
  [key: string]: string;
16420
16574
  };
@@ -16440,7 +16594,7 @@ interface ParsedAstDynamicView {
16440
16594
  description: string | null;
16441
16595
  tags: NonEmptyArray<Tag$2> | null;
16442
16596
  links: NonEmptyArray<ParsedLink> | null;
16443
- steps: DynamicViewStep$1[];
16597
+ steps: DynamicViewStepOrParallel[];
16444
16598
  rules: Array<DynamicViewRule$1>;
16445
16599
  manualLayout?: ViewManualLayout;
16446
16600
  }
@@ -16493,6 +16647,7 @@ declare class LikeC4DocumentLinkProvider implements DocumentLinkProvider {
16493
16647
  constructor(services: LikeC4Services);
16494
16648
  getDocumentLinks(doc: LangiumDocument, _params: DocumentLinkParams): MaybePromise<DocumentLink[]>;
16495
16649
  resolveLink(doc: LangiumDocument, link: string): string;
16650
+ relativeLink(doc: LangiumDocument, link: string): string | null;
16496
16651
  }
16497
16652
 
16498
16653
  declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
@@ -16520,10 +16675,6 @@ declare class LikeC4HoverProvider extends AstNodeHoverProvider {
16520
16675
  protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
16521
16676
  }
16522
16677
 
16523
- declare class LikeC4RenameProvider extends DefaultRenameProvider {
16524
- constructor(services: LikeC4Services);
16525
- }
16526
-
16527
16678
  declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
16528
16679
  protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
16529
16680
  private highlightAstElement;
@@ -16631,7 +16782,6 @@ interface LikeC4AddedServices {
16631
16782
  ModelChanges: LikeC4ModelChanges;
16632
16783
  };
16633
16784
  lsp: {
16634
- RenameProvider: LikeC4RenameProvider;
16635
16785
  CompletionProvider: LikeC4CompletionProvider;
16636
16786
  DocumentHighlightProvider: LikeC4DocumentHighlightProvider;
16637
16787
  DocumentSymbolProvider: LikeC4DocumentSymbolProvider;
@@ -16729,6 +16879,7 @@ declare class LikeC4ModelParser {
16729
16879
  private parseRelationExpr;
16730
16880
  private parseViewRule;
16731
16881
  private parseViewManualLaout;
16882
+ private parseDynamicParallelSteps;
16732
16883
  private parseDynamicStep;
16733
16884
  private parseElementView;
16734
16885
  private parseDynamicElementView;
@@ -17357,7 +17508,7 @@ declare class CliWorkspace {
17357
17508
  private services;
17358
17509
  private isInitialized;
17359
17510
  constructor(services: CliServices);
17360
- initForWorkspace(workspacePath: string): Promise<void>;
17511
+ initWorkspace(workspace: WorkspaceFolder): Promise<void>;
17361
17512
  init(): Promise<void>;
17362
17513
  }
17363
17514
 
@@ -17462,4 +17613,4 @@ declare class LikeC4 {
17462
17613
  dispose(): void;
17463
17614
  }
17464
17615
 
17465
- export { type AutoLayoutDirection, type BBox, BorderStyles, type Color$1 as Color, type ComputedDynamicView, type ComputedEdge, type ComputedElementView, type ComputedLikeC4Model, type ComputedNode, type ComputedView, type DiagramEdge, type DiagramNode, type DiagramView, type DynamicView$1 as DynamicView, type EdgeId$1 as EdgeId, type Element$1 as Element, ElementColors, type ElementKind$1 as ElementKind, ElementShapes, type ElementView$1 as ElementView, type Fqn$1 as Fqn, type HexColorLiteral, LikeC4, LikeC4Model, type LikeC4View$1 as LikeC4View, LikeC4ViewModel, type NodeId, type ParsedLikeC4Model, type Point, type Relation$1 as Relation, type RelationExpr, type RelationID$1 as RelationID, RelationshipColors, StepEdgeId, type Tag$2 as Tag, type ThemeColor$1 as ThemeColor, type ViewID$1 as ViewID, type XYPoint, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareRelations, defaultTheme, extractStep, hasAtLeast, invariant, isAncestor, isComputedDynamicView, isDescendantOf, isDynamicView, isSameHierarchy, isStepEdgeId, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn };
17616
+ export { type AutoLayoutDirection, type BBox, BorderStyles, type Color$1 as Color, type ComputedDynamicView, type ComputedEdge, type ComputedElementView, type ComputedLikeC4Model, type ComputedNode, type ComputedView, type DiagramEdge, type DiagramNode, type DiagramView, type DynamicView$1 as DynamicView, type EdgeId$1 as EdgeId, type Element$1 as Element, ElementColors, type ElementKind$1 as ElementKind, ElementShapes, type ElementView$1 as ElementView, type Fqn$1 as Fqn, type HexColorLiteral, LikeC4, LikeC4Model, type LikeC4View$1 as LikeC4View, LikeC4ViewModel, type NodeId, type ParsedLikeC4Model, type Point, type Relation$1 as Relation, type RelationExpr, type RelationID$1 as RelationID, RelationshipColors, StepEdgeId, type Tag$2 as Tag, type ThemeColor$1 as ThemeColor, type ViewID$1 as ViewID, type XYPoint, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareRelations, defaultTheme, extractStep, hasAtLeast, invariant, isAncestor, isComputedDynamicView, isDescendantOf, isSameHierarchy, isStepEdgeId, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn };