@@ -603,15 +603,15 @@ namespace ts {
603
603
604
604
export type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern ;
605
605
606
- export interface RealDeclaration extends Node {
606
+ export interface Declaration extends Node {
607
607
_declarationBrand : any ;
608
- name ?: DeclarationName ;
609
608
}
610
609
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
+ }
613
613
614
- export interface DeclarationStatement extends RealDeclaration , Statement {
614
+ export interface DeclarationStatement extends NamedDeclaration , Statement {
615
615
name ?: Identifier | StringLiteral | NumericLiteral ;
616
616
}
617
617
@@ -625,7 +625,7 @@ namespace ts {
625
625
expression : LeftHandSideExpression ;
626
626
}
627
627
628
- export interface TypeParameterDeclaration extends RealDeclaration {
628
+ export interface TypeParameterDeclaration extends NamedDeclaration {
629
629
kind : SyntaxKind . TypeParameter ;
630
630
parent ?: DeclarationWithTypeParameters ;
631
631
name : Identifier ;
@@ -636,7 +636,7 @@ namespace ts {
636
636
expression ?: Expression ;
637
637
}
638
638
639
- export interface SignatureDeclaration extends RealDeclaration {
639
+ export interface SignatureDeclaration extends NamedDeclaration {
640
640
name ?: PropertyName ;
641
641
typeParameters ?: NodeArray < TypeParameterDeclaration > ;
642
642
parameters : NodeArray < ParameterDeclaration > ;
@@ -653,7 +653,7 @@ namespace ts {
653
653
654
654
export type BindingName = Identifier | BindingPattern ;
655
655
656
- export interface VariableDeclaration extends RealDeclaration {
656
+ export interface VariableDeclaration extends NamedDeclaration {
657
657
kind : SyntaxKind . VariableDeclaration ;
658
658
parent ?: VariableDeclarationList | CatchClause ;
659
659
name : BindingName ; // Declared variable name
@@ -667,7 +667,7 @@ namespace ts {
667
667
declarations : NodeArray < VariableDeclaration > ;
668
668
}
669
669
670
- export interface ParameterDeclaration extends RealDeclaration {
670
+ export interface ParameterDeclaration extends NamedDeclaration {
671
671
kind : SyntaxKind . Parameter ;
672
672
parent ?: SignatureDeclaration ;
673
673
dotDotDotToken ?: DotDotDotToken ; // Present on rest parameter
@@ -677,7 +677,7 @@ namespace ts {
677
677
initializer ?: Expression ; // Optional initializer
678
678
}
679
679
680
- export interface BindingElement extends RealDeclaration {
680
+ export interface BindingElement extends NamedDeclaration {
681
681
kind : SyntaxKind . BindingElement ;
682
682
parent ?: BindingPattern ;
683
683
propertyName ?: PropertyName ; // Binding property name (in object binding pattern)
@@ -702,7 +702,7 @@ namespace ts {
702
702
initializer ?: Expression ; // Optional initializer
703
703
}
704
704
705
- export interface ObjectLiteralElement extends RealDeclaration {
705
+ export interface ObjectLiteralElement extends NamedDeclaration {
706
706
_objectLiteralBrandBrand : any ;
707
707
name ?: PropertyName ;
708
708
}
@@ -746,7 +746,7 @@ namespace ts {
746
746
// SyntaxKind.ShorthandPropertyAssignment
747
747
// SyntaxKind.EnumMember
748
748
// SyntaxKind.JSDocPropertyTag
749
- export interface VariableLikeDeclaration extends RealDeclaration {
749
+ export interface VariableLikeDeclaration extends NamedDeclaration {
750
750
propertyName ?: PropertyName ;
751
751
dotDotDotToken ?: DotDotDotToken ;
752
752
name : DeclarationName ;
@@ -755,7 +755,7 @@ namespace ts {
755
755
initializer ?: Expression ;
756
756
}
757
757
758
- export interface PropertyLikeDeclaration extends RealDeclaration {
758
+ export interface PropertyLikeDeclaration extends NamedDeclaration {
759
759
name : PropertyName ;
760
760
}
761
761
@@ -904,7 +904,7 @@ namespace ts {
904
904
}
905
905
906
906
// A TypeLiteral is the declaration node for an anonymous symbol.
907
- export interface TypeLiteralNode extends TypeNode , RealDeclaration {
907
+ export interface TypeLiteralNode extends TypeNode , NamedDeclaration {
908
908
kind : SyntaxKind . TypeLiteral ;
909
909
members : NodeArray < TypeElement > ;
910
910
}
@@ -948,7 +948,7 @@ namespace ts {
948
948
indexType : TypeNode ;
949
949
}
950
950
951
- export interface MappedTypeNode extends TypeNode , RealDeclaration {
951
+ export interface MappedTypeNode extends TypeNode , NamedDeclaration {
952
952
kind : SyntaxKind . MappedType ;
953
953
parent ?: TypeAliasDeclaration ;
954
954
readonlyToken ?: ReadonlyToken ;
@@ -1219,7 +1219,7 @@ namespace ts {
1219
1219
1220
1220
export type BinaryOperatorToken = Token < BinaryOperator > ;
1221
1221
1222
- export interface BinaryExpression extends Expression {
1222
+ export interface BinaryExpression extends Expression , Declaration {
1223
1223
kind : SyntaxKind . BinaryExpression ;
1224
1224
left : Expression ;
1225
1225
operatorToken : BinaryOperatorToken ;
@@ -1405,7 +1405,7 @@ namespace ts {
1405
1405
* JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type
1406
1406
* ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.)
1407
1407
*/
1408
- export interface ObjectLiteralExpressionBase < T extends ObjectLiteralElement > extends PrimaryExpression , RealDeclaration {
1408
+ export interface ObjectLiteralExpressionBase < T extends ObjectLiteralElement > extends PrimaryExpression , NamedDeclaration {
1409
1409
properties : NodeArray < T > ;
1410
1410
}
1411
1411
@@ -1419,7 +1419,7 @@ namespace ts {
1419
1419
export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression ;
1420
1420
export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression ;
1421
1421
1422
- export interface PropertyAccessExpression extends MemberExpression , RealDeclaration {
1422
+ export interface PropertyAccessExpression extends MemberExpression , NamedDeclaration {
1423
1423
kind : SyntaxKind . PropertyAccessExpression ;
1424
1424
expression : LeftHandSideExpression ;
1425
1425
name : Identifier ;
@@ -1451,7 +1451,7 @@ namespace ts {
1451
1451
| SuperElementAccessExpression
1452
1452
;
1453
1453
1454
- export interface CallExpression extends LeftHandSideExpression , RealDeclaration {
1454
+ export interface CallExpression extends LeftHandSideExpression , NamedDeclaration {
1455
1455
kind : SyntaxKind . CallExpression ;
1456
1456
expression : LeftHandSideExpression ;
1457
1457
typeArguments ?: NodeArray < TypeNode > ;
@@ -1470,7 +1470,7 @@ namespace ts {
1470
1470
typeArguments ?: NodeArray < TypeNode > ;
1471
1471
}
1472
1472
1473
- export interface NewExpression extends PrimaryExpression , RealDeclaration {
1473
+ export interface NewExpression extends PrimaryExpression , NamedDeclaration {
1474
1474
kind : SyntaxKind . NewExpression ;
1475
1475
expression : LeftHandSideExpression ;
1476
1476
typeArguments ?: NodeArray < TypeNode > ;
@@ -1764,7 +1764,7 @@ namespace ts {
1764
1764
1765
1765
export type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration ;
1766
1766
1767
- export interface ClassLikeDeclaration extends RealDeclaration {
1767
+ export interface ClassLikeDeclaration extends NamedDeclaration {
1768
1768
name ?: Identifier ;
1769
1769
typeParameters ?: NodeArray < TypeParameterDeclaration > ;
1770
1770
heritageClauses ?: NodeArray < HeritageClause > ;
@@ -1780,12 +1780,12 @@ namespace ts {
1780
1780
kind : SyntaxKind . ClassExpression ;
1781
1781
}
1782
1782
1783
- export interface ClassElement extends RealDeclaration {
1783
+ export interface ClassElement extends NamedDeclaration {
1784
1784
_classElementBrand : any ;
1785
1785
name ?: PropertyName ;
1786
1786
}
1787
1787
1788
- export interface TypeElement extends RealDeclaration {
1788
+ export interface TypeElement extends NamedDeclaration {
1789
1789
_typeElementBrand : any ;
1790
1790
name ?: PropertyName ;
1791
1791
questionToken ?: QuestionToken ;
@@ -1813,7 +1813,7 @@ namespace ts {
1813
1813
type : TypeNode ;
1814
1814
}
1815
1815
1816
- export interface EnumMember extends RealDeclaration {
1816
+ export interface EnumMember extends NamedDeclaration {
1817
1817
kind : SyntaxKind . EnumMember ;
1818
1818
parent ?: EnumDeclaration ;
1819
1819
// This does include ComputedPropertyName, but the parser will give an error
@@ -1902,14 +1902,14 @@ namespace ts {
1902
1902
// import d, * as ns from "mod" => name = d, namedBinding: NamespaceImport = { name: ns }
1903
1903
// import { a, b as x } from "mod" => name = undefined, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]}
1904
1904
// 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 {
1906
1906
kind : SyntaxKind . ImportClause ;
1907
1907
parent ?: ImportDeclaration ;
1908
1908
name ?: Identifier ; // Default binding
1909
1909
namedBindings ?: NamedImportBindings ;
1910
1910
}
1911
1911
1912
- export interface NamespaceImport extends RealDeclaration {
1912
+ export interface NamespaceImport extends NamedDeclaration {
1913
1913
kind : SyntaxKind . NamespaceImport ;
1914
1914
parent ?: ImportClause ;
1915
1915
name : Identifier ;
@@ -1942,14 +1942,14 @@ namespace ts {
1942
1942
1943
1943
export type NamedImportsOrExports = NamedImports | NamedExports ;
1944
1944
1945
- export interface ImportSpecifier extends RealDeclaration {
1945
+ export interface ImportSpecifier extends NamedDeclaration {
1946
1946
kind : SyntaxKind . ImportSpecifier ;
1947
1947
parent ?: NamedImports ;
1948
1948
propertyName ?: Identifier ; // Name preceding "as" keyword (or undefined when "as" is absent)
1949
1949
name : Identifier ; // Declared name
1950
1950
}
1951
1951
1952
- export interface ExportSpecifier extends RealDeclaration {
1952
+ export interface ExportSpecifier extends NamedDeclaration {
1953
1953
kind : SyntaxKind . ExportSpecifier ;
1954
1954
parent ?: NamedExports ;
1955
1955
propertyName ?: Identifier ; // Name preceding "as" keyword (or undefined when "as" is absent)
@@ -2115,7 +2115,7 @@ namespace ts {
2115
2115
typeExpression : JSDocTypeExpression ;
2116
2116
}
2117
2117
2118
- export interface JSDocTypedefTag extends JSDocTag , RealDeclaration {
2118
+ export interface JSDocTypedefTag extends JSDocTag , NamedDeclaration {
2119
2119
kind : SyntaxKind . JSDocTypedefTag ;
2120
2120
fullName ?: JSDocNamespaceDeclaration | Identifier ;
2121
2121
name ?: Identifier ;
@@ -2249,7 +2249,7 @@ namespace ts {
2249
2249
2250
2250
2251
2251
// Source files are declarations when they are external modules.
2252
- export interface SourceFile extends RealDeclaration {
2252
+ export interface SourceFile extends NamedDeclaration {
2253
2253
kind : SyntaxKind . SourceFile ;
2254
2254
statements : NodeArray < Statement > ;
2255
2255
endOfFileToken : Token < SyntaxKind . EndOfFileToken > ;
0 commit comments