@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.
- package/build/Cli.js +3 -3
- package/build/api/Api.js +10 -4
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +295 -254
- package/build/{chunk-6OPBY3SK.js → chunk-IZHH3TQT.js} +8 -6
- package/build/{chunk-CBYKP5SE.js → chunk-KGZLMBKA.js} +2 -2
- package/build/{chunk-G4UMALLG.js → chunk-XARNKP3Q.js} +2333 -1724
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +4 -4
- package/build/types/analysis/Analyzer.d.ts +23 -14
- package/build/types/analysis/DeclarationsUsageCounter.d.ts +3 -4
- package/build/types/analysis/DiagnosticCollector.d.ts +3 -5
- package/build/types/analysis/InstanceFieldsInitializationValidator.d.ts +2 -2
- package/build/types/analysis/Localization.d.ts +1 -1
- package/build/types/analysis/NodeTypeUtils.d.ts +1 -1
- package/build/types/analysis/PackageAndStaticVariablesInitializationValidator.d.ts +3 -3
- package/build/types/analysis/TypeNarrower.d.ts +1 -1
- package/build/types/analysis/WellKnownDeclarations.d.ts +3 -3
- package/build/types/diagnostic/DiagnosticCode.d.ts +11 -13
- package/build/types/emitter/Emitter.d.ts +4 -8
- package/build/types/emitter/EmitterContext.d.ts +2 -2
- package/build/types/emitter/Entities.d.ts +1 -0
- package/build/types/emitter/EntityMap.d.ts +1 -0
- package/build/types/emitter/IrBuilder.d.ts +18 -10
- package/build/types/emitter/IrToJs.d.ts +1 -1
- package/build/types/emitter/Transformer.d.ts +7 -2
- package/build/types/emitter/ir/EmitOptions.d.ts +5 -5
- package/build/types/emitter/ir/Nodes.d.ts +185 -147
- package/build/types/emitter/ir/types.d.ts +3 -3
- package/build/types/entities/LocalizableTextEntity.d.ts +75 -0
- package/build/types/entities/VariableEntity.d.ts +3 -3
- package/build/types/entities/index.d.ts +5 -2
- package/build/types/services/DisplayService.d.ts +4 -3
- package/build/types/tree/KeywordKind.d.ts +1 -1
- package/build/types/tree/NodeKind.d.ts +88 -84
- package/build/types/tree/green/Nodes.d.ts +96 -55
- package/build/types/tree/green/SyntaxFactory.d.ts +6 -6
- package/build/types/tree/red/Nodes.d.ts +137 -92
- package/build/types/ts-interop/Entities.d.ts +0 -1
- package/build/types/ts-interop/TsInteropContext.d.ts +1 -1
- package/build/types/types/ParameterType.d.ts +3 -3
- package/build/types/types/StandardTypes.d.ts +2 -2
- package/package.json +2 -2
|
@@ -31,10 +31,10 @@ export declare class AnalyzedTranslationPackage {
|
|
|
31
31
|
getLocalizedPackageByOriginalReferencedPackage(): ReadonlyMap<PackageEntity, PackageEntity>;
|
|
32
32
|
getMembers(): TranslatedPackageMembers;
|
|
33
33
|
getTypeEntityMembers(typeEntity: PackageTypeEntity): TranslatedTypeEntityMembers | undefined;
|
|
34
|
-
getPackageVariableTranslationTarget(node: tree.
|
|
35
|
-
getPackageFunctionTranslationTargets(node: tree.
|
|
36
|
-
getFunctionTypeTranslationTarget(node: tree.
|
|
37
|
-
getTypeTranslationTarget(node: tree.
|
|
34
|
+
getPackageVariableTranslationTarget(node: tree.PackageVariableTranslationDeclaration): GetSingleTranslationTargetResult<PackageVariableEntity>;
|
|
35
|
+
getPackageFunctionTranslationTargets(node: tree.PackageFunctionTranslationDeclaration): GetMultipleTranslationTargetsResult<PackageFunctionEntity>;
|
|
36
|
+
getFunctionTypeTranslationTarget(node: tree.FunctionTypeTranslationDeclaration): GetSingleTranslationTargetResult<PackageFunctionTypeEntity>;
|
|
37
|
+
getTypeTranslationTarget(node: tree.TypeTranslationDeclaration): GetSingleTranslationTargetResult<PackageTypeEntity>;
|
|
38
38
|
/**
|
|
39
39
|
* В случае, когда имя переменной экземпляра совпадает с именем статической переменной, перевод будет иметь две цели.
|
|
40
40
|
*/
|
|
@@ -20,7 +20,7 @@ import * as autotypeCallExpressionMeaning from './AutotypeCallExpressionMeaning.
|
|
|
20
20
|
import * as baseExpressionMeaning from './BaseExpressionMeaning.js';
|
|
21
21
|
import * as callExpressionMeaning from './CallExpressionMeaning.js';
|
|
22
22
|
import * as constructorOverloadResolver from './ConstructorOverloadResolver.js';
|
|
23
|
-
import {
|
|
23
|
+
import { DeclarationsUsageMap } from './DeclarationsUsageCounter.js';
|
|
24
24
|
import * as dereferenceExpressionMeaning from './DereferenceExpressionMeaning.js';
|
|
25
25
|
import { DiagnosticArgumentFactory } from './DiagnosticArgumentFactory.js';
|
|
26
26
|
import * as functionOverloadResolver from './FunctionOverloadResolver.js';
|
|
@@ -115,6 +115,7 @@ export declare class Analyzer {
|
|
|
115
115
|
constructor(compilation: project.Compilation, tsInteropInputs: TsInteropInputs);
|
|
116
116
|
getProjectSourceFile(node: tree.SourceFile): project.SourceFile;
|
|
117
117
|
checkExpressionCanBeUsedInForLoop(node: tree.Expression): WithDiagnostics<ExpressionCanBeUsedInForLoopCheckResult>;
|
|
118
|
+
isEnumeratorMethodSignature(entity: e.MethodEntity): boolean;
|
|
118
119
|
ifTypeEnumerableThenItemType(type: types.Type): types.Type | undefined;
|
|
119
120
|
ifTypeEnumeratorThenItemType(type: types.Type): types.Type | undefined;
|
|
120
121
|
isTypeArrayOrReadonlyArray(type: types.Type): {
|
|
@@ -179,7 +180,7 @@ export declare class Analyzer {
|
|
|
179
180
|
*/
|
|
180
181
|
isExpressionOptionalChainingSyntactically(node: tree.Expression): boolean;
|
|
181
182
|
isExpressionValidOutermostOptionalChaining(node: tree.Expression): boolean;
|
|
182
|
-
|
|
183
|
+
includeNullToTypeIfExpressionValidOutermostOptionalChaining(type: types.Type, node: tree.Expression): types.Type;
|
|
183
184
|
checkIdentifierNameIsReserved(name: string, locale: PackageLocale): ReservedIdentifierKind | undefined;
|
|
184
185
|
getReservedIdentifierName(reservedIdentifierKind: ReservedIdentifierKind, locale: PackageLocale): string;
|
|
185
186
|
createNameFromIdentifier(node: tree.Identifier): Name;
|
|
@@ -214,14 +215,14 @@ export declare class Analyzer {
|
|
|
214
215
|
createFunctionTypeInvokeMethod(entity: e.FunctionTypeEntity): e.MethodEntity;
|
|
215
216
|
/**
|
|
216
217
|
* Преобразует тип таким образом, чтобы он не мог содержать значение `пусто`.
|
|
217
|
-
* После преобразования метод `
|
|
218
|
+
* После преобразования метод `canTypeBeNull` вернёт `true` для полученного типа.
|
|
218
219
|
* @example
|
|
219
220
|
* - Число -> Число
|
|
220
221
|
* - Число | Пусто -> Число
|
|
221
|
-
* - Т: Объект? -> Т: Объект? (с флагом
|
|
222
|
+
* - Т: Объект? -> Т: Объект? (с флагом isNullExcluded === true)
|
|
222
223
|
* - Т: Объект -> Т: Объект (без изменения)
|
|
223
224
|
*/
|
|
224
|
-
|
|
225
|
+
excludeNullFromType(type: types.Type): types.Type;
|
|
225
226
|
/**
|
|
226
227
|
* Отвечает на вопрос "Может ли переменная данного типа иметь значение `пусто`?".
|
|
227
228
|
* @example Для следующих типов метод вернёт:
|
|
@@ -230,8 +231,8 @@ export declare class Analyzer {
|
|
|
230
231
|
* - Т: Объект? -> да
|
|
231
232
|
* - Т: Объект -> нет
|
|
232
233
|
*/
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
canTypeBeNull(type: types.Type): boolean;
|
|
235
|
+
canTypeParameterBeNull(type: types.ParameterType): boolean;
|
|
235
236
|
/**
|
|
236
237
|
* Делает тип `Пусто` совместимым с данным типом.
|
|
237
238
|
*
|
|
@@ -240,10 +241,10 @@ export declare class Analyzer {
|
|
|
240
241
|
* @example
|
|
241
242
|
* - Число -> Число | Пусто
|
|
242
243
|
* - Число | Пусто -> Число | Пусто
|
|
243
|
-
* - Т: Объект? -> (Т: Объект?) | Пусто (см. метод
|
|
244
|
+
* - Т: Объект? -> (Т: Объект?) | Пусто (см. метод isNullAssignableToType)
|
|
244
245
|
* - Т: Объект -> (Т: Объект) | Пусто
|
|
245
246
|
*/
|
|
246
|
-
|
|
247
|
+
includeNullToType(type: types.Type, locale: PackageLocale): types.Type;
|
|
247
248
|
/**
|
|
248
249
|
* Отвечает на вопрос "Совместим ли тип `Пусто` с данным типом?" (Можно ли присвоить `пусто` в переменную с данным типом?).
|
|
249
250
|
* @example Для следующих типов метод вернёт:
|
|
@@ -251,7 +252,7 @@ export declare class Analyzer {
|
|
|
251
252
|
* - Число | Пусто -> да
|
|
252
253
|
* - Т: Объект? -> нет, поскольку в качестве конкретного типа, заменяющего параметр, может быть использован тип, исключающий `пусто`.
|
|
253
254
|
*/
|
|
254
|
-
|
|
255
|
+
isNullAssignableToType(type: types.Type): boolean;
|
|
255
256
|
excludeTypeFromUnion(initialType: types.Type, excludedType: types.Type): types.Type;
|
|
256
257
|
isValueParameterVariadic(entity: e.VariableEntity): boolean;
|
|
257
258
|
getDefaultTypeParameterConstraint(locale: PackageLocale): types.Type;
|
|
@@ -276,7 +277,8 @@ export declare class Analyzer {
|
|
|
276
277
|
instantiateTypeMemberByIdentitySubstitution(entity: e.TypeMemberEntity): types.TypeMember;
|
|
277
278
|
createPackageMemberHiding(node: tree.PackageMemberDeclaration, modifierFlags: ModifierFlags): e.EntityHidingLevel | undefined;
|
|
278
279
|
createTypeMemberHiding(node: tree.TypeMemberDeclaration, modifierFlags: ModifierFlags): e.EntityHidingLevel | undefined;
|
|
279
|
-
|
|
280
|
+
collectDeclarationsUsageOfPackages(targetPlatform: PlatformKind, cancellationToken?: CancellationToken | undefined): Promise<Map<tree.SourceFile, DeclarationsUsageMap>>;
|
|
281
|
+
getDeclarationsUsageOfSourceFile(sourceFile: tree.SourceFile, cancellationToken: CancellationToken | undefined): Promise<DeclarationsUsageMap>;
|
|
280
282
|
getPackageAndStaticVariablesInitializationDiagnostics(pkg: SourcePackage, cancellationToken: CancellationToken | undefined): Promise<readonly Diagnostic[]>;
|
|
281
283
|
createDefaultConstructors(typeEntity: e.StructuredTypeEntity, fields: readonly e.FieldEntity[]): readonly e.ConstructorEntity[];
|
|
282
284
|
createBackingPackageVariables(declaredMembers: readonly (e.NamedPackageMemberEntity | e.PackageAliasEntity)[], pkg: e.PackageEntity): e.PackageVariableEntity[];
|
|
@@ -362,7 +364,7 @@ declare class Type {
|
|
|
362
364
|
private ofCallExpression;
|
|
363
365
|
private ofAutotypeCallExpression;
|
|
364
366
|
private ofIndexedAccessExpression;
|
|
365
|
-
private
|
|
367
|
+
private ofMissingExpression;
|
|
366
368
|
private ofIsExpression;
|
|
367
369
|
private ofParenthesizedExpression;
|
|
368
370
|
private ofPrefixUnaryExpression;
|
|
@@ -370,6 +372,7 @@ declare class Type {
|
|
|
370
372
|
private ofReferenceExpression;
|
|
371
373
|
private ofDereferenceExpression;
|
|
372
374
|
private ofConditionalExpression;
|
|
375
|
+
private ofTextLiteral;
|
|
373
376
|
/**
|
|
374
377
|
* По умолчанию литерал шаблона текста имеет тип Текст.
|
|
375
378
|
*
|
|
@@ -441,7 +444,10 @@ declare class Entity {
|
|
|
441
444
|
private readonly _setterEntities;
|
|
442
445
|
private readonly _typeExtensionEntities;
|
|
443
446
|
private readonly _packageAliasEntities;
|
|
444
|
-
private readonly
|
|
447
|
+
private readonly _translationTextTemplateParameterEntities;
|
|
448
|
+
private readonly _localizableSimpleTextEntities;
|
|
449
|
+
private readonly _localizableTextTemplateEntities;
|
|
450
|
+
private readonly _localizableTextEntitiesByPackage;
|
|
445
451
|
constructor(_analyzer: Analyzer);
|
|
446
452
|
ofPackage(pkg: SourcePackage): e.PackageEntity;
|
|
447
453
|
ofPackageVariableDeclaration(node: tree.PackageVariableDeclaration): e.PackageVariableEntity;
|
|
@@ -485,7 +491,10 @@ declare class Entity {
|
|
|
485
491
|
ofTypeExtensionDeclaration(node: tree.TypeExtensionDeclaration): e.TypeExtensionEntity;
|
|
486
492
|
ofPackageImport(node: tree.PackageImport): e.PackageAliasEntity;
|
|
487
493
|
ofTypeWithMembersDeclaration(node: TypeWithMembersDeclaration): e.TypeEntityWithMembers;
|
|
488
|
-
|
|
494
|
+
ofTranslationTextTemplateParameter(node: tree.TranslationTextTemplateParameter): e.TranslationTextTemplateParameterEntity;
|
|
495
|
+
ofTextLiteral(node: tree.TextLiteral): e.LocalizableSimpleTextEntity;
|
|
496
|
+
ofTextTemplateLiteral(node: tree.TextTemplateLiteral): e.LocalizableTextTemplateEntity;
|
|
497
|
+
private ensureLocalizableTextEntitiesCreated;
|
|
489
498
|
private getContainingPackageLoadedFromDts;
|
|
490
499
|
private createComputedFieldEntities;
|
|
491
500
|
private createDereferenceOperatorEntities;
|
|
@@ -5,13 +5,12 @@ import { Analyzer } from './Analyzer.js';
|
|
|
5
5
|
export declare class DeclarationsUsageCounter {
|
|
6
6
|
private readonly _analyzer;
|
|
7
7
|
private readonly _sourceFile;
|
|
8
|
-
private readonly _cancellationToken;
|
|
9
8
|
private readonly _usageInfoByEntity;
|
|
10
|
-
constructor(analyzer: Analyzer, sourceFile: tree.SourceFile
|
|
11
|
-
count(): Promise<
|
|
9
|
+
constructor(analyzer: Analyzer, sourceFile: tree.SourceFile);
|
|
10
|
+
count(cancellationToken?: CancellationToken | undefined): Promise<DeclarationsUsageMap>;
|
|
12
11
|
private recordUsage;
|
|
13
12
|
}
|
|
14
|
-
export declare class
|
|
13
|
+
export declare class DeclarationsUsageMap {
|
|
15
14
|
private readonly _usageCountByEntity;
|
|
16
15
|
constructor(_usageCountByEntity: ReadonlyMap<Entity, DeclarationUsageInfo>);
|
|
17
16
|
getUsageInfo(entity: NamedEntity): DeclarationUsageInfo;
|
|
@@ -6,18 +6,16 @@ export declare class DiagnosticCollector {
|
|
|
6
6
|
static readonly CancellationTokenThrottleTime = 50;
|
|
7
7
|
private readonly _analyzer;
|
|
8
8
|
private readonly _sourceFile;
|
|
9
|
-
private readonly _cancellationToken;
|
|
10
9
|
private readonly _diagnosticArgumentFactory;
|
|
11
10
|
private readonly _translationPackage;
|
|
12
11
|
private readonly _diagnostics;
|
|
13
12
|
private readonly _diagnosticAcceptor;
|
|
14
|
-
private
|
|
13
|
+
private _namedDeclarationsUsageMap;
|
|
15
14
|
private readonly _modifierValidator;
|
|
16
|
-
private get node();
|
|
17
15
|
private get translationPackage();
|
|
18
16
|
private get isInterfacePackageFile();
|
|
19
|
-
constructor(analyzer: Analyzer, sourceFile: project.SourceFile
|
|
20
|
-
collect(): Promise<Diagnostic[]>;
|
|
17
|
+
constructor(analyzer: Analyzer, sourceFile: project.SourceFile);
|
|
18
|
+
collect(cancellationToken?: CancellationToken | undefined): Promise<Diagnostic[]>;
|
|
21
19
|
private collectNodeDiagnostics;
|
|
22
20
|
private checkFunctionLiteral;
|
|
23
21
|
private checkFunctionBlockLiteral;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DiagnosticAcceptor } from '../diagnostic/Diagnostic.js';
|
|
2
2
|
import { Analyzer } from './Analyzer.js';
|
|
3
|
-
import {
|
|
3
|
+
import { DeclarationsUsageMap } from './DeclarationsUsageCounter.js';
|
|
4
4
|
import { TypeWithMembersDeclaration } from './NodeTypeUtils.js';
|
|
5
5
|
export declare class InstanceFieldsInitializationValidator {
|
|
6
6
|
private readonly _analyzer;
|
|
@@ -9,7 +9,7 @@ export declare class InstanceFieldsInitializationValidator {
|
|
|
9
9
|
private readonly _diagnostics;
|
|
10
10
|
private readonly _semanticContext;
|
|
11
11
|
private get semanticContext();
|
|
12
|
-
constructor(_analyzer: Analyzer, _typeDeclaration: TypeWithMembersDeclaration, _declarationsUsageCountResult:
|
|
12
|
+
constructor(_analyzer: Analyzer, _typeDeclaration: TypeWithMembersDeclaration, _declarationsUsageCountResult: DeclarationsUsageMap, _diagnostics: DiagnosticAcceptor);
|
|
13
13
|
validate(): void;
|
|
14
14
|
private getFieldsThatNeedToBeInitializedInConstructor;
|
|
15
15
|
private checkDefaultConstructorInitializesAllFields;
|
|
@@ -39,7 +39,7 @@ export declare class SourceTranslationDefinition {
|
|
|
39
39
|
constructor(nodeOrPackage: TranslationPackage | SourceTranslationDefinitionNode, translatedNameIdentifier: tree.Identifier | undefined);
|
|
40
40
|
equals(other: TranslationDefinition): boolean;
|
|
41
41
|
}
|
|
42
|
-
export type SourceTranslationDefinitionNode = tree.
|
|
42
|
+
export type SourceTranslationDefinitionNode = tree.TranslationDeclaration | tree.TypeMemberTranslation;
|
|
43
43
|
export declare class IntrinsicTranslationDefinition {
|
|
44
44
|
readonly isMissingTranslationReplacement: boolean;
|
|
45
45
|
readonly kind = "intrinsic";
|
|
@@ -12,7 +12,7 @@ export declare class NodeTypeUtils {
|
|
|
12
12
|
static isFunctionDeclaration(node: tree.Node): node is FunctionDeclaration;
|
|
13
13
|
static isVariableDeclaration(node: tree.Node): node is VariableDeclaration;
|
|
14
14
|
static isVariantTypeDeclaration(node: tree.Node): node is VariantTypeDeclaration;
|
|
15
|
-
static
|
|
15
|
+
static isNullLiteral(node: tree.Node): boolean;
|
|
16
16
|
static isSubprogramDeclarationOrLiteral(node: tree.Node): node is SubprogramDeclarationOrLiteral;
|
|
17
17
|
}
|
|
18
18
|
export type PackageTypeDeclaration = tree.PackageAliasTypeDeclaration | tree.PackageFunctionTypeDeclaration | tree.PackageStructuredTypeDeclaration | tree.PackageVariantTypeDeclaration;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { DiagnosticAcceptor } from '../diagnostic/Diagnostic.js';
|
|
2
2
|
import { SourcePackage } from '../project/SourcePackage.js';
|
|
3
3
|
import { Analyzer } from './Analyzer.js';
|
|
4
|
-
import {
|
|
4
|
+
import { DeclarationsUsageMap } from './DeclarationsUsageCounter.js';
|
|
5
5
|
export declare class PackageAndStaticVariablesInitializationValidator {
|
|
6
6
|
private readonly _analyzer;
|
|
7
7
|
private readonly _package;
|
|
8
|
-
private readonly
|
|
8
|
+
private readonly _declarationsUsageMapList;
|
|
9
9
|
private readonly _diagnostics;
|
|
10
|
-
constructor(_analyzer: Analyzer, _package: SourcePackage,
|
|
10
|
+
constructor(_analyzer: Analyzer, _package: SourcePackage, _declarationsUsageMapList: readonly DeclarationsUsageMap[], _diagnostics: DiagnosticAcceptor);
|
|
11
11
|
validate(): void;
|
|
12
12
|
private getVariablesThatNeedToBeInitializedInConstructor;
|
|
13
13
|
private collectStaticFieldsThatNeedToBeInitializedInConstructor;
|
|
@@ -19,7 +19,7 @@ export declare class TypeNarrower {
|
|
|
19
19
|
private getTypeAtSplit;
|
|
20
20
|
private getTypeAtLoop;
|
|
21
21
|
private getTypeAtAssignmentWithImplicitConversion;
|
|
22
|
-
private
|
|
22
|
+
private getTypeAtComparisonWithNull;
|
|
23
23
|
private getTypeAtIsExpression;
|
|
24
24
|
private getTypeAtAssignmentOrDeclaration;
|
|
25
25
|
private addTypeIfUnique;
|
|
@@ -15,7 +15,7 @@ export interface WellKnownDeclarations {
|
|
|
15
15
|
readonly textTemplate: StructuredTypeEntity;
|
|
16
16
|
readonly char: StructuredTypeEntity;
|
|
17
17
|
readonly yesNo: StructuredTypeEntity;
|
|
18
|
-
readonly
|
|
18
|
+
readonly nullEntity: StructuredTypeEntity;
|
|
19
19
|
readonly enumerable: StructuredTypeEntity;
|
|
20
20
|
readonly enumerator: StructuredTypeEntity;
|
|
21
21
|
readonly enumeratorMethod: MethodEntity;
|
|
@@ -48,7 +48,7 @@ export declare class LocalizedWellKnownDeclarations implements WellKnownDeclarat
|
|
|
48
48
|
private _textTemplate;
|
|
49
49
|
private _char;
|
|
50
50
|
private _yesNo;
|
|
51
|
-
private
|
|
51
|
+
private _null;
|
|
52
52
|
private _enumerable;
|
|
53
53
|
private _enumerator;
|
|
54
54
|
private _enumeratorMethod;
|
|
@@ -78,7 +78,7 @@ export declare class LocalizedWellKnownDeclarations implements WellKnownDeclarat
|
|
|
78
78
|
get textTemplate(): StructuredTypeEntity;
|
|
79
79
|
get char(): StructuredTypeEntity;
|
|
80
80
|
get yesNo(): StructuredTypeEntity;
|
|
81
|
-
get
|
|
81
|
+
get nullEntity(): StructuredTypeEntity;
|
|
82
82
|
get enumerable(): StructuredTypeEntity;
|
|
83
83
|
get enumerator(): StructuredTypeEntity;
|
|
84
84
|
get enumeratorMethod(): MethodEntity;
|
|
@@ -25,7 +25,7 @@ export declare enum DiagnosticCode {
|
|
|
25
25
|
PackageImportExpected = 119,
|
|
26
26
|
DeclarationOrPackageImportExpected = 120,
|
|
27
27
|
Expected0But1Found = 121,
|
|
28
|
-
|
|
28
|
+
InvalidTextTemplate = 122,
|
|
29
29
|
ModifierListExpected = 123,
|
|
30
30
|
RunKeywordCreationKeywordOrModifierListExpected = 124,
|
|
31
31
|
HidingLevelExpected = 125,
|
|
@@ -123,7 +123,7 @@ export declare enum DiagnosticCode {
|
|
|
123
123
|
TagNotFound = 284,
|
|
124
124
|
TypeOrFunctionNameExpected = 285,
|
|
125
125
|
PackageNameOrAliasExpected = 286,
|
|
126
|
-
|
|
126
|
+
ExpressionCanBeNull = 287,
|
|
127
127
|
TargetVariableExpressionInTheAssignmentStatementCannotContainQuestionOperator = 288,
|
|
128
128
|
UnreachableCode = 289,
|
|
129
129
|
RecursionOccurredWhileCalculatingTheTypeOfTheExpression = 290,
|
|
@@ -190,17 +190,15 @@ export declare enum DiagnosticCode {
|
|
|
190
190
|
CannotAccessAbstractMemberOfBaseType = 351,
|
|
191
191
|
TheFollowingBaseTypeMembersConflictAndMustBeOverridden0 = 352,
|
|
192
192
|
TheFollowingBaseTypeMembersConflictBecauseTheyHaveTheSameOriginalName0AndMustBeOverridden1 = 353,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
ExpressionOfType0CanNotBeUsedInForLoopBecauseNotEnumerableAndNoMethod1 = 363,
|
|
203
|
-
ForExpressionToBeUsedInForLoopMethod0MustReturnEnumeratorType = 364,
|
|
193
|
+
TheFirstStatementOfConstructorBlockMustBeEitherBaseOrOwnConstructorCall = 354,
|
|
194
|
+
ThisCallCausesOwnConstructorCallCycle = 355,
|
|
195
|
+
OwnConstructorCallMustBeTheFirstStatementOfConstructorBlock = 356,
|
|
196
|
+
BaseConstructorCallMustBeTheFirstStatementOfConstructorBlock = 357,
|
|
197
|
+
Field0HasNoInitializerAndMayNotBeAssignedInConstructor = 358,
|
|
198
|
+
Field0HasNoInitializerAndMayNotBeAssignedInPackageConstructor = 359,
|
|
199
|
+
Variable0HasNoInitializerAndMayNotBeAssignedInPackageConstructor = 360,
|
|
200
|
+
ExpressionOfType0CanNotBeUsedInForLoopBecauseNotEnumerableAndNoMethod1 = 361,
|
|
201
|
+
ForExpressionToBeUsedInForLoopMethod0MustReturnEnumeratorType = 362,
|
|
204
202
|
CannotFindTsLibDirectoryBaseSearchPaths0 = 401,
|
|
205
203
|
SourceFile0IsNotPartOfThePackageAndWontBeLoaded = 402,
|
|
206
204
|
ProgramWithoutMainPackageCannotBeCompiled = 403,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Analyzer
|
|
1
|
+
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { CancellationToken, Uri } from '../common/index.js';
|
|
3
3
|
import { JavaScriptImplementationConfig, PlatformKind } from '../project/index.js';
|
|
4
4
|
import { NamedEntity, PackageEntity, PackageMemberEntity } from './Entities.js';
|
|
@@ -8,16 +8,12 @@ export declare class Emitter {
|
|
|
8
8
|
static readonly IndexFileName = "index.mjs";
|
|
9
9
|
readonly targetPlatform = PlatformKind.JavaScript;
|
|
10
10
|
private readonly _analyzer;
|
|
11
|
-
private readonly _declarationsUsageCountResults;
|
|
12
11
|
private readonly _options;
|
|
13
12
|
private readonly _entityMap;
|
|
14
13
|
private readonly _ectx;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
static create(analyzer: Analyzer, options?: EmitOptions, cancellationToken?: CancellationToken): Promise<Emitter>;
|
|
19
|
-
emitToFileSystem(outputUri: Uri, outputAcceptor: OutputAcceptor): Promise<void>;
|
|
20
|
-
emitToString(): string;
|
|
14
|
+
constructor(analyzer: Analyzer, options: EmitOptions | undefined);
|
|
15
|
+
emitToFileSystem(outputUri: Uri, outputAcceptor: OutputAcceptor, cancellationToken?: CancellationToken | undefined): Promise<void>;
|
|
16
|
+
emitToString(cancellationToken?: CancellationToken | undefined): Promise<string>;
|
|
21
17
|
private createEmitterPackageFromSource;
|
|
22
18
|
private enumerateEmittingSourcePackages;
|
|
23
19
|
private createPackageWithMainFunction;
|
|
@@ -34,7 +34,7 @@ declare class TypeUtils {
|
|
|
34
34
|
declare class StandardTypes {
|
|
35
35
|
private readonly _analyzer;
|
|
36
36
|
private readonly _entityMap;
|
|
37
|
-
private
|
|
37
|
+
private _null;
|
|
38
38
|
private _yesNo;
|
|
39
39
|
private _refObject;
|
|
40
40
|
private _plainObject;
|
|
@@ -46,7 +46,7 @@ declare class StandardTypes {
|
|
|
46
46
|
private _func;
|
|
47
47
|
private _textTemplate;
|
|
48
48
|
private _reference;
|
|
49
|
-
get
|
|
49
|
+
get nullType(): Type;
|
|
50
50
|
get yesNo(): Type;
|
|
51
51
|
get refObject(): Type;
|
|
52
52
|
get plainObject(): Type;
|
|
@@ -33,6 +33,7 @@ export declare class FunctionEntityDetails implements TypeMemberEntityDetails {
|
|
|
33
33
|
isAbstract: boolean;
|
|
34
34
|
isStatic: boolean;
|
|
35
35
|
originalFunctionEntityKind: FunctionEntityKind;
|
|
36
|
+
isJavaScriptIteratorMethod: boolean;
|
|
36
37
|
}
|
|
37
38
|
export interface ComputedNameInfo {
|
|
38
39
|
/**
|
|
@@ -33,6 +33,7 @@ export declare class EntityMap {
|
|
|
33
33
|
getTypeOrExtensionEntity(entity: analyzerEntities.TypeEntity | analyzerEntities.TypeExtensionEntity): emitterEntities.TypeOrExtensionEntity;
|
|
34
34
|
getPackageEntity(entity: analyzerEntities.PackageEntity): emitterEntities.PackageEntity;
|
|
35
35
|
getType(type: analyzerTypes.Type): emitterEntities.Type;
|
|
36
|
+
enumerateAllPackageEntities(): Iterable<emitterEntities.PackageEntity>;
|
|
36
37
|
private getPackageEntityInternal;
|
|
37
38
|
private createTypeMembers;
|
|
38
39
|
private getContainingPackageAndAccumulateIfMember;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeclarationsUsageMap } from '../analysis/DeclarationsUsageCounter.js';
|
|
2
2
|
import { Analyzer } from '../analysis/index.js';
|
|
3
|
-
import { SourceFile } from '../project/index.js';
|
|
3
|
+
import { SourceFile, SourcePackage } from '../project/index.js';
|
|
4
|
+
import * as tree from '../tree/index.js';
|
|
4
5
|
import { EntityMap } from './EntityMap.js';
|
|
5
6
|
import * as ir from './ir/index.js';
|
|
6
7
|
export declare class IrBuilder {
|
|
7
8
|
private readonly _analyzer;
|
|
8
|
-
private readonly _sourceFile;
|
|
9
|
-
private readonly _declarationsUsageCountResult;
|
|
10
|
-
private readonly _declarationsOfPackageSourceFilesUsageCountResults;
|
|
11
9
|
private readonly _entityMap;
|
|
10
|
+
private readonly _declarationUsageInfoOfAllPackages;
|
|
12
11
|
private readonly _typesCreatedFromAnonymousTypes;
|
|
13
12
|
private readonly _textTemplateToTextMethod;
|
|
13
|
+
private _sourceFile;
|
|
14
|
+
private _declarationsUsageInfoOfSourceFile;
|
|
15
|
+
private _declarationsUsageInfoOfPackageSourceFiles;
|
|
14
16
|
private _id;
|
|
15
17
|
private _currentLoopLabel;
|
|
16
18
|
private get textTemplateToTextMethod();
|
|
17
|
-
constructor(
|
|
18
|
-
build(): ir.
|
|
19
|
+
constructor(analyzer: Analyzer, entityMap: EntityMap, declarationUsageInfoOfAllPackages: ReadonlyMap<tree.SourceFile, DeclarationsUsageMap>);
|
|
20
|
+
build(pkg: SourcePackage): ir.Package;
|
|
19
21
|
private buildPackageMemberDeclarationList;
|
|
20
22
|
private buildPackageConstructorDeclaration;
|
|
21
23
|
private buildFunctionBlockOfFunction;
|
|
@@ -79,12 +81,12 @@ export declare class IrBuilder {
|
|
|
79
81
|
private buildAssumptionExpression;
|
|
80
82
|
private buildAsExpression;
|
|
81
83
|
private buildBinaryExpression;
|
|
82
|
-
private buildFunctionBlockLiteral;
|
|
83
84
|
private buildCallExpression;
|
|
84
85
|
private buildAutotypeCallExpression;
|
|
85
86
|
private buildIndexedAccessExpression;
|
|
86
87
|
private buildIsExpression;
|
|
87
88
|
private buildFunctionLiteral;
|
|
89
|
+
private buildFunctionBlockLiteral;
|
|
88
90
|
private buildParenthesizedExpression;
|
|
89
91
|
private buildPrefixUnaryExpression;
|
|
90
92
|
private buildMemberAccessExpression;
|
|
@@ -92,7 +94,10 @@ export declare class IrBuilder {
|
|
|
92
94
|
private convertDereferencedVariableAccess;
|
|
93
95
|
private buildReferenceExpression;
|
|
94
96
|
private buildConditionalExpression;
|
|
97
|
+
private buildTextLiteral;
|
|
98
|
+
private buildLocalizableTextLiteral;
|
|
95
99
|
private buildTextTemplateLiteral;
|
|
100
|
+
private buildLocalizableTextTemplateLiteral;
|
|
96
101
|
private buildTokenExpression;
|
|
97
102
|
private buildKeywordExpression;
|
|
98
103
|
private buildObjectExpression;
|
|
@@ -114,12 +119,15 @@ export declare class IrBuilder {
|
|
|
114
119
|
private createAccessedFunctionFromOperator;
|
|
115
120
|
private expressionIsCallee;
|
|
116
121
|
private generateLoopLabel;
|
|
122
|
+
private buildTextTranslationDeclarationList;
|
|
123
|
+
private buildTextTranslationDeclaration;
|
|
124
|
+
private createTranslationTextTemplate;
|
|
117
125
|
private getSourceLocation;
|
|
118
126
|
}
|
|
119
127
|
export interface IrBuilderParams {
|
|
120
128
|
analyzer: Analyzer;
|
|
121
129
|
sourceFile: SourceFile;
|
|
122
|
-
declarationsUsageCountResult:
|
|
123
|
-
declarationsOfPackageSourceFilesUsageCountResults: readonly
|
|
130
|
+
declarationsUsageCountResult: DeclarationsUsageMap;
|
|
131
|
+
declarationsOfPackageSourceFilesUsageCountResults: readonly DeclarationsUsageMap[];
|
|
124
132
|
entityMap: EntityMap;
|
|
125
133
|
}
|
|
@@ -54,7 +54,7 @@ export declare class IrToJs {
|
|
|
54
54
|
private convertBinaryExpression;
|
|
55
55
|
private convertCallExpression;
|
|
56
56
|
private convertCharLiteral;
|
|
57
|
-
private
|
|
57
|
+
private convertNullLiteral;
|
|
58
58
|
private convertIndexedAccessExpression;
|
|
59
59
|
private convertIntegerLiteral;
|
|
60
60
|
private convertNumericLiteral;
|
|
@@ -75,7 +75,7 @@ export declare class Transformer {
|
|
|
75
75
|
transformCallExpressionChildren(expression: ir.CallExpression): void;
|
|
76
76
|
transformArguments(args: ir.Arguments): ir.Arguments;
|
|
77
77
|
transformCharLiteralChildren(_expression: ir.CharLiteral): void;
|
|
78
|
-
|
|
78
|
+
transformNullLiteralChildren(_expression: ir.NullLiteral): void;
|
|
79
79
|
transformIndexedAccessExpressionChildren(expression: ir.IndexedAccessExpression): void;
|
|
80
80
|
transformIntegerLiteralChildren(_expression: ir.IntegerLiteral): void;
|
|
81
81
|
transformIsExpressionChildren(expression: ir.IsExpression): void;
|
|
@@ -85,8 +85,10 @@ export declare class Transformer {
|
|
|
85
85
|
transformMeasureLiteralChildren(_expression: ir.MeasureLiteral): void;
|
|
86
86
|
transformReferenceExpressionChildren(expression: ir.ReferenceExpression): void;
|
|
87
87
|
transformTextLiteralChildren(_expression: ir.TextLiteral): void;
|
|
88
|
+
transformLocalizableTextLiteralChildren(_expression: ir.LocalizableTextLiteral): void;
|
|
88
89
|
transformTextWithEntityNameChildren(_expression: ir.TextWithEntityName): void;
|
|
89
90
|
transformTextTemplateLiteralChildren(expression: ir.TextTemplateLiteral): void;
|
|
91
|
+
transformLocalizableTextTemplateLiteralChildren(expression: ir.LocalizableTextTemplateLiteral): void;
|
|
90
92
|
transformTernaryExpressionChildren(expression: ir.TernaryExpression): void;
|
|
91
93
|
transformThisExpressionChildren(_expression: ir.ThisExpression): void;
|
|
92
94
|
transformBaseExpressionChildren(_expression: ir.BaseExpression): void;
|
|
@@ -138,14 +140,16 @@ export interface TransformationConfig {
|
|
|
138
140
|
transformFieldAccessExpression?(expression: ir.FieldAccessExpression): ExpressionTransformationResult;
|
|
139
141
|
transformMethodAccessExpression?(expression: ir.MethodAccessExpression): ExpressionTransformationResult;
|
|
140
142
|
transformTextTemplateLiteral?(expression: ir.TextTemplateLiteral): ExpressionTransformationResult;
|
|
143
|
+
transformLocalizableTextTemplateLiteral?(expression: ir.LocalizableTextTemplateLiteral): ExpressionTransformationResult;
|
|
141
144
|
transformCharLiteral?(expression: ir.CharLiteral): ExpressionTransformationResult;
|
|
142
145
|
transformTextLiteral?(expression: ir.TextLiteral): ExpressionTransformationResult;
|
|
146
|
+
transformLocalizableTextLiteral?(expression: ir.LocalizableTextLiteral): ExpressionTransformationResult;
|
|
143
147
|
transformTextWithEntityName?(expression: ir.TextWithEntityName): ExpressionTransformationResult;
|
|
144
148
|
transformBooleanLiteral?(expression: ir.BooleanLiteral): ExpressionTransformationResult;
|
|
145
149
|
transformIntegerLiteral?(expression: ir.IntegerLiteral): ExpressionTransformationResult;
|
|
146
150
|
transformNumericLiteral?(expression: ir.NumericLiteral): ExpressionTransformationResult;
|
|
147
151
|
transformMeasureLiteral?(expression: ir.MeasureLiteral): ExpressionTransformationResult;
|
|
148
|
-
|
|
152
|
+
transformNullLiteral?(expression: ir.NullLiteral): ExpressionTransformationResult;
|
|
149
153
|
transformThisExpression?(expression: ir.ThisExpression): ExpressionTransformationResult;
|
|
150
154
|
transformBaseExpression?(expression: ir.BaseExpression): ExpressionTransformationResult;
|
|
151
155
|
transformConstructorCallExpression?(expression: ir.ConstructorCallExpression): ExpressionTransformationResult;
|
|
@@ -214,6 +218,7 @@ export interface TransformationConfig {
|
|
|
214
218
|
transformFunctionJsObjectLiteralProperty?(clause: ir.FunctionJsObjectLiteralProperty): NodeTransformationResult<ir.FunctionJsObjectLiteralProperty>;
|
|
215
219
|
transformSpreadJsObjectLiteralProperty?(clause: ir.SpreadJsObjectLiteralProperty): NodeTransformationResult<ir.SpreadJsObjectLiteralProperty>;
|
|
216
220
|
transformDecorator?(node: ir.Decorator): NodeTransformationResult<ir.Decorator>;
|
|
221
|
+
transformTextTranslationDeclaration?(declaration: ir.TextTranslationDeclaration): PackageMemberDeclarationTransformationResult;
|
|
217
222
|
}
|
|
218
223
|
export declare const enum TransformationContinuationAction {
|
|
219
224
|
Continue = 0,
|
|
@@ -66,17 +66,17 @@ declare enum FieldAccessExpressionEmitOptionsFlags {
|
|
|
66
66
|
None = 0,
|
|
67
67
|
ForceUseNonComputedName = 1
|
|
68
68
|
}
|
|
69
|
-
export declare class
|
|
69
|
+
export declare class TextTemplateEmitOptions {
|
|
70
70
|
private _flags;
|
|
71
|
-
constructor(flags?:
|
|
71
|
+
constructor(flags?: TextTemplateEmitOptionsFlags);
|
|
72
72
|
constructor(createTextTemplateInstance: boolean);
|
|
73
|
-
static default():
|
|
73
|
+
static default(): TextTemplateEmitOptions;
|
|
74
74
|
get createTextTemplateInstance(): boolean;
|
|
75
75
|
set createTextTemplateInstance(value: boolean);
|
|
76
76
|
setCreateTextTemplateInstance(value: boolean): this;
|
|
77
|
-
clone():
|
|
77
|
+
clone(): TextTemplateEmitOptions;
|
|
78
78
|
}
|
|
79
|
-
declare enum
|
|
79
|
+
declare enum TextTemplateEmitOptionsFlags {
|
|
80
80
|
None = 0,
|
|
81
81
|
CreateTextTemplateInstance = 1
|
|
82
82
|
}
|