@artel/artc 0.6.25207 → 0.6.25209
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 +36 -20
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +9923 -9250
- package/build/{chunk-FYWHIGGV.js → chunk-4EDLYSNW.js} +11 -8
- package/build/{chunk-F6DF37J3.js → chunk-5SWGY25I.js} +39172 -46399
- package/build/{chunk-OORYH37I.js → chunk-GKEW2LBL.js} +27 -14
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +14 -10
- package/build/types/analysis/Analyzer.d.ts +27 -11
- package/build/types/analysis/AutotypeCallExpressionMeaning.d.ts +17 -1
- package/build/types/analysis/BaseExpressionMeaning.d.ts +17 -1
- package/build/types/analysis/CallExpressionMeaning.d.ts +17 -1
- package/build/types/analysis/DereferenceExpressionMeaning.d.ts +6 -1
- package/build/types/analysis/DereferencedVariableAccess.d.ts +14 -0
- package/build/types/analysis/DiagnosticCollector.d.ts +3 -0
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +2 -5
- package/build/types/analysis/IndexedAccess.d.ts +14 -0
- package/build/types/analysis/IndexedAccessExpressionMeaning.d.ts +6 -3
- package/build/types/analysis/ObjectExpressionMeaning.d.ts +19 -3
- package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +2 -4
- package/build/types/analysis/SemanticContext.d.ts +4 -4
- package/build/types/analysis/VariableAccess.d.ts +6 -2
- package/build/types/analysis/WellKnownDeclarations.d.ts +1 -0
- package/build/types/analysis/index.d.ts +4 -2
- package/build/types/api/Api.d.ts +2 -2
- package/build/types/common/AccessKind.d.ts +2 -1
- package/build/types/common/Constants.d.ts +1 -1
- package/build/types/common/JavaScriptIdentifier.d.ts +6 -0
- package/build/types/common/Logger.d.ts +1 -0
- package/build/types/common/Name.d.ts +18 -21
- package/build/types/common/Query.d.ts +6 -1
- package/build/types/common/TreeQuery.d.ts +0 -2
- package/build/types/common/index.d.ts +2 -1
- package/build/types/emitter/Emitter.d.ts +50 -16
- package/build/types/emitter/EmitterContext.d.ts +42 -337
- package/build/types/emitter/EmitterGeneratedDeclarationKind.d.ts +55 -17
- package/build/types/emitter/Entities.d.ts +144 -0
- package/build/types/emitter/EntityMap.d.ts +45 -0
- package/build/types/emitter/ExpressionTransformationResult.d.ts +1 -1
- package/build/types/emitter/GeneralLowering.d.ts +4 -68
- package/build/types/emitter/Internal.d.ts +0 -1
- package/build/types/emitter/IrBuilder.d.ts +27 -17
- package/build/types/emitter/IrToJs.d.ts +17 -11
- package/build/types/emitter/StatementTransformationResult.d.ts +5 -2
- package/build/types/emitter/Transformer.d.ts +21 -93
- package/build/types/emitter/ir/AccessedEntities.d.ts +5 -11
- package/build/types/emitter/ir/ComputedAccess.d.ts +19 -0
- package/build/types/emitter/ir/LoweringState.d.ts +25 -0
- package/build/types/emitter/ir/Nodes.d.ts +531 -1109
- package/build/types/emitter/ir/index.d.ts +3 -1
- package/build/types/emitter/ir/types.d.ts +6 -7
- package/build/types/entities/BinaryOperatorEntity.d.ts +3 -0
- package/build/types/entities/ConstructorEntity.d.ts +17 -21
- package/build/types/entities/PackageMembers.d.ts +2 -2
- package/build/types/entities/TypeEntityMembers.d.ts +2 -2
- package/build/types/entities/UnaryOperatorEntity.d.ts +3 -0
- package/build/types/entities/Variants.d.ts +2 -2
- package/build/types/entities/index.d.ts +4 -2
- package/build/types/executor/Compiler.d.ts +6 -1
- package/build/types/executor/NodeCompiler.d.ts +7 -3
- package/build/types/parser/Scanner.d.ts +1 -0
- package/build/types/project/CompilationLoader.d.ts +17 -22
- package/build/types/project/PackageContent.d.ts +16 -0
- package/build/types/project/PackageContentCreator.d.ts +3 -0
- package/build/types/project/SourceFile.d.ts +1 -1
- package/build/types/project/SourcePackage.d.ts +3 -3
- package/build/types/project/configuration/ConfigurationConverter.d.ts +2 -3
- package/build/types/project/configuration/ConfigurationTranslator.d.ts +23 -0
- package/build/types/project/configuration/PackageConfigurationInterpreter.d.ts +1 -27
- package/build/types/project/index.d.ts +3 -1
- package/build/types/services/AddPropertyAssignmentService.d.ts +2 -2
- package/build/types/services/CodeActionsService.d.ts +22 -0
- package/build/types/services/DefinitionService.d.ts +2 -2
- package/build/types/services/LanguageServer.d.ts +11 -2
- package/build/types/services/NodeSemanticInfo.d.ts +13 -7
- package/build/types/services/ReferencesService.d.ts +1 -3
- package/build/types/services/TranslationsGenerationService.d.ts +7 -0
- package/build/types/services/Types.d.ts +10 -0
- package/build/types/services/source-generation/SourceGenerationService.d.ts +6 -4
- package/build/types/services/workspace/CompilationController.d.ts +4 -3
- package/build/types/services/workspace/FileSystemTreeProviderBasedOnWatchedFileSystem.d.ts +5 -2
- package/build/types/services/workspace/ManuallyUpdatedFileSystemTreeProvider.d.ts +1 -1
- package/build/types/services/workspace/Workspace.d.ts +6 -2
- package/build/types/services/workspace/WorkspaceFiles.d.ts +2 -2
- package/build/types/tree/KeywordKind.d.ts +47 -46
- package/build/types/tree/green/SyntaxToCode.d.ts +4 -3
- package/build/types/ts-interop/TsInteropContext.d.ts +2 -2
- package/build/types/ts-interop/TsPackageMembersCreator.d.ts +3 -3
- package/build/types/ts-interop/Utils.d.ts +39 -33
- package/package.json +6 -6
- package/build/types/analysis/IndexerAccess.d.ts +0 -10
- package/build/types/emitter/EmitterPackage.d.ts +0 -60
- package/build/types/emitter/EntityNameProviders.d.ts +0 -33
- package/build/types/generated/BuiltInSystemPackages.d.ts +0 -3
- package/build/types/old/Executor.d.ts +0 -14
- package/build/types/old/JavaScriptEmittingVisitor.d.ts +0 -1
- package/build/types/old/NzonParser.d.ts +0 -1
- package/build/types/old/NzonScanner.d.ts +0 -1
- package/build/types/old/NzonSyntax.d.ts +0 -1
- package/build/types/old/RemoteWorkspaceFileSystem.d.ts +0 -1
- /package/build/types/{old/JavaScriptEmitter.d.ts → emitter/EmitterContextOld.d.ts} +0 -0
@@ -1,8 +1,8 @@
|
|
1
1
|
import { PackageLocale } from '../common/index.js';
|
2
2
|
export declare const enum EmitterGeneratedDeclarationKind {
|
3
3
|
MainFunction = 0,
|
4
|
-
|
5
|
-
|
4
|
+
PackageConstructor = 1,
|
5
|
+
PackageRunFunction = 2,
|
6
6
|
PlainObjectConstructorPrefix = 3,
|
7
7
|
ExtensionConstructor = 4,
|
8
8
|
ExtensionMethodTargetParameter = 5,
|
@@ -13,24 +13,62 @@ export declare const enum EmitterGeneratedDeclarationKind {
|
|
13
13
|
TypeIndexedElementGetter = 10,
|
14
14
|
TypeIndexedElementSetter = 11,
|
15
15
|
TypeDereferencedVariable = 12,
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
16
|
+
TypeDereferencedVariableGetter = 13,
|
17
|
+
TypeDereferencedVariableSetter = 14,
|
18
|
+
TypeBackingVariablePrefix = 15,
|
19
|
+
TempVariablePrefix = 16,
|
20
|
+
DefaultImportPrefix = 17,
|
21
|
+
NamespaceImportPrefix = 18,
|
22
|
+
RefCountVariable = 19,
|
23
|
+
AddReferenceMethod = 20,
|
24
|
+
RemoveReferenceMethod = 21,
|
25
|
+
ShallowCopyMethod = 22,
|
26
|
+
MergedConstructorIdParameter = 23,
|
27
|
+
MergedConstructorParameterPrefix = 24,
|
28
|
+
AnonymousType = 25,
|
29
|
+
PlainObjectMethodNewThisVariable = 26,
|
30
|
+
PlainObjectMethodResultNewThisProperty = 27,
|
31
|
+
PlainObjectMethodResultResultProperty = 28,
|
32
|
+
ProxyVariable = 29,
|
33
|
+
TypeConstructor = 30,
|
34
|
+
TypeExtensionPrefix = 31
|
31
35
|
}
|
32
36
|
export declare const emitterGeneratedDeclarationNamesByLocale: {
|
33
37
|
[T in PackageLocale]: {
|
34
38
|
[T in EmitterGeneratedDeclarationKind]: string;
|
35
39
|
};
|
36
40
|
};
|
41
|
+
export declare class EmitPhaseName {
|
42
|
+
static ofMainFunction(locale: PackageLocale): string;
|
43
|
+
static ofPackageConstructor(locale: PackageLocale): string;
|
44
|
+
static ofPackageRunFunction(locale: PackageLocale): string;
|
45
|
+
static ofPlainObjectConstructor(locale: PackageLocale, id: number): string;
|
46
|
+
static ofExtensionConstructor(locale: PackageLocale): string;
|
47
|
+
static ofExtensionMethodTargetParameter(locale: PackageLocale): string;
|
48
|
+
static ofGlobalVariableGetter(locale: PackageLocale, originalName: string): string;
|
49
|
+
static ofGlobalVariableSetter(locale: PackageLocale, originalName: string): string;
|
50
|
+
static ofTypeVariableGetter(locale: PackageLocale, originalName: string): string;
|
51
|
+
static ofTypeVariableSetter(locale: PackageLocale, originalName: string): string;
|
52
|
+
static ofTypeIndexedElementGetter(locale: PackageLocale): string;
|
53
|
+
static ofTypeIndexedElementSetter(locale: PackageLocale): string;
|
54
|
+
static ofTypeDereferencedVariable(locale: PackageLocale): string;
|
55
|
+
static ofTypeDereferencedVariableGetter(locale: PackageLocale): string;
|
56
|
+
static ofTypeDereferencedVariableSetter(locale: PackageLocale): string;
|
57
|
+
static ofTypeBackingVariable(locale: PackageLocale, originalName: string): string;
|
58
|
+
static ofTempVariable(locale: PackageLocale, id: number): string;
|
59
|
+
static ofDefaultImport(locale: PackageLocale, id: number): string;
|
60
|
+
static ofNamespaceImport(locale: PackageLocale, id: number): string;
|
61
|
+
static ofRefCountVariable(locale: PackageLocale): string;
|
62
|
+
static ofAddReferenceMethod(locale: PackageLocale): string;
|
63
|
+
static ofRemoveReferenceMethod(locale: PackageLocale): string;
|
64
|
+
static ofShallowCopyMethod(locale: PackageLocale): string;
|
65
|
+
static ofMergedConstructorIdParameter(locale: PackageLocale): string;
|
66
|
+
static ofMergedConstructorParameter(locale: PackageLocale, id: number): string;
|
67
|
+
static ofAnonymousType(locale: PackageLocale): string;
|
68
|
+
static ofPlainObjectMethodNewThisVariable(locale: PackageLocale): string;
|
69
|
+
static ofPlainObjectMethodResultNewThisProperty(locale: PackageLocale): string;
|
70
|
+
static ofPlainObjectMethodResultResultProperty(locale: PackageLocale): string;
|
71
|
+
static ofProxyVariable(locale: PackageLocale, originalName: string): string;
|
72
|
+
static ofTypeConstructor(locale: PackageLocale): string;
|
73
|
+
static ofTypeExtension(locale: PackageLocale, extendedTypeName: string): string;
|
74
|
+
}
|
@@ -0,0 +1,144 @@
|
|
1
|
+
import { PackageLocale } from '../common/index.js';
|
2
|
+
import { JavaScriptImplementationConfig } from '../project/SourcePackage.js';
|
3
|
+
export interface MethodEntity {
|
4
|
+
readonly kind: 'method';
|
5
|
+
methodEntityKind: MethodEntityKind;
|
6
|
+
name: string;
|
7
|
+
parameters: readonly VariableEntity[];
|
8
|
+
returnType: Type;
|
9
|
+
isTypeMember: TypeMemberEntityInfo | undefined;
|
10
|
+
isPackageMember: boolean;
|
11
|
+
containingPackage: PackageEntity;
|
12
|
+
details: MethodEntityDetails;
|
13
|
+
}
|
14
|
+
export declare enum MethodEntityKind {
|
15
|
+
RegularMethod = 0,
|
16
|
+
GetterOrSetter = 1,
|
17
|
+
Constructor = 2,
|
18
|
+
Destructor = 3,
|
19
|
+
Operator = 4
|
20
|
+
}
|
21
|
+
export declare class MethodEntityDetails {
|
22
|
+
isAsync: boolean;
|
23
|
+
isPackageConstructor: boolean;
|
24
|
+
isPackageEntryPoint: boolean;
|
25
|
+
overriddenMember: MethodEntity | undefined;
|
26
|
+
ifRedefinableAliasTypeMethodThenRealMethod: MethodEntity | undefined;
|
27
|
+
isEnumeratorMethod: boolean;
|
28
|
+
isDefaultExport: boolean;
|
29
|
+
isFormerInstanceAliasTypeOrExtensionMember: boolean;
|
30
|
+
}
|
31
|
+
export interface VariableEntity {
|
32
|
+
readonly kind: 'variable';
|
33
|
+
name: string;
|
34
|
+
type: Type;
|
35
|
+
isTypeMember: TypeMemberEntityInfo | undefined;
|
36
|
+
isPackageMember: boolean;
|
37
|
+
containingPackage: PackageEntity;
|
38
|
+
getter: MethodEntity | undefined;
|
39
|
+
setter: MethodEntity | undefined;
|
40
|
+
details: VariableEntityDetails;
|
41
|
+
}
|
42
|
+
export declare class VariableEntityDetails {
|
43
|
+
isVariadicParameter: boolean;
|
44
|
+
overriddenMember: VariableEntity | undefined;
|
45
|
+
isProxiedTypeVariable: ProxiedTypeVariableInfo | undefined;
|
46
|
+
isDefaultExport: boolean;
|
47
|
+
}
|
48
|
+
export interface ProxiedTypeVariableInfo {
|
49
|
+
readonly tagType: TypeOrExtensionEntity;
|
50
|
+
readonly constructor: MethodEntity;
|
51
|
+
}
|
52
|
+
export type TypeMemberEntity = MethodEntity | VariableEntity;
|
53
|
+
export interface TypeOrExtensionEntity {
|
54
|
+
readonly kind: 'type-or-extension';
|
55
|
+
name: string;
|
56
|
+
baseType: TypeOrExtensionEntity | undefined;
|
57
|
+
typeOrExtensionKind: TypeOrExtensionEntityKind;
|
58
|
+
members: readonly TypeMemberEntity[];
|
59
|
+
containingPackage: PackageEntity;
|
60
|
+
details: TypeOrExtensionEntityDetails;
|
61
|
+
}
|
62
|
+
export declare class TypeOrExtensionEntityDetails {
|
63
|
+
structuredTypeKind: StructuredTypeKind;
|
64
|
+
aliasedType: Type | undefined;
|
65
|
+
isDefaultExport: boolean;
|
66
|
+
}
|
67
|
+
export declare enum TypeOrExtensionEntityKind {
|
68
|
+
StructuredType = 0,
|
69
|
+
AliasType = 1,
|
70
|
+
VariantType = 2,
|
71
|
+
MethodType = 3,
|
72
|
+
ParameterType = 4,
|
73
|
+
TypeExtension = 5
|
74
|
+
}
|
75
|
+
export declare enum StructuredTypeKind {
|
76
|
+
RefObject = 0,
|
77
|
+
PlainObject = 1,
|
78
|
+
Aspect = 2
|
79
|
+
}
|
80
|
+
export type PackageMemberEntity = MethodEntity | VariableEntity | TypeOrExtensionEntity;
|
81
|
+
export interface PackageEntity {
|
82
|
+
readonly kind: 'package';
|
83
|
+
name: string;
|
84
|
+
locale: PackageLocale;
|
85
|
+
members: readonly PackageMemberEntity[];
|
86
|
+
details: PackageEntityDetails;
|
87
|
+
}
|
88
|
+
export declare class PackageEntityDetails {
|
89
|
+
isJavaScriptPackage: JavaScriptImplementationConfig | undefined;
|
90
|
+
isSource: boolean;
|
91
|
+
isPackageWithMainMethod: boolean;
|
92
|
+
}
|
93
|
+
export interface TypeMemberEntityInfo {
|
94
|
+
containingType: TypeOrExtensionEntity;
|
95
|
+
isStatic: boolean;
|
96
|
+
}
|
97
|
+
export type Type = SimpleType | UnionType;
|
98
|
+
export declare class SimpleType {
|
99
|
+
readonly entity: TypeOrExtensionEntity;
|
100
|
+
readonly typeArguments: readonly Type[];
|
101
|
+
readonly kind = "simple";
|
102
|
+
constructor(entity: TypeOrExtensionEntity, typeArguments: readonly Type[]);
|
103
|
+
}
|
104
|
+
export declare class UnionType {
|
105
|
+
readonly types: readonly Type[];
|
106
|
+
readonly kind = "union";
|
107
|
+
constructor(types: readonly Type[]);
|
108
|
+
}
|
109
|
+
export type Entity = VariableEntity | MethodEntity | TypeOrExtensionEntity | PackageEntity;
|
110
|
+
export type NamedEntity = VariableEntity | MethodEntity | TypeOrExtensionEntity;
|
111
|
+
export declare function isComputedVariableEntity(entity: VariableEntity): boolean;
|
112
|
+
export declare class IntrinsicVariableEntity implements VariableEntity {
|
113
|
+
name: string;
|
114
|
+
type: Type;
|
115
|
+
containingPackage: PackageEntity;
|
116
|
+
readonly kind = "variable";
|
117
|
+
isVariadicParameter: boolean;
|
118
|
+
isTypeMember: TypeMemberEntityInfo | undefined;
|
119
|
+
isPackageMember: boolean;
|
120
|
+
getter: MethodEntity | undefined;
|
121
|
+
setter: MethodEntity | undefined;
|
122
|
+
details: VariableEntityDetails;
|
123
|
+
constructor(name: string, type: Type, containingPackage: PackageEntity);
|
124
|
+
}
|
125
|
+
export declare class IntrinsicMethodEntity implements MethodEntity {
|
126
|
+
methodEntityKind: MethodEntityKind;
|
127
|
+
name: string;
|
128
|
+
parameters: readonly VariableEntity[];
|
129
|
+
returnType: Type;
|
130
|
+
containingPackage: PackageEntity;
|
131
|
+
readonly kind = "method";
|
132
|
+
isTypeMember: TypeMemberEntityInfo | undefined;
|
133
|
+
isPackageMember: boolean;
|
134
|
+
details: MethodEntityDetails;
|
135
|
+
constructor(methodEntityKind: MethodEntityKind, name: string, parameters: readonly VariableEntity[], returnType: Type, containingPackage: PackageEntity);
|
136
|
+
}
|
137
|
+
export declare class IntrinsicPackageEntity implements PackageEntity {
|
138
|
+
name: string;
|
139
|
+
locale: PackageLocale;
|
140
|
+
readonly kind = "package";
|
141
|
+
members: readonly PackageMemberEntity[];
|
142
|
+
details: PackageEntityDetails;
|
143
|
+
constructor(name: string, locale: PackageLocale);
|
144
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { Analyzer } from '../analysis/Analyzer.js';
|
2
|
+
import * as analyzerEntities from '../entities/index.js';
|
3
|
+
import { PlatformKind } from '../project/SourcePackage.js';
|
4
|
+
import * as analyzerTypes from '../types/index.js';
|
5
|
+
import * as emitterEntities from './Entities.js';
|
6
|
+
/**
|
7
|
+
* Отображает неизменяемые сущности этапа анализа на изменяемые сущности этапа генерации кода, а также
|
8
|
+
* - заменяет сущности из интерфейсных пакетов на сущности из реализационных пакетов для заданной целевой платформы,
|
9
|
+
* - заменяет имя сущности на НастоящееИмя, если указан соответствующий тег.
|
10
|
+
*/
|
11
|
+
export declare class EntityMap {
|
12
|
+
private readonly _analyzer;
|
13
|
+
private readonly _targetPlatform;
|
14
|
+
private readonly _variables;
|
15
|
+
private readonly _methods;
|
16
|
+
private readonly _typeOrExtensions;
|
17
|
+
private readonly _packages;
|
18
|
+
private readonly _linkedPackages;
|
19
|
+
private readonly _enumeratorMethod;
|
20
|
+
private get enumeratorMethod();
|
21
|
+
constructor(analyzer: Analyzer, targetPlatform: PlatformKind);
|
22
|
+
getVariableEntity(entity: analyzerEntities.VariableEntity): emitterEntities.VariableEntity;
|
23
|
+
getVariantEntity(entity: analyzerEntities.VariantEntity): emitterEntities.VariableEntity;
|
24
|
+
getMethodEntity(entity: analyzerEntities.MethodEntity): emitterEntities.MethodEntity;
|
25
|
+
getConstructorEntity(entity: analyzerEntities.ConstructorEntity): emitterEntities.MethodEntity;
|
26
|
+
getDestructorEntity(entity: analyzerEntities.DestructorEntity): emitterEntities.MethodEntity;
|
27
|
+
getGetterEntity(entity: analyzerEntities.GetterEntity): emitterEntities.MethodEntity;
|
28
|
+
getSetterEntity(entity: analyzerEntities.SetterEntity): emitterEntities.MethodEntity;
|
29
|
+
getUnaryOperatorEntity(entity: analyzerEntities.UnaryOperatorEntity): emitterEntities.MethodEntity;
|
30
|
+
getBinaryOperatorEntity(entity: analyzerEntities.BinaryOperatorEntity): emitterEntities.MethodEntity;
|
31
|
+
getStructuredTypeEntity(entity: analyzerEntities.StructuredTypeEntity): emitterEntities.TypeOrExtensionEntity;
|
32
|
+
getVariantTypeEntity(entity: analyzerEntities.VariantTypeEntity): emitterEntities.TypeOrExtensionEntity;
|
33
|
+
getTypeParameterEntity(entity: analyzerEntities.TypeParameterEntity): emitterEntities.TypeOrExtensionEntity;
|
34
|
+
getMethodTypeEntity(entity: analyzerEntities.MethodTypeEntity): emitterEntities.TypeOrExtensionEntity;
|
35
|
+
getAliasTypeEntity(entity: analyzerEntities.AliasTypeEntity): emitterEntities.TypeOrExtensionEntity;
|
36
|
+
getTypeExtensionEntity(entity: analyzerEntities.TypeExtensionEntity): emitterEntities.TypeOrExtensionEntity;
|
37
|
+
getTypeOrExtensionEntity(entity: analyzerEntities.TypeEntity | analyzerEntities.TypeExtensionEntity): emitterEntities.TypeOrExtensionEntity;
|
38
|
+
getPackageEntity(entity: analyzerEntities.PackageEntity): emitterEntities.PackageEntity;
|
39
|
+
getType(type: analyzerTypes.Type): emitterEntities.Type;
|
40
|
+
private getPackageEntityInternal;
|
41
|
+
private createTypeMembers;
|
42
|
+
private getContainingPackageAndAccumulateIfMember;
|
43
|
+
private getNameText;
|
44
|
+
private isDefaultExport;
|
45
|
+
}
|
@@ -1,72 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { EmitterPackage } from './Emitter.js';
|
2
2
|
import { EmitterContext } from './EmitterContext.js';
|
3
|
-
import { RegisteredEntityNames } from './EntityNameProviders.js';
|
4
|
-
import { PackageMethodDeclaration, SourceFile } from './ir/index.js';
|
5
3
|
export declare class GeneralLowering {
|
6
4
|
private readonly _ectx;
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
private readonly _extensionLikeMembersLowering;
|
11
|
-
private readonly _copyOnWriteLowering;
|
12
|
-
private readonly _modifyingMethodLowering;
|
13
|
-
private readonly _methodObjectLowering;
|
14
|
-
private readonly _textTemplateLowering;
|
15
|
-
private readonly _isExpressionLowering;
|
16
|
-
private readonly _enumerableLowering;
|
17
|
-
private readonly _overloadedConstructorsLowering;
|
18
|
-
private readonly _indexerSetAccessLowering;
|
19
|
-
private readonly _variableProxyLowering;
|
20
|
-
private readonly _packageEntryPointMethods;
|
21
|
-
private readonly _packageConstructorMethods;
|
22
|
-
private readonly _registeredEntityNames;
|
23
|
-
private readonly _lazyInlineJsMethod;
|
24
|
-
private get inlineJsMethod();
|
25
|
-
constructor(_ectx: EmitterContext, locale: PackageLocale);
|
26
|
-
lower(sourceFile: SourceFile): GeneralLoweringResult;
|
27
|
-
private excludeRedefinableMethodsFromAliasType;
|
28
|
-
private substituteBaseAliasType;
|
29
|
-
private lowerImplicitVariantAccessExpression;
|
30
|
-
private lowerImplicitConversionExpression;
|
31
|
-
private addRedefinableMethodsToPrototype;
|
32
|
-
private lowerMethodTypeInvokeMethodCall;
|
33
|
-
private lowerParamObjectMemberAccessExpression;
|
34
|
-
private removeObjectFromBaseTypes;
|
35
|
-
private removeUnnecessaryBaseConstructorCalls;
|
36
|
-
private registerUniqueRuntimeNamesForPackageMemberDeclarations;
|
37
|
-
private lowerAssignmentWithIntegerDivision;
|
38
|
-
private lowerBinaryExpressionWithIntegerDivision;
|
39
|
-
private moveInstanceFieldInitializationsToConstructor;
|
40
|
-
private extractStaticFieldInitializations;
|
41
|
-
private orderPackageMemberDeclarations;
|
42
|
-
private lowerInlineJsMethodCall;
|
43
|
-
private lowerBaseConstructorCall;
|
44
|
-
private lowerBlockStatementWithClauses;
|
45
|
-
private lowerRunStatementWithClauses;
|
46
|
-
private lowerNumericVariantVariants;
|
47
|
-
private lowerForStatementWithIndexVariable;
|
48
|
-
private lowerIndexerGetAccessExpression;
|
49
|
-
private lowerIndexerSetAccess;
|
50
|
-
private lowerJsIndexerGetAccessExpression;
|
51
|
-
private lowerJsIndexerSetAccess;
|
52
|
-
private lowerPackageVariableSetAccessExpression;
|
53
|
-
private lowerPackageVariableGetAccessExpression;
|
54
|
-
private lowerStructuredTypeIndexerDeclaration;
|
55
|
-
private lowerPackageEntryPointDeclaration;
|
56
|
-
private lowerPackageConstructorDeclaration;
|
57
|
-
private lowerComputedPackageVariableDeclaration;
|
58
|
-
private lowerPackageVariableGetterDeclaration;
|
59
|
-
private lowerPackageVariableSetterDeclaration;
|
60
|
-
private lowerSubprogramBody;
|
61
|
-
private lowerComputedTypeVariableDeclaration;
|
62
|
-
private registerRuntimeNamesForTypeMethods;
|
63
|
-
private registerRuntimeNamesForNestedMethodsOfBlockStatement;
|
64
|
-
private lowerTypeDereferenceOperatorDeclaration;
|
65
|
-
}
|
66
|
-
export declare class GeneralLoweringResult {
|
67
|
-
readonly sourceFile: SourceFile;
|
68
|
-
readonly registeredEntityNames: RegisteredEntityNames;
|
69
|
-
readonly packageEntryPointMethods: readonly PackageMethodDeclaration[];
|
70
|
-
readonly packageConstructorMethods: readonly PackageMethodDeclaration[];
|
71
|
-
constructor(sourceFile: SourceFile, registeredEntityNames: RegisteredEntityNames, packageEntryPointMethods: readonly PackageMethodDeclaration[], packageConstructorMethods: readonly PackageMethodDeclaration[]);
|
5
|
+
private readonly _packages;
|
6
|
+
constructor(ectx: EmitterContext, packages: readonly EmitterPackage[]);
|
7
|
+
lower(): void;
|
72
8
|
}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
export * as blockStatementTransformationResult from './BlockStatementTransformationResult.js';
|
2
|
-
export * from './EmitterPackage.js';
|
3
2
|
export * as expressionTransformationResult from './ExpressionTransformationResult.js';
|
4
3
|
export * from './IrBuilder.js';
|
5
4
|
export * as packageMemberDeclarationTransformationResult from './PackageMemberDeclarationTransformationResult.js';
|
@@ -1,21 +1,25 @@
|
|
1
|
-
import { Analyzer } from '../analysis/index.js';
|
2
1
|
import { DeclarationsUsageCountResult } from '../analysis/DeclarationsUsageCounter.js';
|
2
|
+
import { Analyzer } from '../analysis/index.js';
|
3
3
|
import { SourceFile } from '../project/index.js';
|
4
|
+
import { EntityMap } from './EntityMap.js';
|
4
5
|
import * as ir from './ir/index.js';
|
5
6
|
export declare class IrBuilder {
|
6
7
|
private readonly _analyzer;
|
7
8
|
private readonly _sourceFile;
|
8
|
-
private readonly
|
9
|
+
private readonly _declarationsUsageCountResult;
|
10
|
+
private readonly _declarationsOfPackageSourceFilesUsageCountResults;
|
11
|
+
private readonly _entityMap;
|
9
12
|
private readonly _typesCreatedFromAnonymousTypes;
|
13
|
+
private readonly _textTemplateToTextMethod;
|
10
14
|
private _id;
|
11
15
|
private _currentLoopLabel;
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
private get textTemplateToTextMethod();
|
17
|
+
constructor(params: IrBuilderParams);
|
18
|
+
build(): ir.PackageMemberDeclaration[];
|
15
19
|
private buildPackageMemberDeclarationList;
|
16
20
|
private buildPackageConstructorDeclaration;
|
21
|
+
private buildBodyOfSubprogramWithResult;
|
17
22
|
private buildStatementBlock;
|
18
|
-
private buildRunStatementClause;
|
19
23
|
private buildStatement;
|
20
24
|
private buildAssignmentStatement;
|
21
25
|
private buildContinueLoopStatement;
|
@@ -25,7 +29,8 @@ export declare class IrBuilder {
|
|
25
29
|
private buildPackageStructuredTypeDeclaration;
|
26
30
|
private buildPackageAliasTypeDeclaration;
|
27
31
|
private buildPackageVariableDeclaration;
|
28
|
-
private
|
32
|
+
private buildPackageVariableGetterDeclaration;
|
33
|
+
private buildPackageVariableSetterDeclaration;
|
29
34
|
private buildBackingPackageVariable;
|
30
35
|
private buildPackageVariantTypeDeclaration;
|
31
36
|
private buildVariantDeclaration;
|
@@ -34,11 +39,14 @@ export declare class IrBuilder {
|
|
34
39
|
private buildTypeConstructorDeclaration;
|
35
40
|
private createDefaultStructuredTypeConstructor;
|
36
41
|
private buildTypeDestructorDeclaration;
|
37
|
-
private
|
38
|
-
private
|
42
|
+
private buildTypeIndexedGetterDeclaration;
|
43
|
+
private buildTypeIndexedSetterDeclaration;
|
44
|
+
private buildTypeDereferencedVariableGetterDeclaration;
|
45
|
+
private buildTypeDereferencedVariableSetterDeclaration;
|
39
46
|
private buildTypeMethodDeclaration;
|
40
47
|
private buildTypeVariableDeclaration;
|
41
|
-
private
|
48
|
+
private buildTypeVariableGetterDeclaration;
|
49
|
+
private buildTypeVariableSetterDeclaration;
|
42
50
|
private buildBackingTypeVariable;
|
43
51
|
private buildDisposeStatement;
|
44
52
|
private buildRunStatement;
|
@@ -51,16 +59,15 @@ export declare class IrBuilder {
|
|
51
59
|
private buildNestedMethodDeclarationStatement;
|
52
60
|
private buildParameterList;
|
53
61
|
private buildLocalVariableDeclarationStatement;
|
54
|
-
private buildUnobservableStatement;
|
55
62
|
private buildLoopStatement;
|
56
63
|
private buildReturnStatement;
|
57
64
|
private buildSwitchStatement;
|
58
65
|
private isDefaultSwitchStatementCaseClause;
|
59
|
-
private buildTransactionalStatement;
|
60
66
|
private buildWhileStatement;
|
61
67
|
private buildYieldStatement;
|
62
68
|
private buildExpression;
|
63
|
-
private
|
69
|
+
private applyImplicitConversionIfRequired;
|
70
|
+
private convertTextTemplateToText;
|
64
71
|
private expressionCanBeImplicitlyConverted;
|
65
72
|
private buildArrayLiteral;
|
66
73
|
private buildAssertionExpression;
|
@@ -72,12 +79,13 @@ export declare class IrBuilder {
|
|
72
79
|
private buildAutotypeCallExpression;
|
73
80
|
private buildIndexedAccessExpression;
|
74
81
|
private buildIsExpression;
|
75
|
-
private buildUnobservableExpression;
|
76
82
|
private buildNotExpression;
|
77
83
|
private buildMethodLiteral;
|
78
84
|
private buildParenthesizedExpression;
|
79
85
|
private buildPrefixUnaryExpression;
|
80
86
|
private buildPropertyAccessExpression;
|
87
|
+
private convertIndexedAccess;
|
88
|
+
private convertDereferencedVariableAccess;
|
81
89
|
private buildReferenceExpression;
|
82
90
|
private buildWhenTernaryExpression;
|
83
91
|
private buildTextTemplateLiteral;
|
@@ -85,11 +93,11 @@ export declare class IrBuilder {
|
|
85
93
|
private buildKeywordExpression;
|
86
94
|
private buildObjectExpression;
|
87
95
|
private buildBaseExpression;
|
88
|
-
private buildTransactionalExpression;
|
89
96
|
private buildDereferenceExpression;
|
90
97
|
private buildGenericSpecializationExpression;
|
91
98
|
private buildDefaultMatchExpression;
|
92
99
|
private buildIdentifierExpression;
|
100
|
+
private createExplicitReceiver;
|
93
101
|
private getEntityFromType;
|
94
102
|
private buildCallArgumentList;
|
95
103
|
private buildAndSaveTypeIfIsAnonymousTypeSpecifier;
|
@@ -98,11 +106,13 @@ export declare class IrBuilder {
|
|
98
106
|
private buildAnonymousVariantTypeDeclaration;
|
99
107
|
private getUnderlyingTypeKind;
|
100
108
|
private expressionIsCallee;
|
101
|
-
private preserveVariableOrUndefinedIfUnused;
|
102
109
|
private generateLoopLabel;
|
103
110
|
private getSourceLocation;
|
104
111
|
}
|
105
|
-
export interface
|
112
|
+
export interface IrBuilderParams {
|
113
|
+
analyzer: Analyzer;
|
114
|
+
sourceFile: SourceFile;
|
106
115
|
declarationsUsageCountResult: DeclarationsUsageCountResult;
|
107
116
|
declarationsOfPackageSourceFilesUsageCountResults: readonly DeclarationsUsageCountResult[];
|
117
|
+
entityMap: EntityMap;
|
108
118
|
}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import * as js from '@babel/types';
|
2
2
|
import { DebugStack } from './DebugStack.js';
|
3
|
-
import {
|
3
|
+
import { Entity } from './Entities.js';
|
4
4
|
import * as ir from './ir/index.js';
|
5
|
-
export interface
|
5
|
+
export interface IrToJsOptions {
|
6
6
|
/**
|
7
7
|
* static: import { MyType } from 'my-lib'
|
8
8
|
*
|
9
9
|
* dynamic: const { MyType } = await import('my-lib')
|
10
10
|
*/
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
importMode?: ImportEmitMode;
|
12
|
+
entityNameOverrides?: ReadonlyMap<Entity, string>;
|
13
|
+
attachSourceLocation?: boolean;
|
14
14
|
}
|
15
15
|
export type ImportEmitMode = ImportEmitMode.Static | ImportEmitMode.Dynamic;
|
16
16
|
export declare namespace ImportEmitMode {
|
@@ -24,12 +24,14 @@ export declare namespace ImportEmitMode {
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
export declare class IrToJs {
|
27
|
-
private readonly _config;
|
28
27
|
static readonly customImportFunctionName = "_artelImport";
|
29
28
|
protected readonly _debugStack: DebugStack;
|
30
|
-
|
31
|
-
|
32
|
-
private
|
29
|
+
private _importMode;
|
30
|
+
private _entityNameOverrides;
|
31
|
+
private _attachSourceLocation;
|
32
|
+
constructor(options?: IrToJsOptions);
|
33
|
+
convert(pkg: ir.Package): js.File;
|
34
|
+
private convertPackage;
|
33
35
|
private convertPackageMemberDeclaration;
|
34
36
|
private convertEsModuleImportDirectiveStatement;
|
35
37
|
private convertCjsModuleImportDirectiveStatement;
|
@@ -42,7 +44,6 @@ export declare class IrToJs {
|
|
42
44
|
private convertPackageMethodDeclaration;
|
43
45
|
private convertValueParameters;
|
44
46
|
private convertPackageTypeDeclaration;
|
45
|
-
private convertPropertyDeclaration;
|
46
47
|
private convertPackageVariableDeclaration;
|
47
48
|
private convertPackageVariantTypeDeclaration;
|
48
49
|
private convertNumericVariants;
|
@@ -54,6 +55,7 @@ export declare class IrToJs {
|
|
54
55
|
private convertCallExpression;
|
55
56
|
private convertCharLiteral;
|
56
57
|
private convertNoneLiteral;
|
58
|
+
private convertIndexedAccessExpression;
|
57
59
|
private convertHelperMethodCallExpression;
|
58
60
|
private convertNotExpression;
|
59
61
|
private convertIntegerLiteral;
|
@@ -76,13 +78,14 @@ export declare class IrToJs {
|
|
76
78
|
private convertVariableAccessExpression;
|
77
79
|
private convertMethodAccessExpression;
|
78
80
|
private convertVariantAccessExpression;
|
79
|
-
private
|
81
|
+
private convertTypeVariableAccessExpression;
|
80
82
|
private convertTypeMethodAccessExpression;
|
81
83
|
private convertConstructorCallExpression;
|
82
84
|
private convertCallArguments;
|
83
85
|
private convertInlineJsExpression;
|
84
86
|
private convertAssignmentExpression;
|
85
87
|
private convertCommaExpression;
|
88
|
+
private convertBaseConstructorCallExpression;
|
86
89
|
private convertJsIndexedAccessExpression;
|
87
90
|
private convertJsObjectLiteral;
|
88
91
|
private convertJsPropertyAccessExpression;
|
@@ -108,6 +111,9 @@ export declare class IrToJs {
|
|
108
111
|
private convertTypeConstructorDeclaration;
|
109
112
|
private convertTypeMethodDeclaration;
|
110
113
|
private convertTypeVariableDeclaration;
|
114
|
+
private convertTypeVariableGetterDeclaration;
|
115
|
+
private convertTypeVariableSetterDeclaration;
|
111
116
|
private addNodeLocation;
|
117
|
+
private getEntityName;
|
112
118
|
private convertArrayWithErrorBoundary;
|
113
119
|
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { VariableEntity } from '
|
1
|
+
import { VariableEntity } from './Entities.js';
|
2
2
|
import { Statement } from './ir/index.js';
|
3
3
|
export declare const enum Kind {
|
4
4
|
Preserve = 0,
|
5
5
|
Replace = 1,
|
6
|
-
|
6
|
+
Remove = 2
|
7
7
|
}
|
8
8
|
export type Type = {
|
9
9
|
kind: Kind.Preserve;
|
@@ -11,6 +11,9 @@ export type Type = {
|
|
11
11
|
kind: Kind.Replace;
|
12
12
|
statement: Statement;
|
13
13
|
hoistedLocalVariables?: readonly VariableEntity[];
|
14
|
+
} | {
|
15
|
+
kind: Kind.Remove;
|
14
16
|
};
|
15
17
|
export declare function preserve(): Type;
|
16
18
|
export declare function replace(statement: Statement, hoistedLocalVariables?: readonly VariableEntity[]): Type;
|
19
|
+
export declare function remove(): Type;
|