@artel/artc 0.6.25221 → 0.6.25223

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.
Files changed (34) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +10 -2
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +281 -261
  5. package/build/{chunk-XMV7LOUY.js → chunk-AX3LQ2CF.js} +2 -2
  6. package/build/{chunk-X7TMUZ4C.js → chunk-DZNNWICP.js} +2738 -1794
  7. package/build/{chunk-5F65ZJE3.js → chunk-LG4Z4SWO.js} +1 -1
  8. package/build/types/analysis/Analyzer.d.ts +13 -10
  9. package/build/types/analysis/ControlFlowGraphBuilder.d.ts +12 -4
  10. package/build/types/analysis/LocalizationContext.d.ts +2 -2
  11. package/build/types/analysis/Lookup.d.ts +4 -4
  12. package/build/types/analysis/NodeTypeUtils.d.ts +1 -6
  13. package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +1 -1
  14. package/build/types/analysis/Scope.d.ts +21 -44
  15. package/build/types/analysis/SemanticContext.d.ts +21 -1
  16. package/build/types/analysis/SemanticContextBuilder.d.ts +3 -0
  17. package/build/types/analysis/StatementBlockScopeBuilder.d.ts +20 -17
  18. package/build/types/analysis/TypeMemberLookup.d.ts +39 -11
  19. package/build/types/analysis/TypeNarrower.d.ts +48 -8
  20. package/build/types/emitter/IrBuilder.d.ts +3 -1
  21. package/build/types/emitter/IrToJs.d.ts +1 -0
  22. package/build/types/emitter/Transformer.d.ts +2 -0
  23. package/build/types/emitter/ir/Nodes.d.ts +86 -78
  24. package/build/types/emitter/ir/types.d.ts +2 -2
  25. package/build/types/entities/index.d.ts +3 -0
  26. package/build/types/parser/Scanner.d.ts +1 -2
  27. package/build/types/tree/KeywordKind.d.ts +41 -40
  28. package/build/types/tree/NodeKind.d.ts +63 -61
  29. package/build/types/tree/green/Nodes.d.ts +83 -56
  30. package/build/types/tree/green/SyntaxFactory.d.ts +12 -10
  31. package/build/types/tree/green/SyntaxToCode.d.ts +1 -0
  32. package/build/types/tree/red/Nodes.d.ts +69 -41
  33. package/build/types/types/TypeMembers.d.ts +5 -0
  34. package/package.json +1 -1
@@ -10,7 +10,7 @@ import {
10
10
  WellKnownDeclarationsLoadError,
11
11
  __async,
12
12
  createTsInteropInputsForCompilation
13
- } from "./chunk-X7TMUZ4C.js";
13
+ } from "./chunk-DZNNWICP.js";
14
14
 
15
15
  // source/executor/Compiler.ts
16
16
  var Compiler = class {
@@ -92,7 +92,7 @@ export declare class Analyzer {
92
92
  private readonly _extendedTypes;
93
93
  private readonly _analyzedTranslationPackages;
94
94
  private readonly _linkedMultiPlatformPackagesByPlatform;
95
- private readonly _bodyUsesYieldStatementCheckResults;
95
+ private readonly _functionBlockWithYieldStatementCheckResults;
96
96
  private readonly _namedDeclarationsUsageCountResults;
97
97
  private readonly _controlFlowGraphs;
98
98
  get tsInterop(): TsInteropContext;
@@ -108,7 +108,7 @@ export declare class Analyzer {
108
108
  } | undefined;
109
109
  isTypeAssignableTo(source: types.Type, target: types.Type): boolean;
110
110
  getTypeAssignabilityFlags(source: types.Type, target: types.Type): TypeAssignabilityFlags;
111
- checkStatementBlockInvokesAsyncMethods(node: tree.StatementBlock): boolean;
111
+ checkBlockInvokesAsyncMethods(node: tree.StatementBlock | tree.FunctionBlock): boolean;
112
112
  getSyntacticAccessKind(node: tree.Expression): SyntacticAccessKind;
113
113
  getTypeMemberEntityContainer(node: tree.TypeMemberDeclaration): e.TypeMemberEntityContainer;
114
114
  getTargetTypeOfExpression(node: tree.Expression, hint?: TargetTypeHint): types.Type | undefined;
@@ -184,7 +184,7 @@ export declare class Analyzer {
184
184
  checkExpressionDenotesPackageNameSegment(expression: tree.Expression): {
185
185
  packageTreeNode: PackageNameTreeNode;
186
186
  } | undefined;
187
- checkMethodBodyUsesYieldStatement(node: tree.StatementBlock): boolean;
187
+ checkFunctionBlockWithYieldStatement(node: tree.FunctionBlock): boolean;
188
188
  enumerateAspects(type: types.Type): Iterable<types.StructuredType>;
189
189
  checkTypeIsBasedOnAspect(type: types.Type, aspectEntity: e.StructuredTypeEntity): boolean;
190
190
  resolvePrefixUnaryExpressionUserDefinableOperator(node: tree.PrefixUnaryExpression): WithDiagnostics<FoundAnonymousDeclaration<types.Operator>>;
@@ -250,6 +250,7 @@ export declare class Analyzer {
250
250
  createPackageMemberHiding(node: tree.PackageMemberDeclaration, modifierFlags: ModifierFlags): e.EntityHidingLevel | undefined;
251
251
  createTypeMemberHiding(node: tree.TypeMemberDeclaration, modifierFlags: ModifierFlags): e.EntityHidingLevel | undefined;
252
252
  getDeclarationsUsageCount(sourceFile: tree.SourceFile, cancellationToken: CancellationToken | undefined): Promise<DeclarationsUsageCountResult>;
253
+ isFunctionResultNone(node: tree.FunctionBlock): boolean;
253
254
  isExpressionImplicitlyReturnedFromSubprogram(node: tree.ExpressionStatement): boolean;
254
255
  createBackingPackageVariables(declaredMembers: readonly (e.NamedPackageMemberEntity | e.PackageAliasEntity)[], pkg: e.PackageEntity): e.PackageVariableEntity[];
255
256
  createBackingTypeVariables(declaredMembers: readonly NamedTypeMemberEntity[], type: e.TypeEntity): e.TypeVariableEntity[];
@@ -461,6 +462,7 @@ declare class Scope {
461
462
  private readonly _nestedMethodDeclarationTypeParametersScopes;
462
463
  private readonly _nestedMethodDeclarationValueParametersScopes;
463
464
  private readonly _methodLiteralScopes;
465
+ private readonly _functionBlockScopes;
464
466
  private readonly _statementBlockScopes;
465
467
  private readonly _forEachStatementScopes;
466
468
  private readonly _catchClauseScopes;
@@ -487,6 +489,7 @@ declare class Scope {
487
489
  ofNestedMethodDeclarationTypeParameters(node: tree.NestedMethodDeclaration): scope.IScope;
488
490
  ofNestedMethodDeclarationValueParameters(node: tree.NestedMethodDeclaration): scope.IScope;
489
491
  ofMethodLiteral(node: tree.MethodLiteral): scope.IScope;
492
+ ofFunctionBlock(node: tree.FunctionBlock): scope.IScope;
490
493
  ofStatementBlock(node: tree.StatementBlock): scope.IScope;
491
494
  ofForStatement(node: tree.ForStatement): scope.IScope;
492
495
  ofCatchClause(node: tree.CatchClause): scope.IScope;
@@ -604,19 +607,19 @@ declare class OwningPlainObjectModificationCheck {
604
607
  private _analyzer;
605
608
  private readonly _owningPlainObjectModificationCheckResult;
606
609
  constructor(_analyzer: Analyzer);
607
- ofDeclarationBody(node: tree.StatementBlock): boolean;
610
+ ofDeclarationBody(node: tree.FunctionBlock): boolean;
608
611
  private checkMethodBodyModifiesPlainObject;
609
612
  private checkReceiverModifiesPlainObjectRecursively;
610
613
  private nodeBelongsToPlainObjectDeclaration;
611
614
  }
612
615
  export declare enum TypeAssignabilityFlags {
613
- NotAssignable = 1,
614
- Identity = 2,
615
- DerivedToBase = 4,
616
- MethodTypes = 8,
617
- ImplicitConversion = 16,
616
+ NotAssignable = 0,
617
+ Identity = 1,
618
+ DerivedToBase = 2,
619
+ MethodTypes = 4,
620
+ ImplicitConversion = 8,
618
621
  First = 1,
619
- Last = 16
622
+ Last = 8
620
623
  }
621
624
  declare class PackageImports {
622
625
  private readonly _analyzer;
@@ -40,11 +40,11 @@ export declare class ControlFlowGraphBuildResult {
40
40
  readonly unreachableCodeDiagnostics: readonly Diagnostic[];
41
41
  constructor(controlFlowNodeByReference: ReadonlyMap<NarrowableReferenceExpression, ControlFlowNode>, unreachableCodeDiagnostics: readonly Diagnostic[]);
42
42
  }
43
- export type NarrowableExpression = tree.IdentifierExpression | tree.PropertyAccessExpression | tree.ObjectExpression;
44
43
  export declare function isNarrowableExpression(node: tree.Node): node is tree.Expression;
45
44
  export type NarrowableReferenceExpression = tree.IdentifierExpression | tree.PropertyAccessExpression | tree.ObjectExpression;
46
45
  export declare function isNarrowableReferenceExpression(node: tree.Node): node is NarrowableReferenceExpression;
47
- export type ControlFlowNode = ControlFlowNode.Start | ControlFlowNode.Condition | ControlFlowNode.Assignment | ControlFlowNode.Split | ControlFlowNode.Loop | ControlFlowNode.Unreachable;
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
48
  export declare namespace ControlFlowNode {
49
49
  abstract class ControlFlowNodeBase {
50
50
  protected abstract thisAsNode: ControlFlowNode;
@@ -80,11 +80,19 @@ export declare namespace ControlFlowNode {
80
80
  */
81
81
  export class Assignment extends ControlFlowNodeBase {
82
82
  readonly predecessor: ControlFlowNode;
83
- readonly syntaxNode: tree.AssignmentStatement | tree.LocalVariableDeclaration;
83
+ readonly syntaxNode: tree.AssignmentStatement;
84
84
  readonly kind = "assignment";
85
85
  get debuggerDisplay(): string;
86
86
  protected get thisAsNode(): ControlFlowNode;
87
- constructor(predecessor: ControlFlowNode, syntaxNode: tree.AssignmentStatement | tree.LocalVariableDeclaration);
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);
88
96
  }
89
97
  /**
90
98
  * Вспомогательный узел, использующийся в местах, где происходит разветвление графа потока управления. Тип переменной
@@ -1,5 +1,5 @@
1
1
  import { Name, PackageLocale } from '../common/index.js';
2
- import { AliasTypeEntity, MethodEntity, PackageAliasEntity, PackageEntity, PackageMethodTypeEntity, PackageStructuredTypeEntity, PackageVariantTypeEntity, TypeEntity, TypeParameterEntity, VariableEntity } from '../entities/index.js';
2
+ import { AliasTypeEntity, MethodEntity, PackageAliasEntity, PackageEntity, PackageMethodTypeEntity, PackageStructuredTypeEntity, PackageVariantTypeEntity, TypeOrExtensionEntity, TypeParameterEntity, VariableEntity } from '../entities/index.js';
3
3
  import { AnalyzedTranslationPackage, TranslatedTypeEntityMembers } from './AnalyzedTranslationPackage.js';
4
4
  export declare class LocalizationContext {
5
5
  readonly originalLocale: PackageLocale;
@@ -8,7 +8,7 @@ export declare class LocalizationContext {
8
8
  constructor(translationPackages: readonly AnalyzedTranslationPackage[], originalLocale: PackageLocale);
9
9
  getTranslationPackage(packageEntity: PackageEntity): AnalyzedTranslationPackage | undefined;
10
10
  getTranslationLocale(packageEntity: PackageEntity): PackageLocale;
11
- getTranslatedTypeEntityMembers(typeEntity: TypeEntity): TranslatedTypeEntityMembers | undefined;
11
+ getTranslatedTypeOrExtensionEntityMembers(entity: TypeOrExtensionEntity): TranslatedTypeEntityMembers | undefined;
12
12
  getEntityName(entity: NamedEntity): Name;
13
13
  }
14
14
  export type NamedEntity = VariableEntity | PackageVariantTypeEntity | MethodEntity | TypeParameterEntity | PackageMethodTypeEntity | PackageStructuredTypeEntity | PackageAliasEntity | AliasTypeEntity;
@@ -9,10 +9,10 @@ export declare class Lookup {
9
9
  constructor(_scopeChain: ScopeChain, _hidingMatcher: IEntityHidingMatcher);
10
10
  getTypesOrContainersWithTypes(): readonly FoundNamedDeclaration<TypeOrContainerWithTypes>[];
11
11
  getTypesOrContainersWithTypesByName(name: SearchName): readonly FoundNamedDeclaration<TypeOrContainerWithTypes>[];
12
- getNamedDeclarations(): readonly FoundNamedDeclaration<NamedDeclaration>[];
13
- getNamedDeclarationsByName(name: SearchName): readonly FoundNamedDeclaration<NamedDeclaration>[];
14
- getOperators(): readonly FoundAnonymousDeclaration<types.Operator>[];
15
- getOperatorsByKind(kind: OperatorKind): readonly FoundAnonymousDeclaration<types.Operator>[];
12
+ getNamedDeclarations(noInstanceMembers?: boolean): readonly FoundNamedDeclaration<NamedDeclaration>[];
13
+ getNamedDeclarationsByName(name: SearchName, noInstanceMembers?: boolean): readonly FoundNamedDeclaration<NamedDeclaration>[];
14
+ getOperators(noInstanceMembers?: boolean): readonly FoundAnonymousDeclaration<types.Operator>[];
15
+ getOperatorsByKind(kind: OperatorKind, noInstanceMembers?: boolean): readonly FoundAnonymousDeclaration<types.Operator>[];
16
16
  getTypeExtensionsByType(type: TypeEntity): readonly TypeExtensionEntity[];
17
17
  private checkTypeOrPackageDeclarationShadowing;
18
18
  private checkNamedDeclarationShadowing;
@@ -29,9 +29,4 @@ export type PackageVariableAccessorDeclaration = tree.PackageVariableGetterDecla
29
29
  export type TypeVariableAccessorDeclaration = tree.TypeVariableGetterDeclaration | tree.TypeVariableSetterDeclaration;
30
30
  export type TypeIndexedAccessorDeclaration = tree.TypeIndexedGetterDeclaration | tree.TypeIndexedSetterDeclaration;
31
31
  export type TypeDereferencedVariableAccessorDeclaration = tree.TypeDereferencedVariableGetterDeclaration | tree.TypeDereferencedVariableSetterDeclaration;
32
- type Declaration = tree.PackageMemberDeclaration | tree.TypeMemberDeclaration | tree.LocalVariableDeclaration | tree.EnumerationVariableDeclaration | tree.ErrorVariableDeclaration | tree.NestedMethodDeclaration | TypeDeclaration;
33
- type SubprogramDeclarationInternal<T extends Declaration = Declaration> = T extends {
34
- block: tree.StatementBlock | undefined;
35
- } ? T : never;
36
- export type SubprogramDeclaration = SubprogramDeclarationInternal | tree.MethodLiteral | tree.MethodBlockLiteral;
37
- export {};
32
+ export type SubprogramDeclaration = tree.FunctionBlockParent | tree.MethodLiteral | tree.MethodBlockLiteral;
@@ -24,7 +24,7 @@ export declare class Resolver {
24
24
  private resolveStaticMemberOrVariantAccessMeaning;
25
25
  private createAccessedMethodFromTypeMember;
26
26
  private resolveInstanceMemberAccessMeaning;
27
- private tryResolveOperatorAccessMeaning;
27
+ private tryResolveInstanceOperatorAccessMeaning;
28
28
  private resolveMethodOverload;
29
29
  private convertSyntacticAccessKind;
30
30
  }
@@ -10,10 +10,10 @@ import { TypeMemberLookup } from './TypeMemberLookup.js';
10
10
  export interface IScope {
11
11
  getTypesOrContainersWithTypes(hidingMatcher?: IEntityHidingMatcher): readonly FoundNamedDeclaration<TypeOrContainerWithTypes>[];
12
12
  getTypesOrContainersWithTypesByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): readonly FoundNamedDeclaration<TypeOrContainerWithTypes>[];
13
- getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): readonly FoundNamedDeclaration<NamedDeclaration>[];
14
- getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): readonly FoundNamedDeclaration<NamedDeclaration>[];
15
- getOperators(hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
16
- getOperatorsByKind(kind: OperatorKind, hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
13
+ getNamedDeclarations(noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): readonly FoundNamedDeclaration<NamedDeclaration>[];
14
+ getNamedDeclarationsByName(name: SearchName, noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): readonly FoundNamedDeclaration<NamedDeclaration>[];
15
+ getOperators(noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
16
+ getOperatorsByKind(kind: OperatorKind, noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
17
17
  getTypeExtensionsByType(typeEntity: TypeEntity, hidingMatcher?: IEntityHidingMatcher): readonly TypeExtensionEntity[];
18
18
  }
19
19
  export type TypeOrContainerWithTypes = NamedDeclaration_type | NamedDeclaration_packageAlias | NamedDeclaration_packageNameSegment;
@@ -139,10 +139,10 @@ export declare class SourceFileScope implements IScope {
139
139
  constructor(analyzer: Analyzer, node: tree.SourceFile);
140
140
  getTypesOrContainersWithTypes(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
141
141
  getTypesOrContainersWithTypesByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
142
- getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
143
- getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
144
- getOperators(_hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
145
- getOperatorsByKind(_kind: OperatorKind, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
142
+ getNamedDeclarations(_noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
143
+ getNamedDeclarationsByName(name: SearchName, _noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
144
+ getOperators(_noInstanceMembers?: boolean, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
145
+ getOperatorsByKind(_kind: OperatorKind, _noInstanceMembers?: boolean, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
146
146
  getTypeExtensionsByType(type: TypeEntity, hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
147
147
  private convertPackageMemberToNamedDeclaration;
148
148
  private convertPackageAliasToTypeOrContainerWithTypes;
@@ -163,10 +163,10 @@ export declare class GenericScope implements IScope {
163
163
  constructor(namedDeclarations: readonly NamedDeclaration[], typeExtensionEntities: readonly TypeExtensionEntity[], locale: PackageLocale);
164
164
  getTypesOrContainersWithTypes(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
165
165
  getTypesOrContainersWithTypesByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
166
- getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
167
- getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
168
- getOperators(_hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
169
- getOperatorsByKind(_kind: OperatorKind, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
166
+ getNamedDeclarations(_noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
167
+ getNamedDeclarationsByName(name: SearchName, _noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
168
+ getOperators(_noInstanceMembers?: boolean, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
169
+ getOperatorsByKind(_kind: OperatorKind, _noInstanceMembers?: boolean, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
170
170
  getTypeExtensionsByType(typeEntity: TypeEntity, hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
171
171
  private checkHiding;
172
172
  }
@@ -182,47 +182,24 @@ export declare class ParameterDeclarationsScope implements IScope {
182
182
  constructor(analyzer: Analyzer, node: tree.ParameterList);
183
183
  getTypesOrContainersWithTypes(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
184
184
  getTypesOrContainersWithTypesByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
185
- getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
186
- getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
187
- getOperators(_hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
188
- getOperatorsByKind(_kind: OperatorKind, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
185
+ getNamedDeclarations(_noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
186
+ getNamedDeclarationsByName(name: SearchName, noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
187
+ getOperators(_noInstanceMembers?: boolean, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
188
+ getOperatorsByKind(_kind: OperatorKind, _noInstanceMembers?: boolean, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
189
189
  getTypeExtensionsByType(typeEntity: TypeEntity, hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
190
190
  private checkHiding;
191
191
  }
192
- export declare class TypeWithMembersBodyScope implements IScope {
192
+ export declare class TypeWithMembersOrExtensionBodyScope implements IScope {
193
193
  private readonly _memberLookup;
194
194
  private readonly _typeExtensionsLookup;
195
195
  constructor(_memberLookup: TypeMemberLookup, _typeExtensionsLookup: Lookup);
196
196
  getTypesOrContainersWithTypes(_hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
197
197
  getTypesOrContainersWithTypesByName(_name: SearchName, _hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
198
- getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
199
- getNamedDeclarationsByName(name: SearchName, hidingMatcher: IEntityHidingMatcher | undefined): FoundNamedDeclaration<NamedDeclaration>[];
200
- getOperators(hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
201
- getOperatorsByKind(kind: OperatorKind, hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
198
+ getNamedDeclarations(noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
199
+ getNamedDeclarationsByName(name: SearchName, noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
200
+ getOperators(noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
201
+ getOperatorsByKind(kind: OperatorKind, noInstanceMembers?: boolean, hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
202
202
  getTypeExtensionsByType(_typeEntity: TypeEntity, _hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
203
203
  private convertNamedMember;
204
204
  }
205
- export declare class TypeExtensionBodyScope implements IScope {
206
- private readonly _analyzer;
207
- private readonly _extendedTypeMemberLookup;
208
- private readonly _extendedType;
209
- private readonly _typeExtensionEntity;
210
- private readonly _typeExtensionsLookup;
211
- private readonly _locale;
212
- private readonly _substitutions;
213
- private get substitutions();
214
- constructor(_analyzer: Analyzer, _extendedTypeMemberLookup: TypeMemberLookup | undefined, _extendedType: NamedTypeEntity | undefined, _typeExtensionEntity: TypeExtensionEntity, _typeExtensionsLookup: Lookup, _locale: PackageLocale);
215
- getTypesOrContainersWithTypes(_hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
216
- getTypesOrContainersWithTypesByName(_name: SearchName, _hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
217
- getNamedDeclarations(hidingMatcher: IEntityHidingMatcher | undefined): FoundNamedDeclaration<NamedDeclaration>[];
218
- getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
219
- getOperators(hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
220
- getOperatorsByKind(kind: OperatorKind, hidingMatcher?: IEntityHidingMatcher): readonly FoundAnonymousDeclaration<types.Operator>[];
221
- getTypeExtensionsByType(_typeEntity: TypeEntity, _hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
222
- private convertNamedTypeExtensionMember;
223
- private convertTypeExtensionOperator;
224
- private convertExtendedTypeMember;
225
- private checkOperatorShadowing;
226
- private checkNamedDeclarationShadowing;
227
- }
228
205
  export {};
@@ -25,6 +25,7 @@ export interface SemanticContext {
25
25
  isInFinallyClause(): boolean;
26
26
  getScopeLookup(): Lookup;
27
27
  getHidingMatcher(): IEntityHidingMatcher;
28
+ isStatic(): boolean;
28
29
  }
29
30
  export type SubprogramInfo = SubprogramInfo.Method | SubprogramInfo.Operator | SubprogramInfo.Constructor | SubprogramInfo.Destructor | SubprogramInfo.Getter | SubprogramInfo.Setter | SubprogramInfo.PackageConstructor | SubprogramInfo.PackageEntryPoint | SubprogramInfo.MethodLiteral;
30
31
  export declare namespace SubprogramInfo {
@@ -161,6 +162,7 @@ declare abstract class SemanticContextWithParent implements SemanticContext {
161
162
  isInFinallyClause(): boolean;
162
163
  getScopeLookup(): Lookup;
163
164
  getHidingMatcher(): IEntityHidingMatcher;
165
+ isStatic(): boolean;
164
166
  }
165
167
  export declare class SourceFileSemanticContext implements SemanticContext {
166
168
  private readonly _analyzer;
@@ -177,6 +179,7 @@ export declare class SourceFileSemanticContext implements SemanticContext {
177
179
  isInFinallyClause(): boolean;
178
180
  getScopeLookup(): Lookup;
179
181
  getLocalizationContext(): LocalizationContext;
182
+ isStatic(): boolean;
180
183
  }
181
184
  export type TypeDeclarationCreatingSemanticContext = StructuredTypeDeclaration | VariantTypeDeclaration | MethodTypeDeclaration | tree.PackageAliasTypeDeclaration;
182
185
  /**
@@ -192,6 +195,7 @@ export declare class LastSemanticContextOfType extends SemanticContextWithParent
192
195
  getContainingSubprogram(): SubprogramInfo | undefined;
193
196
  isInTryStatement(): TryStatementClausesInfo | undefined;
194
197
  isInFinallyClause(): boolean;
198
+ isStatic(): boolean;
195
199
  private getContainingType;
196
200
  }
197
201
  type TypeDeclarationWithTypeParameters = tree.PackageStructuredTypeDeclaration | tree.PackageVariantTypeDeclaration | tree.PackageAliasTypeDeclaration | tree.PackageMethodTypeDeclaration;
@@ -231,6 +235,7 @@ export declare class LastSemanticContextOfMethod extends SemanticContextWithPare
231
235
  getContainingSubprogram(): SubprogramInfo | undefined;
232
236
  isInTryStatement(): TryStatementClausesInfo | undefined;
233
237
  isInFinallyClause(): boolean;
238
+ isStatic(): boolean;
234
239
  }
235
240
  export declare class MethodTypeParameterSemanticContext extends SemanticContextWithParent {
236
241
  private readonly _analyzer;
@@ -268,6 +273,7 @@ export declare class OperatorSemanticContext extends SemanticContextWithParent {
268
273
  constructor(analyzer: Analyzer, node: tree.OperatorDeclaration, parentContext: SemanticContext);
269
274
  getScopeChain(): ScopeChain;
270
275
  getContainingSubprogram(): SubprogramInfo | undefined;
276
+ isStatic(): boolean;
271
277
  }
272
278
  export declare class ConstructorSemanticContext extends SemanticContextWithParent {
273
279
  private readonly _analyzer;
@@ -298,11 +304,11 @@ export declare class IndexerSemanticContext extends SemanticContextWithParent {
298
304
  export declare class GetterSemanticContext extends SemanticContextWithParent {
299
305
  private readonly _analyzer;
300
306
  private readonly _node;
301
- private readonly _scopeChain;
302
307
  private readonly _subprogramInfo;
303
308
  constructor(analyzer: Analyzer, node: GetterDeclaration, parentContext: SemanticContext);
304
309
  getScopeChain(): ScopeChain;
305
310
  getContainingSubprogram(): SubprogramInfo | undefined;
311
+ isStatic(): boolean;
306
312
  }
307
313
  export declare class SetterSemanticContext extends SemanticContextWithParent {
308
314
  private readonly _analyzer;
@@ -310,6 +316,7 @@ export declare class SetterSemanticContext extends SemanticContextWithParent {
310
316
  private readonly _subprogramInfo;
311
317
  constructor(analyzer: Analyzer, node: SetterDeclaration, parentContext: SemanticContext);
312
318
  getContainingSubprogram(): SubprogramInfo | undefined;
319
+ isStatic(): boolean;
313
320
  }
314
321
  export declare class StatementBlockSemanticContext extends SemanticContextWithParent {
315
322
  private readonly _analyzer;
@@ -320,6 +327,13 @@ export declare class StatementBlockSemanticContext extends SemanticContextWithPa
320
327
  isInTryStatement(): TryStatementClausesInfo | undefined;
321
328
  isInFinallyClause(): boolean;
322
329
  }
330
+ export declare class FunctionBlockSemanticContext extends SemanticContextWithParent {
331
+ private readonly _analyzer;
332
+ private readonly _node;
333
+ private readonly _scopeChain;
334
+ constructor(analyzer: Analyzer, node: tree.FunctionBlock, parentContext: SemanticContext);
335
+ getScopeChain(): ScopeChain;
336
+ }
323
337
  export type RegularOrBlockMethodLiteral = tree.MethodLiteral | tree.MethodBlockLiteral;
324
338
  export declare class MethodLiteralSemanticContext extends SemanticContextWithParent {
325
339
  private readonly _analyzer;
@@ -344,4 +358,10 @@ export declare class CatchClauseSemanticContext extends SemanticContextWithParen
344
358
  constructor(analyzer: Analyzer, node: tree.CatchClause, parentContext: SemanticContext);
345
359
  getScopeChain(): ScopeChain;
346
360
  }
361
+ export declare class TypeVariableWithInitializerSemanticContext extends SemanticContextWithParent {
362
+ private readonly _analyzer;
363
+ private readonly _node;
364
+ constructor(analyzer: Analyzer, node: tree.TypeVariableDeclaration, parentContext: SemanticContext);
365
+ isStatic(): boolean;
366
+ }
347
367
  export {};
@@ -34,11 +34,13 @@ export declare class SemanticContextBuilder {
34
34
  ofRegularOrBlockMethodLiteral(node: RegularOrBlockMethodLiteral): SemanticContext;
35
35
  ofForStatement(node: tree.ForStatement): SemanticContext;
36
36
  ofStatementBlock(node: tree.StatementBlock): SemanticContext;
37
+ ofFunctionBlock(node: tree.FunctionBlock): SemanticContext;
37
38
  ofTypeConstructorDeclaration(node: tree.TypeConstructorDeclaration): SemanticContext;
38
39
  ofTypeDestructorDeclaration(node: tree.TypeDestructorDeclaration): SemanticContext;
39
40
  ofTypeIndexedGetterDeclaration(node: tree.TypeIndexedGetterDeclaration, hint: 'body' | 'parameters'): SemanticContext;
40
41
  ofTypeIndexedSetterDeclaration(node: tree.TypeIndexedSetterDeclaration, hint: 'body' | 'parameters'): SemanticContext;
41
42
  ofCatchClause(node: tree.CatchClause): SemanticContext;
43
+ ofTypeVariableDeclarationWithInitializer(node: tree.TypeVariableDeclaration): SemanticContext;
42
44
  private containingInternal;
43
45
  private ofChildOfMethodDeclaration;
44
46
  private ofChildOfTypeDeclarationWithMemberBlock;
@@ -53,4 +55,5 @@ export declare class SemanticContextBuilder {
53
55
  private ofChildOfTypeExtensionDeclaration;
54
56
  private isOffsetBetweenNodes;
55
57
  private isOffsetInsideStatementBlock;
58
+ private isOffsetInsideFunctionBlock;
56
59
  }
@@ -2,22 +2,25 @@ import * as tree from '../tree/index.js';
2
2
  import { Analyzer } from './Analyzer.js';
3
3
  import { IScope } from './Scope.js';
4
4
  export declare class StatementBlockScopeBuilder {
5
- static build(analyzer: Analyzer, node: tree.StatementBlock): IScope;
6
- static buildGenericScope(analyzer: Analyzer, node: tree.StatementBlock): IScope;
7
- static buildScopeForMethodBlockLiteral(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.MethodBlockLiteral): IScope;
8
- static buildScopeForPackageMethodDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.PackageMethodDeclaration): IScope;
9
- static buildScopeForTypeVariableGetterDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeVariableGetterDeclaration): IScope;
10
- static buildScopeForTypeVariableSetterDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeVariableSetterDeclaration): IScope;
11
- static buildScopeForPackageVariableGetterDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.PackageVariableGetterDeclaration): IScope;
12
- static buildScopeForPackageVariableSetterDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.PackageVariableSetterDeclaration): IScope;
13
- static buildScopeForTypeIndexedGetterDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeIndexedGetterDeclaration): IScope;
14
- static buildScopeForTypeIndexedSetterDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeIndexedSetterDeclaration): IScope;
15
- static buildScopeForTypeDereferencedVariableGetterDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeDereferencedVariableGetterDeclaration): IScope;
16
- static buildScopeForTypeDereferencedVariableSetterDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeDereferencedVariableSetterDeclaration): IScope;
17
- static buildScopeForNestedMethodDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.NestedMethodDeclaration): IScope;
18
- static buildScopeForMethodLiteral(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.MethodLiteral): IScope;
19
- static buildScopeForTypeConstructorDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeConstructorDeclaration): IScope;
20
- static buildScopeForTypeMethodDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.TypeMethodDeclaration): IScope;
21
- static buildScopeForOperatorDeclaration(analyzer: Analyzer, node: tree.StatementBlock, parent: tree.OperatorDeclaration): IScope;
5
+ static buildFunctionBlockScope(analyzer: Analyzer, node: tree.FunctionBlock): IScope;
6
+ static buildStatementBlockScope(analyzer: Analyzer, node: tree.StatementBlock): IScope;
7
+ static buildGenericScopeForFunctionBlock(analyzer: Analyzer, node: tree.FunctionBlock): IScope;
8
+ static buildGenericScopeForStatementBlock(analyzer: Analyzer, node: tree.StatementBlock): IScope;
9
+ static buildScopeForMethodBlockLiteral(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.MethodBlockLiteral): IScope;
10
+ static buildScopeForPackageMethodDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.PackageMethodDeclaration): IScope;
11
+ static buildScopeForTypeVariableGetterDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.TypeVariableGetterDeclaration): IScope;
12
+ static buildScopeForTypeVariableSetterDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.TypeVariableSetterDeclaration): IScope;
13
+ static buildScopeForPackageVariableGetterDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.PackageVariableGetterDeclaration): IScope;
14
+ static buildScopeForPackageVariableSetterDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.PackageVariableSetterDeclaration): IScope;
15
+ static buildScopeForTypeIndexedGetterDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.TypeIndexedGetterDeclaration): IScope;
16
+ static buildScopeForTypeIndexedSetterDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.TypeIndexedSetterDeclaration): IScope;
17
+ static buildScopeForTypeDereferencedVariableGetterDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.TypeDereferencedVariableGetterDeclaration): IScope;
18
+ static buildScopeForTypeDereferencedVariableSetterDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.TypeDereferencedVariableSetterDeclaration): IScope;
19
+ static buildScopeForNestedMethodDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.NestedMethodDeclaration): IScope;
20
+ static buildScopeForMethodLiteral(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.MethodLiteral): IScope;
21
+ static buildScopeForTypeConstructorDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.TypeConstructorDeclaration): IScope;
22
+ static buildScopeForTypeMethodDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.TypeMethodDeclaration): IScope;
23
+ static buildScopeForOperatorDeclaration(analyzer: Analyzer, node: tree.FunctionBlock, parent: tree.OperatorDeclaration): IScope;
24
+ private static getLocalNamedDeclarationsOfFunctionBlock;
22
25
  private static getLocalNamedDeclarations;
23
26
  }
@@ -1,5 +1,5 @@
1
1
  import { PackageLocale, SearchName } from '../common/index.js';
2
- import { IEntityHidingMatcher, OperatorKind, TypeEntity } from '../entities/index.js';
2
+ import { IEntityHidingMatcher, OperatorKind, TypeEntity, TypeExtensionEntity, TypeOrExtensionEntity } from '../entities/index.js';
3
3
  import * as types from '../types/index.js';
4
4
  import { Analyzer } from './Analyzer.js';
5
5
  import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
@@ -7,30 +7,36 @@ import { LocalizationContext } from './LocalizationContext.js';
7
7
  import { Lookup } from './Lookup.js';
8
8
  export declare class TypeMemberLookup {
9
9
  private readonly _analyzer;
10
- private readonly _type;
10
+ private readonly _typeOrExtension;
11
11
  private readonly _localizationContext;
12
12
  private readonly _searchLocale;
13
13
  /**
14
14
  * Язык, на котором будет осуществляться поиск членов типа.
15
15
  */
16
16
  get searchLocale(): PackageLocale;
17
- constructor(_analyzer: Analyzer, _type: types.Type, _localizationContext: LocalizationContext | undefined);
17
+ private constructor();
18
+ static ofType(analyzer: Analyzer, type: types.Type, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
18
19
  static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
19
- getNamedMembers(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
20
- getNamedMembersByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
21
- getOperators(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.Operator>[];
22
- getOperatorsByKind(kind: OperatorKind, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.Operator>[];
20
+ static ofTypeExtension(analyzer: Analyzer, typeExtension: TypeExtensionEntity, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
21
+ static ofTypeOrExtension(analyzer: Analyzer, typeOrExtension: TypeOrExtension, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
22
+ getNamedMembers(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
23
+ getNamedMembersByName(name: SearchName, options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
24
+ getOperators(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.Operator>[];
25
+ getOperatorsByKind(kind: OperatorKind, options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.Operator>[];
23
26
  getConstructors(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.Constructor>[];
24
- getIndexers(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.Indexer>[];
25
- getDereferenceOperators(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.DereferenceOperator>[];
27
+ getIndexers(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.Indexer>[];
28
+ getDereferenceOperators(options?: TypeMemberLookupOptions, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): readonly FoundAnonymousDeclaration<types.DereferenceOperator>[];
26
29
  private getLocaleOfTypeEntity;
27
30
  }
28
31
  export declare class BoundTypeMemberLookup {
29
32
  private readonly _lookup;
33
+ private readonly _options;
30
34
  private readonly _hidingMatcher;
31
35
  private readonly _typeExtensionLookup;
32
- constructor(analyzer: Analyzer, type: types.Type, localizationContext: LocalizationContext | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: Lookup | undefined);
33
- static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity, localizationContext: LocalizationContext | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: Lookup | undefined): BoundTypeMemberLookup;
36
+ private constructor();
37
+ static ofType(analyzer: Analyzer, type: types.Type, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: Lookup | undefined): BoundTypeMemberLookup;
38
+ static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: Lookup | undefined): BoundTypeMemberLookup;
39
+ static ofTypeExtension(analyzer: Analyzer, typeExtension: TypeExtensionEntity, localizationContext: LocalizationContext | undefined, options: TypeMemberLookupOptions | undefined, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: Lookup | undefined): BoundTypeMemberLookup;
34
40
  getNamedMembers(): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
35
41
  getNamedMembersByName(name: SearchName): readonly FoundNamedDeclaration<types.NamedTypeMember>[];
36
42
  getOperators(): readonly FoundAnonymousDeclaration<types.Operator>[];
@@ -39,3 +45,25 @@ export declare class BoundTypeMemberLookup {
39
45
  getIndexers(): readonly FoundAnonymousDeclaration<types.Indexer>[];
40
46
  getDereferenceOperators(): readonly FoundAnonymousDeclaration<types.DereferenceOperator>[];
41
47
  }
48
+ export declare enum TypeMemberLookupOptions {
49
+ None = 0,
50
+ OnlyInstanceMembers = 1,
51
+ OnlyStaticMembers = 2
52
+ }
53
+ type TypeOrExtension = TypeOrExtension_type | TypeOrExtension_extension;
54
+ declare class TypeOrExtension_type implements ITypeOrExtension {
55
+ readonly value: types.Type;
56
+ readonly kind = "type";
57
+ constructor(value: types.Type);
58
+ getEntity(): TypeOrExtensionEntity | undefined;
59
+ }
60
+ declare class TypeOrExtension_extension implements ITypeOrExtension {
61
+ readonly value: TypeExtensionEntity;
62
+ readonly kind = "extension";
63
+ constructor(value: TypeExtensionEntity);
64
+ getEntity(): TypeOrExtensionEntity | undefined;
65
+ }
66
+ interface ITypeOrExtension {
67
+ getEntity(): TypeOrExtensionEntity | undefined;
68
+ }
69
+ export {};
@@ -9,49 +9,89 @@ export declare class TypeNarrower {
9
9
  private readonly _controlFlowNode;
10
10
  private _reference;
11
11
  private readonly _typeByNode;
12
+ private readonly _isVariableAssignedInLoopCheckResults;
12
13
  constructor(analyzer: Analyzer, referenceExpression: NarrowableReferenceExpression, initialType: types.Type, controlFlowNode: ControlFlowNode);
13
14
  getType(): types.Type;
14
15
  private getTypeAtControlFlowNode;
15
16
  private getTypeAtCondition;
16
17
  private getTypeAtAssignment;
18
+ private getTypeAtLocalVariableDeclaration;
17
19
  private getTypeAtSplit;
18
20
  private getTypeAtLoop;
21
+ private getTypeAtAssignmentWithImplicitConversion;
19
22
  private getTypeAtComparisonWithNone;
20
23
  private getTypeAtIsExpression;
24
+ private getTypeAtAssignmentOrDeclaration;
21
25
  private addTypeIfUnique;
26
+ private checkIfVariableIsAssignedInLoop;
27
+ private checkIfVariableIsAssignedAtNode;
22
28
  private isSameReferenceAsNarrowedExpression;
23
- private unwrapExpression;
24
29
  private getReferenceAtNodeIfNarrowable;
25
30
  private getReferenceAtNode;
26
31
  private getReferenceAtLocalVariableDeclaration;
27
32
  }
28
- export type NarrowableReference = NarrowableReference.LocalOrPackageVariable | NarrowableReference.InstanceTypeVariable | NarrowableReference.StaticTypeVariable | NarrowableReference.Object;
33
+ export type NarrowableReference = NarrowableReference.LocalVariable | NarrowableReference.PackageVariable | NarrowableReference.InstanceTypeVariable | NarrowableReference.StaticTypeVariable | NarrowableReference.Object;
29
34
  export declare namespace NarrowableReference {
30
- export class LocalOrPackageVariable implements INarrowableReference {
31
- readonly entity: LocalVariableEntity | ParameterVariableEntity | PackageVariableEntity;
32
- readonly kind = "local-or-package-variable";
33
- constructor(entity: LocalVariableEntity | ParameterVariableEntity | PackageVariableEntity);
35
+ export class LocalVariable implements INarrowableReference {
36
+ private readonly _analyzer;
37
+ readonly entity: LocalVariableEntity | ParameterVariableEntity;
38
+ readonly kind = "local-variable";
39
+ constructor(_analyzer: Analyzer, entity: LocalVariableEntity | ParameterVariableEntity);
34
40
  equals(other: NarrowableReference): boolean;
41
+ contains(_other: NarrowableReference): boolean;
42
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
43
+ containsExpression(_expression: NarrowableReferenceExpression): boolean;
44
+ }
45
+ export class PackageVariable implements INarrowableReference {
46
+ private readonly _analyzer;
47
+ readonly entity: PackageVariableEntity;
48
+ readonly kind = "package-variable";
49
+ constructor(_analyzer: Analyzer, entity: PackageVariableEntity);
50
+ equals(other: NarrowableReference): boolean;
51
+ contains(_other: NarrowableReference): boolean;
52
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
53
+ containsExpression(_expression: NarrowableReferenceExpression): boolean;
35
54
  }
36
55
  export class InstanceTypeVariable implements INarrowableReference {
56
+ private readonly _analyzer;
37
57
  readonly variable: types.Variable;
38
58
  readonly receiver: NarrowableReference;
39
59
  readonly kind = "instance-type-variable";
40
- constructor(variable: types.Variable, receiver: NarrowableReference);
60
+ constructor(_analyzer: Analyzer, variable: types.Variable, receiver: NarrowableReference);
41
61
  equals(other: NarrowableReference): boolean;
62
+ contains(other: NarrowableReference): boolean;
63
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
64
+ containsExpression(expression: NarrowableReferenceExpression): boolean;
42
65
  }
43
66
  export class StaticTypeVariable implements INarrowableReference {
67
+ private readonly _analyzer;
44
68
  readonly variable: types.Variable;
45
69
  readonly kind = "static-type-variable";
46
- constructor(variable: types.Variable);
70
+ constructor(_analyzer: Analyzer, variable: types.Variable);
47
71
  equals(other: NarrowableReference): boolean;
72
+ contains(_other: NarrowableReference): boolean;
73
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
74
+ containsExpression(_expression: NarrowableReferenceExpression): boolean;
48
75
  }
49
76
  export class Object implements INarrowableReference {
50
77
  readonly kind = "object";
51
78
  equals(other: NarrowableReference): boolean;
79
+ contains(_other: NarrowableReference): boolean;
80
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
81
+ containsExpression(_expression: NarrowableReferenceExpression): boolean;
52
82
  }
53
83
  interface INarrowableReference {
54
84
  equals(other: NarrowableReference): boolean;
85
+ contains(other: NarrowableReference): boolean;
86
+ /**
87
+ * Отличается от метода `equals` тем, что выполняет сравнение лениво. Например, при сравнении с выражением
88
+ * `а.б` сперва будут сравнены части слева от точки (выражение `а` с `receiver`), и только при равенстве будет
89
+ * связано и сравнено имя `б`. Если выражение `а` не равно `receiver`, то сразу будет возвращено `false` и
90
+ * связывание для имени `б` выполняться не будет. Такое поведение необходимо при анализе циклов,
91
+ * чтобы избежать рекурсии.
92
+ */
93
+ equalsExpression(expression: NarrowableReferenceExpression): boolean;
94
+ containsExpression(expression: NarrowableReferenceExpression): boolean;
55
95
  }
56
96
  export {};
57
97
  }