@artel/artc 0.6.25253 → 0.6.25255
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 +12 -6
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +568 -365
- package/build/{chunk-6WZERC3X.js → chunk-R2AFVF7W.js} +2 -2
- package/build/{chunk-NEFP5U65.js → chunk-SSG7MY2R.js} +1 -1
- package/build/{chunk-3VAVX3J5.js → chunk-Y23FSWAN.js} +13016 -14906
- package/build/types/analysis/AccessedFunction.d.ts +11 -5
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +2 -1
- package/build/types/analysis/Analyzer.d.ts +116 -40
- 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 +12 -6
- 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/DiagnosticCollector.d.ts +5 -9
- 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/SubstitutedFunction.d.ts +10 -4
- 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/index.d.ts +0 -2
- package/build/types/analysis/semantic-context/Declarations.d.ts +4 -4
- 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 +3 -2
- package/build/types/common/Cached.d.ts +2 -0
- package/build/types/common/Query.d.ts +1 -1
- package/build/types/common/TreeQuery.d.ts +1 -2
- 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/StructuredTypeEntity.d.ts +1 -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 +2 -1
- 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/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 +26 -0
- package/build/types/tree/{green/Nodes.d.ts → Nodes.d.ts} +408 -356
- 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 +2 -2
- 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 +2 -2
- package/build/types/types/Type.d.ts +3 -3
- package/build/types/types/TypeMembers.d.ts +1 -0
- package/build/types/types/UnionType.d.ts +2 -2
- package/build/types/types/UnresolvedType.d.ts +2 -2
- package/build/types/types/VariantType.d.ts +2 -2
- package/package.json +1 -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/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,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { TokenKind } from './TokenKind.js';
|
|
2
|
+
import { NodeKind } from './NodeKind.js';
|
|
3
|
+
import { TriviaKind } from './TriviaKind.js';
|
|
4
|
+
import { OperatorKind } from './OperatorKind.js';
|
|
3
5
|
import { BaseNode } from './BaseNode.js';
|
|
4
|
-
import { Node
|
|
6
|
+
import { Node } from './Nodes.js';
|
|
7
|
+
import { Range } from '../common/Range.js';
|
|
5
8
|
export declare const enum TokenFlags {
|
|
6
9
|
None = 0,// обычная лексема
|
|
7
10
|
Missing = 1,// лексема отсутствует в исходном тексте, но требуется по грамматике.
|
|
@@ -14,25 +17,38 @@ export declare const enum TokenFlags {
|
|
|
14
17
|
}
|
|
15
18
|
export declare class Token<TKind extends TokenKind = TokenKind> extends BaseNode {
|
|
16
19
|
readonly kind = NodeKind.Token;
|
|
17
|
-
readonly children: never[];
|
|
18
20
|
readonly tokenKind: TKind;
|
|
19
21
|
readonly value: string;
|
|
20
22
|
readonly leadingTrivia: readonly Trivia[];
|
|
23
|
+
readonly trailingTrivia: readonly Trivia[];
|
|
21
24
|
readonly flags: TokenFlags;
|
|
22
25
|
readonly operatorKind: OperatorKind | undefined;
|
|
26
|
+
get children(): readonly [];
|
|
27
|
+
get parent(): Node;
|
|
23
28
|
get isMissing(): boolean;
|
|
24
29
|
protected get thisAsNode(): Node;
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
constructor(tokenKind: TKind, value: string, leadingTrivia: readonly Trivia[], trailingTrivia: readonly Trivia[], flags: TokenFlags, operatorKind: OperatorKind | undefined, rangeWithTrivia: Range | undefined);
|
|
31
|
+
get rangeWithoutTrivia(): Range;
|
|
27
32
|
getTextWithTrivia(): string;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
hasTrailingLineBreak(): boolean;
|
|
34
|
+
getTriviaAt(position: number): TokenTrivia | undefined;
|
|
35
|
+
selectLeadingTrivia(condition: (trivia: Trivia, rangeStart: number, rangeEnd: number) => boolean): TokenTrivia[];
|
|
36
|
+
selectTrailingTrivia(condition: (trivia: Trivia, rangeStart: number, rangeEnd: number) => boolean): TokenTrivia[];
|
|
37
|
+
protected getLengthWithTrivia(): number;
|
|
31
38
|
}
|
|
32
39
|
export declare class Trivia {
|
|
33
40
|
readonly kind: TriviaKind;
|
|
34
41
|
readonly value: string;
|
|
35
42
|
get rangeLength(): number;
|
|
36
43
|
constructor(kind: TriviaKind, value: string);
|
|
37
|
-
|
|
44
|
+
}
|
|
45
|
+
export declare class TokenTrivia {
|
|
46
|
+
readonly trivia: Trivia;
|
|
47
|
+
readonly token: Token<TokenKind>;
|
|
48
|
+
readonly isTrailing: boolean;
|
|
49
|
+
readonly index: number;
|
|
50
|
+
readonly range: Range;
|
|
51
|
+
get kind(): TriviaKind;
|
|
52
|
+
get value(): string;
|
|
53
|
+
constructor(token: Token<TokenKind>, trivia: Trivia, isTrailing: boolean, index: number, range: Range);
|
|
38
54
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TokenKind } from './TokenKind.js';
|
|
2
|
+
import { KeywordKind } from './KeywordKind.js';
|
|
3
|
+
import { Token } from './Token.js';
|
|
4
|
+
import { Identifier, Keyword, Node } from './Nodes.js';
|
|
3
5
|
export declare function isIdentifier(node: Node): node is Identifier;
|
|
4
6
|
export declare function isToken<T extends TokenKind>(node: Node, kind?: T): node is Token<T>;
|
|
5
7
|
export declare function isKeyword<T extends KeywordKind>(node: Node, kind?: T): node is Keyword<T>;
|
|
6
|
-
export declare function toSourceCode(node: Node, lengthLimit?: number, excludeLeadingTrivia?: boolean): string;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './KeywordKind.js';
|
|
2
|
+
export * from './NodeKind.js';
|
|
3
|
+
export * from './OperatorKind.js';
|
|
4
|
+
export * from './TokenKind.js';
|
|
5
|
+
export * from './TriviaKind.js';
|
|
6
|
+
export * from './BaseNode.js';
|
|
7
|
+
export * from './Nodes.js';
|
|
8
|
+
export * from './Token.js';
|
|
9
|
+
export * from './Utils.js';
|
|
10
|
+
export * from './NodePath.js';
|
|
@@ -64,6 +64,7 @@ export declare class TsGlobalVariableEntity implements PackageVariableEntity {
|
|
|
64
64
|
private readonly _forceHiddenInPackage;
|
|
65
65
|
readonly kind = EntityKind.Variable;
|
|
66
66
|
readonly subkind = "package";
|
|
67
|
+
private readonly _name;
|
|
67
68
|
private readonly _type;
|
|
68
69
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _isDefaultExport: boolean, _containingPackage: PackageEntity, _forceHiddenInPackage: boolean);
|
|
69
70
|
getName(): Name;
|
|
@@ -89,6 +90,7 @@ export declare class TsGlobalFunctionEntity implements PackageFunctionEntity {
|
|
|
89
90
|
private readonly _forceHiddenInPackage;
|
|
90
91
|
readonly kind = EntityKind.Function;
|
|
91
92
|
readonly subkind = "package";
|
|
93
|
+
private readonly _name;
|
|
92
94
|
private readonly _typeParameters;
|
|
93
95
|
private readonly _valueParameters;
|
|
94
96
|
private readonly _returnType;
|
|
@@ -155,6 +157,7 @@ export declare class TsGlobalClassOrInterfaceEntity implements PackageStructured
|
|
|
155
157
|
readonly kind = EntityKind.Type;
|
|
156
158
|
readonly typeEntityKind = TypeEntityKind.Structured;
|
|
157
159
|
readonly subkind = "package";
|
|
160
|
+
private readonly _name;
|
|
158
161
|
private readonly _typeParameters;
|
|
159
162
|
private readonly _members;
|
|
160
163
|
private readonly _baseObjectType;
|
|
@@ -257,6 +260,7 @@ export declare class TsNamedTypeLiteralEntity implements PackageStructuredTypeEn
|
|
|
257
260
|
readonly kind = EntityKind.Type;
|
|
258
261
|
readonly typeEntityKind = TypeEntityKind.Structured;
|
|
259
262
|
readonly subkind = "package";
|
|
263
|
+
private readonly _name;
|
|
260
264
|
private readonly _typeParameters;
|
|
261
265
|
private readonly _baseObjectType;
|
|
262
266
|
private readonly _baseAspectTypes;
|
|
@@ -322,6 +326,7 @@ export declare class TsPropertyEntity implements FieldEntity {
|
|
|
322
326
|
private readonly _forceStatic;
|
|
323
327
|
readonly kind = EntityKind.Variable;
|
|
324
328
|
readonly subkind = "field";
|
|
329
|
+
private readonly _name;
|
|
325
330
|
private readonly _type;
|
|
326
331
|
private readonly _overriddenMembers;
|
|
327
332
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _containingType: TypeEntityWithMembers, _forceStatic: boolean);
|
|
@@ -352,6 +357,7 @@ export declare class TsAccessorEntity implements FieldEntity {
|
|
|
352
357
|
private readonly _forceStatic;
|
|
353
358
|
readonly kind = EntityKind.Variable;
|
|
354
359
|
readonly subkind = "field";
|
|
360
|
+
private readonly _name;
|
|
355
361
|
private readonly _type;
|
|
356
362
|
private readonly _getter;
|
|
357
363
|
private readonly _setter;
|
|
@@ -417,6 +423,7 @@ export declare class TsMethodEntity implements MethodEntity {
|
|
|
417
423
|
private readonly _forceStatic;
|
|
418
424
|
readonly kind = EntityKind.Function;
|
|
419
425
|
readonly subkind = "method";
|
|
426
|
+
private readonly _name;
|
|
420
427
|
private readonly _typeParameters;
|
|
421
428
|
private readonly _valueParameters;
|
|
422
429
|
private readonly _returnType;
|
|
@@ -449,6 +456,7 @@ export declare class TsIteratorFunctionEntity implements MethodEntity {
|
|
|
449
456
|
private readonly _containingType;
|
|
450
457
|
readonly kind = EntityKind.Function;
|
|
451
458
|
readonly subkind = "method";
|
|
459
|
+
private readonly _name;
|
|
452
460
|
private readonly _returnType;
|
|
453
461
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _containingType: TypeEntityWithMembers);
|
|
454
462
|
getName(): Name;
|
|
@@ -479,6 +487,7 @@ export declare class TsParameterEntity implements ParameterVariableEntity {
|
|
|
479
487
|
private readonly _containingEntity;
|
|
480
488
|
readonly kind = EntityKind.Variable;
|
|
481
489
|
readonly subkind = "parameter";
|
|
490
|
+
private readonly _name;
|
|
482
491
|
private readonly _type;
|
|
483
492
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _containingEntity: EntityContainingValueParameter);
|
|
484
493
|
getName(): Name;
|
|
@@ -503,6 +512,7 @@ export declare class TsTypeParameterEntity implements TypeParameterEntity {
|
|
|
503
512
|
private readonly _containingEntity;
|
|
504
513
|
readonly kind = EntityKind.Type;
|
|
505
514
|
readonly typeEntityKind = TypeEntityKind.Parameter;
|
|
515
|
+
private readonly _name;
|
|
506
516
|
private readonly _constraint;
|
|
507
517
|
private readonly _defaultType;
|
|
508
518
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _containingEntity: EntityContainingTypeParameter);
|
|
@@ -592,6 +602,7 @@ export declare class TsEnumEntity implements PackageVariantTypeEntity {
|
|
|
592
602
|
readonly kind = EntityKind.Type;
|
|
593
603
|
readonly typeEntityKind = TypeEntityKind.Variant;
|
|
594
604
|
readonly subkind = "package";
|
|
605
|
+
private readonly _name;
|
|
595
606
|
private readonly _members;
|
|
596
607
|
private readonly _underlyingType;
|
|
597
608
|
private readonly _baseObjectType;
|
|
@@ -618,6 +629,7 @@ export declare class TsEnumMemberEntity implements FieldEntity {
|
|
|
618
629
|
private readonly _variantTypeEntity;
|
|
619
630
|
readonly kind = EntityKind.Variable;
|
|
620
631
|
readonly subkind = "field";
|
|
632
|
+
private readonly _name;
|
|
621
633
|
private readonly _type;
|
|
622
634
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _variantTypeEntity: VariantTypeEntity);
|
|
623
635
|
getContainer(): TypeMemberEntityContainer;
|
|
@@ -646,6 +658,7 @@ export declare class TsTypeAliasEntity implements AliasTypeEntity {
|
|
|
646
658
|
private readonly _containingPackage;
|
|
647
659
|
readonly kind = EntityKind.Type;
|
|
648
660
|
readonly typeEntityKind = TypeEntityKind.Alias;
|
|
661
|
+
private readonly _name;
|
|
649
662
|
private readonly _aliasedType;
|
|
650
663
|
private readonly _typeParameters;
|
|
651
664
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _isDefaultExport: boolean, _containingPackage: PackageEntity);
|
|
@@ -717,6 +730,7 @@ export declare class TsNamedFunctionTypeEntity implements PackageFunctionTypeEnt
|
|
|
717
730
|
readonly kind = EntityKind.Type;
|
|
718
731
|
readonly typeEntityKind = TypeEntityKind.Function;
|
|
719
732
|
readonly subkind = "package";
|
|
733
|
+
private readonly _name;
|
|
720
734
|
private readonly _typeParameters;
|
|
721
735
|
private readonly _valueParameters;
|
|
722
736
|
private readonly _members;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { AliasTypeEntity, TypeParameterEntity } from '../entities/index.js';
|
|
3
|
-
import { IType,
|
|
3
|
+
import { IType, Substitutions, Type } from './index.js';
|
|
4
4
|
export declare class AliasType implements IType {
|
|
5
5
|
private readonly _analyzer;
|
|
6
6
|
private readonly _entity;
|
|
@@ -12,7 +12,7 @@ export declare class AliasType implements IType {
|
|
|
12
12
|
getAliasedType(): Type;
|
|
13
13
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
14
14
|
getSubstitutions(): Substitutions;
|
|
15
|
-
applySubstitutions(
|
|
15
|
+
applySubstitutions(substitutions: Substitutions): Type;
|
|
16
16
|
equals(other: Type): boolean;
|
|
17
17
|
getEntity(): AliasTypeEntity;
|
|
18
18
|
getBaseObjectTypeOrAliasedType(): Type | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { FunctionTypeEntity, TypeParameterEntity } from '../entities/index.js';
|
|
3
|
-
import { IType,
|
|
3
|
+
import { IType, Substitutions, Type, ValueParameter } from './index.js';
|
|
4
4
|
export declare class FunctionType implements IType {
|
|
5
5
|
private readonly _analyzer;
|
|
6
6
|
private readonly _entity;
|
|
@@ -11,7 +11,7 @@ export declare class FunctionType implements IType {
|
|
|
11
11
|
constructor(_analyzer: Analyzer, _entity: FunctionTypeEntity, _substitutions: Substitutions);
|
|
12
12
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
13
13
|
getSubstitutions(): Substitutions;
|
|
14
|
-
applySubstitutions(
|
|
14
|
+
applySubstitutions(substitutions: Substitutions): FunctionType;
|
|
15
15
|
equals(other: Type): boolean;
|
|
16
16
|
getEntity(): FunctionTypeEntity;
|
|
17
17
|
isAsync(): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { TypeEntity } from '../entities/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Substitutions } from './Substitutions.js';
|
|
4
4
|
import { IType, Type } from './index.js';
|
|
5
5
|
export declare class IntersectionType implements IType {
|
|
6
6
|
readonly kind = "intersection";
|
|
@@ -12,7 +12,7 @@ export declare class IntersectionType implements IType {
|
|
|
12
12
|
constructor(analyzer: Analyzer, originalTypes: readonly Type[]);
|
|
13
13
|
equals(other: Type): boolean;
|
|
14
14
|
getSubstitutions(): Substitutions;
|
|
15
|
-
applySubstitutions(
|
|
15
|
+
applySubstitutions(substitutions: Substitutions): Type;
|
|
16
16
|
getEntity(): TypeEntity | undefined;
|
|
17
17
|
getBaseObjectTypeOrAliasedType(): Type | undefined;
|
|
18
18
|
toString(): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { TypeParameterEntity } from '../entities/index.js';
|
|
3
|
-
import { IType,
|
|
3
|
+
import { IType, Substitutions, Type } from './index.js';
|
|
4
4
|
export declare class ParameterType implements IType {
|
|
5
5
|
private readonly _analyzer;
|
|
6
6
|
private readonly _entity;
|
|
@@ -15,7 +15,7 @@ export declare class ParameterType implements IType {
|
|
|
15
15
|
constructor(_analyzer: Analyzer, _entity: TypeParameterEntity, isNullExcluded: boolean);
|
|
16
16
|
getSubstitutions(): Substitutions;
|
|
17
17
|
getEntity(): TypeParameterEntity;
|
|
18
|
-
applySubstitutions(
|
|
18
|
+
applySubstitutions(substitutions: Substitutions): Type;
|
|
19
19
|
equals(other: Type): boolean;
|
|
20
20
|
getBaseObjectTypeOrAliasedType(): Type | undefined;
|
|
21
21
|
toString(): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { StructuredTypeEntity, TypeParameterEntity } from '../entities/index.js';
|
|
3
|
-
import { IType,
|
|
3
|
+
import { IType, Substitutions, Type } from './index.js';
|
|
4
4
|
export declare class StructuredType implements IType {
|
|
5
5
|
private readonly _analyzer;
|
|
6
6
|
private readonly _entity;
|
|
@@ -12,7 +12,7 @@ export declare class StructuredType implements IType {
|
|
|
12
12
|
constructor(_analyzer: Analyzer, _entity: StructuredTypeEntity, _substitutions: Substitutions);
|
|
13
13
|
getSubstitutions(): Substitutions;
|
|
14
14
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
15
|
-
applySubstitutions(
|
|
15
|
+
applySubstitutions(substitutions: Substitutions): StructuredType;
|
|
16
16
|
isAspect(): boolean;
|
|
17
17
|
isRefObject(): boolean;
|
|
18
18
|
isPlainObject(): boolean;
|
|
@@ -14,8 +14,8 @@ export declare class Substitutions {
|
|
|
14
14
|
static empty(analyzer: Analyzer): Substitutions;
|
|
15
15
|
getParameters(): Iterable<TypeParameterEntity>;
|
|
16
16
|
getTypes(): Iterable<Type>;
|
|
17
|
-
substituteTypes(
|
|
18
|
-
substituteTypesAndMerge(
|
|
17
|
+
substituteTypes(substitutions: Substitutions): Substitutions;
|
|
18
|
+
substituteTypesAndMerge(substitutions: Substitutions): Substitutions;
|
|
19
19
|
equals(other: Substitutions): boolean;
|
|
20
20
|
}
|
|
21
21
|
export type SubstitutionMap = ReadonlyMap<TypeParameterEntity, Type>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { TypeEntity } from '../entities/index.js';
|
|
2
2
|
import { AliasType } from './AliasType.js';
|
|
3
|
-
import { IntersectionType } from './IntersectionType.js';
|
|
4
3
|
import { FunctionType } from './FunctionType.js';
|
|
4
|
+
import { IntersectionType } from './IntersectionType.js';
|
|
5
5
|
import { ParameterType } from './ParameterType.js';
|
|
6
6
|
import { StructuredType } from './StructuredType.js';
|
|
7
7
|
import { UnresolvedType } from './UnresolvedType.js';
|
|
8
8
|
import { VariantType } from './VariantType.js';
|
|
9
|
-
import {
|
|
9
|
+
import { Substitutions, UnionType } from './index.js';
|
|
10
10
|
export type Type = StructuredType | VariantType | FunctionType | AliasType | UnresolvedType | ParameterType | UnionType | IntersectionType;
|
|
11
11
|
export interface IType {
|
|
12
12
|
getSubstitutions(): Substitutions;
|
|
13
|
-
applySubstitutions(
|
|
13
|
+
applySubstitutions(substitutions: Substitutions): Type;
|
|
14
14
|
/**
|
|
15
15
|
* Сравнивает типы без учёта языка.
|
|
16
16
|
*/
|
|
@@ -83,6 +83,7 @@ export declare class Operator implements ITypeMember {
|
|
|
83
83
|
isOverride(): boolean;
|
|
84
84
|
applySubstitutions(substitutions: Substitutions): Operator;
|
|
85
85
|
equals(other: TypeMember): boolean;
|
|
86
|
+
toString(): string;
|
|
86
87
|
}
|
|
87
88
|
export declare class Constructor implements ITypeMember {
|
|
88
89
|
private readonly _analyzer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { TypeEntity } from '../entities/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Substitutions } from './Substitutions.js';
|
|
4
4
|
import { IType, Type } from './index.js';
|
|
5
5
|
export declare class UnionType implements IType {
|
|
6
6
|
readonly kind = "union";
|
|
@@ -12,7 +12,7 @@ export declare class UnionType implements IType {
|
|
|
12
12
|
constructor(analyzer: Analyzer, originalTypes: readonly Type[]);
|
|
13
13
|
equals(other: Type): boolean;
|
|
14
14
|
getSubstitutions(): Substitutions;
|
|
15
|
-
applySubstitutions(
|
|
15
|
+
applySubstitutions(substitutions: Substitutions): Type;
|
|
16
16
|
getEntity(): TypeEntity | undefined;
|
|
17
17
|
getBaseObjectTypeOrAliasedType(): Type | undefined;
|
|
18
18
|
toString(): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { TypeEntity } from '../entities/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Substitutions } from './Substitutions.js';
|
|
4
4
|
import { IType, Type } from './Type.js';
|
|
5
5
|
export declare class UnresolvedType implements IType {
|
|
6
6
|
private readonly _analyzer;
|
|
@@ -9,7 +9,7 @@ export declare class UnresolvedType implements IType {
|
|
|
9
9
|
constructor(_analyzer: Analyzer);
|
|
10
10
|
equals(other: Type): boolean;
|
|
11
11
|
getSubstitutions(): Substitutions;
|
|
12
|
-
applySubstitutions(
|
|
12
|
+
applySubstitutions(_substitutions: Substitutions): Type;
|
|
13
13
|
getEntity(): TypeEntity | undefined;
|
|
14
14
|
getBaseObjectTypeOrAliasedType(): Type | undefined;
|
|
15
15
|
toString(): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
|
2
2
|
import { VariantTypeEntity } from '../entities/index.js';
|
|
3
|
-
import { IType,
|
|
3
|
+
import { IType, Substitutions, Type } from './index.js';
|
|
4
4
|
export declare class VariantType implements IType {
|
|
5
5
|
private readonly _analyzer;
|
|
6
6
|
private readonly _entity;
|
|
@@ -9,7 +9,7 @@ export declare class VariantType implements IType {
|
|
|
9
9
|
get debuggerDisplay(): string;
|
|
10
10
|
constructor(_analyzer: Analyzer, _entity: VariantTypeEntity, _substitutions: Substitutions);
|
|
11
11
|
getSubstitutions(): Substitutions;
|
|
12
|
-
applySubstitutions(
|
|
12
|
+
applySubstitutions(substitutions: Substitutions): Type;
|
|
13
13
|
getEntity(): VariantTypeEntity;
|
|
14
14
|
equals(other: Type): boolean;
|
|
15
15
|
getUnderlyingType(): Type;
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Name } from '../common/index.js';
|
|
2
|
-
import * as tree from '../tree/index.js';
|
|
3
|
-
import * as types from '../types/index.js';
|
|
4
|
-
import { Analyzer } from './Analyzer.js';
|
|
5
|
-
export declare class Resolver<TCandidate extends ICandidate<TValueParameter>, TValueParameter extends IValueParameter> {
|
|
6
|
-
private readonly _analyzer;
|
|
7
|
-
constructor(_analyzer: Analyzer);
|
|
8
|
-
resolve(candidates: readonly TCandidate[], args: readonly tree.Argument[]): readonly TCandidate[];
|
|
9
|
-
}
|
|
10
|
-
export interface ICandidate<TValueParameter extends IValueParameter> {
|
|
11
|
-
getValueParameters(): readonly TValueParameter[];
|
|
12
|
-
}
|
|
13
|
-
export interface IValueParameter {
|
|
14
|
-
getName(): Name;
|
|
15
|
-
getType(): types.Type;
|
|
16
|
-
isOptional(): boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare class TypeMemberCandidate implements ICandidate<FoundTypeMemberCandidateValueParameter> {
|
|
19
|
-
readonly value: types.Constructor;
|
|
20
|
-
private readonly _valueParameters;
|
|
21
|
-
constructor(value: types.Constructor);
|
|
22
|
-
getValueParameters(): readonly FoundTypeMemberCandidateValueParameter[];
|
|
23
|
-
}
|
|
24
|
-
declare class FoundTypeMemberCandidateValueParameter implements IValueParameter {
|
|
25
|
-
readonly value: types.ValueParameter;
|
|
26
|
-
constructor(value: types.ValueParameter);
|
|
27
|
-
getName(): Name;
|
|
28
|
-
getType(): types.Type;
|
|
29
|
-
isOptional(): boolean;
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Name } from '../common/index.js';
|
|
2
|
-
import { CallExpression } from '../tree/index.js';
|
|
3
|
-
import * as types from '../types/index.js';
|
|
4
|
-
import { Analyzer } from './Analyzer.js';
|
|
5
|
-
export declare class Resolver<TCandidate extends ICandidate<TValueParameter>, TValueParameter extends IValueParameter> {
|
|
6
|
-
private readonly _analyzer;
|
|
7
|
-
constructor(_analyzer: Analyzer);
|
|
8
|
-
resolveByCallExpression(candidates: readonly TCandidate[], node: CallExpression): readonly TCandidate[];
|
|
9
|
-
resolveByTargetType(candidates: readonly TCandidate[], targetType: types.FunctionType): readonly TCandidate[];
|
|
10
|
-
}
|
|
11
|
-
export interface ICandidate<TValueParameter extends IValueParameter> {
|
|
12
|
-
getValueParameters(): readonly TValueParameter[];
|
|
13
|
-
getSignatureType(): types.Type;
|
|
14
|
-
getTypeParameterCount(): number;
|
|
15
|
-
getRequiredTypeParameterCount(): number;
|
|
16
|
-
}
|
|
17
|
-
export interface IValueParameter {
|
|
18
|
-
getName(): Name | undefined;
|
|
19
|
-
getType(): types.Type;
|
|
20
|
-
isOptional(): boolean;
|
|
21
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Node, Token } from './index.js';
|
|
2
|
-
export declare abstract class BaseNode {
|
|
3
|
-
protected _rangeLength: number;
|
|
4
|
-
protected abstract thisAsNode: Node;
|
|
5
|
-
abstract get children(): readonly (Node | undefined)[];
|
|
6
|
-
get rangeLength(): number;
|
|
7
|
-
get debuggerDisplay(): string;
|
|
8
|
-
/**
|
|
9
|
-
* Информация для оценки размера дерева при отладке.
|
|
10
|
-
*/
|
|
11
|
-
get descendantCount(): number;
|
|
12
|
-
findLeftmostToken(): Token | undefined;
|
|
13
|
-
private countDescendants;
|
|
14
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from '../KeywordKind.js';
|
|
2
|
-
export * from '../NodeKind.js';
|
|
3
|
-
export * from '../OperatorKind.js';
|
|
4
|
-
export * from '../TokenKind.js';
|
|
5
|
-
export * from '../TriviaKind.js';
|
|
6
|
-
export * from './Nodes.js';
|
|
7
|
-
export * from './Token.js';
|
|
8
|
-
export * from './Utils.js';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Range } from '../../common/index.js';
|
|
2
|
-
import * as green from '../green/index.js';
|
|
3
|
-
import { Node, Token } from './index.js';
|
|
4
|
-
export declare abstract class BaseNode {
|
|
5
|
-
readonly green: green.Node;
|
|
6
|
-
readonly rangeStart: number;
|
|
7
|
-
readonly parent: Node | undefined;
|
|
8
|
-
protected abstract thisAsNode: Node;
|
|
9
|
-
abstract get children(): readonly (Node | undefined)[];
|
|
10
|
-
get rangeWithTrivia(): Range;
|
|
11
|
-
get rangeWithoutTrivia(): Range;
|
|
12
|
-
get debuggerDisplay(): string;
|
|
13
|
-
get descendantCount(): number;
|
|
14
|
-
constructor(green: green.Node, rangeStart: number, parent: Node | undefined);
|
|
15
|
-
findLeftmostToken(): Token | undefined;
|
|
16
|
-
}
|