babel-types
This module contains methods for building ASTs manually and for checking the types of AST nodes.
Install
npm install --save-dev babel-types
API
anyTypeAnnotation
t
See also t.isAnyTypeAnnotation(node, opts)
and t.assertAnyTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
arrayExpression
t
See also t.isArrayExpression(node, opts)
and t.assertArrayExpression(node, opts)
.
Aliases: Expression
elements
:Array<null | Expression | SpreadElement>
(default:[]
)
arrayPattern
t
See also t.isArrayPattern(node, opts)
and t.assertArrayPattern(node, opts)
.
Aliases: Pattern
, LVal
elements
:Array<Identifier | Pattern | RestElement>
(required)typeAnnotation
(required)decorators
:Array<Decorator>
(default:null
)
arrayTypeAnnotation
t
See also t.isArrayTypeAnnotation(node, opts)
and t.assertArrayTypeAnnotation(node, opts)
.
Aliases: Flow
elementType
(required)
arrowFunctionExpression
t
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
)returnType
(default:null
)typeParameters
(default:null
)
assignmentExpression
t
See also t.isAssignmentExpression(node, opts)
and t.assertAssignmentExpression(node, opts)
.
Aliases: Expression
operator
:string
(required)left
:LVal
(required)right
:Expression
(required)
assignmentPattern
t
See also t.isAssignmentPattern(node, opts)
and t.assertAssignmentPattern(node, opts)
.
Aliases: Pattern
, LVal
left
:Identifier
(required)right
:Expression
(required)decorators
:Array<Decorator>
(default:null
)
awaitExpression
t
See also t.isAwaitExpression(node, opts)
and t.assertAwaitExpression(node, opts)
.
Aliases: Expression
, Terminatorless
argument
:Expression
(required)
binaryExpression
t
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
t
See also t.isBindExpression(node, opts)
and t.assertBindExpression(node, opts)
.
Aliases: Expression
object
(required)callee
(required)
blockStatement
t
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
t
See also t.isBooleanLiteral(node, opts)
and t.assertBooleanLiteral(node, opts)
.
Aliases: Expression
, Pureish
, Literal
, Immutable
value
:boolean
(required)
booleanLiteralTypeAnnotation
t
See also t.isBooleanLiteralTypeAnnotation(node, opts)
and t.assertBooleanLiteralTypeAnnotation(node, opts)
.
Aliases: Flow
booleanTypeAnnotation
t
See also t.isBooleanTypeAnnotation(node, opts)
and t.assertBooleanTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
breakStatement
t
See also t.isBreakStatement(node, opts)
and t.assertBreakStatement(node, opts)
.
Aliases: Statement
, Terminatorless
, CompletionStatement
label
:Identifier
(default:null
)
callExpression
t
See also t.isCallExpression(node, opts)
and t.assertCallExpression(node, opts)
.
Aliases: Expression
callee
:Expression
(required)arguments
:Array<Expression | SpreadElement>
(required)
catchClause
t
See also t.isCatchClause(node, opts)
and t.assertCatchClause(node, opts)
.
Aliases: Scopable
param
:Identifier
(required)body
:BlockStatement
(required)
classBody
t
See also t.isClassBody(node, opts)
and t.assertClassBody(node, opts)
.
body
:Array<ClassMethod | ClassProperty>
(required)
classDeclaration
t
See also t.isClassDeclaration(node, opts)
and t.assertClassDeclaration(node, opts)
.
Aliases: Scopable
, Class
, Statement
, Declaration
, Pureish
id
:Identifier
(required)superClass
:Expression
(default:null
)body
:ClassBody
(required)decorators
:Array<Decorator>
(required)implements
(default:null
)mixins
(default:null
)superTypeParameters
(default:null
)typeParameters
(default:null
)
classExpression
t
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>
(required)implements
(default:null
)mixins
(default:null
)superTypeParameters
(default:null
)typeParameters
(default:null
)
classImplements
t
See also t.isClassImplements(node, opts)
and t.assertClassImplements(node, opts)
.
Aliases: Flow
id
(required)typeParameters
(required)
classMethod
t
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 thenExpression
elseIdentifier | Literal
(required)params
:Array<LVal>
(required)body
:BlockStatement
(required)computed
:boolean
(default:false
)static
:boolean
(default:false
)async
:boolean
(default:false
)decorators
(default:null
)generator
:boolean
(default:false
)returnType
(default:null
)typeParameters
(default:null
)
classProperty
t
See also t.isClassProperty(node, opts)
and t.assertClassProperty(node, opts)
.
Aliases: Property
key
(required)value
(required)typeAnnotation
(required)decorators
(required)computed
:boolean
(default:false
)
conditionalExpression
t
See also t.isConditionalExpression(node, opts)
and t.assertConditionalExpression(node, opts)
.
Aliases: Expression
, Conditional
test
:Expression
(required)consequent
:Expression
(required)alternate
:Expression
(required)
continueStatement
t
See also t.isContinueStatement(node, opts)
and t.assertContinueStatement(node, opts)
.
Aliases: Statement
, Terminatorless
, CompletionStatement
label
:Identifier
(default:null
)
debuggerStatement
t
See also t.isDebuggerStatement(node, opts)
and t.assertDebuggerStatement(node, opts)
.
Aliases: Statement
declareClass
t
See also t.isDeclareClass(node, opts)
and t.assertDeclareClass(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)typeParameters
(required)extends
(required)body
(required)
declareExportDeclaration
t
See also t.isDeclareExportDeclaration(node, opts)
and t.assertDeclareExportDeclaration(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
declaration
(required)specifiers
(required)source
(required)
declareFunction
t
See also t.isDeclareFunction(node, opts)
and t.assertDeclareFunction(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)
declareInterface
t
See also t.isDeclareInterface(node, opts)
and t.assertDeclareInterface(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)typeParameters
(required)extends
(required)body
(required)
declareModule
t
See also t.isDeclareModule(node, opts)
and t.assertDeclareModule(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)body
(required)
declareModuleExports
t
See also t.isDeclareModuleExports(node, opts)
and t.assertDeclareModuleExports(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
typeAnnotation
(required)
declareOpaqueType
t
See also t.isDeclareOpaqueType(node, opts)
and t.assertDeclareOpaqueType(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)typeParameters
(required)supertype
(required)
declareTypeAlias
t
See also t.isDeclareTypeAlias(node, opts)
and t.assertDeclareTypeAlias(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)typeParameters
(required)right
(required)
declareVariable
t
See also t.isDeclareVariable(node, opts)
and t.assertDeclareVariable(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)
decorator
t
See also t.isDecorator(node, opts)
and t.assertDecorator(node, opts)
.
expression
:Expression
(required)
directive
t
See also t.isDirective(node, opts)
and t.assertDirective(node, opts)
.
value
:DirectiveLiteral
(required)
directiveLiteral
t
See also t.isDirectiveLiteral(node, opts)
and t.assertDirectiveLiteral(node, opts)
.
value
:string
(required)
doExpression
t
See also t.isDoExpression(node, opts)
and t.assertDoExpression(node, opts)
.
Aliases: Expression
body
:BlockStatement
(required)
doWhileStatement
t
See also t.isDoWhileStatement(node, opts)
and t.assertDoWhileStatement(node, opts)
.
Aliases: Statement
, BlockParent
, Loop
, While
, Scopable
test
:Expression
(required)body
:Statement
(required)
emptyStatement
t
See also t.isEmptyStatement(node, opts)
and t.assertEmptyStatement(node, opts)
.
Aliases: Statement
emptyTypeAnnotation
t
See also t.isEmptyTypeAnnotation(node, opts)
and t.assertEmptyTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
existentialTypeParam
t
See also t.isExistentialTypeParam(node, opts)
and t.assertExistentialTypeParam(node, opts)
.
Aliases: Flow
exportAllDeclaration
t
See also t.isExportAllDeclaration(node, opts)
and t.assertExportAllDeclaration(node, opts)
.
Aliases: Statement
, Declaration
, ModuleDeclaration
, ExportDeclaration
source
:StringLiteral
(required)
exportDefaultDeclaration
t
See also t.isExportDefaultDeclaration(node, opts)
and t.assertExportDefaultDeclaration(node, opts)
.
Aliases: Statement
, Declaration
, ModuleDeclaration
, ExportDeclaration
declaration
:FunctionDeclaration | ClassDeclaration | Expression
(required)
exportDefaultSpecifier
t
See also t.isExportDefaultSpecifier(node, opts)
and t.assertExportDefaultSpecifier(node, opts)
.
Aliases: ModuleSpecifier
exported
:Identifier
(required)
exportNamedDeclaration
t
See also t.isExportNamedDeclaration(node, opts)
and t.assertExportNamedDeclaration(node, opts)
.
Aliases: Statement
, Declaration
, ModuleDeclaration
, ExportDeclaration
declaration
:Declaration
(default:null
)specifiers
:Array<ExportSpecifier>
(required)source
:StringLiteral
(default:null
)
exportNamespaceSpecifier
t
See also t.isExportNamespaceSpecifier(node, opts)
and t.assertExportNamespaceSpecifier(node, opts)
.
Aliases: ModuleSpecifier
exported
:Identifier
(required)
exportSpecifier
t
See also t.isExportSpecifier(node, opts)
and t.assertExportSpecifier(node, opts)
.
Aliases: ModuleSpecifier
local
:Identifier
(required)exported
:Identifier
(required)
expressionStatement
t
See also t.isExpressionStatement(node, opts)
and t.assertExpressionStatement(node, opts)
.
Aliases: Statement
, ExpressionWrapper
expression
:Expression
(required)
file
t
See also t.isFile(node, opts)
and t.assertFile(node, opts)
.
program
:Program
(required)comments
(required)tokens
(required)
forAwaitStatement
t
See also t.isForAwaitStatement(node, opts)
and t.assertForAwaitStatement(node, opts)
.
Aliases: Scopable
, Statement
, For
, BlockParent
, Loop
, ForXStatement
left
:VariableDeclaration | LVal
(required)right
:Expression
(required)body
:Statement
(required)
forInStatement
t
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
t
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)
forStatement
t
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
t
See also t.isFunctionDeclaration(node, opts)
and t.assertFunctionDeclaration(node, opts)
.
Aliases: Scopable
, Function
, BlockParent
, FunctionParent
, Statement
, Pureish
, Declaration
id
:Identifier
(required)params
:Array<LVal>
(required)body
:BlockStatement
(required)generator
:boolean
(default:false
)async
:boolean
(default:false
)returnType
(default:null
)typeParameters
(default:null
)
functionExpression
t
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
(default:null
)typeParameters
(default:null
)
functionTypeAnnotation
t
See also t.isFunctionTypeAnnotation(node, opts)
and t.assertFunctionTypeAnnotation(node, opts)
.
Aliases: Flow
typeParameters
(required)params
(required)rest
(required)returnType
(required)
functionTypeParam
t
See also t.isFunctionTypeParam(node, opts)
and t.assertFunctionTypeParam(node, opts)
.
Aliases: Flow
name
(required)typeAnnotation
(required)
genericTypeAnnotation
t
See also t.isGenericTypeAnnotation(node, opts)
and t.assertGenericTypeAnnotation(node, opts)
.
Aliases: Flow
id
(required)typeParameters
(required)
identifier
t
See also t.isIdentifier(node, opts)
and t.assertIdentifier(node, opts)
.
Aliases: Expression
, LVal
name``string
(required)decorators
:Array<Decorator>
(default:null
)typeAnnotation
(default:null
)
ifStatement
t
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
t
See also t.isImport(node, opts)
and t.assertImport(node, opts)
.
Aliases: Expression
importDeclaration
t
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
t
See also t.isImportDefaultSpecifier(node, opts)
and t.assertImportDefaultSpecifier(node, opts)
.
Aliases: ModuleSpecifier
local
:Identifier
(required)
importNamespaceSpecifier
t
See also t.isImportNamespaceSpecifier(node, opts)
and t.assertImportNamespaceSpecifier(node, opts)
.
Aliases: ModuleSpecifier
local
:Identifier
(required)
importSpecifier
t
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
)
interfaceDeclaration
t
See also t.isInterfaceDeclaration(node, opts)
and t.assertInterfaceDeclaration(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)typeParameters
(required)extends
(required)body
(required)
interfaceExtends
t
See also t.isInterfaceExtends(node, opts)
and t.assertInterfaceExtends(node, opts)
.
Aliases: Flow
id
(required)typeParameters
(required)
intersectionTypeAnnotation
t
See also t.isIntersectionTypeAnnotation(node, opts)
and t.assertIntersectionTypeAnnotation(node, opts)
.
Aliases: Flow
types
(required)
jSXAttribute
t
See also t.isJSXAttribute(node, opts)
and t.assertJSXAttribute(node, opts)
.
Aliases: JSX
, Immutable
name
:JSXIdentifier | JSXNamespacedName
(required)value
:JSXElement | StringLiteral | JSXExpressionContainer
(default:null
)
jSXClosingElement
t
See also t.isJSXClosingElement(node, opts)
and t.assertJSXClosingElement(node, opts)
.
Aliases: JSX
, Immutable
name
:JSXIdentifier | JSXMemberExpression
(required)
jSXElement
t
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>
(required)selfClosing
(required)
jSXEmptyExpression
t
See also t.isJSXEmptyExpression(node, opts)
and t.assertJSXEmptyExpression(node, opts)
.
Aliases: JSX
, Expression
jSXExpressionContainer
t
See also t.isJSXExpressionContainer(node, opts)
and t.assertJSXExpressionContainer(node, opts)
.
Aliases: JSX
, Immutable
expression
:Expression
(required)
jSXIdentifier
t
See also t.isJSXIdentifier(node, opts)
and t.assertJSXIdentifier(node, opts)
.
Aliases: JSX
, Expression
name
:string
(required)
jSXMemberExpression
t
See also t.isJSXMemberExpression(node, opts)
and t.assertJSXMemberExpression(node, opts)
.
Aliases: JSX
, Expression
object
:JSXMemberExpression | JSXIdentifier
(required)property
:JSXIdentifier
(required)
jSXNamespacedName
t
See also t.isJSXNamespacedName(node, opts)
and t.assertJSXNamespacedName(node, opts)
.
Aliases: JSX
namespace
:JSXIdentifier
(required)name
:JSXIdentifier
(required)
jSXOpeningElement
t
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
)
jSXSpreadAttribute
t
See also t.isJSXSpreadAttribute(node, opts)
and t.assertJSXSpreadAttribute(node, opts)
.
Aliases: JSX
argument
:Expression
(required)
jSXSpreadChild
t
See also t.isJSXSpreadChild(node, opts)
and t.assertJSXSpreadChild(node, opts)
.
Aliases: JSX
, Immutable
expression
:Expression
(required)
jSXText
t
See also t.isJSXText(node, opts)
and t.assertJSXText(node, opts)
.
Aliases: JSX
, Immutable
value
:string
(required)
labeledStatement
t
See also t.isLabeledStatement(node, opts)
and t.assertLabeledStatement(node, opts)
.
Aliases: Statement
label
:Identifier
(required)body
:Statement
(required)
logicalExpression
t
See also t.isLogicalExpression(node, opts)
and t.assertLogicalExpression(node, opts)
.
Aliases: Binary
, Expression
operator
:'||' | '&&'
(required)left
:Expression
(required)right
:Expression
(required)
memberExpression
t
See also t.isMemberExpression(node, opts)
and t.assertMemberExpression(node, opts)
.
Aliases: Expression
, LVal
object
:Expression
(required)property
if computed thenExpression
elseIdentifier
(required)computed
:boolean
(default:false
)
metaProperty
t
See also t.isMetaProperty(node, opts)
and t.assertMetaProperty(node, opts)
.
Aliases: Expression
meta
:string
(required)property
:string
(required)
mixedTypeAnnotation
t
See also t.isMixedTypeAnnotation(node, opts)
and t.assertMixedTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
newExpression
t
See also t.isNewExpression(node, opts)
and t.assertNewExpression(node, opts)
.
Aliases: Expression
callee
:Expression
(required)arguments
:Array<Expression | SpreadElement>
(required)
noop
t
See also t.isNoop(node, opts)
and t.assertNoop(node, opts)
.
nullLiteral
t
See also t.isNullLiteral(node, opts)
and t.assertNullLiteral(node, opts)
.
Aliases: Expression
, Pureish
, Literal
, Immutable
nullLiteralTypeAnnotation
t
See also t.isNullLiteralTypeAnnotation(node, opts)
and t.assertNullLiteralTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
nullableTypeAnnotation
t
See also t.isNullableTypeAnnotation(node, opts)
and t.assertNullableTypeAnnotation(node, opts)
.
Aliases: Flow
typeAnnotation
(required)
numberTypeAnnotation
t
See also t.isNumberTypeAnnotation(node, opts)
and t.assertNumberTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
numericLiteral
t
See also t.isNumericLiteral(node, opts)
and t.assertNumericLiteral(node, opts)
.
Aliases: Expression
, Pureish
, Literal
, Immutable
value
:number
(required)
numericLiteralTypeAnnotation
t
See also t.isNumericLiteralTypeAnnotation(node, opts)
and t.assertNumericLiteralTypeAnnotation(node, opts)
.
Aliases: Flow
objectExpression
t
See also t.isObjectExpression(node, opts)
and t.assertObjectExpression(node, opts)
.
Aliases: Expression
properties
:Array<ObjectMethod | ObjectProperty | SpreadProperty>
(required)
objectMethod
t
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 thenExpression
elseIdentifier | Literal
(required)params
(required)body
:BlockStatement
(required)computed
:boolean
(default:false
)async
:boolean
(default:false
)decorators
:Array<Decorator>
(default:null
)generator
:boolean
(default:false
)returnType
(default:null
)typeParameters
(default:null
)
objectPattern
t
See also t.isObjectPattern(node, opts)
and t.assertObjectPattern(node, opts)
.
Aliases: Pattern
, LVal
properties
:Array<RestProperty | Property>
(required)typeAnnotation
(required)decorators
:Array<Decorator>
(default:null
)
objectProperty
t
See also t.isObjectProperty(node, opts)
and t.assertObjectProperty(node, opts)
.
Aliases: UserWhitespacable
, Property
, ObjectMember
key
if computed thenExpression
elseIdentifier | Literal
(required)value
:Expression | Pattern | RestElement
(required)computed
:boolean
(default:false
)shorthand
:boolean
(default:false
)decorators
:Array<Decorator>
(default:null
)
objectTypeAnnotation
t
See also t.isObjectTypeAnnotation(node, opts)
and t.assertObjectTypeAnnotation(node, opts)
.
Aliases: Flow
properties
(required)indexers
(required)callProperties
(required)
objectTypeCallProperty
t
See also t.isObjectTypeCallProperty(node, opts)
and t.assertObjectTypeCallProperty(node, opts)
.
Aliases: Flow
, UserWhitespacable
value
(required)
objectTypeIndexer
t
See also t.isObjectTypeIndexer(node, opts)
and t.assertObjectTypeIndexer(node, opts)
.
Aliases: Flow
, UserWhitespacable
id
(required)key
(required)value
(required)
objectTypeProperty
t
See also t.isObjectTypeProperty(node, opts)
and t.assertObjectTypeProperty(node, opts)
.
Aliases: Flow
, UserWhitespacable
key
(required)value
(required)
objectTypeSpreadProperty
t
See also t.isObjectTypeSpreadProperty(node, opts)
and t.assertObjectTypeSpreadProperty(node, opts)
.
Aliases: Flow
, UserWhitespacable
argument
(required)
opaqueType
t
See also t.isOpaqueType(node, opts)
and t.assertOpaqueType(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)typeParameters
(required)impltype
(required)supertype
(required)
parenthesizedExpression
t
See also t.isParenthesizedExpression(node, opts)
and t.assertParenthesizedExpression(node, opts)
.
Aliases: Expression
, ExpressionWrapper
expression
:Expression
(required)
program
t
See also t.isProgram(node, opts)
and t.assertProgram(node, opts)
.
Aliases: Scopable
, BlockParent
, Block
, FunctionParent
body
:Array<Statement>
(required)directives
:Array<Directive>
(default:[]
)
qualifiedTypeIdentifier
t
See also t.isQualifiedTypeIdentifier(node, opts)
and t.assertQualifiedTypeIdentifier(node, opts)
.
Aliases: Flow
id
(required)qualification
(required)
regExpLiteral
t
See also t.isRegExpLiteral(node, opts)
and t.assertRegExpLiteral(node, opts)
.
Aliases: Expression
, Literal
pattern
:string
(required)flags
:string
(default:''
)
restElement
t
See also t.isRestElement(node, opts)
and t.assertRestElement(node, opts)
.
Aliases: LVal
argument
:LVal
(required)typeAnnotation
(required)decorators
:Array<Decorator>
(default:null
)
restProperty
t
See also t.isRestProperty(node, opts)
and t.assertRestProperty(node, opts)
.
Aliases: UnaryLike
argument
:LVal
(required)
returnStatement
t
See also t.isReturnStatement(node, opts)
and t.assertReturnStatement(node, opts)
.
Aliases: Statement
, Terminatorless
, CompletionStatement
argument
:Expression
(default:null
)
sequenceExpression
t
See also t.isSequenceExpression(node, opts)
and t.assertSequenceExpression(node, opts)
.
Aliases: Expression
expressions
:Array<Expression>
(required)
spreadElement
t
See also t.isSpreadElement(node, opts)
and t.assertSpreadElement(node, opts)
.
Aliases: UnaryLike
argument
:Expression
(required)
spreadProperty
t
See also t.isSpreadProperty(node, opts)
and t.assertSpreadProperty(node, opts)
.
Aliases: UnaryLike
argument
:Expression
(required)
stringLiteral
t
See also t.isStringLiteral(node, opts)
and t.assertStringLiteral(node, opts)
.
Aliases: Expression
, Pureish
, Literal
, Immutable
value
:string
(required)
stringLiteralTypeAnnotation
t
See also t.isStringLiteralTypeAnnotation(node, opts)
and t.assertStringLiteralTypeAnnotation(node, opts)
.
Aliases: Flow
stringTypeAnnotation
t
See also t.isStringTypeAnnotation(node, opts)
and t.assertStringTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
super
t
See also t.isSuper(node, opts)
and t.assertSuper(node, opts)
.
Aliases: Expression
switchCase
t
See also t.isSwitchCase(node, opts)
and t.assertSwitchCase(node, opts)
.
test
:Expression
(default:null
)consequent
:Array<Statement>
(required)
switchStatement
t
See also t.isSwitchStatement(node, opts)
and t.assertSwitchStatement(node, opts)
.
Aliases: Statement
, BlockParent
, Scopable
discriminant
:Expression
(required)cases
:Array<SwitchCase>
(required)
taggedTemplateExpression
t
See also t.isTaggedTemplateExpression(node, opts)
and t.assertTaggedTemplateExpression(node, opts)
.
Aliases: Expression
tag
:Expression
(required)quasi
:TemplateLiteral
(required)
templateElement
t
See also t.isTemplateElement(node, opts)
and t.assertTemplateElement(node, opts)
.
value
(required)tail
:boolean
(default:false
)
templateLiteral
t
See also t.isTemplateLiteral(node, opts)
and t.assertTemplateLiteral(node, opts)
.
Aliases: Expression
, Literal
quasis
:Array<TemplateElement>
(required)expressions
:Array<Expression>
(required)
thisExpression
t
See also t.isThisExpression(node, opts)
and t.assertThisExpression(node, opts)
.
Aliases: Expression
thisTypeAnnotation
t
See also t.isThisTypeAnnotation(node, opts)
and t.assertThisTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
throwStatement
t
See also t.isThrowStatement(node, opts)
and t.assertThrowStatement(node, opts)
.
Aliases: Statement
, Terminatorless
, CompletionStatement
argument
:Expression
(required)
tryStatement
t
See also t.isTryStatement(node, opts)
and t.assertTryStatement(node, opts)
.
Aliases: Statement
block
(required)handler
(default:null
)finalizer
:BlockStatement
(default:null
)body
:BlockStatement
(default:null
)
tupleTypeAnnotation
t
See also t.isTupleTypeAnnotation(node, opts)
and t.assertTupleTypeAnnotation(node, opts)
.
Aliases: Flow
types
(required)
typeAlias
t
See also t.isTypeAlias(node, opts)
and t.assertTypeAlias(node, opts)
.
Aliases: Flow
, FlowDeclaration
, Statement
, Declaration
id
(required)typeParameters
(required)right
(required)
typeAnnotation
t
See also t.isTypeAnnotation(node, opts)
and t.assertTypeAnnotation(node, opts)
.
Aliases: Flow
typeAnnotation
(required)
typeCastExpression
t
See also t.isTypeCastExpression(node, opts)
and t.assertTypeCastExpression(node, opts)
.
Aliases: Flow
, ExpressionWrapper
, Expression
expression
(required)typeAnnotation
(required)
typeParameter
t
See also t.isTypeParameter(node, opts)
and t.assertTypeParameter(node, opts)
.
Aliases: Flow
bound
(required)
typeParameterDeclaration
t
See also t.isTypeParameterDeclaration(node, opts)
and t.assertTypeParameterDeclaration(node, opts)
.
Aliases: Flow
params
(required)
typeParameterInstantiation
t
See also t.isTypeParameterInstantiation(node, opts)
and t.assertTypeParameterInstantiation(node, opts)
.
Aliases: Flow
params
(required)
typeofTypeAnnotation
t
See also t.isTypeofTypeAnnotation(node, opts)
and t.assertTypeofTypeAnnotation(node, opts)
.
Aliases: Flow
argument
(required)
unaryExpression
t
See also t.isUnaryExpression(node, opts)
and t.assertUnaryExpression(node, opts)
.
Aliases: UnaryLike
, Expression
operator
:'void' | 'delete' | '!' | '+' | '-' | '++' | '--' | '~' | 'typeof'
(required)argument
:Expression
(required)prefix
:boolean
(default:true
)
unionTypeAnnotation
t
See also t.isUnionTypeAnnotation(node, opts)
and t.assertUnionTypeAnnotation(node, opts)
.
Aliases: Flow
types
(required)
updateExpression
t
See also t.isUpdateExpression(node, opts)
and t.assertUpdateExpression(node, opts)
.
Aliases: Expression
operator
:'++' | '--'
(required)argument
:Expression
(required)prefix
:boolean
(default:false
)
variableDeclaration
t
See also t.isVariableDeclaration(node, opts)
and t.assertVariableDeclaration(node, opts)
.
Aliases: Statement
, Declaration
kind
:"var" | "let" | "const"
(required)declarations
:Array<VariableDeclarator>
(required)
variableDeclarator
t
See also t.isVariableDeclarator(node, opts)
and t.assertVariableDeclarator(node, opts)
.
id
:LVal
(required)init
:Expression
(default:null
)
voidTypeAnnotation
t
See also t.isVoidTypeAnnotation(node, opts)
and t.assertVoidTypeAnnotation(node, opts)
.
Aliases: Flow
, FlowBaseAnnotation
whileStatement
t
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
t
See also t.isWithStatement(node, opts)
and t.assertWithStatement(node, opts)
.
Aliases: Statement
object
(required)body
:BlockStatement | Statement
(required)
yieldExpression
t
See also t.isYieldExpression(node, opts)
and t.assertYieldExpression(node, opts)
.
Aliases: Expression
, Terminatorless
argument
:Expression
(default:null
)delegate
:boolean
(default:false
)