@artel/artc 0.6.25249 → 0.6.25251

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.
Files changed (42) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +10 -4
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +295 -254
  5. package/build/{chunk-6OPBY3SK.js → chunk-IZHH3TQT.js} +8 -6
  6. package/build/{chunk-CBYKP5SE.js → chunk-KGZLMBKA.js} +2 -2
  7. package/build/{chunk-G4UMALLG.js → chunk-XARNKP3Q.js} +2333 -1724
  8. package/build/types/analysis/AnalyzedTranslationPackage.d.ts +4 -4
  9. package/build/types/analysis/Analyzer.d.ts +23 -14
  10. package/build/types/analysis/DeclarationsUsageCounter.d.ts +3 -4
  11. package/build/types/analysis/DiagnosticCollector.d.ts +3 -5
  12. package/build/types/analysis/InstanceFieldsInitializationValidator.d.ts +2 -2
  13. package/build/types/analysis/Localization.d.ts +1 -1
  14. package/build/types/analysis/NodeTypeUtils.d.ts +1 -1
  15. package/build/types/analysis/PackageAndStaticVariablesInitializationValidator.d.ts +3 -3
  16. package/build/types/analysis/TypeNarrower.d.ts +1 -1
  17. package/build/types/analysis/WellKnownDeclarations.d.ts +3 -3
  18. package/build/types/diagnostic/DiagnosticCode.d.ts +11 -13
  19. package/build/types/emitter/Emitter.d.ts +4 -8
  20. package/build/types/emitter/EmitterContext.d.ts +2 -2
  21. package/build/types/emitter/Entities.d.ts +1 -0
  22. package/build/types/emitter/EntityMap.d.ts +1 -0
  23. package/build/types/emitter/IrBuilder.d.ts +18 -10
  24. package/build/types/emitter/IrToJs.d.ts +1 -1
  25. package/build/types/emitter/Transformer.d.ts +7 -2
  26. package/build/types/emitter/ir/EmitOptions.d.ts +5 -5
  27. package/build/types/emitter/ir/Nodes.d.ts +185 -147
  28. package/build/types/emitter/ir/types.d.ts +3 -3
  29. package/build/types/entities/LocalizableTextEntity.d.ts +75 -0
  30. package/build/types/entities/VariableEntity.d.ts +3 -3
  31. package/build/types/entities/index.d.ts +5 -2
  32. package/build/types/services/DisplayService.d.ts +4 -3
  33. package/build/types/tree/KeywordKind.d.ts +1 -1
  34. package/build/types/tree/NodeKind.d.ts +88 -84
  35. package/build/types/tree/green/Nodes.d.ts +96 -55
  36. package/build/types/tree/green/SyntaxFactory.d.ts +6 -6
  37. package/build/types/tree/red/Nodes.d.ts +137 -92
  38. package/build/types/ts-interop/Entities.d.ts +0 -1
  39. package/build/types/ts-interop/TsInteropContext.d.ts +1 -1
  40. package/build/types/types/ParameterType.d.ts +3 -3
  41. package/build/types/types/StandardTypes.d.ts +2 -2
  42. package/package.json +2 -2
@@ -2,9 +2,98 @@ import { AccessKind } from '../../common/index.js';
2
2
  import { FunctionEntity, NamedEntity, Type, TypeOrExtensionEntity, VariableEntity } from '../Entities.js';
3
3
  import { AccessedFunction, AccessedVariable } from './AccessedEntities.js';
4
4
  import { ComputedAccess } from './ComputedAccess.js';
5
- import { AssignmentEmitOptions, CallExpressionEmitOptions, ConstructorCallExpressionEmitOptions, DeclarationWithInitializerEmitOptions, ErrorStatementEmitOptions, FieldAccessExpressionEmitOptions, FieldDeclarationEmitOptions, ForStatementEmitOptions, FunctionAccessExpressionEmitOptions, MethodDeclarationEmitOptions, PackageVariableDeclarationEmitOptions, TextTemplateLiteralEmitOptions } from './EmitOptions.js';
5
+ import { AssignmentEmitOptions, CallExpressionEmitOptions, ConstructorCallExpressionEmitOptions, DeclarationWithInitializerEmitOptions, ErrorStatementEmitOptions, FieldAccessExpressionEmitOptions, FieldDeclarationEmitOptions, ForStatementEmitOptions, FunctionAccessExpressionEmitOptions, MethodDeclarationEmitOptions, PackageVariableDeclarationEmitOptions, TextTemplateEmitOptions } from './EmitOptions.js';
6
6
  import { SourceLocation } from './SourceLocation.js';
7
7
  import { Expression, LValueExpression, PackageMemberDeclaration, Statement, TypeMemberDeclaration } from './types.js';
8
+ export declare class Package {
9
+ leadingStatements: readonly Statement[];
10
+ declarations: readonly PackageMemberDeclaration[];
11
+ translations: readonly TextTranslationDeclaration[];
12
+ trailingStatements: readonly Statement[];
13
+ sourceLocation: SourceLocation | undefined;
14
+ readonly kind = NodeKind.Package;
15
+ constructor(leadingStatements: readonly Statement[], declarations: readonly PackageMemberDeclaration[], translations: readonly TextTranslationDeclaration[], trailingStatements: readonly Statement[], sourceLocation: SourceLocation | undefined);
16
+ clone(): Package;
17
+ }
18
+ export declare class PackageFunctionDeclaration {
19
+ modifiers: Modifiers;
20
+ valueParameters: readonly ValueParameterDeclaration[];
21
+ body: BlockStatement;
22
+ entity: FunctionEntity;
23
+ isGenerator: boolean;
24
+ sourceLocation: SourceLocation | undefined;
25
+ readonly kind = NodeKind.PackageFunctionDeclaration;
26
+ constructor(modifiers: Modifiers, valueParameters: readonly ValueParameterDeclaration[], body: BlockStatement, entity: FunctionEntity, isGenerator: boolean, sourceLocation: SourceLocation | undefined);
27
+ clone(): PackageFunctionDeclaration;
28
+ }
29
+ export declare class PackageTypeDeclaration {
30
+ decorators: readonly Decorator[];
31
+ modifiers: Modifiers;
32
+ members: readonly TypeMemberDeclaration[];
33
+ entity: TypeOrExtensionEntity;
34
+ sourceLocation: SourceLocation | undefined;
35
+ readonly kind = NodeKind.PackageTypeDeclaration;
36
+ constructor(decorators: readonly Decorator[], modifiers: Modifiers, members: readonly TypeMemberDeclaration[], entity: TypeOrExtensionEntity, sourceLocation: SourceLocation | undefined);
37
+ clone(): PackageTypeDeclaration;
38
+ }
39
+ export declare class PackageVariableDeclaration {
40
+ modifiers: Modifiers;
41
+ initializer: Expression | undefined;
42
+ entity: VariableEntity;
43
+ sourceLocation: SourceLocation | undefined;
44
+ options: PackageVariableDeclarationEmitOptions;
45
+ readonly kind = NodeKind.PackageVariableDeclaration;
46
+ constructor(modifiers: Modifiers, initializer: Expression | undefined, entity: VariableEntity, sourceLocation: SourceLocation | undefined, options?: PackageVariableDeclarationEmitOptions);
47
+ clone(): PackageVariableDeclaration;
48
+ }
49
+ export declare class PackageVariableGetterDeclaration {
50
+ entity: FunctionEntity;
51
+ variableEntity: VariableEntity;
52
+ body: BlockStatement;
53
+ sourceLocation: SourceLocation | undefined;
54
+ readonly kind = NodeKind.PackageVariableGetterDeclaration;
55
+ constructor(entity: FunctionEntity, variableEntity: VariableEntity, body: BlockStatement, sourceLocation: SourceLocation | undefined);
56
+ clone(): PackageVariableGetterDeclaration;
57
+ }
58
+ export declare class PackageVariableSetterDeclaration {
59
+ entity: FunctionEntity;
60
+ variableEntity: VariableEntity;
61
+ body: BlockStatement;
62
+ valueLocalVariableEntity: VariableEntity;
63
+ sourceLocation: SourceLocation | undefined;
64
+ readonly kind = NodeKind.PackageVariableSetterDeclaration;
65
+ constructor(entity: FunctionEntity, variableEntity: VariableEntity, body: BlockStatement, valueLocalVariableEntity: VariableEntity, sourceLocation: SourceLocation | undefined);
66
+ clone(): PackageVariableSetterDeclaration;
67
+ }
68
+ export declare class PackageVariantTypeDeclaration {
69
+ modifiers: Modifiers;
70
+ underlyingTypeKind: UnderlyingTypeKind;
71
+ variants: readonly VariantDeclaration[];
72
+ entity: TypeOrExtensionEntity;
73
+ sourceLocation: SourceLocation | undefined;
74
+ readonly kind = NodeKind.PackageVariantTypeDeclaration;
75
+ constructor(modifiers: Modifiers, underlyingTypeKind: UnderlyingTypeKind, variants: readonly VariantDeclaration[], entity: TypeOrExtensionEntity, sourceLocation: SourceLocation | undefined);
76
+ clone(): PackageVariantTypeDeclaration;
77
+ }
78
+ export declare const enum UnderlyingTypeKind {
79
+ Numeric = 0,
80
+ NonNumeric = 1
81
+ }
82
+ export declare class VariantDeclaration {
83
+ value: Expression | undefined;
84
+ entity: VariableEntity;
85
+ sourceLocation: SourceLocation | undefined;
86
+ readonly kind = NodeKind.VariantDeclaration;
87
+ constructor(value: Expression | undefined, entity: VariableEntity, sourceLocation: SourceLocation | undefined);
88
+ clone(): VariantDeclaration;
89
+ }
90
+ export declare class Decorator {
91
+ expression: Expression;
92
+ sourceLocation: SourceLocation | undefined;
93
+ readonly kind = NodeKind.Decorator;
94
+ constructor(expression: Expression, sourceLocation: SourceLocation | undefined);
95
+ clone(): Decorator;
96
+ }
8
97
  export declare class ArrayLiteral {
9
98
  elements: readonly Expression[];
10
99
  type: Type;
@@ -503,11 +592,11 @@ export declare class NestedFunctionDeclarationStatement {
503
592
  constructor(declaration: NestedFunctionDeclaration, sourceLocation: SourceLocation | undefined);
504
593
  clone(): NestedFunctionDeclarationStatement;
505
594
  }
506
- export declare class NoneLiteral {
595
+ export declare class NullLiteral {
507
596
  sourceLocation: SourceLocation | undefined;
508
- readonly kind = NodeKind.NoneLiteral;
597
+ readonly kind = NodeKind.NullLiteral;
509
598
  constructor(sourceLocation: SourceLocation | undefined);
510
- clone(): NoneLiteral;
599
+ clone(): NullLiteral;
511
600
  }
512
601
  export declare class NumericLiteral {
513
602
  value: number;
@@ -533,85 +622,6 @@ export declare class OwnConstructorCallExpression {
533
622
  constructor(entity: FunctionEntity, containingTypeOfConstructor: TypeOrExtensionEntity, args: Arguments, sourceLocation: SourceLocation | undefined);
534
623
  clone(): OwnConstructorCallExpression;
535
624
  }
536
- export declare class PackageFunctionDeclaration {
537
- modifiers: Modifiers;
538
- valueParameters: readonly ValueParameterDeclaration[];
539
- body: BlockStatement;
540
- entity: FunctionEntity;
541
- isGenerator: boolean;
542
- sourceLocation: SourceLocation | undefined;
543
- readonly kind = NodeKind.PackageFunctionDeclaration;
544
- constructor(modifiers: Modifiers, valueParameters: readonly ValueParameterDeclaration[], body: BlockStatement, entity: FunctionEntity, isGenerator: boolean, sourceLocation: SourceLocation | undefined);
545
- clone(): PackageFunctionDeclaration;
546
- }
547
- export declare class PackageTypeDeclaration {
548
- decorators: readonly Decorator[];
549
- modifiers: Modifiers;
550
- members: readonly TypeMemberDeclaration[];
551
- entity: TypeOrExtensionEntity;
552
- sourceLocation: SourceLocation | undefined;
553
- readonly kind = NodeKind.PackageTypeDeclaration;
554
- constructor(decorators: readonly Decorator[], modifiers: Modifiers, members: readonly TypeMemberDeclaration[], entity: TypeOrExtensionEntity, sourceLocation: SourceLocation | undefined);
555
- clone(): PackageTypeDeclaration;
556
- }
557
- export declare class PackageVariableDeclaration {
558
- modifiers: Modifiers;
559
- initializer: Expression | undefined;
560
- entity: VariableEntity;
561
- sourceLocation: SourceLocation | undefined;
562
- options: PackageVariableDeclarationEmitOptions;
563
- readonly kind = NodeKind.PackageVariableDeclaration;
564
- constructor(modifiers: Modifiers, initializer: Expression | undefined, entity: VariableEntity, sourceLocation: SourceLocation | undefined, options?: PackageVariableDeclarationEmitOptions);
565
- clone(): PackageVariableDeclaration;
566
- }
567
- export declare class PackageVariableGetterDeclaration {
568
- entity: FunctionEntity;
569
- variableEntity: VariableEntity;
570
- body: BlockStatement;
571
- sourceLocation: SourceLocation | undefined;
572
- readonly kind = NodeKind.PackageVariableGetterDeclaration;
573
- constructor(entity: FunctionEntity, variableEntity: VariableEntity, body: BlockStatement, sourceLocation: SourceLocation | undefined);
574
- clone(): PackageVariableGetterDeclaration;
575
- }
576
- export declare class PackageVariableSetterDeclaration {
577
- entity: FunctionEntity;
578
- variableEntity: VariableEntity;
579
- body: BlockStatement;
580
- valueLocalVariableEntity: VariableEntity;
581
- sourceLocation: SourceLocation | undefined;
582
- readonly kind = NodeKind.PackageVariableSetterDeclaration;
583
- constructor(entity: FunctionEntity, variableEntity: VariableEntity, body: BlockStatement, valueLocalVariableEntity: VariableEntity, sourceLocation: SourceLocation | undefined);
584
- clone(): PackageVariableSetterDeclaration;
585
- }
586
- export declare class PackageVariantTypeDeclaration {
587
- modifiers: Modifiers;
588
- underlyingTypeKind: UnderlyingTypeKind;
589
- variants: readonly VariantDeclaration[];
590
- entity: TypeOrExtensionEntity;
591
- sourceLocation: SourceLocation | undefined;
592
- readonly kind = NodeKind.PackageVariantTypeDeclaration;
593
- constructor(modifiers: Modifiers, underlyingTypeKind: UnderlyingTypeKind, variants: readonly VariantDeclaration[], entity: TypeOrExtensionEntity, sourceLocation: SourceLocation | undefined);
594
- clone(): PackageVariantTypeDeclaration;
595
- }
596
- export declare const enum UnderlyingTypeKind {
597
- Numeric = 0,
598
- NonNumeric = 1
599
- }
600
- export declare class VariantDeclaration {
601
- value: Expression | undefined;
602
- entity: VariableEntity;
603
- sourceLocation: SourceLocation | undefined;
604
- readonly kind = NodeKind.VariantDeclaration;
605
- constructor(value: Expression | undefined, entity: VariableEntity, sourceLocation: SourceLocation | undefined);
606
- clone(): VariantDeclaration;
607
- }
608
- export declare class Decorator {
609
- expression: Expression;
610
- sourceLocation: SourceLocation | undefined;
611
- readonly kind = NodeKind.Decorator;
612
- constructor(expression: Expression, sourceLocation: SourceLocation | undefined);
613
- clone(): Decorator;
614
- }
615
625
  export declare class PrefixUnaryExpression {
616
626
  operatorKind: PrefixUnaryExpressionOperatorKind;
617
627
  expression: Expression;
@@ -651,15 +661,6 @@ export declare class TryStatement {
651
661
  constructor(body: BlockStatement, catchClause: CatchClause | undefined, finallyClause: FinallyClause | undefined, sourceLocation: SourceLocation | undefined);
652
662
  clone(): TryStatement;
653
663
  }
654
- export declare class Package {
655
- leadingStatements: readonly Statement[];
656
- declarations: readonly PackageMemberDeclaration[];
657
- trailingStatements: readonly Statement[];
658
- sourceLocation: SourceLocation | undefined;
659
- readonly kind = NodeKind.Package;
660
- constructor(leadingStatements: readonly Statement[], declarations: readonly PackageMemberDeclaration[], trailingStatements: readonly Statement[], sourceLocation: SourceLocation | undefined);
661
- clone(): Package;
662
- }
663
664
  export declare class SwitchStatement {
664
665
  matchExpression: Expression;
665
666
  caseClauses: readonly CaseClause[];
@@ -693,6 +694,13 @@ export declare class TextLiteral {
693
694
  constructor(value: string, sourceLocation: SourceLocation | undefined);
694
695
  clone(): TextLiteral;
695
696
  }
697
+ export declare class LocalizableTextLiteral {
698
+ value: string;
699
+ sourceLocation: SourceLocation | undefined;
700
+ readonly kind = NodeKind.LocalizableTextLiteral;
701
+ constructor(value: string, sourceLocation: SourceLocation | undefined);
702
+ clone(): LocalizableTextLiteral;
703
+ }
696
704
  /**
697
705
  * Узел предназначен для генерации строки, состоящей из имени сущности.
698
706
  * Поскольку имена сущностей могут меняться в процессе трансформаций, для этих целей нельзя использовать обычный
@@ -708,11 +716,19 @@ export declare class TextWithEntityName {
708
716
  export declare class TextTemplateLiteral {
709
717
  elements: readonly (string | Expression)[];
710
718
  sourceLocation: SourceLocation | undefined;
711
- options: TextTemplateLiteralEmitOptions;
719
+ options: TextTemplateEmitOptions;
712
720
  readonly kind = NodeKind.TextTemplateLiteral;
713
- constructor(elements: readonly (string | Expression)[], sourceLocation: SourceLocation | undefined, options?: TextTemplateLiteralEmitOptions);
721
+ constructor(elements: readonly (string | Expression)[], sourceLocation: SourceLocation | undefined, options?: TextTemplateEmitOptions);
714
722
  clone(): TextTemplateLiteral;
715
723
  }
724
+ export declare class LocalizableTextTemplateLiteral {
725
+ elements: readonly (string | Expression)[];
726
+ sourceLocation: SourceLocation | undefined;
727
+ options: TextTemplateEmitOptions;
728
+ readonly kind = NodeKind.LocalizableTextTemplateLiteral;
729
+ constructor(elements: readonly (string | Expression)[], sourceLocation: SourceLocation | undefined, options?: TextTemplateEmitOptions);
730
+ clone(): LocalizableTextTemplateLiteral;
731
+ }
716
732
  export declare class ThisExpression {
717
733
  type: Type;
718
734
  sourceLocation: SourceLocation | undefined;
@@ -916,6 +932,23 @@ export declare class YieldStatement {
916
932
  constructor(expression: Expression, sourceLocation: SourceLocation | undefined);
917
933
  clone(): YieldStatement;
918
934
  }
935
+ export declare class TextTranslationDeclaration {
936
+ key: string;
937
+ sourceTextTemplate: TranslationTextTemplate | undefined;
938
+ translatedTextOrTranslationFunction: string | FunctionLiteral | undefined;
939
+ sourceLocation: SourceLocation | undefined;
940
+ readonly kind = NodeKind.TextTranslationDeclaration;
941
+ constructor(key: string, sourceTextTemplate: TranslationTextTemplate | undefined, translatedTextOrTranslationFunction: string | FunctionLiteral | undefined, sourceLocation: SourceLocation | undefined);
942
+ clone(): TextTranslationDeclaration;
943
+ }
944
+ export declare class TranslationTextTemplate {
945
+ fragments: readonly string[];
946
+ parameters: readonly VariableEntity[];
947
+ sourceLocation: SourceLocation | undefined;
948
+ readonly kind = NodeKind.TranslationTextTemplate;
949
+ constructor(fragments: readonly string[], parameters: readonly VariableEntity[], sourceLocation: SourceLocation | undefined);
950
+ clone(): TranslationTextTemplate;
951
+ }
919
952
  export declare const enum NodeKind {
920
953
  AsExpression = 0,
921
954
  AssertionExpression = 1,
@@ -933,7 +966,7 @@ export declare const enum NodeKind {
933
966
  DisposeStatement = 13,
934
967
  RunStatement = 14,
935
968
  TryStatement = 15,
936
- NoneLiteral = 16,
969
+ NullLiteral = 16,
937
970
  EmptyStatement = 17,
938
971
  ErrorStatement = 18,
939
972
  ImportantStatement = 19,
@@ -964,58 +997,63 @@ export declare const enum NodeKind {
964
997
  ReturnStatement = 44,
965
998
  Package = 45,
966
999
  TextLiteral = 46,
967
- TextTemplateLiteral = 47,
968
- ConstructorDeclaration = 48,
969
- DestructorDeclaration = 49,
970
- IndexedElementGetterDeclaration = 50,
971
- IndexedElementSetterDeclaration = 51,
972
- MethodDeclaration = 52,
973
- FieldDeclaration = 53,
974
- FieldGetterDeclaration = 54,
975
- FieldSetterDeclaration = 55,
976
- SwitchStatement = 56,
977
- TernaryExpression = 57,
978
- ThisExpression = 58,
979
- ValueParameterDeclaration = 59,
980
- VariantDeclaration = 60,
981
- WhileStatement = 61,
982
- YieldStatement = 62,
983
- ArrayLiteral = 63,
984
- TypeAccessExpression = 64,
985
- VariableAccessExpression = 65,
986
- FunctionAccessExpression = 66,
987
- ImplicitVariantAccessExpression = 67,
988
- VariantAccessExpression = 68,
989
- FieldAccessExpression = 69,
990
- MethodAccessExpression = 70,
991
- ConstructorCallExpression = 71,
992
- InlineJsExpression = 72,
993
- AssignmentExpression = 73,
994
- CommaExpression = 74,
995
- BaseConstructorCallExpression = 75,
996
- JsImportSpecifier = 76,
997
- JsIndexedAccessExpression = 77,
998
- EsModuleImportDirectiveStatement = 78,
999
- CjsModuleImportDirectiveStatement = 79,
1000
- JsObjectLiteral = 80,
1001
- ValueJsObjectLiteralProperty = 81,
1002
- FunctionJsObjectLiteralProperty = 82,
1003
- SpreadJsObjectLiteralProperty = 83,
1004
- JsPropertyAccessExpression = 84,
1005
- JsFunctionLiteral = 85,
1006
- JsTypeOfExpression = 86,
1007
- JsInstanceOfExpression = 87,
1008
- JsIdentifierExpression = 88,
1009
- DereferenceExpression = 89,
1010
- BaseExpression = 90,
1011
- OwnConstructorCallExpression = 91,
1012
- DereferencedVariableGetterDeclaration = 92,
1013
- DereferencedVariableSetterDeclaration = 93,
1014
- JsNamespaceDestructuringStatement = 94,
1015
- ComputedFieldDeclaration = 95,
1016
- TextWithEntityName = 96,
1017
- Arguments = 97,
1018
- Decorator = 98
1000
+ LocalizableTextLiteral = 47,
1001
+ TextTemplateLiteral = 48,
1002
+ LocalizableTextTemplateLiteral = 49,
1003
+ ConstructorDeclaration = 50,
1004
+ DestructorDeclaration = 51,
1005
+ IndexedElementGetterDeclaration = 52,
1006
+ IndexedElementSetterDeclaration = 53,
1007
+ MethodDeclaration = 54,
1008
+ FieldDeclaration = 55,
1009
+ FieldGetterDeclaration = 56,
1010
+ FieldSetterDeclaration = 57,
1011
+ SwitchStatement = 58,
1012
+ TernaryExpression = 59,
1013
+ ThisExpression = 60,
1014
+ ValueParameterDeclaration = 61,
1015
+ VariantDeclaration = 62,
1016
+ WhileStatement = 63,
1017
+ YieldStatement = 64,
1018
+ ArrayLiteral = 65,
1019
+ TypeAccessExpression = 66,
1020
+ VariableAccessExpression = 67,
1021
+ FunctionAccessExpression = 68,
1022
+ ImplicitVariantAccessExpression = 69,
1023
+ VariantAccessExpression = 70,
1024
+ FieldAccessExpression = 71,
1025
+ MethodAccessExpression = 72,
1026
+ ConstructorCallExpression = 73,
1027
+ InlineJsExpression = 74,
1028
+ AssignmentExpression = 75,
1029
+ CommaExpression = 76,
1030
+ BaseConstructorCallExpression = 77,
1031
+ JsImportSpecifier = 78,
1032
+ JsIndexedAccessExpression = 79,
1033
+ EsModuleImportDirectiveStatement = 80,
1034
+ CjsModuleImportDirectiveStatement = 81,
1035
+ JsObjectLiteral = 82,
1036
+ ValueJsObjectLiteralProperty = 83,
1037
+ FunctionJsObjectLiteralProperty = 84,
1038
+ SpreadJsObjectLiteralProperty = 85,
1039
+ JsPropertyAccessExpression = 86,
1040
+ JsFunctionLiteral = 87,
1041
+ JsTypeOfExpression = 88,
1042
+ JsInstanceOfExpression = 89,
1043
+ JsIdentifierExpression = 90,
1044
+ DereferenceExpression = 91,
1045
+ BaseExpression = 92,
1046
+ OwnConstructorCallExpression = 93,
1047
+ DereferencedVariableGetterDeclaration = 94,
1048
+ DereferencedVariableSetterDeclaration = 95,
1049
+ JsNamespaceDestructuringStatement = 96,
1050
+ ComputedFieldDeclaration = 97,
1051
+ TextWithEntityName = 98,
1052
+ Arguments = 99,
1053
+ Decorator = 100,
1054
+ TextTranslationDeclaration = 101,
1055
+ TranslationTextTemplate = 102,
1056
+ TranslationTextTemplateParameter = 103
1019
1057
  }
1020
1058
  export declare const enum AssignmentOperatorKind {
1021
1059
  Equals = 0,
@@ -1,8 +1,8 @@
1
1
  import * as ir from './Nodes.js';
2
- export type Node = ir.ArrayLiteral | ir.AsExpression | ir.AssertionExpression | ir.AssumptionExpression | ir.AssignmentExpression | ir.AssignmentStatement | ir.BaseConstructorCallExpression | ir.BinaryExpression | ir.BlockStatement | ir.BooleanLiteral | ir.BreakLoopStatement | ir.CallExpression | ir.CharLiteral | ir.CommaExpression | ir.ConstructorCallExpression | ir.ContinueLoopStatement | ir.DisposeStatement | ir.RunStatement | ir.TryStatement | ir.NoneLiteral | ir.EmptyStatement | ir.ErrorStatement | ir.ImportantStatement | ir.ExpressionStatement | ir.FinallyClause | ir.ForStatement | ir.PackageFunctionDeclaration | ir.PackageTypeDeclaration | ir.PackageVariableDeclaration | ir.PackageVariableGetterDeclaration | ir.PackageVariableSetterDeclaration | ir.PackageVariantTypeDeclaration | ir.IfStatement | ir.IndexedAccessExpression | ir.InlineJsExpression | ir.MethodAccessExpression | ir.FieldAccessExpression | ir.IntegerLiteral | ir.IsExpression | ir.JsIndexedAccessExpression | ir.NestedFunctionDeclaration | ir.NestedFunctionDeclarationStatement | ir.LocalVariableDeclaration | ir.LocalVariableDeclarationStatement | ir.NumericLiteral | ir.CatchClause | ir.FunctionAccessExpression | ir.FunctionLiteral | ir.PrefixUnaryExpression | ir.MeasureLiteral | ir.ReferenceExpression | ir.LoopStatement | ir.Package | ir.ReturnStatement | ir.TextLiteral | ir.TextTemplateLiteral | ir.ConstructorDeclaration | ir.DestructorDeclaration | ir.IndexedElementGetterDeclaration | ir.IndexedElementSetterDeclaration | ir.MethodDeclaration | ir.FieldDeclaration | ir.ComputedFieldDeclaration | ir.FieldGetterDeclaration | ir.FieldSetterDeclaration | ir.SwitchStatement | ir.TernaryExpression | ir.ThisExpression | ir.TypeAccessExpression | ir.ValueParameterDeclaration | ir.VariableAccessExpression | ir.VariantDeclaration | ir.WhileStatement | ir.YieldStatement | ir.JsObjectLiteral | ir.ValueJsObjectLiteralProperty | ir.FunctionJsObjectLiteralProperty | ir.SpreadJsObjectLiteralProperty | ir.JsPropertyAccessExpression | ir.JsFunctionLiteral | ir.JsTypeOfExpression | ir.JsInstanceOfExpression | ir.JsIdentifierExpression | ir.DereferenceExpression | ir.BaseExpression | ir.OwnConstructorCallExpression | ir.EsModuleImportDirectiveStatement | ir.CjsModuleImportDirectiveStatement | ir.JsNamespaceDestructuringStatement | ir.DereferencedVariableGetterDeclaration | ir.DereferencedVariableSetterDeclaration | ir.TextWithEntityName | ir.Argument | ir.Arguments | ir.Decorator;
3
- export type Declaration = ir.PackageFunctionDeclaration | ir.PackageTypeDeclaration | ir.PackageVariableDeclaration | ir.PackageVariableGetterDeclaration | ir.PackageVariableSetterDeclaration | ir.PackageVariantTypeDeclaration | ir.NestedFunctionDeclaration | ir.LocalVariableDeclaration | ir.ConstructorDeclaration | ir.DestructorDeclaration | ir.IndexedElementGetterDeclaration | ir.IndexedElementSetterDeclaration | ir.MethodDeclaration | ir.FieldDeclaration | ir.FieldGetterDeclaration | ir.FieldSetterDeclaration | ir.ValueParameterDeclaration | ir.VariantDeclaration | ir.DereferencedVariableGetterDeclaration | ir.DereferencedVariableSetterDeclaration;
2
+ export type Node = ir.ArrayLiteral | ir.AsExpression | ir.AssertionExpression | ir.AssumptionExpression | ir.AssignmentExpression | ir.AssignmentStatement | ir.BaseConstructorCallExpression | ir.BinaryExpression | ir.BlockStatement | ir.BooleanLiteral | ir.BreakLoopStatement | ir.CallExpression | ir.CharLiteral | ir.CommaExpression | ir.ConstructorCallExpression | ir.ContinueLoopStatement | ir.DisposeStatement | ir.RunStatement | ir.TryStatement | ir.NullLiteral | ir.EmptyStatement | ir.ErrorStatement | ir.ImportantStatement | ir.ExpressionStatement | ir.FinallyClause | ir.ForStatement | ir.PackageFunctionDeclaration | ir.PackageTypeDeclaration | ir.PackageVariableDeclaration | ir.PackageVariableGetterDeclaration | ir.PackageVariableSetterDeclaration | ir.PackageVariantTypeDeclaration | ir.IfStatement | ir.IndexedAccessExpression | ir.InlineJsExpression | ir.MethodAccessExpression | ir.FieldAccessExpression | ir.IntegerLiteral | ir.IsExpression | ir.JsIndexedAccessExpression | ir.NestedFunctionDeclaration | ir.NestedFunctionDeclarationStatement | ir.LocalVariableDeclaration | ir.LocalVariableDeclarationStatement | ir.NumericLiteral | ir.CatchClause | ir.FunctionAccessExpression | ir.FunctionLiteral | ir.PrefixUnaryExpression | ir.MeasureLiteral | ir.ReferenceExpression | ir.LoopStatement | ir.Package | ir.ReturnStatement | ir.TextLiteral | ir.LocalizableTextLiteral | ir.TextTemplateLiteral | ir.LocalizableTextTemplateLiteral | ir.ConstructorDeclaration | ir.DestructorDeclaration | ir.IndexedElementGetterDeclaration | ir.IndexedElementSetterDeclaration | ir.MethodDeclaration | ir.FieldDeclaration | ir.ComputedFieldDeclaration | ir.FieldGetterDeclaration | ir.FieldSetterDeclaration | ir.SwitchStatement | ir.TernaryExpression | ir.ThisExpression | ir.TypeAccessExpression | ir.ValueParameterDeclaration | ir.VariableAccessExpression | ir.VariantDeclaration | ir.WhileStatement | ir.YieldStatement | ir.JsObjectLiteral | ir.ValueJsObjectLiteralProperty | ir.FunctionJsObjectLiteralProperty | ir.SpreadJsObjectLiteralProperty | ir.JsPropertyAccessExpression | ir.JsFunctionLiteral | ir.JsTypeOfExpression | ir.JsInstanceOfExpression | ir.JsIdentifierExpression | ir.DereferenceExpression | ir.BaseExpression | ir.OwnConstructorCallExpression | ir.EsModuleImportDirectiveStatement | ir.CjsModuleImportDirectiveStatement | ir.JsNamespaceDestructuringStatement | ir.DereferencedVariableGetterDeclaration | ir.DereferencedVariableSetterDeclaration | ir.TextWithEntityName | ir.Argument | ir.Arguments | ir.Decorator | ir.TextTranslationDeclaration | ir.TranslationTextTemplate;
3
+ export type Declaration = ir.PackageFunctionDeclaration | ir.PackageTypeDeclaration | ir.PackageVariableDeclaration | ir.PackageVariableGetterDeclaration | ir.PackageVariableSetterDeclaration | ir.PackageVariantTypeDeclaration | ir.NestedFunctionDeclaration | ir.LocalVariableDeclaration | ir.ConstructorDeclaration | ir.DestructorDeclaration | ir.IndexedElementGetterDeclaration | ir.IndexedElementSetterDeclaration | ir.MethodDeclaration | ir.FieldDeclaration | ir.FieldGetterDeclaration | ir.FieldSetterDeclaration | ir.ValueParameterDeclaration | ir.VariantDeclaration | ir.DereferencedVariableGetterDeclaration | ir.DereferencedVariableSetterDeclaration | ir.TextTranslationDeclaration | ir.TranslationTextTemplate;
4
4
  export type Statement = ir.AssignmentStatement | ir.BlockStatement | ir.BreakLoopStatement | ir.ContinueLoopStatement | ir.DisposeStatement | ir.RunStatement | ir.TryStatement | ir.EmptyStatement | ir.ErrorStatement | ir.ImportantStatement | ir.ExpressionStatement | ir.ForStatement | ir.IfStatement | ir.NestedFunctionDeclarationStatement | ir.LocalVariableDeclarationStatement | ir.LoopStatement | ir.ReturnStatement | ir.SwitchStatement | ir.WhileStatement | ir.YieldStatement | ir.EsModuleImportDirectiveStatement | ir.CjsModuleImportDirectiveStatement | ir.JsNamespaceDestructuringStatement;
5
- export type Expression = ir.ArrayLiteral | ir.AsExpression | ir.AssertionExpression | ir.AssumptionExpression | ir.AssignmentExpression | ir.BinaryExpression | ir.BooleanLiteral | ir.CallExpression | ir.CharLiteral | ir.CommaExpression | ir.ConstructorCallExpression | ir.NoneLiteral | ir.IndexedAccessExpression | ir.InlineJsExpression | ir.MethodAccessExpression | ir.FieldAccessExpression | ir.IntegerLiteral | ir.IsExpression | ir.NumericLiteral | ir.FunctionAccessExpression | ir.FunctionLiteral | ir.PrefixUnaryExpression | ir.MeasureLiteral | ir.ReferenceExpression | ir.DereferenceExpression | ir.TextLiteral | ir.TextWithEntityName | ir.TextTemplateLiteral | ir.TernaryExpression | ir.ThisExpression | ir.TypeAccessExpression | ir.VariableAccessExpression | ir.BaseConstructorCallExpression | ir.JsIndexedAccessExpression | ir.JsObjectLiteral | ir.JsPropertyAccessExpression | ir.JsFunctionLiteral | ir.JsTypeOfExpression | ir.JsInstanceOfExpression | ir.JsIdentifierExpression | ir.BaseExpression | ir.OwnConstructorCallExpression;
5
+ export type Expression = ir.ArrayLiteral | ir.AsExpression | ir.AssertionExpression | ir.AssumptionExpression | ir.AssignmentExpression | ir.BinaryExpression | ir.BooleanLiteral | ir.CallExpression | ir.CharLiteral | ir.CommaExpression | ir.ConstructorCallExpression | ir.NullLiteral | ir.IndexedAccessExpression | ir.InlineJsExpression | ir.MethodAccessExpression | ir.FieldAccessExpression | ir.IntegerLiteral | ir.IsExpression | ir.NumericLiteral | ir.FunctionAccessExpression | ir.FunctionLiteral | ir.PrefixUnaryExpression | ir.MeasureLiteral | ir.ReferenceExpression | ir.DereferenceExpression | ir.TextLiteral | ir.LocalizableTextLiteral | ir.TextWithEntityName | ir.TextTemplateLiteral | ir.LocalizableTextTemplateLiteral | ir.TernaryExpression | ir.ThisExpression | ir.TypeAccessExpression | ir.VariableAccessExpression | ir.BaseConstructorCallExpression | ir.JsIndexedAccessExpression | ir.JsObjectLiteral | ir.JsPropertyAccessExpression | ir.JsFunctionLiteral | ir.JsTypeOfExpression | ir.JsInstanceOfExpression | ir.JsIdentifierExpression | ir.BaseExpression | ir.OwnConstructorCallExpression;
6
6
  export type TypeMemberDeclaration = ir.FieldDeclaration | ir.ComputedFieldDeclaration | ir.MethodDeclaration | ir.ConstructorDeclaration | ir.DestructorDeclaration | ir.IndexedElementGetterDeclaration | ir.IndexedElementSetterDeclaration | ir.DereferencedVariableGetterDeclaration | ir.DereferencedVariableSetterDeclaration;
7
7
  export type PackageMemberDeclaration = ir.PackageFunctionDeclaration | ir.PackageTypeDeclaration | ir.PackageVariableDeclaration | ir.PackageVariableGetterDeclaration | ir.PackageVariableSetterDeclaration | ir.PackageVariantTypeDeclaration;
8
8
  export type LocalDeclaration = ir.LocalVariableDeclaration | ir.NestedFunctionDeclaration;
@@ -0,0 +1,75 @@
1
+ import * as tree from '../tree/index.js';
2
+ import * as types from '../types/index.js';
3
+ import { Localization } from '../analysis/Localization.js';
4
+ import { Tag } from '../analysis/Tags.js';
5
+ import { DefinitionKind, EntityKind, PackageEntity } from './index.js';
6
+ import { Analyzer } from '../analysis/index.js';
7
+ import { Name } from '../common/index.js';
8
+ export type LocalizableTextEntity = LocalizableSimpleTextEntity | LocalizableTextTemplateEntity;
9
+ interface LocalizableTextEntityBase {
10
+ readonly kind: EntityKind.LocalizableText;
11
+ getKey(): string;
12
+ getComment(): string | undefined;
13
+ getContainingPackage(): PackageEntity;
14
+ getDefinition(): LocalizableTextEntityDefinition;
15
+ getTags(): readonly Tag[];
16
+ getLocalization(): Localization;
17
+ getOriginalEntity(): LocalizableTextEntityBase;
18
+ }
19
+ export interface LocalizableSimpleTextEntity extends LocalizableTextEntityBase {
20
+ readonly subkind: 'simple';
21
+ getText(): string;
22
+ }
23
+ export interface LocalizableTextTemplateEntity extends LocalizableTextEntityBase {
24
+ readonly subkind: 'template';
25
+ getTextFragments(): readonly string[];
26
+ getParameters(): readonly LocalizableTextTemplateEntityParameter[];
27
+ }
28
+ export declare class LocalizableTextTemplateEntityParameter {
29
+ readonly name: Name;
30
+ readonly type: types.Type;
31
+ constructor(name: Name, type: types.Type);
32
+ }
33
+ export type LocalizableTextEntityDefinition = {
34
+ kind: DefinitionKind.Source;
35
+ nodes: readonly (tree.TextLiteral | tree.TextTemplateLiteral)[];
36
+ };
37
+ export declare class TextLiteralEntity implements LocalizableSimpleTextEntity {
38
+ private readonly _analyzer;
39
+ private readonly _nodes;
40
+ readonly kind = EntityKind.LocalizableText;
41
+ readonly subkind = "simple";
42
+ private readonly _key;
43
+ private readonly _text;
44
+ private readonly _comment;
45
+ constructor(_analyzer: Analyzer, _nodes: readonly tree.TextLiteral[]);
46
+ getKey(): string;
47
+ getText(): string;
48
+ getComment(): string | undefined;
49
+ getContainingPackage(): PackageEntity;
50
+ getDefinition(): LocalizableTextEntityDefinition;
51
+ getTags(): readonly Tag[];
52
+ getLocalization(): Localization;
53
+ getOriginalEntity(): LocalizableTextEntityBase;
54
+ }
55
+ export declare class TextTemplateLiteralEntity implements LocalizableTextTemplateEntity {
56
+ private readonly _analyzer;
57
+ private readonly _nodes;
58
+ readonly kind = EntityKind.LocalizableText;
59
+ readonly subkind = "template";
60
+ private readonly _key;
61
+ private readonly _textFragments;
62
+ private readonly _parameters;
63
+ private readonly _comment;
64
+ constructor(_analyzer: Analyzer, _nodes: readonly tree.TextTemplateLiteral[]);
65
+ getKey(): string;
66
+ getTextFragments(): readonly string[];
67
+ getParameters(): readonly LocalizableTextTemplateEntityParameter[];
68
+ getComment(): string | undefined;
69
+ getContainingPackage(): PackageEntity;
70
+ getDefinition(): LocalizableTextEntityDefinition;
71
+ getTags(): readonly Tag[];
72
+ getLocalization(): Localization;
73
+ getOriginalEntity(): LocalizableTextEntityBase;
74
+ }
75
+ export {};
@@ -90,7 +90,7 @@ export type VariableEntityDefinition = {
90
90
  export type SourceVariableEntityDefinition = SingleSourceVariableEntityDefinition | MultiSourceVariableEntityDefinition;
91
91
  export type SingleSourceVariableEntityDefinition = {
92
92
  kind: 'single';
93
- node: tree.PackageVariableDeclaration | tree.FieldDeclaration | tree.LocalVariableDeclaration | tree.EnumerationVariableDeclaration | tree.ErrorVariableDeclaration | tree.ParameterDeclaration | tree.VariantDeclaration | tree.TranslationTextTemplateParameterDeclaration;
93
+ node: tree.PackageVariableDeclaration | tree.FieldDeclaration | tree.LocalVariableDeclaration | tree.EnumerationVariableDeclaration | tree.ErrorVariableDeclaration | tree.ParameterDeclaration | tree.VariantDeclaration | tree.TranslationTextTemplateParameter;
94
94
  };
95
95
  export type MultiSourceVariableEntityDefinition = {
96
96
  kind: 'multi';
@@ -508,12 +508,12 @@ export declare class IntrinsicLocalVariableEntity implements LocalVariableEntity
508
508
  getLocalization(): Localization;
509
509
  getOriginalEntity(): LocalVariableEntity;
510
510
  }
511
- export declare class TranslationTextTemplateParameterDeclarationEntity implements TextTemplateParameterVariableEntity {
511
+ export declare class TranslationTextTemplateParameterEntity implements TextTemplateParameterVariableEntity {
512
512
  private readonly _analyzer;
513
513
  private readonly _node;
514
514
  readonly kind = EntityKind.Variable;
515
515
  readonly subkind = "text-template-parameter";
516
- constructor(_analyzer: Analyzer, _node: tree.TranslationTextTemplateParameterDeclaration);
516
+ constructor(_analyzer: Analyzer, _node: tree.TranslationTextTemplateParameter);
517
517
  getName(): Name;
518
518
  getContainer(): PackageEntity;
519
519
  getType(): types.Type;
@@ -11,6 +11,7 @@ import { FunctionEntity, MethodEntity, PackageFunctionEntity } from './FunctionE
11
11
  import { FunctionTypeEntity, PackageFunctionTypeEntity } from './FunctionTypeEntity.js';
12
12
  import { GetterEntity } from './GetterEntity.js';
13
13
  import { IndexerEntity } from './IndexerEntity.js';
14
+ import { LocalizableTextEntity } from './LocalizableTextEntity.js';
14
15
  import { OperatorEntity } from './OperatorEntity.js';
15
16
  import { PackageAliasEntity } from './PackageAliasEntity.js';
16
17
  import { PackageEntity } from './PackageEntity.js';
@@ -45,6 +46,7 @@ export * from './TypeMemberContainer.js';
45
46
  export * from './TypeParameterEntity.js';
46
47
  export * from './VariableEntity.js';
47
48
  export * from './VariantTypeEntity.js';
49
+ export * from './LocalizableTextEntity.js';
48
50
  export declare const enum DefinitionKind {
49
51
  Source = 0,
50
52
  Intrinsic = 1,
@@ -63,9 +65,10 @@ export declare const enum EntityKind {
63
65
  Operator = 9,
64
66
  PackageAlias = 10,
65
67
  TypeExtension = 11,
66
- Package = 12
68
+ Package = 12,
69
+ LocalizableText = 13
67
70
  }
68
- export type Entity = PackageEntity | VariableEntity | VariantTypeEntity | GetterEntity | SetterEntity | FunctionEntity | TypeParameterEntity | OperatorEntity | IndexerEntity | DereferenceOperatorEntity | ConstructorEntity | DestructorEntity | FunctionTypeEntity | StructuredTypeEntity | PackageAliasEntity | AliasTypeEntity | TypeExtensionEntity;
71
+ export type Entity = PackageEntity | VariableEntity | VariantTypeEntity | GetterEntity | SetterEntity | FunctionEntity | TypeParameterEntity | OperatorEntity | IndexerEntity | DereferenceOperatorEntity | ConstructorEntity | DestructorEntity | FunctionTypeEntity | StructuredTypeEntity | PackageAliasEntity | AliasTypeEntity | TypeExtensionEntity | LocalizableTextEntity;
69
72
  export type PackageTypeEntity = PackageFunctionTypeEntity | PackageStructuredTypeEntity | PackageVariantTypeEntity | AliasTypeEntity;
70
73
  export declare function isPackageTypeEntity(entity: TypeEntity): entity is PackageTypeEntity;
71
74
  export type NamedTypeEntity = PackageFunctionTypeEntity | PackageStructuredTypeEntity | PackageVariantTypeEntity | AliasTypeEntity | TypeParameterEntity;
@@ -42,6 +42,7 @@ export declare class DisplayService {
42
42
  displayGetterEntity(entity: e.GetterEntity): string;
43
43
  displaySetterEntity(entity: e.SetterEntity): string;
44
44
  displayTypeExtensionEntity(entity: e.TypeExtensionEntity): string;
45
+ displayLocalizableTextEntity(entity: e.LocalizableSimpleTextEntity | e.LocalizableTextTemplateEntity): string;
45
46
  displayEntity(entity: e.Entity): string;
46
47
  displayTypeEntity(entity: e.TypeEntity): string;
47
48
  displayTypeMember(member: types.TypeMember): string;
@@ -634,19 +635,19 @@ export declare class ParameterTypeUsage_type implements IParameterTypeUsage {
634
635
  readonly kind = "parameter";
635
636
  constructor(type: types.ParameterType);
636
637
  getEntity(): e.NamedTypeEntity;
637
- isNoneExcluded(): boolean;
638
+ isNullExcluded(): boolean;
638
639
  }
639
640
  export declare class ParameterTypeUsage_entity implements IParameterTypeUsage {
640
641
  readonly entity: e.TypeParameterEntity;
641
642
  readonly kind = "parameter";
642
643
  constructor(entity: e.TypeParameterEntity);
643
644
  getEntity(): e.NamedTypeEntity;
644
- isNoneExcluded(): boolean;
645
+ isNullExcluded(): boolean;
645
646
  }
646
647
  interface IParameterTypeUsage {
647
648
  readonly kind: 'parameter';
648
649
  getEntity(): e.NamedTypeEntity;
649
- isNoneExcluded(): boolean;
650
+ isNullExcluded(): boolean;
650
651
  }
651
652
  type UnionOrIntersectionTypeUsage = UnionOrIntersectionTypeUsage_type;
652
653
  declare class UnionOrIntersectionTypeUsage_type {
@@ -56,7 +56,7 @@ export declare enum KeywordKind {
56
56
  Reference = 54,
57
57
  Translations = 55,
58
58
  Base = 56,
59
- None = 57,
59
+ Null = 57,
60
60
  Get = 58,
61
61
  Set = 59
62
62
  }