@@ -603,15 +603,15 @@ namespace ts {
603603
604604 export type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern ;
605605
606- export interface RealDeclaration extends Node {
606+ export interface Declaration extends Node {
607607 _declarationBrand : any ;
608- name ?: DeclarationName ;
609608 }
610609
611- // Binary expressions can be declarations if they are 'exports.foo = bar' expressions in JS files
612- export type Declaration = RealDeclaration | BinaryExpression ;
610+ export interface NamedDeclaration extends Declaration {
611+ name ?: DeclarationName ;
612+ }
613613
614- export interface DeclarationStatement extends RealDeclaration , Statement {
614+ export interface DeclarationStatement extends NamedDeclaration , Statement {
615615 name ?: Identifier | StringLiteral | NumericLiteral ;
616616 }
617617
@@ -625,7 +625,7 @@ namespace ts {
625625 expression : LeftHandSideExpression ;
626626 }
627627
628- export interface TypeParameterDeclaration extends RealDeclaration {
628+ export interface TypeParameterDeclaration extends NamedDeclaration {
629629 kind : SyntaxKind . TypeParameter ;
630630 parent ?: DeclarationWithTypeParameters ;
631631 name : Identifier ;
@@ -636,7 +636,7 @@ namespace ts {
636636 expression ?: Expression ;
637637 }
638638
639- export interface SignatureDeclaration extends RealDeclaration {
639+ export interface SignatureDeclaration extends NamedDeclaration {
640640 name ?: PropertyName ;
641641 typeParameters ?: NodeArray < TypeParameterDeclaration > ;
642642 parameters : NodeArray < ParameterDeclaration > ;
@@ -653,7 +653,7 @@ namespace ts {
653653
654654 export type BindingName = Identifier | BindingPattern ;
655655
656- export interface VariableDeclaration extends RealDeclaration {
656+ export interface VariableDeclaration extends NamedDeclaration {
657657 kind : SyntaxKind . VariableDeclaration ;
658658 parent ?: VariableDeclarationList | CatchClause ;
659659 name : BindingName ; // Declared variable name
@@ -667,7 +667,7 @@ namespace ts {
667667 declarations : NodeArray < VariableDeclaration > ;
668668 }
669669
670- export interface ParameterDeclaration extends RealDeclaration {
670+ export interface ParameterDeclaration extends NamedDeclaration {
671671 kind : SyntaxKind . Parameter ;
672672 parent ?: SignatureDeclaration ;
673673 dotDotDotToken ?: DotDotDotToken ; // Present on rest parameter
@@ -677,7 +677,7 @@ namespace ts {
677677 initializer ?: Expression ; // Optional initializer
678678 }
679679
680- export interface BindingElement extends RealDeclaration {
680+ export interface BindingElement extends NamedDeclaration {
681681 kind : SyntaxKind . BindingElement ;
682682 parent ?: BindingPattern ;
683683 propertyName ?: PropertyName ; // Binding property name (in object binding pattern)
@@ -702,7 +702,7 @@ namespace ts {
702702 initializer ?: Expression ; // Optional initializer
703703 }
704704
705- export interface ObjectLiteralElement extends RealDeclaration {
705+ export interface ObjectLiteralElement extends NamedDeclaration {
706706 _objectLiteralBrandBrand : any ;
707707 name ?: PropertyName ;
708708 }
@@ -746,7 +746,7 @@ namespace ts {
746746 // SyntaxKind.ShorthandPropertyAssignment
747747 // SyntaxKind.EnumMember
748748 // SyntaxKind.JSDocPropertyTag
749- export interface VariableLikeDeclaration extends RealDeclaration {
749+ export interface VariableLikeDeclaration extends NamedDeclaration {
750750 propertyName ?: PropertyName ;
751751 dotDotDotToken ?: DotDotDotToken ;
752752 name : DeclarationName ;
@@ -755,7 +755,7 @@ namespace ts {
755755 initializer ?: Expression ;
756756 }
757757
758- export interface PropertyLikeDeclaration extends RealDeclaration {
758+ export interface PropertyLikeDeclaration extends NamedDeclaration {
759759 name : PropertyName ;
760760 }
761761
@@ -904,7 +904,7 @@ namespace ts {
904904 }
905905
906906 // A TypeLiteral is the declaration node for an anonymous symbol.
907- export interface TypeLiteralNode extends TypeNode , RealDeclaration {
907+ export interface TypeLiteralNode extends TypeNode , NamedDeclaration {
908908 kind : SyntaxKind . TypeLiteral ;
909909 members : NodeArray < TypeElement > ;
910910 }
@@ -948,7 +948,7 @@ namespace ts {
948948 indexType : TypeNode ;
949949 }
950950
951- export interface MappedTypeNode extends TypeNode , RealDeclaration {
951+ export interface MappedTypeNode extends TypeNode , NamedDeclaration {
952952 kind : SyntaxKind . MappedType ;
953953 parent ?: TypeAliasDeclaration ;
954954 readonlyToken ?: ReadonlyToken ;
@@ -1219,7 +1219,7 @@ namespace ts {
12191219
12201220 export type BinaryOperatorToken = Token < BinaryOperator > ;
12211221
1222- export interface BinaryExpression extends Expression {
1222+ export interface BinaryExpression extends Expression , Declaration {
12231223 kind : SyntaxKind . BinaryExpression ;
12241224 left : Expression ;
12251225 operatorToken : BinaryOperatorToken ;
@@ -1405,7 +1405,7 @@ namespace ts {
14051405 * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type
14061406 * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.)
14071407 */
1408- export interface ObjectLiteralExpressionBase < T extends ObjectLiteralElement > extends PrimaryExpression , RealDeclaration {
1408+ export interface ObjectLiteralExpressionBase < T extends ObjectLiteralElement > extends PrimaryExpression , NamedDeclaration {
14091409 properties : NodeArray < T > ;
14101410 }
14111411
@@ -1419,7 +1419,7 @@ namespace ts {
14191419 export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression ;
14201420 export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression ;
14211421
1422- export interface PropertyAccessExpression extends MemberExpression , RealDeclaration {
1422+ export interface PropertyAccessExpression extends MemberExpression , NamedDeclaration {
14231423 kind : SyntaxKind . PropertyAccessExpression ;
14241424 expression : LeftHandSideExpression ;
14251425 name : Identifier ;
@@ -1451,7 +1451,7 @@ namespace ts {
14511451 | SuperElementAccessExpression
14521452 ;
14531453
1454- export interface CallExpression extends LeftHandSideExpression , RealDeclaration {
1454+ export interface CallExpression extends LeftHandSideExpression , NamedDeclaration {
14551455 kind : SyntaxKind . CallExpression ;
14561456 expression : LeftHandSideExpression ;
14571457 typeArguments ?: NodeArray < TypeNode > ;
@@ -1470,7 +1470,7 @@ namespace ts {
14701470 typeArguments ?: NodeArray < TypeNode > ;
14711471 }
14721472
1473- export interface NewExpression extends PrimaryExpression , RealDeclaration {
1473+ export interface NewExpression extends PrimaryExpression , NamedDeclaration {
14741474 kind : SyntaxKind . NewExpression ;
14751475 expression : LeftHandSideExpression ;
14761476 typeArguments ?: NodeArray < TypeNode > ;
@@ -1764,7 +1764,7 @@ namespace ts {
17641764
17651765 export type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration ;
17661766
1767- export interface ClassLikeDeclaration extends RealDeclaration {
1767+ export interface ClassLikeDeclaration extends NamedDeclaration {
17681768 name ?: Identifier ;
17691769 typeParameters ?: NodeArray < TypeParameterDeclaration > ;
17701770 heritageClauses ?: NodeArray < HeritageClause > ;
@@ -1780,12 +1780,12 @@ namespace ts {
17801780 kind : SyntaxKind . ClassExpression ;
17811781 }
17821782
1783- export interface ClassElement extends RealDeclaration {
1783+ export interface ClassElement extends NamedDeclaration {
17841784 _classElementBrand : any ;
17851785 name ?: PropertyName ;
17861786 }
17871787
1788- export interface TypeElement extends RealDeclaration {
1788+ export interface TypeElement extends NamedDeclaration {
17891789 _typeElementBrand : any ;
17901790 name ?: PropertyName ;
17911791 questionToken ?: QuestionToken ;
@@ -1813,7 +1813,7 @@ namespace ts {
18131813 type : TypeNode ;
18141814 }
18151815
1816- export interface EnumMember extends RealDeclaration {
1816+ export interface EnumMember extends NamedDeclaration {
18171817 kind : SyntaxKind . EnumMember ;
18181818 parent ?: EnumDeclaration ;
18191819 // This does include ComputedPropertyName, but the parser will give an error
@@ -1902,14 +1902,14 @@ namespace ts {
19021902 // import d, * as ns from "mod" => name = d, namedBinding: NamespaceImport = { name: ns }
19031903 // import { a, b as x } from "mod" => name = undefined, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]}
19041904 // import d, { a, b as x } from "mod" => name = d, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]}
1905- export interface ImportClause extends RealDeclaration {
1905+ export interface ImportClause extends NamedDeclaration {
19061906 kind : SyntaxKind . ImportClause ;
19071907 parent ?: ImportDeclaration ;
19081908 name ?: Identifier ; // Default binding
19091909 namedBindings ?: NamedImportBindings ;
19101910 }
19111911
1912- export interface NamespaceImport extends RealDeclaration {
1912+ export interface NamespaceImport extends NamedDeclaration {
19131913 kind : SyntaxKind . NamespaceImport ;
19141914 parent ?: ImportClause ;
19151915 name : Identifier ;
@@ -1942,14 +1942,14 @@ namespace ts {
19421942
19431943 export type NamedImportsOrExports = NamedImports | NamedExports ;
19441944
1945- export interface ImportSpecifier extends RealDeclaration {
1945+ export interface ImportSpecifier extends NamedDeclaration {
19461946 kind : SyntaxKind . ImportSpecifier ;
19471947 parent ?: NamedImports ;
19481948 propertyName ?: Identifier ; // Name preceding "as" keyword (or undefined when "as" is absent)
19491949 name : Identifier ; // Declared name
19501950 }
19511951
1952- export interface ExportSpecifier extends RealDeclaration {
1952+ export interface ExportSpecifier extends NamedDeclaration {
19531953 kind : SyntaxKind . ExportSpecifier ;
19541954 parent ?: NamedExports ;
19551955 propertyName ?: Identifier ; // Name preceding "as" keyword (or undefined when "as" is absent)
@@ -2115,7 +2115,7 @@ namespace ts {
21152115 typeExpression : JSDocTypeExpression ;
21162116 }
21172117
2118- export interface JSDocTypedefTag extends JSDocTag , RealDeclaration {
2118+ export interface JSDocTypedefTag extends JSDocTag , NamedDeclaration {
21192119 kind : SyntaxKind . JSDocTypedefTag ;
21202120 fullName ?: JSDocNamespaceDeclaration | Identifier ;
21212121 name ?: Identifier ;
@@ -2249,7 +2249,7 @@ namespace ts {
22492249
22502250
22512251 // Source files are declarations when they are external modules.
2252- export interface SourceFile extends RealDeclaration {
2252+ export interface SourceFile extends NamedDeclaration {
22532253 kind : SyntaxKind . SourceFile ;
22542254 statements : NodeArray < Statement > ;
22552255 endOfFileToken : Token < SyntaxKind . EndOfFileToken > ;
0 commit comments