@artel/artc 0.6.25223 → 0.6.25225
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 +85 -79
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +797 -674
- package/build/{chunk-DZNNWICP.js → chunk-TFTCV5R5.js} +6604 -5875
- package/build/{chunk-AX3LQ2CF.js → chunk-UB6LHKS5.js} +3 -3
- package/build/{chunk-LG4Z4SWO.js → chunk-Z6TZA6SN.js} +3 -3
- package/build/types/analysis/AccessedFunction.d.ts +53 -0
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +16 -15
- package/build/types/analysis/Analyzer.d.ts +142 -127
- package/build/types/analysis/CallExpressionMeaning.d.ts +10 -10
- package/build/types/analysis/DiagnosticCollector.d.ts +17 -17
- package/build/types/analysis/EntityLocalizationHelper.d.ts +6 -6
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +10 -10
- package/build/types/analysis/ImportedPackageNameTree.d.ts +1 -0
- package/build/types/analysis/LocalizationContext.d.ts +2 -2
- package/build/types/analysis/{PropertyAccessExpressionMeaning.d.ts → MemberAccessExpressionMeaning.d.ts} +27 -21
- package/build/types/analysis/NamedTypeResolver.d.ts +5 -1
- package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +4 -1
- package/build/types/analysis/NodeTypeUtils.d.ts +13 -13
- package/build/types/analysis/OperationOverloadResolver.d.ts +1 -1
- package/build/types/analysis/Scope.d.ts +15 -15
- package/build/types/analysis/SemanticContext.d.ts +29 -29
- package/build/types/analysis/SemanticContextBuilder.d.ts +22 -22
- package/build/types/analysis/SourceFileMembers.d.ts +2 -2
- package/build/types/analysis/StatementBlockScopeBuilder.d.ts +12 -12
- package/build/types/analysis/{SubstitutedMethod.d.ts → SubstitutedFunction.d.ts} +14 -14
- package/build/types/analysis/TagMeaning.d.ts +23 -20
- package/build/types/analysis/Tags.d.ts +6 -6
- package/build/types/analysis/TypeNarrower.d.ts +21 -21
- package/build/types/analysis/Utils.d.ts +15 -3
- package/build/types/analysis/WellKnownDeclarations.d.ts +4 -4
- package/build/types/analysis/control-flow/GraphBuilder.d.ts +43 -0
- package/build/types/analysis/{ControlFlowGraphVisualizer.d.ts → control-flow/GraphVisualizer.d.ts} +3 -3
- package/build/types/analysis/control-flow/NarrowableExpression.d.ts +5 -0
- package/build/types/analysis/control-flow/Nodes.d.ts +91 -0
- package/build/types/analysis/control-flow/index.d.ts +4 -0
- package/build/types/api/Api.d.ts +3 -3
- package/build/types/common/HelperPhrases.d.ts +3 -2
- package/build/types/diagnostic/DiagnosticCode.d.ts +130 -131
- package/build/types/emitter/EmitPhaseName.d.ts +8 -8
- package/build/types/emitter/Emitter.d.ts +4 -4
- package/build/types/emitter/EmitterContext.d.ts +2 -2
- package/build/types/emitter/Entities.d.ts +31 -29
- package/build/types/emitter/EntityMap.d.ts +8 -8
- package/build/types/emitter/IrBuilder.d.ts +18 -18
- package/build/types/emitter/IrToJs.d.ts +9 -9
- package/build/types/emitter/Transformer.d.ts +37 -37
- package/build/types/emitter/ir/AccessedEntities.d.ts +5 -5
- package/build/types/emitter/ir/ComputedAccess.d.ts +5 -5
- package/build/types/emitter/ir/EmitOptions.d.ts +41 -27
- package/build/types/emitter/ir/Nodes.d.ts +141 -140
- package/build/types/emitter/ir/types.d.ts +8 -8
- package/build/types/entities/ConstructorEntity.d.ts +9 -9
- package/build/types/entities/DereferenceOperatorEntity.d.ts +4 -4
- package/build/types/entities/DestructorEntity.d.ts +4 -4
- package/build/types/entities/{MethodEntity.d.ts → FunctionEntity.d.ts} +36 -36
- package/build/types/entities/{MethodTypeEntity.d.ts → FunctionTypeEntity.d.ts} +23 -23
- package/build/types/entities/GetterEntity.d.ts +9 -9
- package/build/types/entities/IndexerEntity.d.ts +4 -4
- package/build/types/entities/SetterEntity.d.ts +9 -9
- package/build/types/entities/TypeEntity.d.ts +3 -3
- package/build/types/entities/TypeEntityMembers.d.ts +3 -3
- package/build/types/entities/TypeParameterEntity.d.ts +2 -2
- package/build/types/entities/VariableEntity.d.ts +32 -32
- package/build/types/entities/index.d.ts +14 -14
- package/build/types/services/CompletionService.d.ts +8 -9
- package/build/types/services/DisplayService.d.ts +72 -69
- package/build/types/services/HoverService.d.ts +1 -1
- package/build/types/services/NodeSemanticInfo.d.ts +26 -21
- package/build/types/services/SemanticTokensService.d.ts +6 -6
- package/build/types/services/SourceFileItemsService.d.ts +11 -11
- package/build/types/services/TypeDefinitionService.d.ts +2 -2
- package/build/types/services/signature-help/SignatureWithValueParameters.d.ts +10 -10
- package/build/types/services/signature-help/TypeParameterSignatureHelpProvider.d.ts +1 -1
- package/build/types/services/source-generation/EntityToSyntax.d.ts +10 -9
- package/build/types/tree/NodeKind.d.ts +27 -27
- package/build/types/tree/green/Nodes.d.ts +127 -128
- package/build/types/tree/green/SyntaxFactory.d.ts +20 -19
- package/build/types/tree/green/SyntaxToCode.d.ts +23 -21
- package/build/types/tree/red/Nodes.d.ts +173 -172
- package/build/types/ts-interop/Entities.d.ts +28 -28
- package/build/types/ts-interop/TsInteropContext.d.ts +2 -1
- package/build/types/ts-interop/TsPackageMembersCreator.d.ts +1 -1
- package/build/types/ts-interop/TsTypeMembersCreator.d.ts +1 -1
- package/build/types/types/{MethodType.d.ts → FunctionType.d.ts} +6 -6
- package/build/types/types/IntersectionType.d.ts +20 -0
- package/build/types/types/ParameterType.d.ts +6 -3
- package/build/types/types/StandardTypes.d.ts +2 -2
- package/build/types/types/Type.d.ts +3 -2
- package/build/types/types/TypeFactory.d.ts +8 -6
- package/build/types/types/TypeMembers.d.ts +8 -8
- package/build/types/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/build/types/analysis/AccessedMethod.d.ts +0 -53
- package/build/types/analysis/ControlFlowGraphBuilder.d.ts +0 -129
@@ -6,7 +6,7 @@ import { PackageEntityDefinition } from '../entities/PackageEntity.js';
|
|
6
6
|
import { OriginalPackageMembers } from '../entities/PackageMembers.js';
|
7
7
|
import { OriginalTypeEntityMembers } from '../entities/TypeEntityMembers.js';
|
8
8
|
import type { EntityContainingTypeParameter, EntityContainingValueParameter, EntityOwningGetter, TypeEntityWithMembers, VariantTypeEntity } from '../entities/index.js';
|
9
|
-
import { AliasTypeEntity, AliasTypeEntityDefinition, AliasedType,
|
9
|
+
import { AliasTypeEntity, AliasTypeEntityDefinition, AliasedType, AnonymousFunctionTypeEntity, AnonymousStructuredTypeEntity, BaseAspectTypes, BaseObjectType, ConstructorEntity, ConstructorEntityDefinition, DefaultConstructorEntityInfo, EntityHidingLevel, EntityKind, EntityNaming, EntityOwningSetter, FunctionEntityDefinition, GetterEntity, GetterEntityDefinition, IndexerEntity, IndexerEntityDefinition, InterfacePackageEntityInfo, MethodEntity, FunctionTypeEntityDefinition, PackageFunctionEntity, PackageFunctionTypeEntity, PackageStructuredTypeEntity, PackageVariableEntity, PackageVariantTypeEntity, ParameterVariableEntity, ParameterVariableEntityContainer, SetterEntity, SetterEntityDefinition, SpecialVariableEntityInfo, StructuredTypeEntityDefinition, SubstitutionApplicationMode, TypeEntityKind, TypeMemberEntityContainer, TypeParameterConstraint, TypeParameterEntity, TypeParameterEntityDefinition, FieldEntity, VariableEntityDefinition, VariantTypeEntityDefinition } from '../entities/index.js';
|
10
10
|
import { JavaScriptImplementationConfig, PackageName, PlatformKind, ProgramPackage } from '../project/index.js';
|
11
11
|
import * as tree from '../tree/index.js';
|
12
12
|
import * as types from '../types/index.js';
|
@@ -41,8 +41,8 @@ export declare class SourcePackageLoadedFromDtsEntity implements PackageEntity {
|
|
41
41
|
getImplementedInterfacePackage(): PackageEntity | undefined;
|
42
42
|
getSupportedPlatforms(): readonly PlatformKind[];
|
43
43
|
getPackageAliasTypeDeclarationEntity(node: tree.PackageAliasTypeDeclaration): AliasTypeEntity;
|
44
|
-
|
45
|
-
|
44
|
+
getPackageFunctionDeclarationEntity(node: tree.PackageFunctionDeclaration): PackageFunctionEntity;
|
45
|
+
getPackageFunctionTypeDeclarationEntity(node: tree.PackageFunctionTypeDeclaration): PackageFunctionTypeEntity;
|
46
46
|
getPackageStructuredTypeDeclarationEntity(node: tree.PackageStructuredTypeDeclaration): PackageStructuredTypeEntity;
|
47
47
|
getPackageVariableDeclarationEntity(node: tree.PackageVariableDeclaration): PackageVariableEntity;
|
48
48
|
getComputedPackageVariableDeclaration(node: tree.PackageVariableGetterDeclaration | tree.PackageVariableSetterDeclaration): PackageVariableEntity;
|
@@ -71,14 +71,14 @@ export declare class TsGlobalVariableEntity implements PackageVariableEntity {
|
|
71
71
|
getTags(): readonly Tag[];
|
72
72
|
private getDeclaration;
|
73
73
|
}
|
74
|
-
export declare class TsGlobalFunctionEntity implements
|
74
|
+
export declare class TsGlobalFunctionEntity implements PackageFunctionEntity {
|
75
75
|
private readonly _tsctx;
|
76
76
|
private readonly _symbol;
|
77
77
|
private readonly _isDefaultExport;
|
78
78
|
private readonly _declaration;
|
79
79
|
private readonly _containingPackage;
|
80
80
|
private readonly _forceHiddenInPackage;
|
81
|
-
readonly kind = EntityKind.
|
81
|
+
readonly kind = EntityKind.Function;
|
82
82
|
readonly subkind = "package";
|
83
83
|
private readonly _typeParameters;
|
84
84
|
private readonly _valueParameters;
|
@@ -89,7 +89,7 @@ export declare class TsGlobalFunctionEntity implements PackageMethodEntity {
|
|
89
89
|
getTypeParameters(): readonly TypeParameterEntity[];
|
90
90
|
getValueParameters(): readonly ParameterVariableEntity[];
|
91
91
|
getReturnType(): types.Type;
|
92
|
-
getDefinition():
|
92
|
+
getDefinition(): FunctionEntityDefinition;
|
93
93
|
isAsync(): boolean;
|
94
94
|
isHidden(): EntityHidingLevel | undefined;
|
95
95
|
getTags(): readonly Tag[];
|
@@ -289,13 +289,13 @@ export declare class SourceAndTsNamedTypeLiteralMergeEntity implements PackageSt
|
|
289
289
|
getTags(): readonly Tag[];
|
290
290
|
getSubstitutionApplicationMode(): SubstitutionApplicationMode;
|
291
291
|
}
|
292
|
-
export declare class TsPropertyEntity implements
|
292
|
+
export declare class TsPropertyEntity implements FieldEntity {
|
293
293
|
private readonly _tsctx;
|
294
294
|
private readonly _symbol;
|
295
295
|
private readonly _containingType;
|
296
296
|
private readonly _forceStatic;
|
297
297
|
readonly kind = EntityKind.Variable;
|
298
|
-
readonly subkind = "
|
298
|
+
readonly subkind = "field";
|
299
299
|
private readonly _type;
|
300
300
|
private readonly _overriddenMembers;
|
301
301
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _containingType: TypeEntityWithMembers, _forceStatic: boolean);
|
@@ -317,13 +317,13 @@ export declare class TsPropertyEntity implements TypeVariableEntity {
|
|
317
317
|
isVariant(): boolean;
|
318
318
|
private getDeclaration;
|
319
319
|
}
|
320
|
-
export declare class TsAccessorEntity implements
|
320
|
+
export declare class TsAccessorEntity implements FieldEntity {
|
321
321
|
private readonly _tsctx;
|
322
322
|
private readonly _symbol;
|
323
323
|
private readonly _containingType;
|
324
324
|
private readonly _forceStatic;
|
325
325
|
readonly kind = EntityKind.Variable;
|
326
|
-
readonly subkind = "
|
326
|
+
readonly subkind = "field";
|
327
327
|
private readonly _type;
|
328
328
|
private readonly _getter;
|
329
329
|
private readonly _setter;
|
@@ -375,14 +375,14 @@ export declare class TsSetAccessorEntity implements SetterEntity {
|
|
375
375
|
isHidden(): EntityHidingLevel | undefined;
|
376
376
|
getTags(): readonly Tag[];
|
377
377
|
}
|
378
|
-
export declare class
|
378
|
+
export declare class TsFunctionEntity implements MethodEntity {
|
379
379
|
private readonly _tsctx;
|
380
380
|
private readonly _symbol;
|
381
381
|
private readonly _declaration;
|
382
382
|
private readonly _containingType;
|
383
383
|
private readonly _forceStatic;
|
384
|
-
readonly kind = EntityKind.
|
385
|
-
readonly subkind = "
|
384
|
+
readonly kind = EntityKind.Function;
|
385
|
+
readonly subkind = "method";
|
386
386
|
private readonly _typeParameters;
|
387
387
|
private readonly _valueParameters;
|
388
388
|
private readonly _returnType;
|
@@ -392,7 +392,7 @@ export declare class TsMethodEntity implements TypeMethodEntity {
|
|
392
392
|
getTypeParameters(): readonly TypeParameterEntity[];
|
393
393
|
getValueParameters(): readonly ParameterVariableEntity[];
|
394
394
|
getReturnType(): types.Type;
|
395
|
-
getDefinition():
|
395
|
+
getDefinition(): FunctionEntityDefinition;
|
396
396
|
getContainer(): TypeMemberEntityContainer;
|
397
397
|
isStatic(): boolean;
|
398
398
|
isRedefinable(): boolean;
|
@@ -403,16 +403,16 @@ export declare class TsMethodEntity implements TypeMethodEntity {
|
|
403
403
|
isHidden(): EntityHidingLevel | undefined;
|
404
404
|
getTags(): readonly Tag[];
|
405
405
|
getTypeParametersArity(): number;
|
406
|
-
|
406
|
+
isFunctionTypeInvokeMethod(): boolean;
|
407
407
|
getSubstitutionApplicationMode(): SubstitutionApplicationMode;
|
408
408
|
getOverriddenMembers(): readonly types.Method[];
|
409
409
|
}
|
410
|
-
export declare class
|
410
|
+
export declare class TsIteratorFunctionEntity implements MethodEntity {
|
411
411
|
private readonly _tsctx;
|
412
412
|
private readonly _symbol;
|
413
413
|
private readonly _containingType;
|
414
|
-
readonly kind = EntityKind.
|
415
|
-
readonly subkind = "
|
414
|
+
readonly kind = EntityKind.Function;
|
415
|
+
readonly subkind = "method";
|
416
416
|
private readonly _returnType;
|
417
417
|
private readonly _overriddenMembers;
|
418
418
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _containingType: TypeEntityWithMembers);
|
@@ -420,7 +420,7 @@ export declare class TsIteratorMethodEntity implements TypeMethodEntity {
|
|
420
420
|
getTypeParameters(): readonly TypeParameterEntity[];
|
421
421
|
getValueParameters(): readonly ParameterVariableEntity[];
|
422
422
|
getReturnType(): types.Type;
|
423
|
-
getDefinition():
|
423
|
+
getDefinition(): FunctionEntityDefinition;
|
424
424
|
getContainer(): TypeMemberEntityContainer;
|
425
425
|
isStatic(): boolean;
|
426
426
|
isRedefinable(): boolean;
|
@@ -431,7 +431,7 @@ export declare class TsIteratorMethodEntity implements TypeMethodEntity {
|
|
431
431
|
isHidden(): EntityHidingLevel | undefined;
|
432
432
|
getTags(): readonly Tag[];
|
433
433
|
getTypeParametersArity(): number;
|
434
|
-
|
434
|
+
isFunctionTypeInvokeMethod(): boolean;
|
435
435
|
getSubstitutionApplicationMode(): SubstitutionApplicationMode;
|
436
436
|
getOverriddenMembers(): readonly types.Method[];
|
437
437
|
private getFirstDeclaration;
|
@@ -561,12 +561,12 @@ export declare class TsEnumEntity implements PackageVariantTypeEntity {
|
|
561
561
|
getSubstitutionApplicationMode(): SubstitutionApplicationMode;
|
562
562
|
getBaseObjectType(): BaseObjectType;
|
563
563
|
}
|
564
|
-
export declare class TsEnumMemberEntity implements
|
564
|
+
export declare class TsEnumMemberEntity implements FieldEntity {
|
565
565
|
private readonly _tsctx;
|
566
566
|
private readonly _symbol;
|
567
567
|
private readonly _variantTypeEntity;
|
568
568
|
readonly kind = EntityKind.Variable;
|
569
|
-
readonly subkind = "
|
569
|
+
readonly subkind = "field";
|
570
570
|
private readonly _type;
|
571
571
|
constructor(_tsctx: TsInteropContext, _symbol: ts.Symbol, _variantTypeEntity: VariantTypeEntity);
|
572
572
|
getContainer(): TypeMemberEntityContainer;
|
@@ -608,13 +608,13 @@ export declare class TsTypeAliasEntity implements AliasTypeEntity {
|
|
608
608
|
getSubstitutionApplicationMode(): SubstitutionApplicationMode;
|
609
609
|
private getDeclaration;
|
610
610
|
}
|
611
|
-
export declare class TsAnonymousFunctionTypeEntity implements
|
611
|
+
export declare class TsAnonymousFunctionTypeEntity implements AnonymousFunctionTypeEntity {
|
612
612
|
private readonly _tsctx;
|
613
613
|
private readonly _symbol;
|
614
614
|
private readonly _declaration;
|
615
615
|
private readonly _containingPackage;
|
616
616
|
readonly kind = EntityKind.Type;
|
617
|
-
readonly typeEntityKind = TypeEntityKind.
|
617
|
+
readonly typeEntityKind = TypeEntityKind.Function;
|
618
618
|
readonly subkind = "anonymous";
|
619
619
|
private readonly _valueParameters;
|
620
620
|
private readonly _returnType;
|
@@ -626,7 +626,7 @@ export declare class TsAnonymousFunctionTypeEntity implements AnonymousMethodTyp
|
|
626
626
|
getValueParameters(): readonly ParameterVariableEntity[];
|
627
627
|
getReturnType(): types.Type;
|
628
628
|
getMembers(): OriginalTypeEntityMembers;
|
629
|
-
getDefinition():
|
629
|
+
getDefinition(): FunctionTypeEntityDefinition;
|
630
630
|
isAsync(): boolean;
|
631
631
|
getArity(): number;
|
632
632
|
isHidden(): EntityHidingLevel | undefined;
|
@@ -646,7 +646,7 @@ export declare class TsAnonymousFunctionTypeEntity implements AnonymousMethodTyp
|
|
646
646
|
* type MyType = { (): number } // псевдоним типа с единственным членом - сигнатурой вызова
|
647
647
|
* ```
|
648
648
|
*/
|
649
|
-
export declare class TsNamedFunctionTypeEntity implements
|
649
|
+
export declare class TsNamedFunctionTypeEntity implements PackageFunctionTypeEntity {
|
650
650
|
private readonly _tsctx;
|
651
651
|
private readonly _signatureSymbol;
|
652
652
|
private readonly _signatureDeclaration;
|
@@ -656,7 +656,7 @@ export declare class TsNamedFunctionTypeEntity implements PackageMethodTypeEntit
|
|
656
656
|
private readonly _containingPackage;
|
657
657
|
private readonly _forceHiddenInPackage;
|
658
658
|
readonly kind = EntityKind.Type;
|
659
|
-
readonly typeEntityKind = TypeEntityKind.
|
659
|
+
readonly typeEntityKind = TypeEntityKind.Function;
|
660
660
|
readonly subkind = "package";
|
661
661
|
private readonly _typeParameters;
|
662
662
|
private readonly _valueParameters;
|
@@ -671,7 +671,7 @@ export declare class TsNamedFunctionTypeEntity implements PackageMethodTypeEntit
|
|
671
671
|
getValueParameters(): readonly ParameterVariableEntity[];
|
672
672
|
getReturnType(): types.Type;
|
673
673
|
getMembers(): OriginalTypeEntityMembers;
|
674
|
-
getDefinition():
|
674
|
+
getDefinition(): FunctionTypeEntityDefinition;
|
675
675
|
isAsync(): boolean;
|
676
676
|
getArity(): number;
|
677
677
|
isHidden(): EntityHidingLevel | undefined;
|
@@ -31,7 +31,7 @@ export declare class TsInteropContext {
|
|
31
31
|
getTypeMemberHiding(node: ts.Declaration | undefined, containingType: TypeEntity): EntityHidingLevel | undefined;
|
32
32
|
onPackageMembersCreated(pkg: PackageEntity, creationResult: TsPackageMembersCreationResult): void;
|
33
33
|
onTypeMembersCreated(type: TypeEntityWithMembers, creationResult: TsTypeMembersCreationResult): void;
|
34
|
-
|
34
|
+
ifTypeCanBeExpressedByFunctionTypeThenCallSignature(symbol: ts.Symbol): ts.Symbol | undefined;
|
35
35
|
getName(original: string, ownerKind: 'type' | 'variable' | 'method'): Name;
|
36
36
|
createDefaultExportTag(): Tag;
|
37
37
|
private getPackagesCreationResult;
|
@@ -103,6 +103,7 @@ declare class TypeContext {
|
|
103
103
|
private ofTypeAlias;
|
104
104
|
private ofObjectType;
|
105
105
|
private ofUnionType;
|
106
|
+
private ofIntersectionType;
|
106
107
|
private ofTypeParameter;
|
107
108
|
private createTypeArguments;
|
108
109
|
private createTypeFromEntity;
|
@@ -59,7 +59,7 @@ export declare class TsPackageMembersCreator {
|
|
59
59
|
private createReplacementSourceEntities;
|
60
60
|
private getSourceEntity;
|
61
61
|
}
|
62
|
-
export type NamedPackageMemberDeclaration = tree.PackageAliasTypeDeclaration | tree.
|
62
|
+
export type NamedPackageMemberDeclaration = tree.PackageAliasTypeDeclaration | tree.PackageFunctionDeclaration | tree.PackageFunctionTypeDeclaration | tree.PackageStructuredTypeDeclaration | tree.PackageVariableDeclaration | tree.PackageVariableGetterDeclaration | tree.PackageVariableSetterDeclaration | tree.PackageVariantTypeDeclaration;
|
63
63
|
export declare class TsPackageMembersCreationResult {
|
64
64
|
readonly members: OriginalPackageMembers;
|
65
65
|
readonly typeEntityBySymbol: ReadonlyMap<ts.Symbol, TypeEntity>;
|
@@ -30,7 +30,7 @@ export declare class TsTypeMembersCreator {
|
|
30
30
|
* @param symbol (symbol.flags & ts.SymbolFlags.Method) !== 0
|
31
31
|
*/
|
32
32
|
private createMethods;
|
33
|
-
private
|
33
|
+
private createFunctionEntityNoReplacement;
|
34
34
|
private createConstructors;
|
35
35
|
private createIndexerSignatures;
|
36
36
|
private registerTypeParameters;
|
@@ -1,19 +1,19 @@
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
2
|
-
import {
|
2
|
+
import { FunctionTypeEntity, TypeParameterEntity } from '../entities/index.js';
|
3
3
|
import { IType, SubstitutionMap, Substitutions, Type, ValueParameter } from './index.js';
|
4
|
-
export declare class
|
4
|
+
export declare class FunctionType implements IType {
|
5
5
|
private readonly _analyzer;
|
6
6
|
private readonly _entity;
|
7
7
|
private readonly _substitutions;
|
8
|
-
readonly kind = "
|
8
|
+
readonly kind = "function";
|
9
9
|
private readonly _valueParameters;
|
10
10
|
get debuggerDisplay(): string;
|
11
|
-
constructor(_analyzer: Analyzer, _entity:
|
11
|
+
constructor(_analyzer: Analyzer, _entity: FunctionTypeEntity, _substitutions: Substitutions);
|
12
12
|
getTypeParameters(): readonly TypeParameterEntity[];
|
13
13
|
getSubstitutions(): Substitutions;
|
14
|
-
applySubstitutions(map: SubstitutionMap):
|
14
|
+
applySubstitutions(map: SubstitutionMap): FunctionType;
|
15
15
|
equals(other: Type): boolean;
|
16
|
-
getEntity():
|
16
|
+
getEntity(): FunctionTypeEntity;
|
17
17
|
isAsync(): boolean;
|
18
18
|
getReturnType(): Type;
|
19
19
|
getValueParameters(): readonly ValueParameter[];
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Analyzer } from '../analysis/index.js';
|
2
|
+
import { TypeEntity } from '../entities/index.js';
|
3
|
+
import { SubstitutionMap, Substitutions } from './Substitutions.js';
|
4
|
+
import { IType, Type } from './index.js';
|
5
|
+
export declare class IntersectionType implements IType {
|
6
|
+
readonly kind = "intersection";
|
7
|
+
readonly originalTypes: readonly Type[];
|
8
|
+
private readonly _analyzer;
|
9
|
+
private readonly _unaliasedFlattenedTypes;
|
10
|
+
get unaliasedFlattenedTypes(): readonly Type[];
|
11
|
+
get debuggerDisplay(): string;
|
12
|
+
constructor(analyzer: Analyzer, originalTypes: readonly Type[]);
|
13
|
+
equals(other: Type): boolean;
|
14
|
+
getSubstitutions(): Substitutions;
|
15
|
+
applySubstitutions(map: SubstitutionMap): Type;
|
16
|
+
getEntity(): TypeEntity | undefined;
|
17
|
+
getBaseObjectTypeOrAliasedType(): Type | undefined;
|
18
|
+
toString(): string;
|
19
|
+
private unaliasAndFlattenType;
|
20
|
+
}
|
@@ -4,12 +4,15 @@ import { IType, SubstitutionMap, Substitutions, Type } from './index.js';
|
|
4
4
|
export declare class ParameterType implements IType {
|
5
5
|
private readonly _analyzer;
|
6
6
|
private readonly _entity;
|
7
|
-
|
7
|
+
readonly isNoneExcluded: boolean;
|
8
8
|
readonly kind = "parameter";
|
9
|
-
|
9
|
+
private readonly _constraint;
|
10
|
+
/**
|
11
|
+
* Ограничение параметра типа с учётом флага {@link isNoneExcluded}.
|
12
|
+
*/
|
10
13
|
get constraint(): Type | undefined;
|
11
14
|
get debuggerDisplay(): string;
|
12
|
-
constructor(_analyzer: Analyzer, _entity: TypeParameterEntity,
|
15
|
+
constructor(_analyzer: Analyzer, _entity: TypeParameterEntity, isNoneExcluded: boolean);
|
13
16
|
getSubstitutions(): Substitutions;
|
14
17
|
getEntity(): TypeParameterEntity;
|
15
18
|
applySubstitutions(map: SubstitutionMap): Type;
|
@@ -19,7 +19,7 @@ export declare class StandardTypes {
|
|
19
19
|
private _reference;
|
20
20
|
private _task;
|
21
21
|
private _error;
|
22
|
-
private
|
22
|
+
private _func;
|
23
23
|
constructor(_analyzer: Analyzer);
|
24
24
|
get refObject(): StructuredType;
|
25
25
|
get plainObject(): StructuredType;
|
@@ -38,5 +38,5 @@ export declare class StandardTypes {
|
|
38
38
|
get reference(): StructuredType;
|
39
39
|
get task(): StructuredType;
|
40
40
|
get error(): StructuredType;
|
41
|
-
get
|
41
|
+
get func(): StructuredType;
|
42
42
|
}
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { TypeEntity } from '../entities/index.js';
|
2
2
|
import { AliasType } from './AliasType.js';
|
3
|
-
import {
|
3
|
+
import { IntersectionType } from './IntersectionType.js';
|
4
|
+
import { FunctionType } from './FunctionType.js';
|
4
5
|
import { ParameterType } from './ParameterType.js';
|
5
6
|
import { StructuredType } from './StructuredType.js';
|
6
7
|
import { UnresolvedType } from './UnresolvedType.js';
|
7
8
|
import { VariantType } from './VariantType.js';
|
8
9
|
import { SubstitutionMap, Substitutions, UnionType } from './index.js';
|
9
|
-
export type Type = StructuredType | VariantType |
|
10
|
+
export type Type = StructuredType | VariantType | FunctionType | AliasType | UnresolvedType | ParameterType | UnionType | IntersectionType;
|
10
11
|
export interface IType {
|
11
12
|
getSubstitutions(): Substitutions;
|
12
13
|
applySubstitutions(map: SubstitutionMap): Type;
|
@@ -1,16 +1,18 @@
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
2
|
-
import { AliasTypeEntity,
|
3
|
-
import { AliasType,
|
2
|
+
import { AliasTypeEntity, FunctionTypeEntity, StructuredTypeEntity, TypeParameterEntity, VariantTypeEntity } from '../entities/index.js';
|
3
|
+
import { AliasType, FunctionType, ParameterType, StructuredType, Substitutions, Type, UnresolvedType, VariantType } from './index.js';
|
4
4
|
export declare class TypeFactory {
|
5
5
|
readonly analyzer: Analyzer;
|
6
6
|
constructor(analyzer: Analyzer);
|
7
7
|
getStructuredType(entity: StructuredTypeEntity, substitutions: Substitutions): StructuredType;
|
8
8
|
getParameterType(entity: TypeParameterEntity, excludeNone: boolean): ParameterType;
|
9
9
|
getVariantType(entity: VariantTypeEntity, substitutions: Substitutions): VariantType;
|
10
|
-
|
10
|
+
getFunctionType(entity: FunctionTypeEntity, substitutions: Substitutions): FunctionType;
|
11
11
|
getAliasType(entity: AliasTypeEntity, substitutions: Substitutions): AliasType;
|
12
|
-
getUnionType(types: readonly Type[],
|
12
|
+
getUnionType(types: readonly Type[], reduce?: boolean): Type;
|
13
|
+
getIntersectionType(types: readonly Type[], reduce?: boolean): Type;
|
13
14
|
getUnresolvedType(): UnresolvedType;
|
14
|
-
private
|
15
|
-
private
|
15
|
+
private flattenAndExcludeDuplicateTypes;
|
16
|
+
private removeBaseTypes;
|
17
|
+
private removeDerivedTypes;
|
16
18
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Analyzer } from '../analysis/index.js';
|
2
2
|
import { Name } from '../common/index.js';
|
3
|
-
import { ConstructorEntity, DereferenceOperatorEntity, DestructorEntity, EntityHidingLevel, IndexerEntity, OperatorEntity, OperatorKind, ParameterVariableEntity,
|
4
|
-
import {
|
3
|
+
import { ConstructorEntity, DereferenceOperatorEntity, DestructorEntity, EntityHidingLevel, IndexerEntity, OperatorEntity, OperatorKind, ParameterVariableEntity, MethodEntity, TypeParameterEntity, FieldEntity } from '../entities/index.js';
|
4
|
+
import { FunctionType } from './FunctionType.js';
|
5
5
|
import { Substitutions } from './Substitutions.js';
|
6
6
|
import { Type } from './Type.js';
|
7
7
|
export type TypeMember = Variable | Method | Operator | Constructor | Destructor | Indexer | DereferenceOperator;
|
@@ -13,14 +13,14 @@ export declare class Method implements ITypeMember {
|
|
13
13
|
readonly kind = "method";
|
14
14
|
private readonly _valueParameters;
|
15
15
|
private readonly _signatureEntity;
|
16
|
-
constructor(_analyzer: Analyzer, _entity:
|
16
|
+
constructor(_analyzer: Analyzer, _entity: MethodEntity, _substitutions: Substitutions);
|
17
17
|
getName(): Name;
|
18
18
|
getTypeParameters(): readonly TypeParameterEntity[];
|
19
19
|
getValueParameters(): readonly ValueParameter[];
|
20
20
|
getReturnType(): Type;
|
21
|
-
getEntity():
|
21
|
+
getEntity(): MethodEntity;
|
22
22
|
getSubstitutions(): Substitutions;
|
23
|
-
getSignatureType():
|
23
|
+
getSignatureType(): FunctionType;
|
24
24
|
isAsync(): boolean;
|
25
25
|
isHidden(): EntityHidingLevel | undefined;
|
26
26
|
isStatic(): boolean;
|
@@ -43,10 +43,10 @@ export declare class Variable implements ITypeMember {
|
|
43
43
|
private readonly _entity;
|
44
44
|
private readonly _substitutions;
|
45
45
|
readonly kind = "variable";
|
46
|
-
constructor(_entity:
|
46
|
+
constructor(_entity: FieldEntity, _substitutions: Substitutions);
|
47
47
|
getName(): Name;
|
48
48
|
getType(): Type;
|
49
|
-
getEntity():
|
49
|
+
getEntity(): FieldEntity;
|
50
50
|
getSubstitutions(): Substitutions;
|
51
51
|
isConstant(): boolean;
|
52
52
|
isHidden(): EntityHidingLevel | undefined;
|
@@ -68,7 +68,7 @@ export declare class Operator implements ITypeMember {
|
|
68
68
|
getReturnType(): Type;
|
69
69
|
getEntity(): OperatorEntity;
|
70
70
|
getSubstitutions(): Substitutions;
|
71
|
-
getSignatureType():
|
71
|
+
getSignatureType(): FunctionType;
|
72
72
|
isHidden(): EntityHidingLevel | undefined;
|
73
73
|
isStatic(): boolean;
|
74
74
|
applySubstitutions(substitutions: Substitutions): Operator;
|
package/package.json
CHANGED
@@ -1,53 +0,0 @@
|
|
1
|
-
import { Name } from '../common/index.js';
|
2
|
-
import { MethodEntity, ParameterVariableEntity, TypeParameterEntity } from '../entities/index.js';
|
3
|
-
import * as types from '../types/index.js';
|
4
|
-
import { Analyzer } from './Analyzer.js';
|
5
|
-
import { SubstitutedMethod } from './SubstitutedMethod.js';
|
6
|
-
export type AccessedMethod = AccessedMethod_entity | AccessedMethod_typeMember | AccessedMethod_substitutedMethod;
|
7
|
-
export declare class AccessedMethod_entity implements IAccessedMethod {
|
8
|
-
readonly value: MethodEntity;
|
9
|
-
readonly kind = "entity";
|
10
|
-
constructor(value: MethodEntity);
|
11
|
-
getTypeParameters(): readonly TypeParameterEntity[];
|
12
|
-
getValueParameters(): readonly AccessedMethodValueParameter[];
|
13
|
-
getReturnType(): types.Type;
|
14
|
-
getEntity(): MethodEntity;
|
15
|
-
getName(): Name;
|
16
|
-
getSignatureType(analyzer: Analyzer): types.MethodType;
|
17
|
-
}
|
18
|
-
export declare class AccessedMethod_typeMember implements IAccessedMethod {
|
19
|
-
readonly value: types.Method;
|
20
|
-
readonly kind = "type-member";
|
21
|
-
constructor(value: types.Method);
|
22
|
-
getTypeParameters(): readonly TypeParameterEntity[];
|
23
|
-
getValueParameters(): readonly AccessedMethodValueParameter[];
|
24
|
-
getReturnType(): types.Type;
|
25
|
-
getEntity(): MethodEntity;
|
26
|
-
getName(): Name;
|
27
|
-
getSignatureType(_analyzer: Analyzer): types.MethodType;
|
28
|
-
}
|
29
|
-
export declare class AccessedMethod_substitutedMethod implements IAccessedMethod {
|
30
|
-
readonly value: SubstitutedMethod;
|
31
|
-
readonly kind = "substituted-method";
|
32
|
-
constructor(value: SubstitutedMethod);
|
33
|
-
getTypeParameters(): readonly TypeParameterEntity[];
|
34
|
-
getValueParameters(): readonly AccessedMethodValueParameter[];
|
35
|
-
getReturnType(): types.Type;
|
36
|
-
getEntity(): MethodEntity;
|
37
|
-
getName(): Name;
|
38
|
-
getSignatureType(_analyzer: Analyzer): types.MethodType;
|
39
|
-
}
|
40
|
-
export declare class AccessedMethodValueParameter {
|
41
|
-
readonly entity: ParameterVariableEntity;
|
42
|
-
readonly type: types.Type;
|
43
|
-
constructor(entity: ParameterVariableEntity, type: types.Type);
|
44
|
-
}
|
45
|
-
interface IAccessedMethod {
|
46
|
-
getTypeParameters(): readonly TypeParameterEntity[];
|
47
|
-
getValueParameters(): readonly AccessedMethodValueParameter[];
|
48
|
-
getReturnType(): types.Type;
|
49
|
-
getEntity(): MethodEntity;
|
50
|
-
getName(): Name;
|
51
|
-
getSignatureType(analyzer: Analyzer): types.MethodType;
|
52
|
-
}
|
53
|
-
export {};
|
@@ -1,129 +0,0 @@
|
|
1
|
-
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
2
|
-
import { SourceFile } from '../project/SourceFile.js';
|
3
|
-
import * as tree from '../tree/index.js';
|
4
|
-
export declare class ControlFlowGraphBuilder {
|
5
|
-
private readonly _sourceFile;
|
6
|
-
private readonly _controlFlowNodeByReference;
|
7
|
-
private readonly _unreachableCodeDiagnostics;
|
8
|
-
private _isInRebuildingFinallyClauseGraphMode;
|
9
|
-
private _currentPredecessor;
|
10
|
-
private _currentContinueLoopTarget;
|
11
|
-
private _currentBreakLoopTarget;
|
12
|
-
private _currentErrorTarget;
|
13
|
-
private _currentReturnTarget;
|
14
|
-
constructor(sourceFile: SourceFile);
|
15
|
-
build(): ControlFlowGraphBuildResult;
|
16
|
-
private visitNode;
|
17
|
-
private visitAssignmentStatement;
|
18
|
-
private visitIfStatement;
|
19
|
-
private visitWhileStatement;
|
20
|
-
private visitLoopStatement;
|
21
|
-
private visitForStatement;
|
22
|
-
private visitContinueLoopStatement;
|
23
|
-
private visitBreakLoopStatement;
|
24
|
-
private visitSwitchStatement;
|
25
|
-
private visitTryStatement;
|
26
|
-
private visitReturnStatement;
|
27
|
-
private visitErrorStatement;
|
28
|
-
private visitLocalVariableDeclaration;
|
29
|
-
private visitWhenTernaryExpression;
|
30
|
-
private visitCondition;
|
31
|
-
private visitBinaryExpression;
|
32
|
-
private visitPrefixUnaryExpressionInCondition;
|
33
|
-
private visitIsExpressionInCondition;
|
34
|
-
private setAssignmentAsCurrentPredecessor;
|
35
|
-
private visitChildren;
|
36
|
-
private addUnreachableCodeDiagnostic;
|
37
|
-
}
|
38
|
-
export declare class ControlFlowGraphBuildResult {
|
39
|
-
readonly controlFlowNodeByReference: ReadonlyMap<NarrowableReferenceExpression, ControlFlowNode>;
|
40
|
-
readonly unreachableCodeDiagnostics: readonly Diagnostic[];
|
41
|
-
constructor(controlFlowNodeByReference: ReadonlyMap<NarrowableReferenceExpression, ControlFlowNode>, unreachableCodeDiagnostics: readonly Diagnostic[]);
|
42
|
-
}
|
43
|
-
export declare function isNarrowableExpression(node: tree.Node): node is tree.Expression;
|
44
|
-
export type NarrowableReferenceExpression = tree.IdentifierExpression | tree.PropertyAccessExpression | tree.ObjectExpression;
|
45
|
-
export declare function isNarrowableReferenceExpression(node: tree.Node): node is NarrowableReferenceExpression;
|
46
|
-
export declare function unwrapExpressionForNarrowableReferenceCheck(node: tree.Expression): tree.Expression;
|
47
|
-
export type ControlFlowNode = ControlFlowNode.Start | ControlFlowNode.Condition | ControlFlowNode.Assignment | ControlFlowNode.LocalVariableDeclaration | ControlFlowNode.Split | ControlFlowNode.Loop | ControlFlowNode.Unreachable;
|
48
|
-
export declare namespace ControlFlowNode {
|
49
|
-
abstract class ControlFlowNodeBase {
|
50
|
-
protected abstract thisAsNode: ControlFlowNode;
|
51
|
-
/**
|
52
|
-
* Для отладочных целей.
|
53
|
-
*/
|
54
|
-
generateVisualizationCode(): string;
|
55
|
-
}
|
56
|
-
/**
|
57
|
-
* Начальный узел, не имеющий предшественников.
|
58
|
-
*/
|
59
|
-
export class Start extends ControlFlowNodeBase {
|
60
|
-
readonly kind = "start";
|
61
|
-
get debuggerDisplay(): string;
|
62
|
-
protected get thisAsNode(): ControlFlowNode;
|
63
|
-
}
|
64
|
-
/**
|
65
|
-
* Хранит информацию об истинности некоторого условия. Например, если условие `а != пусто` истинно, то из типа
|
66
|
-
* переменной `а` необходимо исключить тип `Пусто`.
|
67
|
-
*/
|
68
|
-
export class Condition extends ControlFlowNodeBase {
|
69
|
-
readonly predecessor: ControlFlowNode;
|
70
|
-
readonly syntaxNode: ConditionControlFlowNodeExpression;
|
71
|
-
readonly isTrue: boolean;
|
72
|
-
readonly kind = "condition";
|
73
|
-
get debuggerDisplay(): string;
|
74
|
-
protected get thisAsNode(): ControlFlowNode;
|
75
|
-
constructor(predecessor: ControlFlowNode, syntaxNode: ConditionControlFlowNodeExpression, isTrue: boolean);
|
76
|
-
}
|
77
|
-
/**
|
78
|
-
* Создаётся в местах присваивания значений в переменную, а также объявления переменных с начальным значением.
|
79
|
-
* После присваивания тип переменной меняется на тип выражения справа от равно.
|
80
|
-
*/
|
81
|
-
export class Assignment extends ControlFlowNodeBase {
|
82
|
-
readonly predecessor: ControlFlowNode;
|
83
|
-
readonly syntaxNode: tree.AssignmentStatement;
|
84
|
-
readonly kind = "assignment";
|
85
|
-
get debuggerDisplay(): string;
|
86
|
-
protected get thisAsNode(): ControlFlowNode;
|
87
|
-
constructor(predecessor: ControlFlowNode, syntaxNode: tree.AssignmentStatement);
|
88
|
-
}
|
89
|
-
export class LocalVariableDeclaration extends ControlFlowNodeBase {
|
90
|
-
readonly predecessor: ControlFlowNode;
|
91
|
-
readonly syntaxNode: tree.LocalVariableDeclaration;
|
92
|
-
readonly kind = "local-variable-declaration";
|
93
|
-
get debuggerDisplay(): string;
|
94
|
-
protected get thisAsNode(): ControlFlowNode;
|
95
|
-
constructor(predecessor: ControlFlowNode, syntaxNode: tree.LocalVariableDeclaration);
|
96
|
-
}
|
97
|
-
/**
|
98
|
-
* Вспомогательный узел, использующийся в местах, где происходит разветвление графа потока управления. Тип переменной
|
99
|
-
* для этого узла определяется как союзный тип из типов переменных в предшествующих узлах.
|
100
|
-
*/
|
101
|
-
export class Split extends ControlFlowNodeBase {
|
102
|
-
readonly predecessors: readonly ControlFlowNode[];
|
103
|
-
readonly kind = "split";
|
104
|
-
get debuggerDisplay(): string;
|
105
|
-
protected get thisAsNode(): ControlFlowNode;
|
106
|
-
constructor(predecessors: readonly ControlFlowNode[]);
|
107
|
-
}
|
108
|
-
/**
|
109
|
-
* Используется для циклов (пока, цикл - повтор пока, для-из). Отличается от узла `Split` тем, что предшествующие
|
110
|
-
* узлы, указанные в массиве `loopingPredecessors` образуют циклы в графе потока управления.
|
111
|
-
*/
|
112
|
-
export abstract class Loop extends ControlFlowNodeBase {
|
113
|
-
readonly kind = "loop";
|
114
|
-
get debuggerDisplay(): string;
|
115
|
-
protected get thisAsNode(): ControlFlowNode;
|
116
|
-
abstract predecessor: ControlFlowNode;
|
117
|
-
abstract loopingPredecessors: readonly ControlFlowNode[];
|
118
|
-
}
|
119
|
-
/**
|
120
|
-
* Обозначает недостижимый код.
|
121
|
-
*/
|
122
|
-
export class Unreachable extends ControlFlowNodeBase {
|
123
|
-
readonly kind = "unreachable";
|
124
|
-
get debuggerDisplay(): string;
|
125
|
-
protected get thisAsNode(): ControlFlowNode;
|
126
|
-
}
|
127
|
-
export {};
|
128
|
-
}
|
129
|
-
export type ConditionControlFlowNodeExpression = tree.BinaryExpression | tree.IsExpression;
|