A.1 Types

  TypeParameters:   <TypeParameterList>

  TypeParameterList:   TypeParameter   TypeParameterList,TypeParameter

  TypeParameter:   BindingIdentifierConstraintopt

  Constraint:   extendsType

  TypeArguments:   <TypeArgumentList>

  TypeArgumentList:   TypeArgument   TypeArgumentList,TypeArgument

  TypeArgument:   Type

  Type:   UnionOrIntersectionOrPrimaryType   FunctionType   ConstructorType

  UnionOrIntersectionOrPrimaryType:   UnionType   IntersectionOrPrimaryType

  IntersectionOrPrimaryType:   IntersectionType   PrimaryType

  PrimaryType:   ParenthesizedType   PredefinedType   TypeReference   ObjectType   ArrayType   TupleType   TypeQuery   ThisType

  ParenthesizedType:   (Type)

  PredefinedType:   any   number   boolean   string   symbol   void

  TypeReference:   TypeName[no LineTerminator here]TypeArgumentsopt

  TypeName:   IdentifierReference   NamespaceName.IdentifierReference

  NamespaceName:   IdentifierReference   NamespaceName.IdentifierReference

  ObjectType:   {TypeBodyopt}

  TypeBody:   TypeMemberList;opt   TypeMemberList,opt

  TypeMemberList:   TypeMember   TypeMemberList;TypeMember   TypeMemberList,TypeMember

  TypeMember:   PropertySignature   CallSignature   ConstructSignature   IndexSignature   MethodSignature

  ArrayType:   PrimaryType[no LineTerminator here][]

  TupleType:   [TupleElementTypes]

  TupleElementTypes:   TupleElementType   TupleElementTypes,TupleElementType

  TupleElementType:   Type

  UnionType:   UnionOrIntersectionOrPrimaryType|IntersectionOrPrimaryType

  IntersectionType:   IntersectionOrPrimaryType&PrimaryType

  FunctionType:   TypeParametersopt(ParameterListopt)=>Type

  ConstructorType:   newTypeParametersopt(ParameterListopt)=>Type

  TypeQuery:   typeofTypeQueryExpression

  TypeQueryExpression:   IdentifierReference   TypeQueryExpression.IdentifierName

  ThisType:   this

  PropertySignature:   PropertyName?optTypeAnnotationopt

  PropertyName:   IdentifierName   StringLiteral   NumericLiteral

  TypeAnnotation:   :Type

  CallSignature:   TypeParametersopt(ParameterListopt)TypeAnnotationopt

  ParameterList:   RequiredParameterList   OptionalParameterList   RestParameter   RequiredParameterList,OptionalParameterList   RequiredParameterList,RestParameter   OptionalParameterList,RestParameter   RequiredParameterList,OptionalParameterList,RestParameter

  RequiredParameterList:   RequiredParameter   RequiredParameterList,RequiredParameter

  RequiredParameter:   AccessibilityModifieroptBindingIdentifierOrPatternTypeAnnotationopt   BindingIdentifier:StringLiteral

  AccessibilityModifier:   public   private   protected

  BindingIdentifierOrPattern:   BindingIdentifier   BindingPattern

  OptionalParameterList:   OptionalParameter   OptionalParameterList,OptionalParameter

  OptionalParameter:   AccessibilityModifieroptBindingIdentifierOrPattern?TypeAnnotationopt   AccessibilityModifieroptBindingIdentifierOrPatternTypeAnnotationoptInitializer   BindingIdentifier?:StringLiteral

  RestParameter:   ...BindingIdentifierTypeAnnotationopt

  ConstructSignature:   newTypeParametersopt(ParameterListopt)TypeAnnotationopt

  IndexSignature:   [BindingIdentifier:string]TypeAnnotation   [BindingIdentifier:number]TypeAnnotation

  MethodSignature:   PropertyName?optCallSignature

  TypeAliasDeclaration:   typeBindingIdentifierTypeParametersopt=Type;