@artel/artc 0.6.25254 → 0.6.25256
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 +18 -8
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +607 -389
- package/build/{chunk-JTDPRR7O.js → chunk-CTEZ5IHI.js} +2 -2
- package/build/{chunk-3JS4YG6N.js → chunk-ER3TEZSN.js} +14316 -16033
- package/build/{chunk-JV2EK6MS.js → chunk-IHZZGWNS.js} +1 -1
- package/build/types/analysis/AccessedFunction.d.ts +19 -6
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +2 -1
- package/build/types/analysis/Analyzer.d.ts +119 -47
- package/build/types/analysis/ArgumentToParameterMatchResult.d.ts +1 -4
- package/build/types/analysis/ArgumentsToParametersMatcher.d.ts +9 -15
- package/build/types/analysis/AutotypeCallExpressionMeaning.d.ts +13 -7
- package/build/types/analysis/BaseExpressionMeaning.d.ts +43 -15
- package/build/types/analysis/CallExpressionMeaning.d.ts +41 -22
- package/build/types/analysis/ConstructorCallResolver.d.ts +22 -0
- package/build/types/analysis/DiagnosticArgumentFactory.d.ts +3 -1
- package/build/types/analysis/DiagnosticCollector.d.ts +5 -9
- package/build/types/analysis/DisplayableEntity.d.ts +12 -6
- package/build/types/analysis/FunctionAccessResolver.d.ts +15 -0
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +56 -22
- package/build/types/analysis/IndexedAccessExpressionMeaning.d.ts +3 -2
- package/build/types/analysis/MemberAccessExpressionMeaning.d.ts +76 -27
- package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +0 -1
- package/build/types/analysis/NodeTypeUtils.d.ts +1 -0
- package/build/types/analysis/ObjectExpressionMeaning.d.ts +1 -0
- package/build/types/analysis/OperatorAccessResolver.d.ts +9 -0
- package/build/types/analysis/OverloadResolver.d.ts +91 -5
- package/build/types/analysis/ReturnTypeInferrer.d.ts +13 -0
- package/build/types/analysis/SourceFileMembers.d.ts +2 -0
- package/build/types/analysis/SubstitutedFunction.d.ts +22 -20
- package/build/types/analysis/TagMeaning.d.ts +16 -15
- package/build/types/analysis/TypeArgumentInferrer.d.ts +49 -0
- package/build/types/analysis/TypeNarrower.d.ts +6 -4
- package/build/types/analysis/TypeOverloadResolver.d.ts +4 -2
- package/build/types/analysis/UserDefinableBinaryOperatorResolver.d.ts +2 -6
- package/build/types/analysis/UserDefinableUnaryOperatorResolver.d.ts +2 -2
- package/build/types/analysis/Utils.d.ts +2 -0
- package/build/types/analysis/Visitor.d.ts +2 -2
- package/build/types/analysis/index.d.ts +0 -2
- package/build/types/analysis/semantic-context/Declarations.d.ts +4 -4
- package/build/types/analysis/semantic-context/SemanticContextBase.d.ts +4 -0
- package/build/types/analysis/semantic-context/SemanticContextBuilder.d.ts +1 -0
- package/build/types/api/Api.d.ts +0 -2
- package/build/types/common/ArrayUtils.d.ts +5 -2
- package/build/types/common/Cached.d.ts +4 -0
- package/build/types/common/Lazy.d.ts +2 -0
- package/build/types/common/Query.d.ts +1 -1
- package/build/types/common/TreeQuery.d.ts +14 -48
- package/build/types/common/TreeTraversal.d.ts +1 -1
- package/build/types/common/index.d.ts +0 -1
- package/build/types/diagnostic/Diagnostic.d.ts +7 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +180 -173
- package/build/types/entities/AliasTypeEntity.d.ts +1 -0
- package/build/types/entities/AliasedType.d.ts +2 -2
- package/build/types/entities/FunctionEntity.d.ts +6 -3
- package/build/types/entities/FunctionTypeEntity.d.ts +2 -1
- package/build/types/entities/PackageAliasEntity.d.ts +2 -2
- package/build/types/entities/PackageMembers.d.ts +1 -0
- package/build/types/entities/StructuredTypeEntity.d.ts +1 -0
- package/build/types/entities/TypeEntityMembers.d.ts +2 -0
- package/build/types/entities/TypeParameterEntity.d.ts +1 -0
- package/build/types/entities/VariableEntity.d.ts +23 -11
- package/build/types/entities/VariantTypeEntity.d.ts +1 -0
- package/build/types/entities/index.d.ts +3 -2
- package/build/types/parser/CharacterCodes.d.ts +0 -8
- package/build/types/parser/Parser.d.ts +2 -2
- package/build/types/parser/TriviaInterner.d.ts +8 -0
- package/build/types/services/AddPropertyAssignmentService.d.ts +0 -7
- package/build/types/services/DisplayService.d.ts +16 -10
- package/build/types/services/NodeSemanticInfo.d.ts +3 -1
- package/build/types/services/TreeUtils.d.ts +1 -1
- package/build/types/services/signature-help/SignatureWithValueParameters.d.ts +9 -1
- package/build/types/services/signature-help/TypeParameterSignatureHelpProvider.d.ts +1 -1
- package/build/types/services/source-generation/EntityToSyntax.d.ts +1 -1
- package/build/types/tree/BaseNode.d.ts +32 -0
- package/build/types/tree/{green/Nodes.d.ts → Nodes.d.ts} +411 -359
- package/build/types/tree/{green/SyntaxToCode.d.ts → SyntaxToCode.d.ts} +1 -1
- package/build/types/tree/{green/Token.d.ts → Token.d.ts} +26 -10
- package/build/types/tree/{red/Utils.d.ts → Utils.d.ts} +4 -3
- package/build/types/tree/index.d.ts +10 -1
- package/build/types/ts-interop/Entities.d.ts +14 -0
- package/build/types/types/AliasType.d.ts +2 -2
- package/build/types/types/FunctionType.d.ts +2 -2
- package/build/types/types/IntersectionType.d.ts +3 -3
- package/build/types/types/ParameterType.d.ts +2 -2
- package/build/types/types/StructuredType.d.ts +2 -2
- package/build/types/types/Substitutions.d.ts +18 -6
- package/build/types/types/Type.d.ts +3 -3
- package/build/types/types/TypeMembers.d.ts +2 -1
- package/build/types/types/UnionType.d.ts +3 -3
- package/build/types/types/UnresolvedType.d.ts +2 -2
- package/build/types/types/VariantType.d.ts +2 -2
- package/package.json +7 -1
- package/build/types/analysis/ConstructorOverloadResolver.d.ts +0 -31
- package/build/types/analysis/FunctionOverloadResolver.d.ts +0 -21
- package/build/types/analysis/TargetTypeHint.d.ts +0 -5
- package/build/types/common/Errors.d.ts +0 -2
- package/build/types/tree/green/BaseNode.d.ts +0 -14
- package/build/types/tree/green/Utils.d.ts +0 -2
- package/build/types/tree/green/index.d.ts +0 -8
- package/build/types/tree/red/BaseNode.d.ts +0 -16
- package/build/types/tree/red/Internal.d.ts +0 -2
- package/build/types/tree/red/Nodes.d.ts +0 -2271
- package/build/types/tree/red/Token.d.ts +0 -30
- package/build/types/tree/red/index.d.ts +0 -10
- /package/build/types/tree/{red/NodePath.d.ts → NodePath.d.ts} +0 -0
- /package/build/types/tree/{green/SyntaxFactory.d.ts → SyntaxFactory.d.ts} +0 -0
|
@@ -1,41 +1,53 @@
|
|
|
1
1
|
import { Name } from '../common/index.js';
|
|
2
|
-
import { FunctionEntity, ParameterVariableEntity, TypeParameterEntity } from '../entities/index.js';
|
|
2
|
+
import { FunctionEntity, MethodEntity, PackageOrNestedFunctionEntity, ParameterVariableEntity, TypeParameterEntity } from '../entities/index.js';
|
|
3
3
|
import * as types from '../types/index.js';
|
|
4
4
|
import { Analyzer } from './Analyzer.js';
|
|
5
5
|
import { SubstitutedFunction } from './SubstitutedFunction.js';
|
|
6
6
|
export type AccessedFunction = AccessedFunction_entity | AccessedFunction_typeMember | AccessedFunction_substitutedFunction;
|
|
7
|
+
export type NotSubstitutedAccessedFunction = AccessedFunction_entity | AccessedFunction_typeMember;
|
|
7
8
|
export declare class AccessedFunction_entity implements IAccessedFunction {
|
|
8
|
-
readonly value:
|
|
9
|
+
readonly value: PackageOrNestedFunctionEntity;
|
|
9
10
|
readonly kind = "entity";
|
|
10
|
-
|
|
11
|
+
private readonly _valueParameters;
|
|
12
|
+
private readonly _signatureType;
|
|
13
|
+
get debuggerDisplay(): string;
|
|
14
|
+
constructor(value: PackageOrNestedFunctionEntity);
|
|
11
15
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
12
16
|
getValueParameters(): readonly AccessedFunctionValueParameter[];
|
|
13
17
|
getReturnType(): types.Type;
|
|
14
|
-
getEntity():
|
|
18
|
+
getEntity(): PackageOrNestedFunctionEntity;
|
|
15
19
|
getName(): Name;
|
|
16
20
|
getSignatureType(analyzer: Analyzer): types.FunctionType;
|
|
21
|
+
applySubstitutions(substitutions: types.Substitutions): AccessedFunction;
|
|
22
|
+
getOuterSubstitutions(): types.Substitutions | undefined;
|
|
17
23
|
}
|
|
18
24
|
export declare class AccessedFunction_typeMember implements IAccessedFunction {
|
|
19
25
|
readonly value: types.Method;
|
|
20
26
|
readonly kind = "type-member";
|
|
27
|
+
private readonly _valueParameters;
|
|
28
|
+
get debuggerDisplay(): string;
|
|
21
29
|
constructor(value: types.Method);
|
|
22
30
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
23
31
|
getValueParameters(): readonly AccessedFunctionValueParameter[];
|
|
24
32
|
getReturnType(): types.Type;
|
|
25
|
-
getEntity():
|
|
33
|
+
getEntity(): MethodEntity;
|
|
26
34
|
getName(): Name;
|
|
27
35
|
getSignatureType(_analyzer: Analyzer): types.FunctionType;
|
|
36
|
+
applySubstitutions(substitutions: types.Substitutions): AccessedFunction;
|
|
37
|
+
getOuterSubstitutions(): types.Substitutions | undefined;
|
|
28
38
|
}
|
|
29
39
|
export declare class AccessedFunction_substitutedFunction implements IAccessedFunction {
|
|
30
40
|
readonly value: SubstitutedFunction;
|
|
31
41
|
readonly kind = "substituted-function";
|
|
42
|
+
get debuggerDisplay(): string;
|
|
32
43
|
constructor(value: SubstitutedFunction);
|
|
33
44
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
34
45
|
getValueParameters(): readonly AccessedFunctionValueParameter[];
|
|
35
46
|
getReturnType(): types.Type;
|
|
36
47
|
getEntity(): FunctionEntity;
|
|
37
48
|
getName(): Name;
|
|
38
|
-
getSignatureType(
|
|
49
|
+
getSignatureType(analyzer: Analyzer): types.FunctionType;
|
|
50
|
+
getOuterSubstitutions(): types.Substitutions | undefined;
|
|
39
51
|
}
|
|
40
52
|
export declare class AccessedFunctionValueParameter {
|
|
41
53
|
readonly entity: ParameterVariableEntity;
|
|
@@ -49,5 +61,6 @@ interface IAccessedFunction {
|
|
|
49
61
|
getEntity(): FunctionEntity;
|
|
50
62
|
getName(): Name;
|
|
51
63
|
getSignatureType(analyzer: Analyzer): types.FunctionType;
|
|
64
|
+
getOuterSubstitutions(): types.Substitutions | undefined;
|
|
52
65
|
}
|
|
53
66
|
export {};
|
|
@@ -22,6 +22,7 @@ export declare class AnalyzedTranslationPackage {
|
|
|
22
22
|
private readonly _constructorSignatureTranslations;
|
|
23
23
|
private readonly _indexerSignatureTranslations;
|
|
24
24
|
private readonly _translatedTypeHeaders;
|
|
25
|
+
private readonly _typeTranslationByEntity;
|
|
25
26
|
constructor(_analyzer: Analyzer, _package: TranslationPackage, _targetTarget: PackageEntity);
|
|
26
27
|
getTargetPackage(): PackageEntity;
|
|
27
28
|
getPackageInTranslatedLanguage(): PackageEntity;
|
|
@@ -63,7 +64,7 @@ export declare class AnalyzedTranslationPackage {
|
|
|
63
64
|
private createTranslatedSubprogramSignatureForDefaultConstructor;
|
|
64
65
|
private createTranslatedTypeSignature;
|
|
65
66
|
private enumerateTranslationsDeclarations;
|
|
66
|
-
private
|
|
67
|
+
private getTypeEntityTranslationNode;
|
|
67
68
|
}
|
|
68
69
|
export declare class TranslatedPackageMembers {
|
|
69
70
|
private readonly _namedMembers;
|
|
@@ -19,26 +19,22 @@ import { ArgumentToParameterMatchResult, MatchResultValueParameter } from './Arg
|
|
|
19
19
|
import * as autotypeCallExpressionMeaning from './AutotypeCallExpressionMeaning.js';
|
|
20
20
|
import * as baseExpressionMeaning from './BaseExpressionMeaning.js';
|
|
21
21
|
import * as callExpressionMeaning from './CallExpressionMeaning.js';
|
|
22
|
-
import * as constructorOverloadResolver from './ConstructorOverloadResolver.js';
|
|
23
22
|
import { DeclarationsUsageMap } from './DeclarationsUsageCounter.js';
|
|
24
23
|
import * as dereferenceExpressionMeaning from './DereferenceExpressionMeaning.js';
|
|
25
24
|
import { DiagnosticArgumentFactory } from './DiagnosticArgumentFactory.js';
|
|
26
|
-
import * as functionOverloadResolver from './FunctionOverloadResolver.js';
|
|
27
25
|
import * as identifierExpressionResolution from './IdentifierExpressionMeaning.js';
|
|
28
26
|
import { ImportedPackageNameTree, PackageNameTreeNode } from './ImportedPackageNameTree.js';
|
|
29
27
|
import * as indexedAccessExpressionMeaning from './IndexedAccessExpressionMeaning.js';
|
|
30
28
|
import * as memberAccessExpressionResolution from './MemberAccessExpressionMeaning.js';
|
|
31
29
|
import { ModifierFlags } from './ModifierFlags.js';
|
|
32
30
|
import { NamedTypeSpecifierResolutionResult } from './NamedTypeSpecifierResolver.js';
|
|
33
|
-
import { DereferencedVariableAccessorDeclaration, FieldAccessorDeclaration, FunctionTypeDeclaration, GetterDeclaration, IndexedElementAccessorDeclaration, PackageVariableAccessorDeclaration, SetterDeclaration, StructuredTypeDeclaration, TypeDeclaration, TypeWithMembersDeclaration, VariantTypeDeclaration } from './NodeTypeUtils.js';
|
|
31
|
+
import { DereferencedVariableAccessorDeclaration, FieldAccessorDeclaration, FunctionDeclaration, FunctionTypeDeclaration, GetterDeclaration, IndexedElementAccessorDeclaration, PackageVariableAccessorDeclaration, RegularOrBlockFunctionLiteral, SetterDeclaration, StructuredTypeDeclaration, TypeDeclaration, TypeWithMembersDeclaration, VariantTypeDeclaration } from './NodeTypeUtils.js';
|
|
34
32
|
import * as objectExpressionMeaning from './ObjectExpressionMeaning.js';
|
|
35
33
|
import { OwnAndBaseConstructorCallsCheckResult } from './OwnAndBaseConstructorCallsChecker.js';
|
|
36
34
|
import { SourceFileMembers as ActualSourceFileMembers } from './SourceFileMembers.js';
|
|
37
35
|
import * as tagMeaning from './TagMeaning.js';
|
|
38
36
|
import * as tags from './Tags.js';
|
|
39
|
-
import { TargetTypeHint } from './TargetTypeHint.js';
|
|
40
37
|
import { TypeMemberImplementationCheckResult } from './TypeMemberImplementationChecker.js';
|
|
41
|
-
import * as typeOverloadResolver from './TypeOverloadResolver.js';
|
|
42
38
|
import * as controlFlow from './control-flow/index.js';
|
|
43
39
|
import { WellKnownDeclarations } from './index.js';
|
|
44
40
|
import * as semanticContext from './semantic-context/index.js';
|
|
@@ -72,31 +68,34 @@ export declare class Analyzer {
|
|
|
72
68
|
readonly owningPlainObjectModificationCheck: OwningPlainObjectModificationCheck;
|
|
73
69
|
readonly packageImports: PackageImports;
|
|
74
70
|
readonly typeUtils: TypeUtils;
|
|
71
|
+
readonly signatureComparer: SignatureComparer;
|
|
75
72
|
readonly conflictsCheck: ConflictsCheck;
|
|
73
|
+
readonly typeAssignabilityCheck: TypeAssignabilityCheck;
|
|
76
74
|
private readonly _tsInteropInputs;
|
|
77
75
|
private readonly _targetType;
|
|
78
|
-
private readonly _typeAssignabilityCheck;
|
|
79
76
|
private readonly _tsInterop;
|
|
80
77
|
private readonly _memberAccessExpressionResolutionResults;
|
|
78
|
+
private readonly _memberAccessExpressionResolutionResultsFirstStage;
|
|
81
79
|
private readonly _sourceFileMembers;
|
|
82
|
-
private readonly
|
|
80
|
+
private readonly _callExpressionResolutionResults;
|
|
83
81
|
private readonly _indexedAccessExpressionResolutionResults;
|
|
84
82
|
private readonly _dereferenceExpressionMeanings;
|
|
85
|
-
private readonly
|
|
83
|
+
private readonly _autotypeCallExpressionResolutionResults;
|
|
86
84
|
private readonly _identifierExpressionResolutionResults;
|
|
85
|
+
private readonly _identifierExpressionResolutionResultsFirstStage;
|
|
87
86
|
private readonly _tagResolutionResults;
|
|
88
87
|
private readonly _objectExpressionResolutionResults;
|
|
88
|
+
private readonly _baseExpressionResolutionResultsFirstStage;
|
|
89
89
|
private readonly _baseExpressionResolutionResults;
|
|
90
90
|
private readonly _namedTypeSpecifierResolutionResults;
|
|
91
91
|
private readonly _prefixUnaryExpressionOperatorResolutionResults;
|
|
92
92
|
private readonly _binaryExpressionUserDefinableOperatorResolutionResults;
|
|
93
93
|
private readonly _assignmentStatementOperatorResolutionResults;
|
|
94
|
-
private readonly _functionEntitySignatureTypes;
|
|
95
94
|
private readonly _valueParametersOfFunctionBlockLiterals;
|
|
96
95
|
private readonly _extendedTypes;
|
|
97
96
|
private readonly _analyzedTranslationPackages;
|
|
98
97
|
private readonly _linkedMultiPlatformPackagesByPlatform;
|
|
99
|
-
private readonly
|
|
98
|
+
private readonly _isFunctionGeneratorCheckResults;
|
|
100
99
|
private readonly _namedDeclarationsUsageCountResults;
|
|
101
100
|
private readonly _packageAndStaticVariablesInitializationDiagnostics;
|
|
102
101
|
private readonly _controlFlowGraphs;
|
|
@@ -111,6 +110,7 @@ export declare class Analyzer {
|
|
|
111
110
|
private readonly _localizedStandardTypes;
|
|
112
111
|
private readonly _ownAndBaseConstructorCallsCheckResults;
|
|
113
112
|
private readonly _expressionCanBeUsedInForLoopCheckResults;
|
|
113
|
+
private readonly _nameByIdentifierText;
|
|
114
114
|
get tsInterop(): TsInteropContext;
|
|
115
115
|
constructor(compilation: project.Compilation, tsInteropInputs: TsInteropInputs);
|
|
116
116
|
getProjectSourceFile(node: tree.SourceFile): project.SourceFile;
|
|
@@ -118,6 +118,7 @@ export declare class Analyzer {
|
|
|
118
118
|
isEnumeratorMethodSignature(entity: e.MethodEntity): boolean;
|
|
119
119
|
ifTypeEnumerableThenItemType(type: types.Type): types.Type | undefined;
|
|
120
120
|
ifTypeEnumeratorThenItemType(type: types.Type): types.Type | undefined;
|
|
121
|
+
ifTypeEnumerableOrEnumeratorThenItemType(type: types.Type): types.Type | undefined;
|
|
121
122
|
isTypeArrayOrReadonlyArray(type: types.Type): {
|
|
122
123
|
elementType: types.Type;
|
|
123
124
|
} | undefined;
|
|
@@ -129,27 +130,25 @@ export declare class Analyzer {
|
|
|
129
130
|
checkBlockInvokesAsyncMethods(node: tree.StatementBlock | tree.FunctionBlock): boolean;
|
|
130
131
|
getSyntacticAccessKind(node: tree.Expression): SyntacticAccessKind;
|
|
131
132
|
getTypeMemberEntityContainer(node: tree.TypeMemberDeclaration): e.TypeMemberEntityContainer;
|
|
132
|
-
getTargetTypeOfExpression(node: tree.Expression,
|
|
133
|
+
getTargetTypeOfExpression(node: tree.Expression, analysisOptions?: ExpressionAnalysisOptions): types.Type | undefined;
|
|
133
134
|
getUnambiguousTargetFunctionType(targetType: types.Type | undefined): types.FunctionType | undefined;
|
|
134
135
|
getUnambiguousTargetArrayType(targetType: types.Type | undefined): types.Type | undefined;
|
|
135
136
|
getEnumeratorElementType(node: tree.Node): types.Type | undefined;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
resolveConstructorOverload<TCandidate extends constructorOverloadResolver.ICandidate<TValueParameter>, TValueParameter extends constructorOverloadResolver.IValueParameter>(candidates: readonly TCandidate[], args: readonly tree.Argument[]): readonly TCandidate[];
|
|
139
|
-
resolveTypeOverloadByArgumentCount<TCandidate extends typeOverloadResolver.ICandidate>(candidates: readonly TCandidate[], argumentCount: number): readonly TCandidate[];
|
|
140
|
-
resolveMemberAccessExpression(node: tree.MemberAccessExpression, targetTypeHint?: TargetTypeHint): memberAccessExpressionResolution.ResolutionResult;
|
|
137
|
+
resolveMemberAccessExpressionFirstStage(node: tree.MemberAccessExpression): memberAccessExpressionResolution.FirstStageResolutionResult;
|
|
138
|
+
resolveMemberAccessExpression(node: tree.MemberAccessExpression, analysisOptions?: ExpressionAnalysisOptions): memberAccessExpressionResolution.ResolutionResult;
|
|
141
139
|
enumeratePackageImports(packageImportDirectives: Iterable<tree.PackageImportDirective>): Iterable<tree.PackageImport>;
|
|
142
140
|
getSourceFileMembers(node: tree.SourceFile): ActualSourceFileMembers;
|
|
143
|
-
|
|
144
|
-
getCallExpressionType(node: tree.CallExpression): types.Type;
|
|
141
|
+
resolveCallExpression(node: tree.CallExpression, analysisOptions?: ExpressionAnalysisOptions): callExpressionMeaning.ResolutionResult;
|
|
145
142
|
getRespectiveParameter(node: tree.Argument): MatchResultValueParameter | undefined;
|
|
146
143
|
resolveIndexedAccessExpression(node: tree.IndexedAccessExpression): indexedAccessExpressionMeaning.ResolutionResult;
|
|
147
144
|
getDereferenceExpressionMeaning(node: tree.DereferenceExpression): dereferenceExpressionMeaning.Meaning;
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
resolveAutotypeCallExpression(node: tree.AutotypeCallExpression, analysisOptions?: ExpressionAnalysisOptions): autotypeCallExpressionMeaning.ResolutionResult;
|
|
146
|
+
resolveIdentifierExpressionFirstStage(node: tree.IdentifierExpression): identifierExpressionResolution.FirstStageResolutionResult;
|
|
147
|
+
resolveIdentifierExpression(node: tree.IdentifierExpression, analysisOptions?: ExpressionAnalysisOptions): identifierExpressionResolution.ResolutionResult;
|
|
150
148
|
resolveTag(node: tree.Tag): tagMeaning.ResolutionResult;
|
|
151
149
|
resolveObjectExpression(node: tree.ObjectExpression): objectExpressionMeaning.ResolutionResult;
|
|
152
|
-
|
|
150
|
+
resolveBaseExpressionFirstStage(node: tree.BaseExpression): baseExpressionMeaning.FirstStageResolutionsResult;
|
|
151
|
+
resolveBaseExpression(node: tree.BaseExpression): baseExpressionMeaning.ResolutionResult;
|
|
153
152
|
/**
|
|
154
153
|
* Проверяет, является ли выражение цепочкой доступов через `?`, заканчивающейся выражением, тип которого допускает
|
|
155
154
|
* `пусто`.
|
|
@@ -199,7 +198,14 @@ export declare class Analyzer {
|
|
|
199
198
|
checkExpressionDenotesPackageNameSegment(expression: tree.Expression): {
|
|
200
199
|
packageTreeNode: PackageNameTreeNode;
|
|
201
200
|
} | undefined;
|
|
202
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Функция считается генератором, если:
|
|
203
|
+
* - Использует команду `выдать`.
|
|
204
|
+
* - Не использует команду `выдать`, но её возвращаемым типом является `Перебираемый` или `Перебор`, она не
|
|
205
|
+
* возвращает значение и не использует переменную `результат` (использование команды `вернуть` без указания
|
|
206
|
+
* возвращаемого значения допустимо). В таком случае это генератор, не возвращающий ни одного элемента.
|
|
207
|
+
*/
|
|
208
|
+
isFunctionGenerator(node: FunctionDeclaration): boolean;
|
|
203
209
|
enumerateAspects(type: types.Type): Iterable<types.StructuredType>;
|
|
204
210
|
checkTypeIsBasedOnAspect(type: types.Type, aspectEntity: e.StructuredTypeEntity): boolean;
|
|
205
211
|
resolvePrefixUnaryExpressionUserDefinableOperator(node: tree.PrefixUnaryExpression): WithDiagnostics<types.Operator>;
|
|
@@ -256,7 +262,6 @@ export declare class Analyzer {
|
|
|
256
262
|
excludeTypeFromUnion(initialType: types.Type, excludedType: types.Type): types.Type;
|
|
257
263
|
isValueParameterVariadic(entity: e.VariableEntity): boolean;
|
|
258
264
|
getDefaultTypeParameterConstraint(locale: PackageLocale): types.Type;
|
|
259
|
-
getSignatureTypeOfFunctionEntity(entity: e.FunctionEntity): types.FunctionType;
|
|
260
265
|
getFunctionBlockLiteralValueParameters(node: tree.FunctionBlockLiteral): readonly e.ParameterVariableEntity[];
|
|
261
266
|
getExtendedType(node: tree.TypeExtensionDeclaration): WithDiagnostics<e.NamedTypeEntity>;
|
|
262
267
|
getAnalyzedTranslationPackageIfTargetResolved(package_: project.TranslationPackage): AnalyzedTranslationPackage | undefined;
|
|
@@ -293,7 +298,7 @@ export declare class Analyzer {
|
|
|
293
298
|
basicMethodOfOriginalType: e.MethodEntity;
|
|
294
299
|
} | undefined;
|
|
295
300
|
getControlFlowGraph(sourceFile: project.SourceFile): controlFlow.GraphBuildResult;
|
|
296
|
-
createAmbiguousEntityAccessDiagnostic(entities: readonly e.Entity[], node: tree.Node): Diagnostic;
|
|
301
|
+
createAmbiguousEntityAccessDiagnostic(entities: readonly e.Entity[], node: tree.Node, diagnosticArgumentFactory?: DiagnosticArgumentFactory): Diagnostic;
|
|
297
302
|
createAmbiguousFunctionAccessDiagnostic(functions: readonly AccessedFunction[], node: tree.Node): Diagnostic;
|
|
298
303
|
createAmbiguousTypeMemberAccessDiagnostic(members: readonly types.TypeMember[], node: tree.Node): Diagnostic;
|
|
299
304
|
createAmbiguousNamedScopeDeclarationAccessDiagnostic(declarations: readonly semanticContext.NamedDeclaration[], node: tree.Node): Diagnostic;
|
|
@@ -311,8 +316,12 @@ export declare class Analyzer {
|
|
|
311
316
|
determineUnderlyingTypeOfSourceVariantType(memberList: tree.TypeMemberDeclarationList): types.Type;
|
|
312
317
|
getOwnAndBaseConstructorCallsCheckResult(node: TypeWithMembersDeclaration): OwnAndBaseConstructorCallsCheckResult;
|
|
313
318
|
isConstructorCallingOwnConstructor(node: tree.ConstructorDeclaration): boolean;
|
|
314
|
-
|
|
315
|
-
|
|
319
|
+
ifCalleeThenCallExpression(node: tree.Expression): tree.CallExpression | undefined;
|
|
320
|
+
getNodeForAmbiguousAccessDiagnostic(access: tree.Expression): tree.Node;
|
|
321
|
+
isPossibleWrappedTargetTypeDependentFunctionLiteral(node: tree.Expression): boolean;
|
|
322
|
+
isTargetTypeDependentFunctionLiteral(node: tree.Expression): node is RegularOrBlockFunctionLiteral;
|
|
323
|
+
checkTypeArgumentCount(typeArgumentCount: number, typeParameters: readonly e.TypeParameterEntity[], diagnostics?: DiagnosticAcceptor, nodeForDiagnostic?: tree.Node): boolean;
|
|
324
|
+
checkTypeCanBeUsedAsValue(typeAccess: tree.Expression): boolean;
|
|
316
325
|
private createTsInterop;
|
|
317
326
|
}
|
|
318
327
|
export declare class TsInteropInputs {
|
|
@@ -348,14 +357,14 @@ declare class Type {
|
|
|
348
357
|
private readonly _unionTypeSpecifierTypes;
|
|
349
358
|
private readonly _intersectionTypeSpecifierTypes;
|
|
350
359
|
private readonly _functionLiteralTypes;
|
|
351
|
-
private readonly
|
|
360
|
+
private readonly _nodesForWhichReturnTypeInferenceDiagnosticHasBeenReported;
|
|
352
361
|
constructor(_analyzer: Analyzer);
|
|
353
|
-
ofExpression(node: tree.Expression,
|
|
362
|
+
ofExpression(node: tree.Expression, analysisOptions?: ExpressionAnalysisOptions): types.Type;
|
|
354
363
|
ofTypeSpecifier(node: tree.TypeSpecifier): types.Type;
|
|
355
|
-
ofAccessedFunction(accessedFunction: AccessedFunction): types.Type;
|
|
356
364
|
ofAccessedOperator(operator: types.Operator): types.Type;
|
|
357
|
-
|
|
358
|
-
|
|
365
|
+
ofRegularOrBlockFunctionLiteral(node: RegularOrBlockFunctionLiteral, analysisOptions?: ExpressionAnalysisOptions): types.FunctionType;
|
|
366
|
+
ofFunctionBlockLiteral(node: tree.FunctionBlockLiteral, analysisOptions?: ExpressionAnalysisOptions): types.FunctionType;
|
|
367
|
+
ofFunctionLiteral(node: tree.FunctionLiteral, analysisOptions?: ExpressionAnalysisOptions): types.FunctionType;
|
|
359
368
|
private ofArrayLiteral;
|
|
360
369
|
private ofAssertionExpression;
|
|
361
370
|
private ofAssumptionExpression;
|
|
@@ -396,9 +405,11 @@ declare class Type {
|
|
|
396
405
|
private ofUnionTypeSpecifier;
|
|
397
406
|
private ofIntersectionTypeSpecifier;
|
|
398
407
|
private ofInvalidTypeSpecifier;
|
|
399
|
-
private
|
|
400
|
-
private
|
|
401
|
-
private
|
|
408
|
+
private createFunctionLiteralType;
|
|
409
|
+
private createFunctionBlockLiteralType;
|
|
410
|
+
private inferAndCacheReturnTypeOfRegularOrBlockFunctionLiteral;
|
|
411
|
+
private replaceReturnTypeOfFunctionType;
|
|
412
|
+
private reportReturnTypeCanNotBeInferredDiagnostic;
|
|
402
413
|
private getNarrowedTypeIfNarrowableReference;
|
|
403
414
|
}
|
|
404
415
|
declare class ReturnType {
|
|
@@ -416,6 +427,7 @@ declare class ReturnType {
|
|
|
416
427
|
ofFieldGetterDeclaration(node: tree.FieldGetterDeclaration): types.Type;
|
|
417
428
|
ofDereferencedVariableGetterDeclaration(node: tree.DereferencedVariableGetterDeclaration): types.Type;
|
|
418
429
|
ofIndexedElementGetterDeclaration(node: tree.IndexedElementGetterDeclaration): types.Type;
|
|
430
|
+
ofFunctionDeclaration(node: FunctionDeclaration): types.Type;
|
|
419
431
|
}
|
|
420
432
|
declare class Entity {
|
|
421
433
|
private readonly _analyzer;
|
|
@@ -492,18 +504,12 @@ declare class Entity {
|
|
|
492
504
|
ofPackageImport(node: tree.PackageImport): e.PackageAliasEntity;
|
|
493
505
|
ofTypeWithMembersDeclaration(node: TypeWithMembersDeclaration): e.TypeEntityWithMembers;
|
|
494
506
|
ofTranslationTextTemplateParameter(node: tree.TranslationTextTemplateParameter): e.TranslationTextTemplateParameterEntity;
|
|
495
|
-
ofTextLiteral(node: tree.TextLiteral): e.LocalizableSimpleTextEntity;
|
|
496
|
-
ofTextTemplateLiteral(node: tree.TextTemplateLiteral): e.LocalizableTextTemplateEntity;
|
|
497
|
-
private ensureLocalizableTextEntitiesCreated;
|
|
498
507
|
private getContainingPackageLoadedFromDts;
|
|
499
508
|
private createComputedFieldEntities;
|
|
500
509
|
private createDereferenceOperatorEntities;
|
|
501
510
|
private createIndexerEntities;
|
|
502
511
|
private areIndexedElementAccessorDeclarationsEqual;
|
|
503
512
|
}
|
|
504
|
-
type EntityClassMembers = Entity[keyof Entity];
|
|
505
|
-
type GetNodesFromMethodsParameter<T> = T extends (node: infer TNode) => e.Entity ? (TNode extends tree.Node ? TNode : never) : never;
|
|
506
|
-
export type NodeCorrespondingToEntity = GetNodesFromMethodsParameter<EntityClassMembers>;
|
|
507
513
|
declare class ResultLocalVariableEntity {
|
|
508
514
|
private readonly _analyzer;
|
|
509
515
|
private readonly _entities;
|
|
@@ -518,6 +524,7 @@ declare class ResultLocalVariableEntity {
|
|
|
518
524
|
ofFieldGetterDeclaration(node: tree.FieldGetterDeclaration): e.LocalVariableEntity;
|
|
519
525
|
ofIndexedElementGetterDeclaration(node: tree.IndexedElementGetterDeclaration): e.LocalVariableEntity;
|
|
520
526
|
ofDereferencedVariableGetterDeclaration(node: tree.DereferencedVariableGetterDeclaration): e.LocalVariableEntity;
|
|
527
|
+
ofFunctionDeclaration(node: FunctionDeclaration): e.LocalVariableEntity;
|
|
521
528
|
private createResultLocalVariableEntity;
|
|
522
529
|
}
|
|
523
530
|
declare class ValueLocalVariableEntity {
|
|
@@ -528,6 +535,7 @@ declare class ValueLocalVariableEntity {
|
|
|
528
535
|
ofFieldSetterDeclaration(node: tree.FieldSetterDeclaration): e.LocalVariableEntity;
|
|
529
536
|
ofIndexedElementSetterDeclaration(node: tree.IndexedElementSetterDeclaration): e.LocalVariableEntity;
|
|
530
537
|
ofDereferencedVariableSetterDeclaration(node: tree.DereferencedVariableSetterDeclaration): e.LocalVariableEntity;
|
|
538
|
+
private createValueLocalVariableEntity;
|
|
531
539
|
}
|
|
532
540
|
declare class OverriddenMember {
|
|
533
541
|
private readonly _analyzer;
|
|
@@ -662,6 +670,32 @@ declare class OwningPlainObjectModificationCheck {
|
|
|
662
670
|
private checkReceiverModifiesPlainObjectRecursively;
|
|
663
671
|
private nodeBelongsToPlainObjectDeclaration;
|
|
664
672
|
}
|
|
673
|
+
declare class TypeAssignabilityCheck {
|
|
674
|
+
private readonly _analyzer;
|
|
675
|
+
constructor(_analyzer: Analyzer);
|
|
676
|
+
isTypeAssignableTo(source: types.Type, target: types.Type): boolean;
|
|
677
|
+
getAssignabilityFlags(source: types.Type, target: types.Type): TypeAssignabilityFlags;
|
|
678
|
+
/**
|
|
679
|
+
* Определяет, насколько данный вид совместимости типов более предпочтителен при определении совместимости союзного
|
|
680
|
+
* тип с другим, а также при определении наиболее подходящей перегрузки. Чем выше счёт - тем вид более предпочтителен.
|
|
681
|
+
*/
|
|
682
|
+
getSingleFlagScore(flag: TypeAssignabilityFlags): number;
|
|
683
|
+
getLowestFlagsScore(flags: TypeAssignabilityFlags): number;
|
|
684
|
+
private getAssignabilityFlagsForStructuredTypes;
|
|
685
|
+
/**
|
|
686
|
+
* @example
|
|
687
|
+
* ```artel
|
|
688
|
+
* пусть а = операция(п: Текст): Объект { }
|
|
689
|
+
* пусть б = операция(п: Объект): Текст { }
|
|
690
|
+
*
|
|
691
|
+
* а = б // Корректно
|
|
692
|
+
* б = а // Ошибка
|
|
693
|
+
* ```
|
|
694
|
+
*/
|
|
695
|
+
private getAssignabilityFlagsForFunctionTypes;
|
|
696
|
+
private areNewFlagsBetter;
|
|
697
|
+
private getFlagCount;
|
|
698
|
+
}
|
|
665
699
|
export declare enum TypeAssignabilityFlags {
|
|
666
700
|
None = 0,
|
|
667
701
|
/**
|
|
@@ -701,8 +735,8 @@ export declare class AnalyzedPackageImports {
|
|
|
701
735
|
}
|
|
702
736
|
export declare class PackageImportInfo {
|
|
703
737
|
readonly entity: e.PackageEntity;
|
|
704
|
-
readonly
|
|
705
|
-
constructor(entity: e.PackageEntity,
|
|
738
|
+
readonly aliasEntity: e.PackageAliasEntity | undefined;
|
|
739
|
+
constructor(entity: e.PackageEntity, aliasEntity: e.PackageAliasEntity | undefined);
|
|
706
740
|
}
|
|
707
741
|
declare class TypeUtils {
|
|
708
742
|
private readonly _analyzer;
|
|
@@ -712,7 +746,10 @@ declare class TypeUtils {
|
|
|
712
746
|
removeDerivedTypesInPlace(types: types.Type[]): void;
|
|
713
747
|
getBaseOrAliasedTypes(type: types.Type): readonly types.Type[];
|
|
714
748
|
getPossiblyAliasedBaseObjectType(type: types.Type): types.Type | undefined;
|
|
749
|
+
getPossiblyAliasedBaseAspectTypes(type: types.Type): readonly types.Type[] | undefined;
|
|
750
|
+
getBaseObjectTypeOrAliasedType(type: types.Type): types.Type | undefined;
|
|
715
751
|
getBaseAndAliasedTypesRecursively(type: types.Type): readonly types.Type[];
|
|
752
|
+
isTypeDerivedFromOrEqualsTo(source: types.Type, target: types.Type, considerTypeArguments?: boolean): boolean;
|
|
716
753
|
private collectBaseAndAliasedTypesRecursively;
|
|
717
754
|
private getBaseTypesForCommonTypesSearch;
|
|
718
755
|
private addTypeAndCollectAllBaseTypes;
|
|
@@ -720,10 +757,37 @@ declare class TypeUtils {
|
|
|
720
757
|
private getFlattenedConstituentTypesForCommonTypesSearch;
|
|
721
758
|
private flattenTypeParameterConstraint;
|
|
722
759
|
}
|
|
723
|
-
declare class
|
|
760
|
+
declare class SignatureComparer {
|
|
724
761
|
private readonly _analyzer;
|
|
725
762
|
private _stubParameterTypes;
|
|
726
763
|
constructor(_analyzer: Analyzer);
|
|
764
|
+
areEqualFunctionEntities(function1: e.FunctionEntity, function2: e.FunctionEntity, options: SignatureComparisonOptions): boolean;
|
|
765
|
+
/**
|
|
766
|
+
* Метод аналогичен методу {@link areEqualFunctionEntities}.
|
|
767
|
+
*/
|
|
768
|
+
areEqualMethods(method1: types.Method, method2: types.Method, options: SignatureComparisonOptions): boolean;
|
|
769
|
+
/**
|
|
770
|
+
* Проверяет, конфликтуют две сущности, имеющие параметры, но не имеющие параметры типа.
|
|
771
|
+
*
|
|
772
|
+
* Отношение "сущности, имеющие только параметры, конфликтуют" является транзитивным.
|
|
773
|
+
*/
|
|
774
|
+
areEqualSignaturesWithoutTypeParameters(entity1: EntityWithoutTypeParametersInSignature, entity2: EntityWithoutTypeParametersInSignature): boolean;
|
|
775
|
+
areEqualTypeMemberSignaturesWithoutTypeParameters(member1: TypeMemberWithoutTypeParametersInSignature, member2: TypeMemberWithoutTypeParametersInSignature): boolean;
|
|
776
|
+
doTypeParameterCountsIntersect(typeParameters1: readonly e.TypeParameterEntity[], typeParameters2: readonly e.TypeParameterEntity[]): boolean;
|
|
777
|
+
private areEqualParameters;
|
|
778
|
+
private areEqualTypeMemberParameters;
|
|
779
|
+
private createSubstitutionsWithStubTypes;
|
|
780
|
+
}
|
|
781
|
+
export declare enum SignatureComparisonOptions {
|
|
782
|
+
None = 0,
|
|
783
|
+
CompareNames = 1,
|
|
784
|
+
CompareReturnTypes = 2,
|
|
785
|
+
CheckTypeParameterCountIntersection = 4
|
|
786
|
+
}
|
|
787
|
+
declare class ConflictsCheck {
|
|
788
|
+
private readonly _analyzer;
|
|
789
|
+
private static readonly _signatureComparisonOptions;
|
|
790
|
+
constructor(_analyzer: Analyzer);
|
|
727
791
|
/**
|
|
728
792
|
* Проверяет, конфликтуют ли две функции, т.е. могут ли такие функции находиться в одной области видимости.
|
|
729
793
|
* Метод не сравнивает имена.
|
|
@@ -760,10 +824,6 @@ declare class ConflictsCheck {
|
|
|
760
824
|
* {@link doFunctionSignaturesConflict}).
|
|
761
825
|
*/
|
|
762
826
|
doPackageTypesConflict(type1: e.PackageTypeEntity, type2: e.PackageTypeEntity): boolean;
|
|
763
|
-
doTypeArgumentCountsIntersect(typeParameters1: readonly e.TypeParameterEntity[], typeParameters2: readonly e.TypeParameterEntity[]): boolean;
|
|
764
|
-
private doParametersConflict;
|
|
765
|
-
private doTypeMemberParametersConflict;
|
|
766
|
-
private createSubstitutionMapWithStubTypes;
|
|
767
827
|
}
|
|
768
828
|
export type EntityWithoutTypeParametersInSignature = e.ConstructorEntity | e.DestructorEntity | e.OperatorEntity | e.IndexerEntity;
|
|
769
829
|
export type TypeMemberWithoutTypeParametersInSignature = types.Constructor | types.Destructor | types.Operator | types.Indexer;
|
|
@@ -771,6 +831,7 @@ export declare class ExpressionDenotesFunctionCheckResult {
|
|
|
771
831
|
readonly candidates: readonly AccessedFunction[];
|
|
772
832
|
readonly suitableFunctions: readonly AccessedFunction[];
|
|
773
833
|
get singleSuitableFunction(): AccessedFunction | undefined;
|
|
834
|
+
get singleFunction(): AccessedFunction | undefined;
|
|
774
835
|
constructor(candidates: readonly AccessedFunction[], suitableFunctions: readonly AccessedFunction[]);
|
|
775
836
|
}
|
|
776
837
|
export declare class ExpressionDenotesOperatorCheckResult {
|
|
@@ -790,4 +851,15 @@ export declare class DeclaredTypeMemberEntities {
|
|
|
790
851
|
get namedMembers(): e.NamedTypeMemberEntity[];
|
|
791
852
|
constructor(variables: readonly e.FieldEntity[], methods: readonly e.MethodEntity[], operators: readonly e.OperatorEntity[], constructors: readonly e.ConstructorEntity[], destructors: readonly e.DestructorEntity[], indexers: readonly e.SourceIndexerEntity[], dereferenceOperators: readonly e.DereferenceOperatorEntity[]);
|
|
792
853
|
}
|
|
854
|
+
export declare class ExpressionAnalysisOptions {
|
|
855
|
+
readonly targetType: types.Type | undefined;
|
|
856
|
+
readonly allowCaching: boolean;
|
|
857
|
+
readonly isResolvingOverload: boolean;
|
|
858
|
+
constructor(targetType: types.Type | undefined, allowCaching: boolean, isResolvingOverload: boolean);
|
|
859
|
+
static withTargetType(options: ExpressionAnalysisOptions | undefined, targetType: types.Type | undefined): ExpressionAnalysisOptions;
|
|
860
|
+
withTargetType(targetType: types.Type | undefined): ExpressionAnalysisOptions;
|
|
861
|
+
withAllowCaching(allowCaching: boolean): ExpressionAnalysisOptions;
|
|
862
|
+
withIsResolvingOverload(isResolvingOverload: boolean): ExpressionAnalysisOptions;
|
|
863
|
+
withTargetTypeAndAllowCaching(targetType: types.Type | undefined, allowCaching: boolean): ExpressionAnalysisOptions;
|
|
864
|
+
}
|
|
793
865
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
2
1
|
import { ParameterVariableEntity } from '../entities/index.js';
|
|
3
2
|
import * as tree from '../tree/index.js';
|
|
4
3
|
import * as types from '../types/index.js';
|
|
@@ -16,9 +15,7 @@ export declare class ArgumentToParameterMatchResult {
|
|
|
16
15
|
}
|
|
17
16
|
export declare class MatchResult {
|
|
18
17
|
readonly parameterByArgument: ReadonlyMap<tree.Argument, MatchResultValueParameter>;
|
|
19
|
-
|
|
20
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
21
|
-
constructor(parameterByArgument: ReadonlyMap<tree.Argument, MatchResultValueParameter>, unmatchedParameters: readonly MatchResultValueParameter[], diagnostics: readonly Diagnostic[]);
|
|
18
|
+
constructor(parameterByArgument: ReadonlyMap<tree.Argument, MatchResultValueParameter>);
|
|
22
19
|
}
|
|
23
20
|
export declare class MatchResultValueParameter {
|
|
24
21
|
readonly entity: ParameterVariableEntity;
|
|
@@ -1,44 +1,38 @@
|
|
|
1
1
|
import { Name } from '../common/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { DiagnosticAcceptor, DiagnosticLocation } from '../diagnostic/Diagnostic.js';
|
|
3
3
|
import * as tree from '../tree/index.js';
|
|
4
|
-
import * as types from '../types/index.js';
|
|
5
4
|
import { Analyzer } from './index.js';
|
|
6
5
|
export declare class ArgumentToParameterMatcher<TSignature extends ISignature<TParameter>, TParameter extends ISignatureParameter, TArgument extends IArgument> {
|
|
7
6
|
private readonly _analyzer;
|
|
8
7
|
private readonly _signature;
|
|
9
8
|
private readonly _arguments;
|
|
10
|
-
|
|
9
|
+
private readonly _diagnostics;
|
|
10
|
+
private readonly _nodeForUnmatchedRequiredParametersDiagnostic;
|
|
11
|
+
constructor(_analyzer: Analyzer, _signature: TSignature, _arguments: readonly TArgument[], _diagnostics: DiagnosticAcceptor | undefined, _nodeForUnmatchedRequiredParametersDiagnostic: tree.Node | undefined);
|
|
11
12
|
match(): MatchResult<TParameter, TArgument>;
|
|
12
13
|
private matchArgumentsToParameters;
|
|
13
|
-
private
|
|
14
|
-
private getArgumentType;
|
|
14
|
+
private reportArgumentDiagnostic;
|
|
15
15
|
}
|
|
16
16
|
export declare class MatchResult<TParameter extends ISignatureParameter, TArgument extends IArgument> {
|
|
17
17
|
readonly mapping: ReadonlyMap<TArgument, TParameter>;
|
|
18
|
-
readonly
|
|
19
|
-
|
|
20
|
-
readonly hasTypeAssignabilityErrors: boolean;
|
|
21
|
-
get isMatching(): boolean;
|
|
22
|
-
constructor(mapping: ReadonlyMap<TArgument, TParameter>, unmatchedRequiredParameters: readonly TParameter[], argumentArrangementDiagnostics: readonly Diagnostic[], hasTypeAssignabilityErrors: boolean);
|
|
18
|
+
readonly isMatching: boolean;
|
|
19
|
+
constructor(mapping: ReadonlyMap<TArgument, TParameter>, isMatching: boolean);
|
|
23
20
|
}
|
|
24
21
|
export interface ISignature<TParameter extends ISignatureParameter> {
|
|
25
22
|
getParameters(): readonly TParameter[];
|
|
26
23
|
}
|
|
27
24
|
export interface ISignatureParameter {
|
|
28
25
|
getName(): Name | undefined;
|
|
29
|
-
getType(): types.Type;
|
|
30
26
|
isOptional(): boolean;
|
|
31
27
|
}
|
|
32
28
|
export interface IArgument {
|
|
33
|
-
|
|
34
|
-
getName(): Name | undefined;
|
|
29
|
+
readonly name: Name | undefined;
|
|
35
30
|
getDiagnosticLocation(): DiagnosticLocation | undefined;
|
|
36
31
|
}
|
|
37
32
|
export declare class SourceArgument implements IArgument {
|
|
38
33
|
private readonly _analyzer;
|
|
39
34
|
readonly node: tree.Argument;
|
|
35
|
+
readonly name: Name | undefined;
|
|
40
36
|
constructor(_analyzer: Analyzer, node: tree.Argument);
|
|
41
|
-
getExpression(): tree.Expression;
|
|
42
|
-
getName(): Name | undefined;
|
|
43
37
|
getDiagnosticLocation(): DiagnosticLocation;
|
|
44
38
|
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
2
2
|
import { AutotypeCallExpression } from '../tree/index.js';
|
|
3
3
|
import * as types from '../types/index.js';
|
|
4
|
-
import { Analyzer,
|
|
4
|
+
import { Analyzer, ExpressionAnalysisOptions } from './index.js';
|
|
5
5
|
export declare class Resolver {
|
|
6
6
|
private readonly _analyzer;
|
|
7
|
-
readonly _node
|
|
8
|
-
readonly
|
|
9
|
-
constructor(_analyzer: Analyzer, _node: AutotypeCallExpression,
|
|
10
|
-
resolve():
|
|
7
|
+
private readonly _node;
|
|
8
|
+
private readonly _analysisOptions;
|
|
9
|
+
constructor(_analyzer: Analyzer, _node: AutotypeCallExpression, _analysisOptions: ExpressionAnalysisOptions | undefined);
|
|
10
|
+
resolve(): ResolutionResult;
|
|
11
|
+
}
|
|
12
|
+
export declare class ResolutionResult {
|
|
13
|
+
readonly meaning: Meaning;
|
|
14
|
+
readonly diagnostics?: readonly Diagnostic[] | undefined;
|
|
15
|
+
constructor(meaning: Meaning, diagnostics?: readonly Diagnostic[] | undefined);
|
|
16
|
+
static unresolved(diagnostics: readonly Diagnostic[] | undefined): ResolutionResult;
|
|
11
17
|
}
|
|
12
18
|
export type Meaning = Meaning_constructorCall | Meaning_unresolved;
|
|
13
19
|
declare class Meaning_constructorCall {
|
|
@@ -22,6 +28,8 @@ declare class Meaning_constructorCall {
|
|
|
22
28
|
readonly candidates: readonly types.Constructor[];
|
|
23
29
|
readonly suitableConstructors: readonly types.Constructor[];
|
|
24
30
|
readonly kind = "constructor-call";
|
|
31
|
+
get singleSuitableConstructor(): types.Constructor | undefined;
|
|
32
|
+
get singleConstructor(): types.Constructor | undefined;
|
|
25
33
|
constructor(
|
|
26
34
|
/**
|
|
27
35
|
* Тип объекта, получаемого в результате вызова конструктора.
|
|
@@ -33,8 +41,6 @@ declare class Meaning_constructorCall {
|
|
|
33
41
|
type: types.Type, candidates: readonly types.Constructor[], suitableConstructors: readonly types.Constructor[]);
|
|
34
42
|
}
|
|
35
43
|
declare class Meaning_unresolved {
|
|
36
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
37
44
|
readonly kind = "unresolved";
|
|
38
|
-
constructor(diagnostics: readonly Diagnostic[]);
|
|
39
45
|
}
|
|
40
46
|
export {};
|