@@ -616,7 +616,6 @@ namespace ts {
616
616
| CallExpression
617
617
| CallSignatureDeclaration
618
618
| ClassDeclaration
619
- | ClassElement
620
619
| ClassExpression
621
620
| ClassLikeDeclaration
622
621
| ConstructSignatureDeclaration
@@ -717,13 +716,14 @@ namespace ts {
717
716
typeParameters ?: NodeArray < TypeParameterDeclaration > ;
718
717
parameters : NodeArray < ParameterDeclaration > ;
719
718
type ?: TypeNode ;
719
+ questionToken ?: QuestionToken ;
720
720
}
721
721
722
- export interface CallSignatureDeclaration extends SignatureDeclaration , TypeElement {
722
+ export interface CallSignatureDeclaration extends SignatureDeclaration {
723
723
kind : SyntaxKind . CallSignature ;
724
724
}
725
725
726
- export interface ConstructSignatureDeclaration extends SignatureDeclaration , TypeElement {
726
+ export interface ConstructSignatureDeclaration extends SignatureDeclaration {
727
727
kind : SyntaxKind . ConstructSignature ;
728
728
}
729
729
@@ -762,15 +762,15 @@ namespace ts {
762
762
initializer ?: Expression ; // Optional initializer
763
763
}
764
764
765
- export interface PropertySignature extends TypeElement {
765
+ export interface PropertySignature extends DeclarationBase {
766
766
kind : SyntaxKind . PropertySignature | SyntaxKind . JSDocRecordMember ;
767
767
name : PropertyName ; // Declared property name
768
768
questionToken ?: QuestionToken ; // Present on optional property
769
769
type ?: TypeNode ; // Optional type annotation
770
770
initializer ?: Expression ; // Optional initializer
771
771
}
772
772
773
- export interface PropertyDeclaration extends ClassElement {
773
+ export interface PropertyDeclaration extends DeclarationBase {
774
774
kind : SyntaxKind . PropertyDeclaration ;
775
775
questionToken ?: QuestionToken ; // Present for use with reporting a grammar error
776
776
name : PropertyName ;
@@ -876,7 +876,7 @@ namespace ts {
876
876
body ?: FunctionBody ;
877
877
}
878
878
879
- export interface MethodSignature extends SignatureDeclaration , TypeElement {
879
+ export interface MethodSignature extends SignatureDeclaration {
880
880
kind : SyntaxKind . MethodSignature ;
881
881
name : PropertyName ;
882
882
}
@@ -890,27 +890,28 @@ namespace ts {
890
890
// Because of this, it may be necessary to determine what sort of MethodDeclaration you have
891
891
// at later stages of the compiler pipeline. In that case, you can either check the parent kind
892
892
// of the method, or use helpers like isObjectLiteralMethodDeclaration
893
- export interface MethodDeclaration extends FunctionLikeDeclaration , ClassElement , ObjectLiteralElement {
893
+ export interface MethodDeclaration extends FunctionLikeDeclaration , ObjectLiteralElement {
894
894
kind : SyntaxKind . MethodDeclaration ;
895
895
name : PropertyName ;
896
896
body ?: FunctionBody ;
897
897
}
898
898
899
- export interface ConstructorDeclaration extends FunctionLikeDeclaration , ClassElement {
899
+ export interface ConstructorDeclaration extends FunctionLikeDeclaration {
900
900
kind : SyntaxKind . Constructor ;
901
901
parent ?: ClassDeclaration | ClassExpression ;
902
902
body ?: FunctionBody ;
903
903
}
904
904
905
905
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
906
- export interface SemicolonClassElement extends ClassElement {
906
+ export interface SemicolonClassElement extends DeclarationBase {
907
907
kind : SyntaxKind . SemicolonClassElement ;
908
908
parent ?: ClassDeclaration | ClassExpression ;
909
+ name ?: PropertyName ;
909
910
}
910
911
911
912
// See the comment on MethodDeclaration for the intuition behind GetAccessorDeclaration being a
912
913
// ClassElement and an ObjectLiteralElement.
913
- export interface GetAccessorDeclaration extends FunctionLikeDeclaration , ClassElement , ObjectLiteralElement {
914
+ export interface GetAccessorDeclaration extends FunctionLikeDeclaration , ObjectLiteralElement {
914
915
kind : SyntaxKind . GetAccessor ;
915
916
parent ?: ClassDeclaration | ClassExpression | ObjectLiteralExpression ;
916
917
name : PropertyName ;
@@ -919,7 +920,7 @@ namespace ts {
919
920
920
921
// See the comment on MethodDeclaration for the intuition behind SetAccessorDeclaration being a
921
922
// ClassElement and an ObjectLiteralElement.
922
- export interface SetAccessorDeclaration extends FunctionLikeDeclaration , ClassElement , ObjectLiteralElement {
923
+ export interface SetAccessorDeclaration extends FunctionLikeDeclaration , ObjectLiteralElement {
923
924
kind : SyntaxKind . SetAccessor ;
924
925
parent ?: ClassDeclaration | ClassExpression | ObjectLiteralExpression ;
925
926
name : PropertyName ;
@@ -928,7 +929,7 @@ namespace ts {
928
929
929
930
export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration ;
930
931
931
- export interface IndexSignatureDeclaration extends SignatureDeclaration , ClassElement , TypeElement {
932
+ export interface IndexSignatureDeclaration extends SignatureDeclaration {
932
933
kind : SyntaxKind . IndexSignature ;
933
934
parent ?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode ;
934
935
}
@@ -1695,7 +1696,7 @@ namespace ts {
1695
1696
kind : SyntaxKind . DebuggerStatement ;
1696
1697
}
1697
1698
1698
- export interface MissingDeclaration extends DeclarationStatement , ClassElement , ObjectLiteralElement , TypeElement {
1699
+ export interface MissingDeclaration extends DeclarationStatement , ObjectLiteralElement {
1699
1700
kind : SyntaxKind . MissingDeclaration ;
1700
1701
name ?: Identifier ;
1701
1702
}
@@ -1863,34 +1864,26 @@ namespace ts {
1863
1864
kind : SyntaxKind . ClassExpression ;
1864
1865
}
1865
1866
1866
- export interface ClassElement extends DeclarationBase {
1867
- kind :
1868
- | SyntaxKind . PropertyDeclaration
1869
- | SyntaxKind . MethodDeclaration
1870
- | SyntaxKind . Constructor
1871
- | SyntaxKind . SemicolonClassElement
1872
- | SyntaxKind . GetAccessor
1873
- | SyntaxKind . SetAccessor
1874
- | SyntaxKind . IndexSignature
1875
- | SyntaxKind . MissingDeclaration ;
1876
- _classElementBrand : any ;
1877
- name ?: PropertyName ;
1878
- }
1867
+ export type ClassElement =
1868
+ | PropertyDeclaration
1869
+ | MethodDeclaration
1870
+ | ConstructorDeclaration
1871
+ | SemicolonClassElement
1872
+ | GetAccessorDeclaration
1873
+ | SetAccessorDeclaration
1874
+ | IndexSignatureDeclaration
1875
+ | MissingDeclaration ;
1879
1876
1880
- export interface TypeElement extends DeclarationBase {
1881
- kind :
1882
- | SyntaxKind . CallSignature
1883
- | SyntaxKind . ConstructSignature
1884
- | SyntaxKind . PropertySignature
1885
- | SyntaxKind . MethodSignature
1886
- | SyntaxKind . IndexSignature
1887
- | SyntaxKind . MissingDeclaration
1888
- | SyntaxKind . JSDocPropertyTag
1889
- | SyntaxKind . JSDocRecordMember ;
1890
- _typeElementBrand : any ;
1891
- name ?: PropertyName ;
1892
- questionToken ?: QuestionToken ;
1893
- }
1877
+ export type TypeElement =
1878
+ | CallSignatureDeclaration
1879
+ | ConstructSignatureDeclaration
1880
+ | PropertySignature
1881
+ | MethodSignature
1882
+ | IndexSignatureDeclaration
1883
+ | MissingDeclaration
1884
+ | IndexSignatureDeclaration
1885
+ | JSDocPropertyTag
1886
+ | JSDocRecordMember ;
1894
1887
1895
1888
export interface InterfaceDeclaration extends DeclarationStatement {
1896
1889
kind : SyntaxKind . InterfaceDeclaration ;
@@ -2224,7 +2217,7 @@ namespace ts {
2224
2217
jsDocTypeLiteral ?: JSDocTypeLiteral ;
2225
2218
}
2226
2219
2227
- export interface JSDocPropertyTag extends JSDocTag , TypeElement {
2220
+ export interface JSDocPropertyTag extends JSDocTag {
2228
2221
kind : SyntaxKind . JSDocPropertyTag ;
2229
2222
name : Identifier ;
2230
2223
typeExpression : JSDocTypeExpression ;
0 commit comments