@@ -553,10 +553,12 @@ namespace ts {
553553 // @kind (SyntaxKind.ConstructSignature)
554554 export interface ConstructSignatureDeclaration extends SignatureDeclaration , TypeElement { }
555555
556+ export type BindingName = Identifier | ObjectBindingPattern | ArrayBindingPattern ;
557+
556558 // @kind (SyntaxKind.VariableDeclaration)
557559 export interface VariableDeclaration extends Declaration {
558560 parent ?: VariableDeclarationList ;
559- name : Identifier | BindingPattern ; // Declared variable name
561+ name : BindingName ; // Declared variable name
560562 type ?: TypeNode ; // Optional type annotation
561563 initializer ?: Expression ; // Optional initializer
562564 }
@@ -569,7 +571,7 @@ namespace ts {
569571 // @kind (SyntaxKind.Parameter)
570572 export interface ParameterDeclaration extends Declaration {
571573 dotDotDotToken ?: Node ; // Present on rest parameter
572- name : Identifier | BindingPattern ; // Declared parameter name
574+ name : BindingName ; // Declared parameter name
573575 questionToken ?: Node ; // Present on optional parameter
574576 type ?: TypeNode ; // Optional type annotation
575577 initializer ?: Expression ; // Optional initializer
@@ -579,7 +581,7 @@ namespace ts {
579581 export interface BindingElement extends Declaration {
580582 propertyName ?: PropertyName ; // Binding property name (in object binding pattern)
581583 dotDotDotToken ?: Node ; // Present on rest binding element
582- name : Identifier | BindingPattern ; // Declared binding element name
584+ name : BindingName ; // Declared binding element name
583585 initializer ?: Expression ; // Optional initializer
584586 }
585587
@@ -946,6 +948,8 @@ namespace ts {
946948 _templateLiteralFragmentBrand : any ;
947949 }
948950
951+ export type Template = TemplateExpression | LiteralExpression ;
952+
949953 // @kind (SyntaxKind.TemplateExpression)
950954 export interface TemplateExpression extends PrimaryExpression {
951955 head : TemplateLiteralFragment ;
@@ -1017,7 +1021,7 @@ namespace ts {
10171021 // @kind (SyntaxKind.TaggedTemplateExpression)
10181022 export interface TaggedTemplateExpression extends MemberExpression {
10191023 tag : LeftHandSideExpression ;
1020- template : LiteralExpression | TemplateExpression ;
1024+ template : Template ;
10211025 }
10221026
10231027 export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator ;
@@ -1049,7 +1053,7 @@ namespace ts {
10491053 export interface JsxOpeningElement extends Expression {
10501054 _openingElementBrand ?: any ;
10511055 tagName : EntityName ;
1052- attributes : NodeArray < JsxAttribute | JsxSpreadAttribute > ;
1056+ attributes : NodeArray < JsxAttributeLike > ;
10531057 }
10541058
10551059 /// A JSX expression of the form <TagName attrs />
@@ -1061,6 +1065,8 @@ namespace ts {
10611065 /// Either the opening tag in a <Tag>...</Tag> pair, or the lone <Tag /> in a self-closing form
10621066 export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement ;
10631067
1068+ export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute ;
1069+
10641070 // @kind (SyntaxKind.JsxAttribute)
10651071 export interface JsxAttribute extends Node {
10661072 name : Identifier ;
@@ -1143,22 +1149,24 @@ namespace ts {
11431149 expression : Expression ;
11441150 }
11451151
1152+ export type ForInitializer = VariableDeclarationList | Expression ;
1153+
11461154 // @kind (SyntaxKind.ForStatement)
11471155 export interface ForStatement extends IterationStatement {
1148- initializer ?: VariableDeclarationList | Expression ;
1156+ initializer ?: ForInitializer ;
11491157 condition ?: Expression ;
11501158 incrementor ?: Expression ;
11511159 }
11521160
11531161 // @kind (SyntaxKind.ForInStatement)
11541162 export interface ForInStatement extends IterationStatement {
1155- initializer : VariableDeclarationList | Expression ;
1163+ initializer : ForInitializer ;
11561164 expression : Expression ;
11571165 }
11581166
11591167 // @kind (SyntaxKind.ForOfStatement)
11601168 export interface ForOfStatement extends IterationStatement {
1161- initializer : VariableDeclarationList | Expression ;
1169+ initializer : ForInitializer ;
11621170 expression : Expression ;
11631171 }
11641172
@@ -1297,9 +1305,11 @@ namespace ts {
12971305
12981306 export type ModuleBody = ModuleBlock | ModuleDeclaration ;
12991307
1308+ export type ModuleName = Identifier | StringLiteral ;
1309+
13001310 // @kind (SyntaxKind.ModuleDeclaration)
13011311 export interface ModuleDeclaration extends DeclarationStatement {
1302- name : Identifier | LiteralExpression ;
1312+ name : ModuleName ;
13031313 body : ModuleBlock | ModuleDeclaration ;
13041314 }
13051315
@@ -1334,6 +1344,8 @@ namespace ts {
13341344 moduleSpecifier : Expression ;
13351345 }
13361346
1347+ export type NamedImportBindings = NamespaceImport | NamedImports ;
1348+
13371349 // In case of:
13381350 // import d from "mod" => name = d, namedBinding = undefined
13391351 // import * as ns from "mod" => name = undefined, namedBinding: NamespaceImport = { name: ns }
@@ -1343,7 +1355,7 @@ namespace ts {
13431355 // @kind (SyntaxKind.ImportClause)
13441356 export interface ImportClause extends Declaration {
13451357 name ?: Identifier ; // Default binding
1346- namedBindings ?: NamespaceImport | NamedImports ;
1358+ namedBindings ?: NamedImportBindings ;
13471359 }
13481360
13491361 // @kind (SyntaxKind.NamespaceImport)
0 commit comments