@artel/artc 0.6.25207 → 0.6.25208
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 +32 -18
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +9964 -9262
- package/build/{chunk-FYWHIGGV.js → chunk-FABHNF5H.js} +8 -6
- package/build/{chunk-OORYH37I.js → chunk-LZ4IJBSA.js} +3 -4
- package/build/{chunk-F6DF37J3.js → chunk-PNUVVKWZ.js} +38838 -46249
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +10 -7
- package/build/types/analysis/Analyzer.d.ts +27 -10
- package/build/types/analysis/DereferenceExpressionMeaning.d.ts +6 -1
- package/build/types/analysis/DereferencedVariableAccess.d.ts +14 -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 +2 -2
- 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/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 +4 -0
- 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/PackageMembers.d.ts +2 -2
- package/build/types/entities/TypeEntityMembers.d.ts +2 -2
- package/build/types/entities/Variants.d.ts +2 -2
- package/build/types/entities/index.d.ts +3 -1
- 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 +9 -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 +5 -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 +3 -4
- 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
@@ -35,7 +35,10 @@ export declare class AnalyzedTranslationPackage {
|
|
35
35
|
getPackageMethodTranslationTargets(node: tree.PackageMethodTranslation): GetMultipleTranslationTargetsResult<PackageMethodEntity>;
|
36
36
|
getMethodTypeTranslationTarget(node: tree.MethodTypeTranslation): GetSingleTranslationTargetResult<PackageMethodTypeEntity>;
|
37
37
|
getTypeTranslationTarget(node: tree.TypeTranslation): GetSingleTranslationTargetResult<PackageTypeEntity>;
|
38
|
-
|
38
|
+
/**
|
39
|
+
* В случае, когда имя переменной экземпляра совпадает с именем статической переменной, перевод будет иметь две цели.
|
40
|
+
*/
|
41
|
+
getTypeVariableOrVariantTranslationTargets(node: tree.TypeVariableOrVariantTranslation): GetMultipleTranslationTargetsResult<TypeVariableEntity | VariantEntity>;
|
39
42
|
getTypeMethodTranslationTargets(node: tree.TypeMethodTranslation): GetMultipleTranslationTargetsResult<TypeMethodEntity>;
|
40
43
|
getConstructorTranslationTargets(node: tree.ConstructorTranslation): GetMultipleTranslationTargetsResult<ConstructorEntity>;
|
41
44
|
getIndexerTranslationTargets(node: tree.IndexerTranslation): GetMultipleTranslationTargetsResult<IndexerEntity>;
|
@@ -62,9 +65,9 @@ export declare class AnalyzedTranslationPackage {
|
|
62
65
|
}
|
63
66
|
export declare class TranslatedPackageMembers {
|
64
67
|
private readonly _namedMembers;
|
65
|
-
private readonly
|
68
|
+
private readonly _membersByNameKey;
|
66
69
|
private readonly _nameByEntity;
|
67
|
-
private get
|
70
|
+
private get membersByNameKey();
|
68
71
|
private get nameByEntity();
|
69
72
|
constructor(_namedMembers: readonly TranslatedNamedPackageMember[]);
|
70
73
|
getNamedMembers(): readonly TranslatedNamedPackageMember[];
|
@@ -79,9 +82,9 @@ export declare class TranslatedNamedPackageMember {
|
|
79
82
|
export declare class TranslatedTypeEntityMembers {
|
80
83
|
private readonly _namedMembers;
|
81
84
|
readonly translationPackage: AnalyzedTranslationPackage;
|
82
|
-
private readonly
|
85
|
+
private readonly _membersByNameKey;
|
83
86
|
private readonly _nameByEntity;
|
84
|
-
private get
|
87
|
+
private get membersByNameKey();
|
85
88
|
private get nameByEntity();
|
86
89
|
constructor(_namedMembers: readonly TranslatedNamedTypeEntityMember[], translationPackage: AnalyzedTranslationPackage);
|
87
90
|
getNamedMembers(): readonly TranslatedNamedTypeEntityMember[];
|
@@ -96,9 +99,9 @@ export declare class TranslatedNamedTypeEntityMember {
|
|
96
99
|
export declare class TranslatedVariants {
|
97
100
|
private readonly _variants;
|
98
101
|
readonly translationPackage: AnalyzedTranslationPackage;
|
99
|
-
private readonly
|
102
|
+
private readonly _variantsByNameKey;
|
100
103
|
private readonly _nameByEntity;
|
101
|
-
private get
|
104
|
+
private get variantsByNameKey();
|
102
105
|
private get nameByEntity();
|
103
106
|
constructor(_variants: readonly TranslatedVariant[], translationPackage: AnalyzedTranslationPackage);
|
104
107
|
get(): readonly TranslatedVariant[];
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import ts from 'typescript';
|
2
|
-
import {
|
2
|
+
import { CancellationToken, Name, PackageLocale, Range, SearchName, WithDiagnostics } from '../common/index.js';
|
3
3
|
import { Diagnostic, DiagnosticAcceptor, DiagnosticLocation } from '../diagnostic/Diagnostic.js';
|
4
4
|
import { DiagnosticCode } from '../diagnostic/DiagnosticCode.js';
|
5
5
|
import { DiagnosticFlags, DiagnosticKind } from '../diagnostic/DiagnosticData.js';
|
6
6
|
import * as packageMembers from '../entities/PackageMembers.js';
|
7
|
+
import { NamedTypeMemberEntity } from '../entities/TypeEntityMembers.js';
|
7
8
|
import * as entities from '../entities/index.js';
|
8
9
|
import { AliasTypeEntity, AnonymousMethodTypeEntity, AnonymousStructuredTypeEntity, AnonymousVariantTypeEntity, BinaryOperatorEntity, BinaryOperatorKind, ConstructorEntity, DereferenceOperatorEntity, DestructorEntity, GetterEntity, IEntityHidingMatcher, LocalVariableEntity, MethodEntity, MethodTypeEntity, NamedTypeEntity, NestedMethodEntity, PackageAliasEntity, PackageEntity, PackageMethodEntity, PackageMethodTypeEntity, PackageStructuredTypeEntity, PackageVariableEntity, PackageVariantTypeEntity, SetterEntity, SourceIndexerEntity, StructuredTypeEntity, TypeEntity, TypeExtensionEntity, TypeMemberEntityContainer, TypeMethodEntity, TypeParameterEntity, TypeVariableEntity, UnaryOperatorEntity, VariableEntity, VariantEntity, VariantTypeEntity } from '../entities/index.js';
|
9
10
|
import { ReservedIdentifierKind } from '../parser/ReservedIdentifierDictionary.js';
|
@@ -42,7 +43,6 @@ import * as tags from './Tags.js';
|
|
42
43
|
import { TargetTypeHint } from './TargetTypeHint.js';
|
43
44
|
import * as typeOverloadResolver from './TypeOverloadResolver.js';
|
44
45
|
import { WellKnownDeclarations } from './index.js';
|
45
|
-
import { NamedTypeMemberEntity } from '../entities/TypeEntityMembers.js';
|
46
46
|
export declare class Analyzer {
|
47
47
|
static readonly enumeratorMethodName = "\u043F\u0435\u0440\u0435\u0431\u043E\u0440";
|
48
48
|
static readonly methodTypeInvokeMethodName = "\u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C";
|
@@ -110,7 +110,7 @@ export declare class Analyzer {
|
|
110
110
|
} | undefined;
|
111
111
|
isTypeAssignableTo(source: types.Type, target: types.Type): boolean;
|
112
112
|
checkStatementBlockInvokesAsyncMethods(node: tree.StatementBlock): boolean;
|
113
|
-
|
113
|
+
getSyntacticAccessKind(node: tree.Expression): SyntacticAccessKind;
|
114
114
|
getTypeMemberEntityContainer(node: tree.TypeMemberDeclaration): TypeMemberEntityContainer;
|
115
115
|
getTargetTypeOfExpression(node: tree.Expression, hint?: TargetTypeHint): types.Type | undefined;
|
116
116
|
getUnambiguousTargetMethodType(targetType: types.Type | undefined): types.MethodType | undefined;
|
@@ -249,6 +249,12 @@ export type BinaryExpressionOperatorClassificationResult = {
|
|
249
249
|
} | {
|
250
250
|
kind: 'question-question';
|
251
251
|
};
|
252
|
+
export declare const enum SyntacticAccessKind {
|
253
|
+
Get = 0,
|
254
|
+
Set = 1,
|
255
|
+
GetSet = 2,
|
256
|
+
ReferencedValue = 3
|
257
|
+
}
|
252
258
|
declare class Type {
|
253
259
|
private readonly _analyzer;
|
254
260
|
private readonly _unionTypeSpecifierTypes;
|
@@ -387,11 +393,11 @@ declare class ResultLocalVariableEntity {
|
|
387
393
|
private readonly _analyzer;
|
388
394
|
private readonly _entities;
|
389
395
|
constructor(_analyzer: Analyzer);
|
390
|
-
ofPackageMethodDeclaration(node: tree.PackageMethodDeclaration): LocalVariableEntity
|
391
|
-
ofTypeMethodDeclaration(node: tree.TypeMethodDeclaration): LocalVariableEntity
|
392
|
-
ofNestedMethodDeclaration(node: tree.NestedMethodDeclaration): LocalVariableEntity
|
393
|
-
ofMethodLiteral(node: tree.MethodLiteral): LocalVariableEntity
|
394
|
-
ofMethodBlockLiteral(node: tree.MethodBlockLiteral): LocalVariableEntity
|
396
|
+
ofPackageMethodDeclaration(node: tree.PackageMethodDeclaration): LocalVariableEntity;
|
397
|
+
ofTypeMethodDeclaration(node: tree.TypeMethodDeclaration): LocalVariableEntity;
|
398
|
+
ofNestedMethodDeclaration(node: tree.NestedMethodDeclaration): LocalVariableEntity;
|
399
|
+
ofMethodLiteral(node: tree.MethodLiteral): LocalVariableEntity;
|
400
|
+
ofMethodBlockLiteral(node: tree.MethodBlockLiteral): LocalVariableEntity;
|
395
401
|
ofPackageVariableGetterDeclaration(node: tree.PackageVariableGetterDeclaration): LocalVariableEntity;
|
396
402
|
ofTypeVariableGetterDeclaration(node: tree.TypeVariableGetterDeclaration): LocalVariableEntity;
|
397
403
|
ofTypeIndexedGetterDeclaration(node: tree.TypeIndexedGetterDeclaration): LocalVariableEntity;
|
@@ -525,6 +531,7 @@ declare class Tags {
|
|
525
531
|
declare class LinkedEntity {
|
526
532
|
private readonly _analyzer;
|
527
533
|
constructor(_analyzer: Analyzer);
|
534
|
+
entityCanBeLinked(entity: entities.Entity): boolean;
|
528
535
|
ofType(entity: TypeEntity, platform: PlatformKind): TypeEntity | undefined;
|
529
536
|
ofTypeWithMembers(entity: entities.TypeEntityWithMembers, platform: PlatformKind): entities.TypeEntityWithMembers | undefined;
|
530
537
|
ofParameterType(entity: TypeParameterEntity, platform: PlatformKind): TypeParameterEntity | undefined;
|
@@ -535,6 +542,11 @@ declare class LinkedEntity {
|
|
535
542
|
ofConstructor(entity: entities.ConstructorEntity, platform: PlatformKind): entities.ConstructorEntity | undefined;
|
536
543
|
ofIndexer(entity: entities.IndexerEntity, platform: PlatformKind): entities.IndexerEntity | undefined;
|
537
544
|
ofDereferenceOperator(entity: entities.DereferenceOperatorEntity, platform: PlatformKind): entities.DereferenceOperatorEntity | undefined;
|
545
|
+
ofUnaryOperator(entity: entities.UnaryOperatorEntity, platform: PlatformKind): entities.UnaryOperatorEntity | undefined;
|
546
|
+
ofBinaryOperator(entity: entities.BinaryOperatorEntity, platform: PlatformKind): entities.BinaryOperatorEntity | undefined;
|
547
|
+
ofVariant(entity: VariantEntity, platform: PlatformKind): VariantEntity | undefined;
|
548
|
+
ofGetter(entity: entities.GetterEntity, platform: PlatformKind): entities.GetterEntity | undefined;
|
549
|
+
ofSetter(entity: entities.SetterEntity, platform: PlatformKind): entities.SetterEntity | undefined;
|
538
550
|
}
|
539
551
|
export declare class LinkedMultiPlatformPackage {
|
540
552
|
readonly analyzer: Analyzer;
|
@@ -565,13 +577,18 @@ export declare class LinkedTypeWithMembers {
|
|
565
577
|
readonly targetType: entities.TypeEntityWithMembers;
|
566
578
|
readonly linkedPackage: LinkedMultiPlatformPackage;
|
567
579
|
private readonly _memberLookup;
|
580
|
+
private readonly _variantLookup;
|
568
581
|
private get memberLookup();
|
582
|
+
private get variantLookup();
|
569
583
|
constructor(analyzer: Analyzer, externalType: entities.TypeEntityWithMembers, targetType: entities.TypeEntityWithMembers, linkedPackage: LinkedMultiPlatformPackage);
|
570
584
|
getLinkedVariable(entity: entities.TypeVariableEntity): entities.TypeVariableEntity | undefined;
|
571
585
|
getLinkedMethod(entity: entities.TypeMethodEntity): entities.TypeMethodEntity | undefined;
|
572
586
|
getLinkedConstructor(entity: entities.ConstructorEntity): entities.ConstructorEntity | undefined;
|
573
|
-
|
574
|
-
|
587
|
+
getLinkedIndexer(entity: entities.IndexerEntity): entities.IndexerEntity | undefined;
|
588
|
+
getLinkedDereferenceOperator(entity: entities.DereferenceOperatorEntity): entities.DereferenceOperatorEntity | undefined;
|
589
|
+
getLinkedUnaryOperator(entity: UnaryOperatorEntity): UnaryOperatorEntity | undefined;
|
590
|
+
getLinkedBinaryOperator(entity: BinaryOperatorEntity): BinaryOperatorEntity | undefined;
|
591
|
+
getLinkedVariant(entity: VariantEntity): VariantEntity | undefined;
|
575
592
|
}
|
576
593
|
declare class OwningPlainObjectModificationCheck {
|
577
594
|
private _analyzer;
|
@@ -1,19 +1,24 @@
|
|
1
1
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
2
2
|
import { DereferenceExpression } from '../tree/index.js';
|
3
3
|
import * as types from '../types/index.js';
|
4
|
+
import * as dereferencedVariableAccess from './DereferencedVariableAccess.js';
|
4
5
|
import { FoundAnonymousDeclaration } from './FoundDeclaration.js';
|
5
6
|
import { Analyzer } from './index.js';
|
6
7
|
export declare class Resolver {
|
7
8
|
private readonly _analyzer;
|
8
9
|
private readonly _node;
|
10
|
+
private readonly _semanticContext;
|
11
|
+
private get semanticContext();
|
9
12
|
constructor(_analyzer: Analyzer, _node: DereferenceExpression);
|
10
13
|
resolve(): Meaning;
|
14
|
+
private convertSyntacticAccessKind;
|
11
15
|
}
|
12
16
|
export type Meaning = Meaning_resolved | Meaning_unresolved;
|
13
17
|
declare class Meaning_resolved {
|
14
18
|
readonly operator: FoundAnonymousDeclaration<types.DereferenceOperator>;
|
19
|
+
readonly access: dereferencedVariableAccess.DereferencedVariableAccess;
|
15
20
|
readonly kind = "resolved";
|
16
|
-
constructor(operator: FoundAnonymousDeclaration<types.DereferenceOperator
|
21
|
+
constructor(operator: FoundAnonymousDeclaration<types.DereferenceOperator>, access: dereferencedVariableAccess.DereferencedVariableAccess);
|
17
22
|
}
|
18
23
|
declare class Meaning_unresolved {
|
19
24
|
readonly diagnostic: Diagnostic | undefined;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { AccessKind } from '../common/index.js';
|
2
|
+
import { DereferenceOperatorEntity, GetterEntity, SetterEntity } from '../entities/index.js';
|
3
|
+
export type DereferencedVariableAccess = {
|
4
|
+
kind: AccessKind.Get;
|
5
|
+
getAccessor: GetterEntity | undefined;
|
6
|
+
} | {
|
7
|
+
kind: AccessKind.Set;
|
8
|
+
setAccessor: SetterEntity | undefined;
|
9
|
+
} | {
|
10
|
+
kind: AccessKind.GetSet;
|
11
|
+
getAccessor: GetterEntity | undefined;
|
12
|
+
setAccessor: SetterEntity | undefined;
|
13
|
+
};
|
14
|
+
export declare function create(indexerEntity: DereferenceOperatorEntity, accessKind: AccessKind): DereferencedVariableAccess;
|
@@ -10,19 +10,16 @@ import * as scope from './Scope.js';
|
|
10
10
|
import * as variableAccess from './VariableAccess.js';
|
11
11
|
import { Analyzer, TargetTypeHint } from './index.js';
|
12
12
|
export declare class Resolver {
|
13
|
-
private readonly _identifierValue;
|
14
|
-
private readonly _accessKind;
|
15
13
|
private readonly _semanticContext;
|
16
14
|
private readonly _analyzer;
|
17
15
|
private readonly _node;
|
18
16
|
private readonly _targetTypeHint;
|
19
|
-
constructor(analyzer: Analyzer, node: IdentifierExpression, targetTypeHint: TargetTypeHint | undefined);
|
20
|
-
private get identifierSearchName();
|
21
|
-
private get accessKind();
|
22
17
|
private get semanticContext();
|
18
|
+
constructor(analyzer: Analyzer, node: IdentifierExpression, targetTypeHint: TargetTypeHint | undefined);
|
23
19
|
resolve(): ResolutionResult;
|
24
20
|
private resolveMethodOverload;
|
25
21
|
private createAccessedMethod;
|
22
|
+
private convertSyntacticAccessKind;
|
26
23
|
}
|
27
24
|
export declare class ResolutionResult {
|
28
25
|
readonly meaning: Meaning;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { AccessKind } from '../common/index.js';
|
2
|
+
import { GetterEntity, IndexerEntity, SetterEntity } from '../entities/index.js';
|
3
|
+
export type IndexedAccess = {
|
4
|
+
kind: AccessKind.Get;
|
5
|
+
getAccessor: GetterEntity | undefined;
|
6
|
+
} | {
|
7
|
+
kind: AccessKind.Set;
|
8
|
+
setAccessor: SetterEntity | undefined;
|
9
|
+
} | {
|
10
|
+
kind: AccessKind.GetSet;
|
11
|
+
getAccessor: GetterEntity | undefined;
|
12
|
+
setAccessor: SetterEntity | undefined;
|
13
|
+
};
|
14
|
+
export declare function create(indexerEntity: IndexerEntity, accessKind: AccessKind): IndexedAccess;
|
@@ -2,21 +2,24 @@ import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
2
2
|
import { IndexedAccessExpression } from '../tree/index.js';
|
3
3
|
import * as types from '../types/index.js';
|
4
4
|
import { FoundAnonymousDeclaration } from './FoundDeclaration.js';
|
5
|
-
import * as
|
5
|
+
import * as indexedAccess from './IndexedAccess.js';
|
6
6
|
import { Analyzer } from './index.js';
|
7
7
|
export declare class Resolver {
|
8
8
|
private readonly _analyzer;
|
9
9
|
private readonly _node;
|
10
|
+
private readonly _semanticContext;
|
11
|
+
private get semanticContext();
|
10
12
|
constructor(_analyzer: Analyzer, _node: IndexedAccessExpression);
|
11
13
|
resolve(): Meaning;
|
12
14
|
private getArgumentsRangeWithBrackets;
|
15
|
+
private convertSyntacticAccessKind;
|
13
16
|
}
|
14
17
|
export type Meaning = Meaning_resolved | Meaning_unresolved;
|
15
18
|
declare class Meaning_resolved {
|
16
19
|
readonly indexer: FoundAnonymousDeclaration<types.Indexer>;
|
17
|
-
readonly access:
|
20
|
+
readonly access: indexedAccess.IndexedAccess;
|
18
21
|
readonly kind = "resolved";
|
19
|
-
constructor(indexer: FoundAnonymousDeclaration<types.Indexer>, access:
|
22
|
+
constructor(indexer: FoundAnonymousDeclaration<types.Indexer>, access: indexedAccess.IndexedAccess);
|
20
23
|
}
|
21
24
|
declare class Meaning_unresolved {
|
22
25
|
readonly diagnostic: Diagnostic | undefined;
|
@@ -31,8 +31,8 @@ declare class Meaning_objectAccess {
|
|
31
31
|
constructor(type: types.Type);
|
32
32
|
}
|
33
33
|
declare class Meaning_unresolved {
|
34
|
-
readonly diagnostic: Diagnostic;
|
34
|
+
readonly diagnostic: Diagnostic | undefined;
|
35
35
|
readonly kind = "unresolved";
|
36
|
-
constructor(diagnostic: Diagnostic);
|
36
|
+
constructor(diagnostic: Diagnostic | undefined);
|
37
37
|
}
|
38
38
|
export {};
|
@@ -8,17 +8,14 @@ import { PackageNameTreeNode } from './ImportedPackageNameTree.js';
|
|
8
8
|
import * as variableAccess from './VariableAccess.js';
|
9
9
|
import { Analyzer, TargetTypeHint } from './index.js';
|
10
10
|
export declare class Resolver {
|
11
|
-
private readonly _propertySearchName;
|
12
|
-
private readonly _accessKind;
|
13
11
|
private readonly _semanticContext;
|
14
12
|
private readonly _analyzer;
|
15
13
|
private readonly _node;
|
16
14
|
private readonly _targetTypeHint;
|
17
|
-
constructor(analyzer: Analyzer, node: PropertyAccessExpression, targetTypeHint: TargetTypeHint | undefined);
|
18
15
|
private get propertySearchName();
|
19
|
-
private get accessKind();
|
20
16
|
private get semanticContext();
|
21
17
|
private get receiver();
|
18
|
+
constructor(analyzer: Analyzer, node: PropertyAccessExpression, targetTypeHint: TargetTypeHint | undefined);
|
22
19
|
resolve(): ResolutionResult;
|
23
20
|
private resolvePackageAliasMemberAccessMeaning;
|
24
21
|
private resolvePackageMemberAccessMeaning;
|
@@ -28,6 +25,7 @@ export declare class Resolver {
|
|
28
25
|
private createAccessedMethodFromTypeMember;
|
29
26
|
private resolveInstanceMemberAccessMeaning;
|
30
27
|
private resolveMethodOverload;
|
28
|
+
private convertSyntacticAccessKind;
|
31
29
|
}
|
32
30
|
export declare class ResolutionResult {
|
33
31
|
readonly meaning: Meaning;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IEntityHidingMatcher } from '../entities/EntityHiding.js';
|
2
|
-
import { ConstructorEntity, PackageEntity, TypeEntityWithMembers, TypeExtensionEntity } from '../entities/index.js';
|
2
|
+
import { ConstructorEntity, PackageEntity, TypeEntity, TypeEntityWithMembers, TypeExtensionEntity } from '../entities/index.js';
|
3
3
|
import { SourceFile } from '../project/SourceFile.js';
|
4
4
|
import * as tree from '../tree/index.js';
|
5
5
|
import * as types from '../types/index.js';
|
@@ -107,18 +107,18 @@ export declare namespace TypeOrTypeExtension {
|
|
107
107
|
readonly value: TypeEntityWithMembers;
|
108
108
|
readonly kind = "type";
|
109
109
|
constructor(value: TypeEntityWithMembers);
|
110
|
-
|
110
|
+
getContextualTypeEntity(): TypeEntity | undefined;
|
111
111
|
getEntity(): TypeEntityWithMembers;
|
112
112
|
}
|
113
113
|
export class TypeExtension implements ITypeOrTypeExtension {
|
114
114
|
readonly value: TypeExtensionEntity;
|
115
115
|
readonly kind = "type-extension";
|
116
116
|
constructor(value: TypeExtensionEntity);
|
117
|
-
|
117
|
+
getContextualTypeEntity(): TypeEntity | undefined;
|
118
118
|
getEntity(): TypeExtensionEntity;
|
119
119
|
}
|
120
120
|
interface ITypeOrTypeExtension {
|
121
|
-
|
121
|
+
getContextualTypeEntity(): TypeEntity | undefined;
|
122
122
|
getEntity(): TypeEntityWithMembers | TypeExtensionEntity;
|
123
123
|
}
|
124
124
|
export {};
|
@@ -2,9 +2,13 @@ import { AccessKind } from '../common/index.js';
|
|
2
2
|
import { GetterEntity, SetterEntity, VariableEntity } from '../entities/index.js';
|
3
3
|
export type VariableAccess = {
|
4
4
|
kind: AccessKind.Get;
|
5
|
-
|
5
|
+
getAccessor: GetterEntity | undefined;
|
6
6
|
} | {
|
7
7
|
kind: AccessKind.Set;
|
8
|
-
|
8
|
+
setAccessor: SetterEntity | undefined;
|
9
|
+
} | {
|
10
|
+
kind: AccessKind.GetSet;
|
11
|
+
getAccessor: GetterEntity | undefined;
|
12
|
+
setAccessor: SetterEntity | undefined;
|
9
13
|
};
|
10
14
|
export declare function create(entity: VariableEntity, accessKind: AccessKind): VariableAccess;
|
@@ -1,8 +1,10 @@
|
|
1
|
-
export * from './CallArgumentsToParametersMatcher.js';
|
2
1
|
export * from './Analyzer.js';
|
2
|
+
export * from './CallArgumentsToParametersMatcher.js';
|
3
|
+
export * from './DeclarationsUsageCounter.js';
|
4
|
+
export * from './DiagnosticCollector.js';
|
3
5
|
export * from './FindModifier.js';
|
4
6
|
export * from './OverloadResolver.js';
|
5
|
-
export * from './
|
7
|
+
export * from './SourcePackageDependencyGraph.js';
|
6
8
|
export * from './TargetTypeHint.js';
|
7
9
|
export * from './Visitor.js';
|
8
10
|
export * from './WellKnownDeclarations.js';
|
package/build/types/api/Api.d.ts
CHANGED
@@ -5,6 +5,7 @@ export type { Meaning as AutotypeCallExpressionMeaning } from '../analysis/Autot
|
|
5
5
|
export type { Meaning as BaseExpressionMeaning } from '../analysis/BaseExpressionMeaning.js';
|
6
6
|
export { MatchResult, MatchResultValueParameter } from '../analysis/CallArgumentToParameterMatchResult.js';
|
7
7
|
export type { Meaning as CallExpressionMeaning } from '../analysis/CallExpressionMeaning.js';
|
8
|
+
export * as dereferencedVariableAccess from '../analysis/DereferencedVariableAccess.js';
|
8
9
|
export type { Meaning as DereferenceExpressionMeaning } from '../analysis/DereferenceExpressionMeaning.js';
|
9
10
|
export * from '../analysis/DiagnosticCollector.js';
|
10
11
|
export * from '../analysis/EntityLocalizationHelper.js';
|
@@ -12,8 +13,8 @@ export * from '../analysis/FindModifier.js';
|
|
12
13
|
export * from '../analysis/FoundDeclaration.js';
|
13
14
|
export type { Meaning as IdentifierExpressionMeaning, ResolutionResult as IdentifierExpressionResolutionResult } from '../analysis/IdentifierExpressionMeaning.js';
|
14
15
|
export * from '../analysis/ImportedPackageNameTree.js';
|
16
|
+
export * as indexedAccess from '../analysis/IndexedAccess.js';
|
15
17
|
export type { Meaning as IndexedAccessExpressionMeaning } from '../analysis/IndexedAccessExpressionMeaning.js';
|
16
|
-
export * as indexerAccess from '../analysis/IndexerAccess.js';
|
17
18
|
export * from '../analysis/Localization.js';
|
18
19
|
export * from '../analysis/LocalizationContext.js';
|
19
20
|
export * from '../analysis/Lookup.js';
|
@@ -42,7 +43,6 @@ export * from '../diagnostic/DiagnosticData.js';
|
|
42
43
|
export * from '../emitter/Emitter.js';
|
43
44
|
export * from '../entities/index.js';
|
44
45
|
export * from '../executor/Compiler.js';
|
45
|
-
export * from '../generated/BuiltInSystemPackages.js';
|
46
46
|
export * from '../parser/CharacterCodes.js';
|
47
47
|
export * from '../parser/KeywordDictionary.js';
|
48
48
|
export * from '../parser/ParseNumber.js';
|
@@ -10,7 +10,7 @@ export declare const LocaleByConfigurationDirectoryName: Map<string, PackageLoca
|
|
10
10
|
export declare const JsonConfigurationFileNamesByLocale: Map<PackageLocale, string[]>;
|
11
11
|
export declare const JsonConfigurationFileNameSet: Set<string>;
|
12
12
|
export declare const LocaleByJsonConfigurationFileName: Map<string, PackageLocale>;
|
13
|
-
export declare const
|
13
|
+
export declare const InMemoryPackageScheme = "artel-in-memory";
|
14
14
|
export declare const GeneratedSourceFileScheme = "artel-gen";
|
15
15
|
export declare const DefaultTsLibDeclarationsFileName = "lib.es2023.d.ts";
|
16
16
|
export declare const DefaultLocale = PackageLocale.Ru;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export declare const validJavaScriptIdentifierStartRegExp: RegExp;
|
2
|
+
export declare const invalidJavaScriptIdentifierCharsRegExp: RegExp;
|
3
|
+
export declare const javaScriptIdentifierRegExp: RegExp;
|
4
|
+
export declare function isJavaScriptIdentifier(text: string, allowReserved?: boolean): boolean;
|
5
|
+
export declare function isReservedJavaScriptIdentifier(text: string): boolean;
|
6
|
+
export declare const reservedJavaScriptIdentifiers: ReadonlySet<string>;
|
@@ -2,6 +2,7 @@ import { EmitterError } from '../emitter/error-boundary.js';
|
|
2
2
|
import { Node } from '../tree/index.js';
|
3
3
|
export declare class Logger {
|
4
4
|
static info(message: string): void;
|
5
|
+
static warn(message: string): void;
|
5
6
|
static error(message: string): void;
|
6
7
|
static error(error: Error | unknown): void;
|
7
8
|
static errorAtNode(message: string, node: Node): void;
|
@@ -15,35 +15,26 @@ export declare const enum NameFlags {
|
|
15
15
|
* Имя не может быть отображено без кавычек, например: 'имя с пробелами', '+'.
|
16
16
|
*/
|
17
17
|
RequiresQuotes = 8,
|
18
|
-
/**
|
19
|
-
* Имя с обратным апострофом для превращения служебного слова в обычное имя, например: тип\`, объект\`.
|
20
|
-
*/
|
21
|
-
EscapedKeyword = 16,
|
22
18
|
/**
|
23
19
|
* Имя с обратным апострофом для избежания конфликта между параметром метода и свойством объекта,
|
24
20
|
* например: имя\`, 'имя с пробелами'\`.
|
25
21
|
*/
|
26
|
-
ConflictResolvingParameterName =
|
22
|
+
ConflictResolvingParameterName = 16,
|
27
23
|
/**
|
28
24
|
* Имя с двойным обратным апострофом для избежания конфликта между вычисляемым свойством и скрытой
|
29
25
|
* хранимой переменной объекта, например: длина\`\`, 'имя с пробелами'\`\`.
|
30
26
|
*/
|
31
|
-
BackingVariableName =
|
27
|
+
BackingVariableName = 32,
|
32
28
|
/**
|
33
|
-
*
|
29
|
+
* Конвертировать имя в формат kebab case при формировании исходного имени.
|
34
30
|
*/
|
35
|
-
|
31
|
+
PreferKebabCase = 64
|
36
32
|
}
|
37
33
|
export declare class Name {
|
38
34
|
/**
|
39
35
|
* Исходное имя без одиночных кавычек и без символов '\`' в конце. Не содержит символ '~'.
|
40
36
|
*/
|
41
|
-
readonly
|
42
|
-
/**
|
43
|
-
* Исходное имя, при необходимости взятое в одиночные кавычки и содержащее обратные кавычки согласно флагам.
|
44
|
-
* Не содержит символ '~'.
|
45
|
-
*/
|
46
|
-
readonly original: string;
|
37
|
+
readonly unescapedOriginalWithoutQuotes: string;
|
47
38
|
/**
|
48
39
|
* Флаги, указывающие на наличии у имени символов '~', '\`', одиночных кавычек и их смысл.
|
49
40
|
*/
|
@@ -65,14 +56,20 @@ export declare class Name {
|
|
65
56
|
*/
|
66
57
|
get meaningfulBackQuoteCount(): number;
|
67
58
|
/**
|
68
|
-
*
|
69
|
-
*
|
70
|
-
|
59
|
+
* Исходное имя, при необходимости взятое в одиночные кавычки и содержащее обратные кавычки согласно флагам.
|
60
|
+
* Не содержит символ '~'.
|
61
|
+
*/
|
62
|
+
get unescapedOriginal(): string;
|
63
|
+
/**
|
64
|
+
* @param unescapedOriginalWithoutQuotes Исходное имя без апострофов, одиночных кавычек и экранирования.
|
65
|
+
* @param flags Флаги имени (`NameFlags`). `NameFlags.None` по умолчанию.
|
71
66
|
*/
|
72
|
-
constructor(
|
67
|
+
constructor(unescapedOriginalWithoutQuotes: string, flags?: NameFlags);
|
68
|
+
toConflictResolvingParameterName(): Name;
|
69
|
+
toBackingVariableName(): Name;
|
73
70
|
considerEqual(other: Name, considerBackQuotes?: boolean): boolean;
|
74
71
|
toString(): string;
|
75
|
-
|
76
|
-
|
77
|
-
private static
|
72
|
+
getPreferredUnescapedOriginal(flags: NameFlags): string;
|
73
|
+
static parse(original: string, initialFlags?: NameFlags): Name;
|
74
|
+
private static toUnescapedOriginal;
|
78
75
|
}
|
@@ -34,6 +34,10 @@ export declare abstract class Query<T> implements Iterable<T> {
|
|
34
34
|
groupByToMap<K>(keySelector: (t: T) => K): Map<K, T[]>;
|
35
35
|
groupByToMap<K, V>(keySelector: (t: T) => K, mapFn: (t: T) => V): Map<K, V[]>;
|
36
36
|
unique(keySelector?: (t: T) => any): Query<T>;
|
37
|
+
uniqueWithComparator(comparator: (t1: T, t2: T) => boolean): Query<T>;
|
37
38
|
uniqueToSet(): Set<T>;
|
38
39
|
maxByValue(valueSelector: (t: T) => number): T | undefined;
|
40
|
+
single(): T | undefined;
|
41
|
+
single<K extends T>(fn: (t: T) => t is K): K | undefined;
|
42
|
+
single(fn: (t: T) => boolean): T | undefined;
|
39
43
|
}
|
@@ -41,13 +41,11 @@ declare class TypeMemberDeclarationContainer_typeExtension implements ITypeMembe
|
|
41
41
|
constructor(declaration: tree.TypeExtensionDeclaration, memberBlock: tree.TypeMemberDeclarationBlock);
|
42
42
|
getNode(): tree.TypeExtensionDeclaration;
|
43
43
|
getMemberBlock(): tree.TypeMemberDeclarationBlock;
|
44
|
-
getTypeEntity(_analyzer: Analyzer): TypeEntityWithMembers | undefined;
|
45
44
|
getContextualTypeEntity(analyzer: Analyzer): TypeEntity | undefined;
|
46
45
|
}
|
47
46
|
interface ITypeMemberDeclarationContainer {
|
48
47
|
getNode(): StructuredTypeDeclaration | VariantTypeDeclaration | tree.PackageAliasTypeDeclaration | tree.TypeExtensionDeclaration;
|
49
48
|
getMemberBlock(): tree.TypeMemberDeclarationBlock;
|
50
|
-
getTypeEntity(analyzer: Analyzer): TypeEntityWithMembers | undefined;
|
51
49
|
getContextualTypeEntity(analyzer: Analyzer): TypeEntity | undefined;
|
52
50
|
}
|
53
51
|
export {};
|
@@ -7,6 +7,7 @@ export * from './Debug.js';
|
|
7
7
|
export * from './Delayed.js';
|
8
8
|
export * from './FormatString.js';
|
9
9
|
export * from './Interner.js';
|
10
|
+
export * from './JavaScriptIdentifier.js';
|
10
11
|
export * from './Lazy.js';
|
11
12
|
export * from './LocalizationHelper.js';
|
12
13
|
export * from './Logger.js';
|
@@ -14,8 +15,8 @@ export * from './Name.js';
|
|
14
15
|
export * from './NameFormatConversion.js';
|
15
16
|
export * from './NonEmptyArray.js';
|
16
17
|
export * from './Option.js';
|
17
|
-
export * from './PackageLocale.js';
|
18
18
|
export * from './PackageDialect.js';
|
19
|
+
export * from './PackageLocale.js';
|
19
20
|
export * from './Path.js';
|
20
21
|
export * from './PerformanceMeasurement.js';
|
21
22
|
export * from './Query.js';
|
@@ -1,21 +1,46 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { EntityNameProviderChain } from './EntityNameProviders.js';
|
1
|
+
import { Analyzer, SourcePackageDependencyGraph } from '../analysis/index.js';
|
2
|
+
import { CancellationToken, Uri } from '../common/index.js';
|
3
|
+
import { JavaScriptImplementationConfig, PlatformKind } from '../project/index.js';
|
4
|
+
import { NamedEntity, PackageEntity, PackageMemberEntity } from './Entities.js';
|
6
5
|
import * as ir from './ir/index.js';
|
7
|
-
import { SourceLocation } from './ir/index.js';
|
8
6
|
export declare class Emitter {
|
9
|
-
static LaunchFileName
|
10
|
-
static IndexFileName
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
7
|
+
static readonly LaunchFileName = "launch.mjs";
|
8
|
+
static readonly IndexFileName = "index.mjs";
|
9
|
+
readonly targetPlatform = PlatformKind.JavaScript;
|
10
|
+
private readonly _analyzer;
|
11
|
+
private readonly _declarationsUsageCountResults;
|
12
|
+
private readonly _options;
|
13
|
+
private readonly _entityMap;
|
14
|
+
private readonly _ectx;
|
15
|
+
private _packageGraph;
|
16
|
+
get packageGraph(): SourcePackageDependencyGraph;
|
17
|
+
private constructor();
|
18
|
+
static create(analyzer: Analyzer, options?: EmitOptions, cancellationToken?: CancellationToken): Promise<Emitter>;
|
19
|
+
emitToFileSystem(outputUri: Uri, outputAcceptor: OutputAcceptor): Promise<void>;
|
20
|
+
emitToString(): string;
|
21
|
+
private createEmitterPackageFromSource;
|
22
|
+
private enumerateEmittingSourcePackages;
|
23
|
+
private createPackageWithMainMethod;
|
24
|
+
private createMainMethod;
|
25
|
+
private createMainMethodCall;
|
26
|
+
private createUniqueNamesForPackageMembers;
|
27
|
+
private setOutputUris;
|
28
|
+
private addImports;
|
29
|
+
private addExportModifierToAllPackageMemberDeclarations;
|
30
|
+
private renameDeclarationsAndAddImportsInToStringMode;
|
31
|
+
private generateCode;
|
32
|
+
private generateCodeAndSourceMaps;
|
33
|
+
private prepareSourceMap;
|
34
|
+
}
|
35
|
+
export declare class EmitterPackage {
|
36
|
+
ir: ir.Package;
|
37
|
+
entity: PackageEntity;
|
38
|
+
outputUri: Uri;
|
39
|
+
packageLevelNames: ReadonlySet<string>;
|
40
|
+
entityNameOverrides: ReadonlyMap<NamedEntity, string> | undefined;
|
41
|
+
private _referencedPackageMembers;
|
42
|
+
constructor(ir: ir.Package, entity: PackageEntity);
|
43
|
+
getReferencedPackageMembers(): ReferencedPackageMembers;
|
19
44
|
}
|
20
45
|
export interface OutputAcceptor {
|
21
46
|
clearDirectory(uri: Uri): Promise<void>;
|
@@ -59,3 +84,12 @@ export declare enum ImportEmitKind {
|
|
59
84
|
*/
|
60
85
|
CustomWithFallbackToDynamic = 3
|
61
86
|
}
|
87
|
+
declare class ReferencedPackageMembers {
|
88
|
+
readonly entitiesByPackage: ReadonlyMap<PackageEntity, ReadonlySet<PackageMemberEntity>>;
|
89
|
+
constructor(entitiesByPackage: ReadonlyMap<PackageEntity, ReadonlySet<PackageMemberEntity>>);
|
90
|
+
excludeMembersOfPackage(entity: PackageEntity): ReferencedPackageMembers;
|
91
|
+
getNamesOfGlobalJsDeclarations(): ReadonlySet<string>;
|
92
|
+
getEntitiesFromJs(): ReadonlyMap<JavaScriptImplementationConfig, ReadonlySet<PackageMemberEntity>>;
|
93
|
+
getEntitiesFromArtel(): ReadonlyMap<PackageEntity, ReadonlySet<PackageMemberEntity>>;
|
94
|
+
}
|
95
|
+
export {};
|