@babel/types

Install

  1. npm install --save-dev @babel/types

API

anyTypeAnnotation

  1. t.anyTypeAnnotation()

See also t.isAnyTypeAnnotation(node, opts) and t.assertAnyTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


arrayExpression

  1. t.arrayExpression(elements)

See also t.isArrayExpression(node, opts) and t.assertArrayExpression(node, opts).

Aliases: Expression

  • elements: Array<null | Expression | SpreadElement> (default: [])

argumentPlaceholder

  1. t.argumentPlaceholder()

See also t.isArgumentPlaceholder(node, opts) and t.assertArgumentPlaceholder(node, opts).

Aliases: none


arrayPattern

  1. t.arrayPattern(elements)

See also t.isArrayPattern(node, opts) and t.assertArrayPattern(node, opts).

Aliases: Pattern, PatternLike, LVal

  • elements: Array<PatternLike> (required)
  • decorators: Array<Decorator> (default: null)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (default: null)

arrayTypeAnnotation

  1. t.arrayTypeAnnotation(elementType)

See also t.isArrayTypeAnnotation(node, opts) and t.assertArrayTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • elementType: FlowType (required)

arrowFunctionExpression

  1. t.arrowFunctionExpression(params, body, async)

See also t.isArrowFunctionExpression(node, opts) and t.assertArrowFunctionExpression(node, opts).

Aliases: Scopable, Function, BlockParent, FunctionParent, Expression, Pureish

  • params: Array<LVal> (required)
  • body: BlockStatement | Expression (required)
  • async: boolean (default: false)
  • expression: boolean (default: null)
  • generator: boolean (default: false)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (default: null)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (default: null)

assignmentExpression

  1. t.assignmentExpression(operator, left, right)

See also t.isAssignmentExpression(node, opts) and t.assertAssignmentExpression(node, opts).

Aliases: Expression

  • operator: string (required)
  • left: LVal (required)
  • right: Expression (required)

assignmentPattern

  1. t.assignmentPattern(left, right)

See also t.isAssignmentPattern(node, opts) and t.assertAssignmentPattern(node, opts).

Aliases: Pattern, PatternLike, LVal

  • left: Identifier | ObjectPattern | ArrayPattern (required)
  • right: Expression (required)
  • decorators: Array<Decorator> (default: null)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (default: null)

awaitExpression

  1. t.awaitExpression(argument)

See also t.isAwaitExpression(node, opts) and t.assertAwaitExpression(node, opts).

Aliases: Expression, Terminatorless

  • argument: Expression (required)

bigIntLiteral

  1. t.bigIntLiteral(value)

See also t.isBigIntLiteral(node, opts) and t.assertBigIntLiteral(node, opts).

Aliases: Expression, Pureish, Literal, Immutable

  • value: string (required)

binaryExpression

  1. t.binaryExpression(operator, left, right)

See also t.isBinaryExpression(node, opts) and t.assertBinaryExpression(node, opts).

Aliases: Binary, Expression

  • operator: "+" | "-" | "/" | "%" | "" | "*" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" (required)
  • left: Expression (required)
  • right: Expression (required)

bindExpression

  1. t.bindExpression(object, callee)

See also t.isBindExpression(node, opts) and t.assertBindExpression(node, opts).

Aliases: Expression

  • object (required)
  • callee (required)

blockStatement

  1. t.blockStatement(body, directives)

See also t.isBlockStatement(node, opts) and t.assertBlockStatement(node, opts).

Aliases: Scopable, BlockParent, Block, Statement

  • body: Array<Statement> (required)
  • directives: Array<Directive> (default: [])

booleanLiteral

  1. t.booleanLiteral(value)

See also t.isBooleanLiteral(node, opts) and t.assertBooleanLiteral(node, opts).

Aliases: Expression, Pureish, Literal, Immutable

  • value: boolean (required)

booleanLiteralTypeAnnotation

  1. t.booleanLiteralTypeAnnotation(value)

See also t.isBooleanLiteralTypeAnnotation(node, opts) and t.assertBooleanLiteralTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • value: boolean (required)

booleanTypeAnnotation

  1. t.booleanTypeAnnotation()

See also t.isBooleanTypeAnnotation(node, opts) and t.assertBooleanTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


breakStatement

  1. t.breakStatement(label)

See also t.isBreakStatement(node, opts) and t.assertBreakStatement(node, opts).

Aliases: Statement, Terminatorless, CompletionStatement

  • label: Identifier (default: null)

callExpression

  1. t.callExpression(callee, arguments)

See also t.isCallExpression(node, opts) and t.assertCallExpression(node, opts).

Aliases: Expression

  • callee: Expression (required)
  • arguments: Array<Expression | SpreadElement | JSXNamespacedName> (required)
  • optional: true | false (default: null)
  • typeArguments: TypeParameterInstantiation (default: null)
  • typeParameters: TSTypeParameterInstantiation (default: null)

catchClause

  1. t.catchClause(param, body)

See also t.isCatchClause(node, opts) and t.assertCatchClause(node, opts).

Aliases: Scopable, BlockParent

  • param: Identifier (default: null)
  • body: BlockStatement (required)

classBody

  1. t.classBody(body)

See also t.isClassBody(node, opts) and t.assertClassBody(node, opts).

  • body: Array<ClassMethod | ClassProperty | ClassPrivateProperty | TSDeclareMethod | TSIndexSignature> (required)

classDeclaration

  1. t.classDeclaration(id, superClass, body, decorators)

See also t.isClassDeclaration(node, opts) and t.assertClassDeclaration(node, opts).

Aliases: Scopable, Class, Statement, Declaration, Pureish

  • id: Identifier (default: null)
  • superClass: Expression (default: null)
  • body: ClassBody (required)
  • decorators: Array<Decorator> (default: null)
  • abstract: boolean (default: null)
  • declare: boolean (default: null)
  • implements: Array<TSExpressionWithTypeArguments | ClassImplements> (default: null)
  • mixins (default: null)
  • superTypeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation (default: null)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (default: null)

classExpression

  1. t.classExpression(id, superClass, body, decorators)

See also t.isClassExpression(node, opts) and t.assertClassExpression(node, opts).

Aliases: Scopable, Class, Expression, Pureish

  • id: Identifier (default: null)
  • superClass: Expression (default: null)
  • body: ClassBody (required)
  • decorators: Array<Decorator> (default: null)
  • implements: Array<TSExpressionWithTypeArguments | ClassImplements> (default: null)
  • mixins (default: null)
  • superTypeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation (default: null)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (default: null)

classImplements

  1. t.classImplements(id, typeParameters)

See also t.isClassImplements(node, opts) and t.assertClassImplements(node, opts).

Aliases: Flow

  • id: Identifier (required)
  • typeParameters: TypeParameterInstantiation (default: null)

classMethod

  1. t.classMethod(kind, key, params, body, computed, static)

See also t.isClassMethod(node, opts) and t.assertClassMethod(node, opts).

Aliases: Function, Scopable, BlockParent, FunctionParent, Method

  • kind: "get" | "set" | "method" | "constructor" (default: 'method')
  • key: if computed then Expression else Identifier | Literal (required)
  • params: Array<LVal> (required)
  • body: BlockStatement (required)
  • computed: boolean (default: false)
  • static: boolean (default: null)
  • abstract: boolean (default: null)
  • access: "public" | "private" | "protected" (default: null)
  • accessibility: "public" | "private" | "protected" (default: null)
  • async: boolean (default: false)
  • decorators: Array<Decorator> (default: null)
  • generator: boolean (default: false)
  • optional: boolean (default: null)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (default: null)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (default: null)

classPrivateProperty

  1. t.classPrivateProperty(key, value)

See also t.isClassPrivateProperty(node, opts) and t.assertClassPrivateProperty(node, opts).

Aliases: Property, Private

  • key: PrivateName (required)
  • value: Expression (default: null)

classProperty

  1. t.classProperty(key, value, typeAnnotation, decorators, computed, static)

See also t.isClassProperty(node, opts) and t.assertClassProperty(node, opts).

Aliases: Property

  • key: Identifier | StringLiteral | NumericLiteral | Expression (required)
  • value: Expression (default: null)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (default: null)
  • decorators: Array<Decorator> (default: null)
  • computed: boolean (default: false)
  • abstract: boolean (default: null)
  • accessibility: "public" | "private" | "protected" (default: null)
  • definite: boolean (default: null)
  • optional: boolean (default: null)
  • readonly: boolean (default: null)
  • static: boolean (default: null)

conditionalExpression

  1. t.conditionalExpression(test, consequent, alternate)

See also t.isConditionalExpression(node, opts) and t.assertConditionalExpression(node, opts).

Aliases: Expression, Conditional

  • test: Expression (required)
  • consequent: Expression (required)
  • alternate: Expression (required)

continueStatement

  1. t.continueStatement(label)

See also t.isContinueStatement(node, opts) and t.assertContinueStatement(node, opts).

Aliases: Statement, Terminatorless, CompletionStatement

  • label: Identifier (default: null)

debuggerStatement

  1. t.debuggerStatement()

See also t.isDebuggerStatement(node, opts) and t.assertDebuggerStatement(node, opts).

Aliases: Statement


declareClass

  1. t.declareClass(id, typeParameters, extends, body)

See also t.isDeclareClass(node, opts) and t.assertDeclareClass(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TypeParameterInstantiation (default: null)
  • extends: Array<InterfaceExtends> (default: null)
  • body: ObjectTypeAnnotation (required)
  • implements: Array<ClassImplements> (default: null)
  • mixins: Array<InterfaceExtends> (default: null)

declareExportAllDeclaration

  1. t.declareExportAllDeclaration(source)

See also t.isDeclareExportAllDeclaration(node, opts) and t.assertDeclareExportAllDeclaration(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • source: StringLiteral (required)
  • exportKind: ["type","value"] (default: null)

declareExportDeclaration

  1. t.declareExportDeclaration(declaration, specifiers, source)

See also t.isDeclareExportDeclaration(node, opts) and t.assertDeclareExportDeclaration(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • declaration: Flow (default: null)
  • specifiers: Array<ExportSpecifier | ExportNamespaceSpecifier> (default: null)
  • source: StringLiteral (default: null)
  • default: boolean (default: null)

declareFunction

  1. t.declareFunction(id)

See also t.isDeclareFunction(node, opts) and t.assertDeclareFunction(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)
  • predicate: DeclaredPredicate (default: null)

declareInterface

  1. t.declareInterface(id, typeParameters, extends, body)

See also t.isDeclareInterface(node, opts) and t.assertDeclareInterface(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TypeParameterDeclaration (default: null)
  • extends: Array<InterfaceExtends> (default: null)
  • body: ObjectTypeAnnotation (required)
  • implements: Array<ClassImplements> (default: null)
  • mixins: Array<InterfaceExtends> (default: null)

declareModule

  1. t.declareModule(id, body, kind)

See also t.isDeclareModule(node, opts) and t.assertDeclareModule(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier | StringLiteral (required)
  • body: BlockStatement (required)
  • kind: "CommonJS" | "ES" (default: null)

declareModuleExports

  1. t.declareModuleExports(typeAnnotation)

See also t.isDeclareModuleExports(node, opts) and t.assertDeclareModuleExports(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • typeAnnotation: TypeAnnotation (required)

declareOpaqueType

  1. t.declareOpaqueType(id, typeParameters, supertype)

See also t.isDeclareOpaqueType(node, opts) and t.assertDeclareOpaqueType(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TypeParameterDeclaration (default: null)
  • supertype: FlowType (default: null)

declareTypeAlias

  1. t.declareTypeAlias(id, typeParameters, right)

See also t.isDeclareTypeAlias(node, opts) and t.assertDeclareTypeAlias(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TypeParameterDeclaration (default: null)
  • right: FlowType (required)

declareVariable

  1. t.declareVariable(id)

See also t.isDeclareVariable(node, opts) and t.assertDeclareVariable(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)

declaredPredicate

  1. t.declaredPredicate(value)

See also t.isDeclaredPredicate(node, opts) and t.assertDeclaredPredicate(node, opts).

Aliases: Flow, FlowPredicate

  • value: Flow (required)

decorator

  1. t.decorator(expression)

See also t.isDecorator(node, opts) and t.assertDecorator(node, opts).

  • expression: Expression (required)

directive

  1. t.directive(value)

See also t.isDirective(node, opts) and t.assertDirective(node, opts).

  • value: DirectiveLiteral (required)

directiveLiteral

  1. t.directiveLiteral(value)

See also t.isDirectiveLiteral(node, opts) and t.assertDirectiveLiteral(node, opts).

  • value: string (required)

doExpression

  1. t.doExpression(body)

See also t.isDoExpression(node, opts) and t.assertDoExpression(node, opts).

Aliases: Expression

  • body: BlockStatement (required)

doWhileStatement

  1. t.doWhileStatement(test, body)

See also t.isDoWhileStatement(node, opts) and t.assertDoWhileStatement(node, opts).

Aliases: Statement, BlockParent, Loop, While, Scopable

  • test: Expression (required)
  • body: Statement (required)

emptyStatement

  1. t.emptyStatement()

See also t.isEmptyStatement(node, opts) and t.assertEmptyStatement(node, opts).

Aliases: Statement


emptyTypeAnnotation

  1. t.emptyTypeAnnotation()

See also t.isEmptyTypeAnnotation(node, opts) and t.assertEmptyTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


existsTypeAnnotation

  1. t.existsTypeAnnotation()

See also t.isExistsTypeAnnotation(node, opts) and t.assertExistsTypeAnnotation(node, opts).

Aliases: Flow, FlowType


exportAllDeclaration

  1. t.exportAllDeclaration(source)

See also t.isExportAllDeclaration(node, opts) and t.assertExportAllDeclaration(node, opts).

Aliases: Statement, Declaration, ModuleDeclaration, ExportDeclaration

  • source: StringLiteral (required)

exportDefaultDeclaration

  1. t.exportDefaultDeclaration(declaration)

See also t.isExportDefaultDeclaration(node, opts) and t.assertExportDefaultDeclaration(node, opts).

Aliases: Statement, Declaration, ModuleDeclaration, ExportDeclaration

  • declaration: FunctionDeclaration | TSDeclareFunction | ClassDeclaration | Expression (required)

exportDefaultSpecifier

  1. t.exportDefaultSpecifier(exported)

See also t.isExportDefaultSpecifier(node, opts) and t.assertExportDefaultSpecifier(node, opts).

Aliases: ModuleSpecifier

  • exported: Identifier (required)

exportNamedDeclaration

  1. t.exportNamedDeclaration(declaration, specifiers, source)

See also t.isExportNamedDeclaration(node, opts) and t.assertExportNamedDeclaration(node, opts).

Aliases: Statement, Declaration, ModuleDeclaration, ExportDeclaration

  • declaration: Declaration (default: null)
  • specifiers: Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier> (required)
  • source: StringLiteral (default: null)

exportNamespaceSpecifier

  1. t.exportNamespaceSpecifier(exported)

See also t.isExportNamespaceSpecifier(node, opts) and t.assertExportNamespaceSpecifier(node, opts).

Aliases: ModuleSpecifier

  • exported: Identifier (required)

exportSpecifier

  1. t.exportSpecifier(local, exported)

See also t.isExportSpecifier(node, opts) and t.assertExportSpecifier(node, opts).

Aliases: ModuleSpecifier

  • local: Identifier (required)
  • exported: Identifier (required)

expressionStatement

  1. t.expressionStatement(expression)

See also t.isExpressionStatement(node, opts) and t.assertExpressionStatement(node, opts).

Aliases: Statement, ExpressionWrapper

  • expression: Expression (required)

file

  1. t.file(program, comments, tokens)

See also t.isFile(node, opts) and t.assertFile(node, opts).

  • program: Program (required)
  • comments (required)
  • tokens (required)

forInStatement

  1. t.forInStatement(left, right, body)

See also t.isForInStatement(node, opts) and t.assertForInStatement(node, opts).

Aliases: Scopable, Statement, For, BlockParent, Loop, ForXStatement

  • left: VariableDeclaration | LVal (required)
  • right: Expression (required)
  • body: Statement (required)

forOfStatement

  1. t.forOfStatement(left, right, body)

See also t.isForOfStatement(node, opts) and t.assertForOfStatement(node, opts).

Aliases: Scopable, Statement, For, BlockParent, Loop, ForXStatement

  • left: VariableDeclaration | LVal (required)
  • right: Expression (required)
  • body: Statement (required)
  • await: boolean (default: false)

forStatement

  1. t.forStatement(init, test, update, body)

See also t.isForStatement(node, opts) and t.assertForStatement(node, opts).

Aliases: Scopable, Statement, For, BlockParent, Loop

  • init: VariableDeclaration | Expression (default: null)
  • test: Expression (default: null)
  • update: Expression (default: null)
  • body: Statement (required)

functionDeclaration

  1. t.functionDeclaration(id, params, body, generator, async)

See also t.isFunctionDeclaration(node, opts) and t.assertFunctionDeclaration(node, opts).

Aliases: Scopable, Function, BlockParent, FunctionParent, Statement, Pureish, Declaration

  • id: Identifier (default: null)
  • params: Array<LVal> (required)
  • body: BlockStatement (required)
  • generator: boolean (default: false)
  • async: boolean (default: false)
  • declare: boolean (default: null)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (default: null)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (default: null)

functionExpression

  1. t.functionExpression(id, params, body, generator, async)

See also t.isFunctionExpression(node, opts) and t.assertFunctionExpression(node, opts).

Aliases: Scopable, Function, BlockParent, FunctionParent, Expression, Pureish

  • id: Identifier (default: null)
  • params: Array<LVal> (required)
  • body: BlockStatement (required)
  • generator: boolean (default: false)
  • async: boolean (default: false)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (default: null)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (default: null)

functionTypeAnnotation

  1. t.functionTypeAnnotation(typeParameters, params, rest, returnType)

See also t.isFunctionTypeAnnotation(node, opts) and t.assertFunctionTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • typeParameters: TypeParameterDeclaration (default: null)
  • params: Array<FunctionTypeParam> (required)
  • rest: FunctionTypeParam (default: null)
  • returnType: FlowType (required)

functionTypeParam

  1. t.functionTypeParam(name, typeAnnotation)

See also t.isFunctionTypeParam(node, opts) and t.assertFunctionTypeParam(node, opts).

Aliases: Flow

  • name: Identifier (default: null)
  • typeAnnotation: FlowType (required)
  • optional: boolean (default: null)

genericTypeAnnotation

  1. t.genericTypeAnnotation(id, typeParameters)

See also t.isGenericTypeAnnotation(node, opts) and t.assertGenericTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • id: Identifier (required)
  • typeParameters: TypeParameterInstantiation (default: null)

identifier

  1. t.identifier(name)

See also t.isIdentifier(node, opts) and t.assertIdentifier(node, opts).

Aliases: Expression, PatternLike, LVal, TSEntityName

  • name: string (required)
  • decorators: Array<Decorator> (default: null)
  • optional: boolean (default: null)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (default: null)

ifStatement

  1. t.ifStatement(test, consequent, alternate)

See also t.isIfStatement(node, opts) and t.assertIfStatement(node, opts).

Aliases: Statement, Conditional

  • test: Expression (required)
  • consequent: Statement (required)
  • alternate: Statement (default: null)

import

  1. t.import()

See also t.isImport(node, opts) and t.assertImport(node, opts).

Aliases: Expression


importDeclaration

  1. t.importDeclaration(specifiers, source)

See also t.isImportDeclaration(node, opts) and t.assertImportDeclaration(node, opts).

Aliases: Statement, Declaration, ModuleDeclaration

  • specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier> (required)
  • source: StringLiteral (required)

importDefaultSpecifier

  1. t.importDefaultSpecifier(local)

See also t.isImportDefaultSpecifier(node, opts) and t.assertImportDefaultSpecifier(node, opts).

Aliases: ModuleSpecifier

  • local: Identifier (required)

importNamespaceSpecifier

  1. t.importNamespaceSpecifier(local)

See also t.isImportNamespaceSpecifier(node, opts) and t.assertImportNamespaceSpecifier(node, opts).

Aliases: ModuleSpecifier

  • local: Identifier (required)

importSpecifier

  1. t.importSpecifier(local, imported)

See also t.isImportSpecifier(node, opts) and t.assertImportSpecifier(node, opts).

Aliases: ModuleSpecifier

  • local: Identifier (required)
  • imported: Identifier (required)
  • importKind: null | "type" | "typeof" (default: null)

inferredPredicate

  1. t.inferredPredicate()

See also t.isInferredPredicate(node, opts) and t.assertInferredPredicate(node, opts).

Aliases: Flow, FlowPredicate


interfaceDeclaration

  1. t.interfaceDeclaration(id, typeParameters, extends, body)

See also t.isInterfaceDeclaration(node, opts) and t.assertInterfaceDeclaration(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TypeParameterDeclaration (default: null)
  • extends: Array<InterfaceExtends> (default: null)
  • body: ObjectTypeAnnotation (required)
  • implements: Array<ClassImplements> (default: null)
  • mixins: Array<InterfaceExtends> (default: null)

interfaceExtends

  1. t.interfaceExtends(id, typeParameters)

See also t.isInterfaceExtends(node, opts) and t.assertInterfaceExtends(node, opts).

Aliases: Flow

  • id: Identifier (required)
  • typeParameters: TypeParameterInstantiation (default: null)

interfaceTypeAnnotation

  1. t.interfaceTypeAnnotation(extends, body)

See also t.isInterfaceTypeAnnotation(node, opts) and t.assertInterfaceTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • extends: Array<InterfaceExtends> (default: null)
  • body: ObjectTypeAnnotation (required)

interpreterDirective

  1. t.interpreterDirective(value)

See also t.isInterpreterDirective(node, opts) and t.assertInterpreterDirective(node, opts).

  • value: string (required)

intersectionTypeAnnotation

  1. t.intersectionTypeAnnotation(types)

See also t.isIntersectionTypeAnnotation(node, opts) and t.assertIntersectionTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • types: Array<FlowType> (required)

jSXAttribute

  1. t.jsxAttribute(name, value)

See also t.isJSXAttribute(node, opts) and t.assertJSXAttribute(node, opts).

Aliases: JSX, Immutable

  • name: JSXIdentifier | JSXNamespacedName (required)
  • value: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer (default: null)

jSXClosingElement

  1. t.jsxClosingElement(name)

See also t.isJSXClosingElement(node, opts) and t.assertJSXClosingElement(node, opts).

Aliases: JSX, Immutable

  • name: JSXIdentifier | JSXMemberExpression (required)

jSXClosingFragment

  1. t.jsxClosingFragment()

See also t.isJSXClosingFragment(node, opts) and t.assertJSXClosingFragment(node, opts).

Aliases: JSX, Immutable


jSXElement

  1. t.jsxElement(openingElement, closingElement, children, selfClosing)

See also t.isJSXElement(node, opts) and t.assertJSXElement(node, opts).

Aliases: JSX, Immutable, Expression

  • openingElement: JSXOpeningElement (required)
  • closingElement: JSXClosingElement (default: null)
  • children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment> (required)
  • selfClosing (required)

jSXEmptyExpression

  1. t.jsxEmptyExpression()

See also t.isJSXEmptyExpression(node, opts) and t.assertJSXEmptyExpression(node, opts).

Aliases: JSX


jSXExpressionContainer

  1. t.jsxExpressionContainer(expression)

See also t.isJSXExpressionContainer(node, opts) and t.assertJSXExpressionContainer(node, opts).

Aliases: JSX, Immutable

  • expression: Expression (required)

jSXFragment

  1. t.jsxFragment(openingFragment, closingFragment, children)

See also t.isJSXFragment(node, opts) and t.assertJSXFragment(node, opts).

Aliases: JSX, Immutable, Expression

  • openingFragment: JSXOpeningFragment (required)
  • closingFragment: JSXClosingFragment (required)
  • children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment> (required)

jSXIdentifier

  1. t.jsxIdentifier(name)

See also t.isJSXIdentifier(node, opts) and t.assertJSXIdentifier(node, opts).

Aliases: JSX

  • name: string (required)

jSXMemberExpression

  1. t.jsxMemberExpression(object, property)

See also t.isJSXMemberExpression(node, opts) and t.assertJSXMemberExpression(node, opts).

Aliases: JSX

  • object: JSXMemberExpression | JSXIdentifier (required)
  • property: JSXIdentifier (required)

jSXNamespacedName

  1. t.jsxNamespacedName(namespace, name)

See also t.isJSXNamespacedName(node, opts) and t.assertJSXNamespacedName(node, opts).

Aliases: JSX

  • namespace: JSXIdentifier (required)
  • name: JSXIdentifier (required)

jSXOpeningElement

  1. t.jsxOpeningElement(name, attributes, selfClosing)

See also t.isJSXOpeningElement(node, opts) and t.assertJSXOpeningElement(node, opts).

Aliases: JSX, Immutable

  • name: JSXIdentifier | JSXMemberExpression (required)
  • attributes: Array<JSXAttribute | JSXSpreadAttribute> (required)
  • selfClosing: boolean (default: false)

jSXOpeningFragment

  1. t.jsxOpeningFragment()

See also t.isJSXOpeningFragment(node, opts) and t.assertJSXOpeningFragment(node, opts).

Aliases: JSX, Immutable


jSXSpreadAttribute

  1. t.jsxSpreadAttribute(argument)

See also t.isJSXSpreadAttribute(node, opts) and t.assertJSXSpreadAttribute(node, opts).

Aliases: JSX

  • argument: Expression (required)

jSXSpreadChild

  1. t.jsxSpreadChild(expression)

See also t.isJSXSpreadChild(node, opts) and t.assertJSXSpreadChild(node, opts).

Aliases: JSX, Immutable

  • expression: Expression (required)

jSXText

  1. t.jsxText(value)

See also t.isJSXText(node, opts) and t.assertJSXText(node, opts).

Aliases: JSX, Immutable

  • value: string (required)

labeledStatement

  1. t.labeledStatement(label, body)

See also t.isLabeledStatement(node, opts) and t.assertLabeledStatement(node, opts).

Aliases: Statement

  • label: Identifier (required)
  • body: Statement (required)

logicalExpression

  1. t.logicalExpression(operator, left, right)

See also t.isLogicalExpression(node, opts) and t.assertLogicalExpression(node, opts).

Aliases: Binary, Expression

  • operator: "||" | "&&" | "??" (required)
  • left: Expression (required)
  • right: Expression (required)

memberExpression

  1. t.memberExpression(object, property, computed, optional)

See also t.isMemberExpression(node, opts) and t.assertMemberExpression(node, opts).

Aliases: Expression, LVal

  • object: Expression (required)
  • property: if computed then Expression else Identifier (required)
  • computed: boolean (default: false)
  • optional: true | false (default: null)

metaProperty

  1. t.metaProperty(meta, property)

See also t.isMetaProperty(node, opts) and t.assertMetaProperty(node, opts).

Aliases: Expression

  • meta: Identifier (required)
  • property: Identifier (required)

mixedTypeAnnotation

  1. t.mixedTypeAnnotation()

See also t.isMixedTypeAnnotation(node, opts) and t.assertMixedTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


newExpression

  1. t.newExpression(callee, arguments)

See also t.isNewExpression(node, opts) and t.assertNewExpression(node, opts).

Aliases: Expression

  • callee: Expression (required)
  • arguments: Array<Expression | SpreadElement | JSXNamespacedName> (required)
  • optional: true | false (default: null)
  • typeArguments: TypeParameterInstantiation (default: null)
  • typeParameters: TSTypeParameterInstantiation (default: null)

noop

  1. t.noop()

See also t.isNoop(node, opts) and t.assertNoop(node, opts).


nullLiteral

  1. t.nullLiteral()

See also t.isNullLiteral(node, opts) and t.assertNullLiteral(node, opts).

Aliases: Expression, Pureish, Literal, Immutable


nullLiteralTypeAnnotation

  1. t.nullLiteralTypeAnnotation()

See also t.isNullLiteralTypeAnnotation(node, opts) and t.assertNullLiteralTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


nullableTypeAnnotation

  1. t.nullableTypeAnnotation(typeAnnotation)

See also t.isNullableTypeAnnotation(node, opts) and t.assertNullableTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • typeAnnotation: FlowType (required)

numberLiteralTypeAnnotation

  1. t.numberLiteralTypeAnnotation(value)

See also t.isNumberLiteralTypeAnnotation(node, opts) and t.assertNumberLiteralTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • value: number (required)

numberTypeAnnotation

  1. t.numberTypeAnnotation()

See also t.isNumberTypeAnnotation(node, opts) and t.assertNumberTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


numericLiteral

  1. t.numericLiteral(value)

See also t.isNumericLiteral(node, opts) and t.assertNumericLiteral(node, opts).

Aliases: Expression, Pureish, Literal, Immutable

  • value: number (required)

objectExpression

  1. t.objectExpression(properties)

See also t.isObjectExpression(node, opts) and t.assertObjectExpression(node, opts).

Aliases: Expression

  • properties: Array<ObjectMethod | ObjectProperty | SpreadElement> (required)

objectMethod

  1. t.objectMethod(kind, key, params, body, computed)

See also t.isObjectMethod(node, opts) and t.assertObjectMethod(node, opts).

Aliases: UserWhitespacable, Function, Scopable, BlockParent, FunctionParent, Method, ObjectMember

  • kind: "method" | "get" | "set" (default: 'method')
  • key: if computed then Expression else Identifier | Literal (required)
  • params: Array<LVal> (required)
  • body: BlockStatement (required)
  • computed: boolean (default: false)
  • async: boolean (default: false)
  • decorators: Array<Decorator> (default: null)
  • generator: boolean (default: false)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (default: null)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (default: null)

objectPattern

  1. t.objectPattern(properties)

See also t.isObjectPattern(node, opts) and t.assertObjectPattern(node, opts).

Aliases: Pattern, PatternLike, LVal

  • properties: Array<RestElement | ObjectProperty> (required)
  • decorators: Array<Decorator> (default: null)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (default: null)

objectProperty

  1. t.objectProperty(key, value, computed, shorthand, decorators)

See also t.isObjectProperty(node, opts) and t.assertObjectProperty(node, opts).

Aliases: UserWhitespacable, Property, ObjectMember

  • key: if computed then Expression else Identifier | Literal (required)
  • value: Expression | PatternLike (required)
  • computed: boolean (default: false)
  • shorthand: boolean (default: false)
  • decorators: Array<Decorator> (default: null)

objectTypeAnnotation

  1. t.objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact)

See also t.isObjectTypeAnnotation(node, opts) and t.assertObjectTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • properties: Array<ObjectTypeProperty | ObjectTypeSpreadProperty> (required)
  • indexers: Array<ObjectTypeIndexer> (default: null)
  • callProperties: Array<ObjectTypeCallProperty> (default: null)
  • internalSlots: Array<ObjectTypeInternalSlot> (default: null)
  • exact: boolean (default: false)

objectTypeCallProperty

  1. t.objectTypeCallProperty(value)

See also t.isObjectTypeCallProperty(node, opts) and t.assertObjectTypeCallProperty(node, opts).

Aliases: Flow, UserWhitespacable

  • value: FlowType (required)
  • static: boolean (default: null)

objectTypeIndexer

  1. t.objectTypeIndexer(id, key, value, variance)

See also t.isObjectTypeIndexer(node, opts) and t.assertObjectTypeIndexer(node, opts).

Aliases: Flow, UserWhitespacable

  • id: Identifier (default: null)
  • key: FlowType (required)
  • value: FlowType (required)
  • variance: Variance (default: null)
  • static: boolean (default: null)

objectTypeInternalSlot

  1. t.objectTypeInternalSlot(id, value, optional, static, method)

See also t.isObjectTypeInternalSlot(node, opts) and t.assertObjectTypeInternalSlot(node, opts).

Aliases: Flow, UserWhitespacable

  • id: Identifier (required)
  • value: FlowType (required)
  • optional: boolean (required)
  • static: boolean (required)
  • method: boolean (required)

objectTypeProperty

  1. t.objectTypeProperty(key, value, variance)

See also t.isObjectTypeProperty(node, opts) and t.assertObjectTypeProperty(node, opts).

Aliases: Flow, UserWhitespacable

  • key: Identifier | StringLiteral (required)
  • value: FlowType (required)
  • variance: Variance (default: null)
  • kind: "init" | "get" | "set" (default: null)
  • optional: boolean (default: null)
  • proto: boolean (default: null)
  • static: boolean (default: null)

objectTypeSpreadProperty

  1. t.objectTypeSpreadProperty(argument)

See also t.isObjectTypeSpreadProperty(node, opts) and t.assertObjectTypeSpreadProperty(node, opts).

Aliases: Flow, UserWhitespacable

  • argument: FlowType (required)

opaqueType

  1. t.opaqueType(id, typeParameters, supertype, impltype)

See also t.isOpaqueType(node, opts) and t.assertOpaqueType(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TypeParameterDeclaration (default: null)
  • supertype: FlowType (default: null)
  • impltype: FlowType (required)

optionalCallExpression

  1. t.optionalCallExpression(callee, arguments, optional)

See also t.isOptionalCallExpression(node, opts) and t.assertOptionalCallExpression(node, opts).

Aliases: Expression

  • callee: Expression (required)
  • arguments: Array<Expression | SpreadElement | JSXNamespacedName> (required)
  • optional: boolean (required)
  • typeArguments: TypeParameterInstantiation (default: null)
  • typeParameters: TSTypeParameterInstantiation (default: null)

optionalMemberExpression

  1. t.optionalMemberExpression(object, property, computed, optional)

See also t.isOptionalMemberExpression(node, opts) and t.assertOptionalMemberExpression(node, opts).

Aliases: Expression

  • object: Expression (required)
  • property: any (required)
  • computed: boolean (default: false)
  • optional: boolean (required)

parenthesizedExpression

  1. t.parenthesizedExpression(expression)

See also t.isParenthesizedExpression(node, opts) and t.assertParenthesizedExpression(node, opts).

Aliases: Expression, ExpressionWrapper

  • expression: Expression (required)

privateName

  1. t.privateName(id)

See also t.isPrivateName(node, opts) and t.assertPrivateName(node, opts).

Aliases: Private

  • id: Identifier (required)

program

  1. t.program(body, directives, sourceType, interpreter)

See also t.isProgram(node, opts) and t.assertProgram(node, opts).

Aliases: Scopable, BlockParent, Block

  • body: Array<Statement> (required)
  • directives: Array<Directive> (default: [])
  • sourceType: "script" | "module" (default: 'script')
  • interpreter: InterpreterDirective (default: null)
  • sourceFile: string (default: null)

qualifiedTypeIdentifier

  1. t.qualifiedTypeIdentifier(id, qualification)

See also t.isQualifiedTypeIdentifier(node, opts) and t.assertQualifiedTypeIdentifier(node, opts).

Aliases: Flow

  • id: Identifier (required)
  • qualification: Identifier | QualifiedTypeIdentifier (required)

regExpLiteral

  1. t.regExpLiteral(pattern, flags)

See also t.isRegExpLiteral(node, opts) and t.assertRegExpLiteral(node, opts).

Aliases: Expression, Literal

  • pattern: string (required)
  • flags: string (default: '')

restElement

  1. t.restElement(argument)

See also t.isRestElement(node, opts) and t.assertRestElement(node, opts).

Aliases: LVal, PatternLike

  • argument: LVal (required)
  • decorators: Array<Decorator> (default: null)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (default: null)

returnStatement

  1. t.returnStatement(argument)

See also t.isReturnStatement(node, opts) and t.assertReturnStatement(node, opts).

Aliases: Statement, Terminatorless, CompletionStatement

  • argument: Expression (default: null)

sequenceExpression

  1. t.sequenceExpression(expressions)

See also t.isSequenceExpression(node, opts) and t.assertSequenceExpression(node, opts).

Aliases: Expression

  • expressions: Array<Expression> (required)

spreadElement

  1. t.spreadElement(argument)

See also t.isSpreadElement(node, opts) and t.assertSpreadElement(node, opts).

Aliases: UnaryLike

  • argument: Expression (required)

stringLiteral

  1. t.stringLiteral(value)

See also t.isStringLiteral(node, opts) and t.assertStringLiteral(node, opts).

Aliases: Expression, Pureish, Literal, Immutable

  • value: string (required)

stringLiteralTypeAnnotation

  1. t.stringLiteralTypeAnnotation(value)

See also t.isStringLiteralTypeAnnotation(node, opts) and t.assertStringLiteralTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • value: string (required)

stringTypeAnnotation

  1. t.stringTypeAnnotation()

See also t.isStringTypeAnnotation(node, opts) and t.assertStringTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


super

  1. t.super()

See also t.isSuper(node, opts) and t.assertSuper(node, opts).

Aliases: Expression


switchCase

  1. t.switchCase(test, consequent)

See also t.isSwitchCase(node, opts) and t.assertSwitchCase(node, opts).

  • test: Expression (default: null)
  • consequent: Array<Statement> (required)

switchStatement

  1. t.switchStatement(discriminant, cases)

See also t.isSwitchStatement(node, opts) and t.assertSwitchStatement(node, opts).

Aliases: Statement, BlockParent, Scopable

  • discriminant: Expression (required)
  • cases: Array<SwitchCase> (required)

tSAnyKeyword

  1. t.tsAnyKeyword()

See also t.isTSAnyKeyword(node, opts) and t.assertTSAnyKeyword(node, opts).

Aliases: TSType


tSArrayType

  1. t.tsArrayType(elementType)

See also t.isTSArrayType(node, opts) and t.assertTSArrayType(node, opts).

Aliases: TSType

  • elementType: TSType (required)

tSAsExpression

  1. t.tsAsExpression(expression, typeAnnotation)

See also t.isTSAsExpression(node, opts) and t.assertTSAsExpression(node, opts).

Aliases: Expression

  • expression: Expression (required)
  • typeAnnotation: TSType (required)

tSBooleanKeyword

  1. t.tsBooleanKeyword()

See also t.isTSBooleanKeyword(node, opts) and t.assertTSBooleanKeyword(node, opts).

Aliases: TSType


tSCallSignatureDeclaration

  1. t.tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation)

See also t.isTSCallSignatureDeclaration(node, opts) and t.assertTSCallSignatureDeclaration(node, opts).

Aliases: TSTypeElement

  • typeParameters: TSTypeParameterDeclaration (default: null)
  • parameters: Array<Identifier | RestElement> (default: null)
  • typeAnnotation: TSTypeAnnotation (default: null)

tSConditionalType

  1. t.tsConditionalType(checkType, extendsType, trueType, falseType)

See also t.isTSConditionalType(node, opts) and t.assertTSConditionalType(node, opts).

Aliases: TSType

  • checkType: TSType (required)
  • extendsType: TSType (required)
  • trueType: TSType (required)
  • falseType: TSType (required)

tSConstructSignatureDeclaration

  1. t.tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation)

See also t.isTSConstructSignatureDeclaration(node, opts) and t.assertTSConstructSignatureDeclaration(node, opts).

Aliases: TSTypeElement

  • typeParameters: TSTypeParameterDeclaration (default: null)
  • parameters: Array<Identifier | RestElement> (default: null)
  • typeAnnotation: TSTypeAnnotation (default: null)

tSConstructorType

  1. t.tsConstructorType(typeParameters, typeAnnotation)

See also t.isTSConstructorType(node, opts) and t.assertTSConstructorType(node, opts).

Aliases: TSType

  • typeParameters: TSTypeParameterDeclaration (default: null)
  • typeAnnotation: TSTypeAnnotation (default: null)
  • parameters: Array<Identifier | RestElement> (default: null)

tSDeclareFunction

  1. t.tsDeclareFunction(id, typeParameters, params, returnType)

See also t.isTSDeclareFunction(node, opts) and t.assertTSDeclareFunction(node, opts).

Aliases: Statement, Declaration

  • id: Identifier (default: null)
  • typeParameters: TSTypeParameterDeclaration | Noop (default: null)
  • params: Array<LVal> (required)
  • returnType: TSTypeAnnotation | Noop (default: null)
  • async: boolean (default: false)
  • declare: boolean (default: null)
  • generator: boolean (default: false)

tSDeclareMethod

  1. t.tsDeclareMethod(decorators, key, typeParameters, params, returnType)

See also t.isTSDeclareMethod(node, opts) and t.assertTSDeclareMethod(node, opts).

  • decorators: Array<Decorator> (default: null)
  • key: Identifier | StringLiteral | NumericLiteral | Expression (required)
  • typeParameters: TSTypeParameterDeclaration | Noop (default: null)
  • params: Array<LVal> (required)
  • returnType: TSTypeAnnotation | Noop (default: null)
  • abstract: boolean (default: null)
  • access: "public" | "private" | "protected" (default: null)
  • accessibility: "public" | "private" | "protected" (default: null)
  • async: boolean (default: false)
  • computed: boolean (default: false)
  • generator: boolean (default: false)
  • kind: "get" | "set" | "method" | "constructor" (default: 'method')
  • optional: boolean (default: null)
  • static: boolean (default: null)

tSEnumDeclaration

  1. t.tsEnumDeclaration(id, members)

See also t.isTSEnumDeclaration(node, opts) and t.assertTSEnumDeclaration(node, opts).

Aliases: Statement, Declaration

  • id: Identifier (required)
  • members: Array<TSEnumMember> (required)
  • const: boolean (default: null)
  • declare: boolean (default: null)
  • initializer: Expression (default: null)

tSEnumMember

  1. t.tsEnumMember(id, initializer)

See also t.isTSEnumMember(node, opts) and t.assertTSEnumMember(node, opts).

  • id: Identifier | StringLiteral (required)
  • initializer: Expression (default: null)

tSExportAssignment

  1. t.tsExportAssignment(expression)

See also t.isTSExportAssignment(node, opts) and t.assertTSExportAssignment(node, opts).

Aliases: Statement

  • expression: Expression (required)

tSExpressionWithTypeArguments

  1. t.tsExpressionWithTypeArguments(expression, typeParameters)

See also t.isTSExpressionWithTypeArguments(node, opts) and t.assertTSExpressionWithTypeArguments(node, opts).

Aliases: TSType

  • expression: TSEntityName (required)
  • typeParameters: TSTypeParameterInstantiation (default: null)

tSExternalModuleReference

  1. t.tsExternalModuleReference(expression)

See also t.isTSExternalModuleReference(node, opts) and t.assertTSExternalModuleReference(node, opts).

  • expression: StringLiteral (required)

tSFunctionType

  1. t.tsFunctionType(typeParameters, typeAnnotation)

See also t.isTSFunctionType(node, opts) and t.assertTSFunctionType(node, opts).

Aliases: TSType

  • typeParameters: TSTypeParameterDeclaration (default: null)
  • typeAnnotation: TSTypeAnnotation (default: null)
  • parameters: Array<Identifier | RestElement> (default: null)

tSImportEqualsDeclaration

  1. t.tsImportEqualsDeclaration(id, moduleReference)

See also t.isTSImportEqualsDeclaration(node, opts) and t.assertTSImportEqualsDeclaration(node, opts).

Aliases: Statement

  • id: Identifier (required)
  • moduleReference: TSEntityName | TSExternalModuleReference (required)
  • isExport: boolean (default: null)

tSIndexSignature

  1. t.tsIndexSignature(parameters, typeAnnotation)

See also t.isTSIndexSignature(node, opts) and t.assertTSIndexSignature(node, opts).

Aliases: TSTypeElement

  • parameters: Array<Identifier> (required)
  • typeAnnotation: TSTypeAnnotation (default: null)
  • readonly: boolean (default: null)

tSIndexedAccessType

  1. t.tsIndexedAccessType(objectType, indexType)

See also t.isTSIndexedAccessType(node, opts) and t.assertTSIndexedAccessType(node, opts).

Aliases: TSType

  • objectType: TSType (required)
  • indexType: TSType (required)

tSInferType

  1. t.tsInferType(typeParameter)

See also t.isTSInferType(node, opts) and t.assertTSInferType(node, opts).

Aliases: TSType

  • typeParameter: TSTypeParameter (required)

tSInterfaceBody

  1. t.tsInterfaceBody(body)

See also t.isTSInterfaceBody(node, opts) and t.assertTSInterfaceBody(node, opts).

  • body: Array<TSTypeElement> (required)

tSInterfaceDeclaration

  1. t.tsInterfaceDeclaration(id, typeParameters, extends, body)

See also t.isTSInterfaceDeclaration(node, opts) and t.assertTSInterfaceDeclaration(node, opts).

Aliases: Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TSTypeParameterDeclaration (default: null)
  • extends: Array<TSExpressionWithTypeArguments> (default: null)
  • body: TSInterfaceBody (required)
  • declare: boolean (default: null)

tSIntersectionType

  1. t.tsIntersectionType(types)

See also t.isTSIntersectionType(node, opts) and t.assertTSIntersectionType(node, opts).

Aliases: TSType

  • types: Array<TSType> (required)

tSLiteralType

  1. t.tsLiteralType(literal)

See also t.isTSLiteralType(node, opts) and t.assertTSLiteralType(node, opts).

Aliases: TSType

  • literal: NumericLiteral | StringLiteral | BooleanLiteral (required)

tSMappedType

  1. t.tsMappedType(typeParameter, typeAnnotation)

See also t.isTSMappedType(node, opts) and t.assertTSMappedType(node, opts).

Aliases: TSType

  • typeParameter: TSTypeParameter (required)
  • typeAnnotation: TSType (default: null)
  • optional: boolean (default: null)
  • readonly: boolean (default: null)

tSMethodSignature

  1. t.tsMethodSignature(key, typeParameters, parameters, typeAnnotation)

See also t.isTSMethodSignature(node, opts) and t.assertTSMethodSignature(node, opts).

Aliases: TSTypeElement

  • key: Expression (required)
  • typeParameters: TSTypeParameterDeclaration (default: null)
  • parameters: Array<Identifier | RestElement> (default: null)
  • typeAnnotation: TSTypeAnnotation (default: null)
  • computed: boolean (default: null)
  • optional: boolean (default: null)

tSModuleBlock

  1. t.tsModuleBlock(body)

See also t.isTSModuleBlock(node, opts) and t.assertTSModuleBlock(node, opts).

  • body: Array<Statement> (required)

tSModuleDeclaration

  1. t.tsModuleDeclaration(id, body)

See also t.isTSModuleDeclaration(node, opts) and t.assertTSModuleDeclaration(node, opts).

Aliases: Statement, Declaration

  • id: Identifier | StringLiteral (required)
  • body: TSModuleBlock | TSModuleDeclaration (required)
  • declare: boolean (default: null)
  • global: boolean (default: null)

tSNamespaceExportDeclaration

  1. t.tsNamespaceExportDeclaration(id)

See also t.isTSNamespaceExportDeclaration(node, opts) and t.assertTSNamespaceExportDeclaration(node, opts).

Aliases: Statement

  • id: Identifier (required)

tSNeverKeyword

  1. t.tsNeverKeyword()

See also t.isTSNeverKeyword(node, opts) and t.assertTSNeverKeyword(node, opts).

Aliases: TSType


tSNonNullExpression

  1. t.tsNonNullExpression(expression)

See also t.isTSNonNullExpression(node, opts) and t.assertTSNonNullExpression(node, opts).

Aliases: Expression

  • expression: Expression (required)

tSNullKeyword

  1. t.tsNullKeyword()

See also t.isTSNullKeyword(node, opts) and t.assertTSNullKeyword(node, opts).

Aliases: TSType


tSNumberKeyword

  1. t.tsNumberKeyword()

See also t.isTSNumberKeyword(node, opts) and t.assertTSNumberKeyword(node, opts).

Aliases: TSType


tSObjectKeyword

  1. t.tsObjectKeyword()

See also t.isTSObjectKeyword(node, opts) and t.assertTSObjectKeyword(node, opts).

Aliases: TSType


tSParameterProperty

  1. t.tsParameterProperty(parameter)

See also t.isTSParameterProperty(node, opts) and t.assertTSParameterProperty(node, opts).

Aliases: LVal

  • parameter: Identifier | AssignmentPattern (required)
  • accessibility: "public" | "private" | "protected" (default: null)
  • readonly: boolean (default: null)

tSParenthesizedType

  1. t.tsParenthesizedType(typeAnnotation)

See also t.isTSParenthesizedType(node, opts) and t.assertTSParenthesizedType(node, opts).

Aliases: TSType

  • typeAnnotation: TSType (required)

tSPropertySignature

  1. t.tsPropertySignature(key, typeAnnotation, initializer)

See also t.isTSPropertySignature(node, opts) and t.assertTSPropertySignature(node, opts).

Aliases: TSTypeElement

  • key: Expression (required)
  • typeAnnotation: TSTypeAnnotation (default: null)
  • initializer: Expression (default: null)
  • computed: boolean (default: null)
  • optional: boolean (default: null)
  • readonly: boolean (default: null)

tSQualifiedName

  1. t.tsQualifiedName(left, right)

See also t.isTSQualifiedName(node, opts) and t.assertTSQualifiedName(node, opts).

Aliases: TSEntityName

  • left: TSEntityName (required)
  • right: Identifier (required)

tSStringKeyword

  1. t.tsStringKeyword()

See also t.isTSStringKeyword(node, opts) and t.assertTSStringKeyword(node, opts).

Aliases: TSType


tSSymbolKeyword

  1. t.tsSymbolKeyword()

See also t.isTSSymbolKeyword(node, opts) and t.assertTSSymbolKeyword(node, opts).

Aliases: TSType


tSThisType

  1. t.tsThisType()

See also t.isTSThisType(node, opts) and t.assertTSThisType(node, opts).

Aliases: TSType


tSTupleType

  1. t.tsTupleType(elementTypes)

See also t.isTSTupleType(node, opts) and t.assertTSTupleType(node, opts).

Aliases: TSType

  • elementTypes: Array<TSType> (required)

tSTypeAliasDeclaration

  1. t.tsTypeAliasDeclaration(id, typeParameters, typeAnnotation)

See also t.isTSTypeAliasDeclaration(node, opts) and t.assertTSTypeAliasDeclaration(node, opts).

Aliases: Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TSTypeParameterDeclaration (default: null)
  • typeAnnotation: TSType (required)
  • declare: boolean (default: null)

tSTypeAnnotation

  1. t.tsTypeAnnotation(typeAnnotation)

See also t.isTSTypeAnnotation(node, opts) and t.assertTSTypeAnnotation(node, opts).

  • typeAnnotation: TSType (required)

tSTypeAssertion

  1. t.tsTypeAssertion(typeAnnotation, expression)

See also t.isTSTypeAssertion(node, opts) and t.assertTSTypeAssertion(node, opts).

Aliases: Expression

  • typeAnnotation: TSType (required)
  • expression: Expression (required)

tSTypeLiteral

  1. t.tsTypeLiteral(members)

See also t.isTSTypeLiteral(node, opts) and t.assertTSTypeLiteral(node, opts).

Aliases: TSType

  • members: Array<TSTypeElement> (required)

tSTypeOperator

  1. t.tsTypeOperator(typeAnnotation)

See also t.isTSTypeOperator(node, opts) and t.assertTSTypeOperator(node, opts).

Aliases: TSType

  • typeAnnotation: TSType (required)
  • operator: string (default: null)

tSTypeParameter

  1. t.tsTypeParameter(constraint, default)

See also t.isTSTypeParameter(node, opts) and t.assertTSTypeParameter(node, opts).

  • constraint: TSType (default: null)
  • default: TSType (default: null)
  • name: string (default: null)

tSTypeParameterDeclaration

  1. t.tsTypeParameterDeclaration(params)

See also t.isTSTypeParameterDeclaration(node, opts) and t.assertTSTypeParameterDeclaration(node, opts).

  • params: Array<TSTypeParameter> (required)

tSTypeParameterInstantiation

  1. t.tsTypeParameterInstantiation(params)

See also t.isTSTypeParameterInstantiation(node, opts) and t.assertTSTypeParameterInstantiation(node, opts).

  • params: Array<TSType> (required)

tSTypePredicate

  1. t.tsTypePredicate(parameterName, typeAnnotation)

See also t.isTSTypePredicate(node, opts) and t.assertTSTypePredicate(node, opts).

Aliases: TSType

  • parameterName: Identifier | TSThisType (required)
  • typeAnnotation: TSTypeAnnotation (required)

tSTypeQuery

  1. t.tsTypeQuery(exprName)

See also t.isTSTypeQuery(node, opts) and t.assertTSTypeQuery(node, opts).

Aliases: TSType

  • exprName: TSEntityName (required)

tSTypeReference

  1. t.tsTypeReference(typeName, typeParameters)

See also t.isTSTypeReference(node, opts) and t.assertTSTypeReference(node, opts).

Aliases: TSType

  • typeName: TSEntityName (required)
  • typeParameters: TSTypeParameterInstantiation (default: null)

tSUndefinedKeyword

  1. t.tsUndefinedKeyword()

See also t.isTSUndefinedKeyword(node, opts) and t.assertTSUndefinedKeyword(node, opts).

Aliases: TSType


tSUnionType

  1. t.tsUnionType(types)

See also t.isTSUnionType(node, opts) and t.assertTSUnionType(node, opts).

Aliases: TSType

  • types: Array<TSType> (required)

tSUnknownType

  1. t.tsUnknownType(types)

See also t.isTSUnknownType(node, opts) and t.assertTSUnknownType(node, opts).

Aliases: TSType

  • types: Array<TSType> (required)

tSVoidKeyword

  1. t.tsVoidKeyword()

See also t.isTSVoidKeyword(node, opts) and t.assertTSVoidKeyword(node, opts).

Aliases: TSType


taggedTemplateExpression

  1. t.taggedTemplateExpression(tag, quasi)

See also t.isTaggedTemplateExpression(node, opts) and t.assertTaggedTemplateExpression(node, opts).

Aliases: Expression

  • tag: Expression (required)
  • quasi: TemplateLiteral (required)

templateElement

  1. t.templateElement(value, tail)

See also t.isTemplateElement(node, opts) and t.assertTemplateElement(node, opts).

  • value: { raw: string, cooked: string } (required)
  • tail: boolean (default: false)

templateLiteral

  1. t.templateLiteral(quasis, expressions)

See also t.isTemplateLiteral(node, opts) and t.assertTemplateLiteral(node, opts).

Aliases: Expression, Literal

  • quasis: Array<TemplateElement> (required)
  • expressions: Array<Expression> (required)

thisExpression

  1. t.thisExpression()

See also t.isThisExpression(node, opts) and t.assertThisExpression(node, opts).

Aliases: Expression


thisTypeAnnotation

  1. t.thisTypeAnnotation()

See also t.isThisTypeAnnotation(node, opts) and t.assertThisTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


throwStatement

  1. t.throwStatement(argument)

See also t.isThrowStatement(node, opts) and t.assertThrowStatement(node, opts).

Aliases: Statement, Terminatorless, CompletionStatement

  • argument: Expression (required)

tryStatement

  1. t.tryStatement(block, handler, finalizer)

See also t.isTryStatement(node, opts) and t.assertTryStatement(node, opts).

Aliases: Statement

  • block: BlockStatement (required)
  • handler: CatchClause (default: null)
  • finalizer: BlockStatement (default: null)

tupleTypeAnnotation

  1. t.tupleTypeAnnotation(types)

See also t.isTupleTypeAnnotation(node, opts) and t.assertTupleTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • types: Array<FlowType> (required)

typeAlias

  1. t.typeAlias(id, typeParameters, right)

See also t.isTypeAlias(node, opts) and t.assertTypeAlias(node, opts).

Aliases: Flow, FlowDeclaration, Statement, Declaration

  • id: Identifier (required)
  • typeParameters: TypeParameterDeclaration (default: null)
  • right: FlowType (required)

typeAnnotation

  1. t.typeAnnotation(typeAnnotation)

See also t.isTypeAnnotation(node, opts) and t.assertTypeAnnotation(node, opts).

Aliases: Flow

  • typeAnnotation: FlowType (required)

typeCastExpression

  1. t.typeCastExpression(expression, typeAnnotation)

See also t.isTypeCastExpression(node, opts) and t.assertTypeCastExpression(node, opts).

Aliases: Flow, ExpressionWrapper, Expression

  • expression: Expression (required)
  • typeAnnotation: TypeAnnotation (required)

typeParameter

  1. t.typeParameter(bound, default, variance)

See also t.isTypeParameter(node, opts) and t.assertTypeParameter(node, opts).

Aliases: Flow

  • bound: TypeAnnotation (default: null)
  • default: FlowType (default: null)
  • variance: Variance (default: null)
  • name: string (default: null)

typeParameterDeclaration

  1. t.typeParameterDeclaration(params)

See also t.isTypeParameterDeclaration(node, opts) and t.assertTypeParameterDeclaration(node, opts).

Aliases: Flow

  • params: Array<TypeParameter> (required)

typeParameterInstantiation

  1. t.typeParameterInstantiation(params)

See also t.isTypeParameterInstantiation(node, opts) and t.assertTypeParameterInstantiation(node, opts).

Aliases: Flow

  • params: Array<FlowType> (required)

typeofTypeAnnotation

  1. t.typeofTypeAnnotation(argument)

See also t.isTypeofTypeAnnotation(node, opts) and t.assertTypeofTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • argument: FlowType (required)

unaryExpression

  1. t.unaryExpression(operator, argument, prefix)

See also t.isUnaryExpression(node, opts) and t.assertUnaryExpression(node, opts).

Aliases: UnaryLike, Expression

  • operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof" (required)
  • argument: Expression (required)
  • prefix: boolean (default: true)

unionTypeAnnotation

  1. t.unionTypeAnnotation(types)

See also t.isUnionTypeAnnotation(node, opts) and t.assertUnionTypeAnnotation(node, opts).

Aliases: Flow, FlowType

  • types: Array<FlowType> (required)

updateExpression

  1. t.updateExpression(operator, argument, prefix)

See also t.isUpdateExpression(node, opts) and t.assertUpdateExpression(node, opts).

Aliases: Expression

  • operator: "++" | "—" (required)
  • argument: Expression (required)
  • prefix: boolean (default: false)

variableDeclaration

  1. t.variableDeclaration(kind, declarations)

See also t.isVariableDeclaration(node, opts) and t.assertVariableDeclaration(node, opts).

Aliases: Statement, Declaration

  • kind: "var" | "let" | "const" (required)
  • declarations: Array<VariableDeclarator> (required)
  • declare: boolean (default: null)

variableDeclarator

  1. t.variableDeclarator(id, init)

See also t.isVariableDeclarator(node, opts) and t.assertVariableDeclarator(node, opts).

  • id: LVal (required)
  • init: Expression (default: null)
  • definite: boolean (default: null)

variance

  1. t.variance(kind)

See also t.isVariance(node, opts) and t.assertVariance(node, opts).

Aliases: Flow

  • kind: "minus" | "plus" (required)

voidTypeAnnotation

  1. t.voidTypeAnnotation()

See also t.isVoidTypeAnnotation(node, opts) and t.assertVoidTypeAnnotation(node, opts).

Aliases: Flow, FlowType, FlowBaseAnnotation


whileStatement

  1. t.whileStatement(test, body)

See also t.isWhileStatement(node, opts) and t.assertWhileStatement(node, opts).

Aliases: Statement, BlockParent, Loop, While, Scopable

  • test: Expression (required)
  • body: BlockStatement | Statement (required)

withStatement

  1. t.withStatement(object, body)

See also t.isWithStatement(node, opts) and t.assertWithStatement(node, opts).

Aliases: Statement

  • object: Expression (required)
  • body: BlockStatement | Statement (required)

yieldExpression

  1. t.yieldExpression(argument, delegate)

See also t.isYieldExpression(node, opts) and t.assertYieldExpression(node, opts).

Aliases: Expression, Terminatorless

  • argument: Expression (default: null)
  • delegate: boolean (default: false)