Merge pull request #14418 from ajafff/fix-parent-type

Fix parent type of JsxAttributes
This commit is contained in:
Mohamed Hegazy 2017-03-22 10:32:43 -07:00 committed by GitHub
commit a71879c4a9

View File

@ -815,18 +815,21 @@ namespace ts {
export interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement {
kind: SyntaxKind.Constructor;
parent?: ClassDeclaration | ClassExpression;
body?: FunctionBody;
}
// For when we encounter a semicolon in a class declaration. ES6 allows these as class elements.
export interface SemicolonClassElement extends ClassElement {
kind: SyntaxKind.SemicolonClassElement;
parent?: ClassDeclaration | ClassExpression;
}
// See the comment on MethodDeclaration for the intuition behind GetAccessorDeclaration being a
// ClassElement and an ObjectLiteralElement.
export interface GetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
kind: SyntaxKind.GetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
name: PropertyName;
body: FunctionBody;
}
@ -835,6 +838,7 @@ namespace ts {
// ClassElement and an ObjectLiteralElement.
export interface SetAccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
kind: SyntaxKind.SetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
name: PropertyName;
body: FunctionBody;
}
@ -843,6 +847,7 @@ namespace ts {
export interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement, TypeElement {
kind: SyntaxKind.IndexSignature;
parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode;
}
export interface TypeNode extends Node {
@ -937,6 +942,7 @@ namespace ts {
export interface MappedTypeNode extends TypeNode, Declaration {
kind: SyntaxKind.MappedType;
parent?: TypeAliasDeclaration;
readonlyToken?: ReadonlyToken;
typeParameter: TypeParameterDeclaration;
questionToken?: QuestionToken;
@ -1450,7 +1456,7 @@ namespace ts {
kind: SyntaxKind.NewExpression;
expression: LeftHandSideExpression;
typeArguments?: NodeArray<TypeNode>;
arguments: NodeArray<Expression>;
arguments?: NodeArray<Expression>;
}
export interface TaggedTemplateExpression extends MemberExpression {
@ -1504,6 +1510,7 @@ namespace ts {
export type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression;
export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
parent?: JsxOpeningLikeElement;
}
/// The opening element of a <Tag>...</Tag> JsxElement
@ -1523,7 +1530,7 @@ namespace ts {
export interface JsxAttribute extends ObjectLiteralElement {
kind: SyntaxKind.JsxAttribute;
parent?: JsxOpeningLikeElement;
parent?: JsxAttributes;
name: Identifier;
/// JSX attribute initializers are optional; <X y /> is sugar for <X y={true} />
initializer?: StringLiteral | JsxExpression;
@ -1531,7 +1538,7 @@ namespace ts {
export interface JsxSpreadAttribute extends ObjectLiteralElement {
kind: SyntaxKind.JsxSpreadAttribute;
parent?: JsxOpeningLikeElement;
parent?: JsxAttributes;
expression: Expression;
}
@ -1777,7 +1784,7 @@ namespace ts {
kind: SyntaxKind.HeritageClause;
parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression;
token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword;
types?: NodeArray<ExpressionWithTypeArguments>;
types: NodeArray<ExpressionWithTypeArguments>;
}
export interface TypeAliasDeclaration extends DeclarationStatement {