# @babel/类型

该模块包含用于手动构建 AST 和检查 AST 节点类型的方法。

# 安装

  • npm
npm install --save-dev @babel/types
  • yarn
yarn add --dev @babel/types

# 应用程序接口

# 节点构建器 (opens new window)

# anyTypeAnnotation

JavaScript

t.anyTypeAnnotation();

另见t.isAnyTypeAnnotation(node, opts)t.assertAnyTypeAnnotation(node, opts)

别名:Flow (opens new window) , FlowType ,FlowBaseAnnotation (opens new window)

# 参数占位符

JavaScript

t.argumentPlaceholder();

另见t.isArgumentPlaceholder(node, opts)t.assertArgumentPlaceholder(node, opts)

# 数组表达式

JavaScript

t.arrayExpression(elements);

另见t.isArrayExpression(node, opts)t.assertArrayExpression(node, opts)

AST节点ArrayExpression形状:

  • elements: Array<js | Expression | SpreadElement>(默认: [])

别名: Standardized ,Expression (opens new window)

# 数组模式

JavaScript

t.arrayPattern(elements);

另见t.isArrayPattern(node, opts)t.assertArrayPattern(node, opts)

AST节点ArrayPattern形状:

  • elements: Array<js | PatternLike | LVal>(必填)
  • decorators:(Array<Decorator>默认值:js,从构建函数中排除)
  • optional:(boolean默认值:js,从构建函数中排除)
  • typeAnnotation:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Pattern , PatternLike ,LVal (opens new window)

# arrayTypeAnnotation

JavaScript

t.arrayTypeAnnotation(elementType);

另见t.isArrayTypeAnnotation(node, opts)t.assertArrayTypeAnnotation(node, opts)

AST节点ArrayTypeAnnotation形状:

  • elementType: FlowType(必填)

别名: Flow ,FlowType (opens new window)

# arrowFunctionExpression

JavaScript

t.arrowFunctionExpression(params, body, async);

另见t.isArrowFunctionExpression(node, opts)t.assertArrowFunctionExpression(node, opts)

AST节点ArrowFunctionExpression形状:

  • params: Array<Identifier | Pattern | RestElement>(必填)
  • body: BlockStatement | Expression(必填)
  • async: boolean(默认: false)
  • expression: boolean(必填)
  • generator:(boolean默认值:false,从构建函数中排除)
  • predicate:(DeclaredPredicate | InferredPredicate默认值:js,从构建函数中排除)
  • returnType:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)
  • typeParameters:(TypeParameterDeclaration | TSTypeParameterDeclaration | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Scopable , Function , BlockParent , FunctionParent , Expression ,Pureish (opens new window)

# 赋值表达式

JavaScript

t.assignmentExpression(operator, left, right);

另见t.isAssignmentExpression(node, opts)t.assertAssignmentExpression(node, opts)

AST节点AssignmentExpression形状:

  • operator: string(必填)
  • left: LVal(必填)
  • right: Expression(必填)

别名: Standardized ,Expression (opens new window)

# 赋值模式

JavaScript

t.assignmentPattern(left, right);

另见t.isAssignmentPattern(node, opts)t.assertAssignmentPattern(node, opts)

AST节点AssignmentPattern形状:

  • left: Identifier | ObjectPattern | ArrayPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression(必填)
  • right: Expression(必填)
  • decorators:(Array<Decorator>默认值:js,从构建函数中排除)
  • optional:(boolean默认值:js,从构建函数中排除)
  • typeAnnotation:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Pattern , PatternLike ,LVal (opens new window)

# 等待表达式

JavaScript

t.awaitExpression(argument);

另见t.isAwaitExpression(node, opts)t.assertAwaitExpression(node, opts)

AST节点AwaitExpression形状:

  • argument: Expression(必填)

别名:Standardized (opens new window) , Expression ,Terminatorless (opens new window)

# bigIntLiteral

JavaScript

t.bigIntLiteral(value);

另见t.isBigIntLiteral(node, opts)t.assertBigIntLiteral(node, opts)

AST节点BigIntLiteral形状:

  • value: string(必填)

别名:Standardized (opens new window) , Expression , Pureish , Literal ,Immutable (opens new window)

# 二元表达式

JavaScript

t.binaryExpression(operator, left, right);

另见t.isBinaryExpression(node, opts)t.assertBinaryExpression(node, opts)

AST节点BinaryExpression形状:

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

别名:Standardized (opens new window) , Binary ,Expression (opens new window)

# 绑定表达式

JavaScript

t.bindExpression(object, callee);

另见t.isBindExpression(node, opts)t.assertBindExpression(node, opts)

AST节点BindExpression形状:

  • object: Expression(必填)
  • callee: Expression(必填)

别名:Expression (opens new window)

# 块语句

JavaScript

t.blockStatement(body, directives);

另见t.isBlockStatement(node, opts)t.assertBlockStatement(node, opts)

AST节点BlockStatement形状:

  • body: Array<Statement>(必填)
  • directives: Array<Directive>(默认: [])

别名:Standardized (opens new window) , Scopable , BlockParent , Block ,Statement (opens new window)

# 布尔文字

JavaScript

t.booleanLiteral(value);

另见t.isBooleanLiteral(node, opts)t.assertBooleanLiteral(node, opts)

AST节点BooleanLiteral形状:

  • value: boolean(必填)

别名:Standardized (opens new window) , Expression , Pureish , Literal ,Immutable (opens new window)

# booleanLiteralTypeAnnotation

JavaScript

t.booleanLiteralTypeAnnotation(value);

另见t.isBooleanLiteralTypeAnnotation(node, opts)t.assertBooleanLiteralTypeAnnotation(node, opts)

AST节点BooleanLiteralTypeAnnotation形状:

  • value: boolean(必填)

别名: Flow ,FlowType (opens new window)

# 布尔类型注解

JavaScript

t.booleanTypeAnnotation();

另见t.isBooleanTypeAnnotation(node, opts)t.assertBooleanTypeAnnotation(node, opts)

别名:Flow (opens new window) , FlowType ,FlowBaseAnnotation (opens new window)

# break语句

JavaScript

t.breakStatement(label);

另见t.isBreakStatement(node, opts)t.assertBreakStatement(node, opts)

AST节点BreakStatement形状:

  • label: Identifier(默认: js)

别名:Standardized (opens new window) , Statement , Terminatorless ,CompletionStatement (opens new window)

# callExpression

JavaScript

t.callExpression(callee, arguments);

另见t.isCallExpression(node, opts)t.assertCallExpression(node, opts)

AST节点CallExpression形状:

  • callee: Expression | Super | V8IntrinsicIdentifier(必填)
  • arguments: Array<Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder>(必填)
  • optional:(true | false默认值:js,从构建函数中排除)
  • typeArguments:(TypeParameterInstantiation默认值:js,从构建函数中排除)
  • typeParameters:(TSTypeParameterInstantiation默认值:js,从构建函数中排除)

别名: Standardized ,Expression (opens new window)

# 捕获子句

JavaScript

t.catchClause(param, body);

另见t.isCatchClause(node, opts)t.assertCatchClause(node, opts)

AST节点CatchClause形状:

  • param: Identifier | ArrayPattern | ObjectPattern(默认: js)
  • body: BlockStatement(必填)

别名:Standardized (opens new window) , Scopable ,BlockParent (opens new window)

# 类AccessorProperty

JavaScript

t.classAccessorProperty(key, value, typeAnnotation, decorators, computed, static);

另见t.isClassAccessorProperty(node, opts)t.assertClassAccessorProperty(node, opts)

AST节点ClassAccessorProperty形状:

  • key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName(必填)
  • value: Expression(默认: js)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop(默认: js)
  • decorators: Array<Decorator>(默认: js)
  • computed: boolean(默认: false)
  • static: boolean(默认: false)
  • abstract:(boolean默认值:js,从构建函数中排除)
  • accessibility:("public" | "private" | "protected"默认值:js,从构建函数中排除)
  • declare:(boolean默认值:js,从构建函数中排除)
  • definite:(boolean默认值:js,从构建函数中排除)
  • optional:(boolean默认值:js,从构建函数中排除)
  • override:(boolean默认值:false,从构建函数中排除)
  • readonly:(boolean默认值:js,从构建函数中排除)
  • variance:(Variance默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Property ,Accessor (opens new window)

# 类主体

JavaScript

t.classBody(body);

另见t.isClassBody(node, opts)t.assertClassBody(node, opts)

AST节点ClassBody形状:

  • body: Array<ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock>(必填)

别名:Standardized (opens new window)

# 类声明

JavaScript

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

另见t.isClassDeclaration(node, opts)t.assertClassDeclaration(node, opts)

AST节点ClassDeclaration形状:

  • id: Identifier(必填)
  • superClass: Expression(默认: js)
  • body: ClassBody(必填)
  • decorators: Array<Decorator>(默认: js)
  • abstract:(boolean默认值:js,从构建函数中排除)
  • declare:(boolean默认值:js,从构建函数中排除)
  • implements:(Array<TSExpressionWithTypeArguments | ClassImplements>默认值:js,从构建函数中排除)
  • mixins:(InterfaceExtends默认值:js,从构建函数中排除)
  • superTypeParameters:(TypeParameterInstantiation | TSTypeParameterInstantiation默认值:js,从构建函数中排除)
  • typeParameters:(TypeParameterDeclaration | TSTypeParameterDeclaration | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Scopable , Class , Statement ,Declaration (opens new window)

# 类表达式

JavaScript

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

另见t.isClassExpression(node, opts)t.assertClassExpression(node, opts)

AST节点ClassExpression形状:

  • id: Identifier(默认: js)
  • superClass: Expression(默认: js)
  • body: ClassBody(必填)
  • decorators: Array<Decorator>(默认: js)
  • implements:(Array<TSExpressionWithTypeArguments | ClassImplements>默认值:js,从构建函数中排除)
  • mixins:(InterfaceExtends默认值:js,从构建函数中排除)
  • superTypeParameters:(TypeParameterInstantiation | TSTypeParameterInstantiation默认值:js,从构建函数中排除)
  • typeParameters:(TypeParameterDeclaration | TSTypeParameterDeclaration | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Scopable , Class ,Expression (opens new window)

# 类实现

JavaScript

t.classImplements(id, typeParameters);

另见t.isClassImplements(node, opts)t.assertClassImplements(node, opts)

AST节点ClassImplements形状:

  • id: Identifier(必填)
  • typeParameters: TypeParameterInstantiation(默认: js)

别名:Flow (opens new window)

# 类方法

JavaScript

t.classMethod(kind, key, params, body, computed, static, generator, async);

另见t.isClassMethod(node, opts)t.assertClassMethod(node, opts)

AST节点ClassMethod形状:

  • kind: "get" | "set" | "method" | "constructor"(默认: 'method')
  • key: if computed then Expressionelse Identifier | Literal(必填)
  • params: Array<Identifier | Pattern | RestElement | TSParameterProperty>(必填)
  • body: BlockStatement(必填)
  • computed: boolean(默认: false)
  • static: boolean(默认: false)
  • generator: boolean(默认: false)
  • async: boolean(默认: false)
  • abstract:(boolean默认值:js,从构建函数中排除)
  • access:("public" | "private" | "protected"默认值:js,从构建函数中排除)
  • accessibility:("public" | "private" | "protected"默认值:js,从构建函数中排除)
  • decorators:(Array<Decorator>默认值:js,从构建函数中排除)
  • optional:(boolean默认值:js,从构建函数中排除)
  • override:(boolean默认值:false,从构建函数中排除)
  • returnType:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)
  • typeParameters:(TypeParameterDeclaration | TSTypeParameterDeclaration | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Function , Scopable , BlockParent , FunctionParent ,Method (opens new window)

# 类私有方法

JavaScript

t.classPrivateMethod(kind, key, params, body, static);

另见t.isClassPrivateMethod(node, opts)t.assertClassPrivateMethod(node, opts)

AST节点ClassPrivateMethod形状:

  • kind: "get" | "set" | "method"(默认: 'method')
  • key: PrivateName(必填)
  • params: Array<Identifier | Pattern | RestElement | TSParameterProperty>(必填)
  • body: BlockStatement(必填)
  • static: boolean(默认: false)
  • abstract:(boolean默认值:js,从构建函数中排除)
  • access:("public" | "private" | "protected"默认值:js,从构建函数中排除)
  • accessibility:("public" | "private" | "protected"默认值:js,从构建函数中排除)
  • async:(boolean默认值:false,从构建函数中排除)
  • computed: 'false' (默认值:false,从构建函数中排除)
  • decorators:(Array<Decorator>默认值:js,从构建函数中排除)
  • generator:(boolean默认值:false,从构建函数中排除)
  • optional:(boolean默认值:js,从构建函数中排除)
  • override:(boolean默认值:false,从构建函数中排除)
  • returnType:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)
  • typeParameters:(TypeParameterDeclaration | TSTypeParameterDeclaration | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Function , Scopable , BlockParent , FunctionParent , Method ,Private (opens new window)

# 类私有属性

JavaScript

t.classPrivateProperty(key, value, decorators, static);

另见t.isClassPrivateProperty(node, opts)t.assertClassPrivateProperty(node, opts)

AST节点ClassPrivateProperty形状:

  • key: PrivateName(必填)
  • value: Expression(默认: js)
  • decorators: Array<Decorator>(默认: js)
  • static: boolean(默认: false)
  • definite:(boolean默认值:js,从构建函数中排除)
  • readonly:(boolean默认值:js,从构建函数中排除)
  • typeAnnotation:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)
  • variance:(Variance默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Property ,Private (opens new window)

# 类属性

JavaScript

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

历史| | | | :--- | :--- | | | |

另见t.isClassProperty(node, opts)t.assertClassProperty(node, opts)

AST节点ClassProperty形状:

  • key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression(必填)
  • value: Expression(默认: js)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop(默认: js)
  • decorators: Array<Decorator>(默认: js)
  • computed: boolean(默认: false)
  • static: boolean(默认: false)
  • abstract:(boolean默认值:js,从构建函数中排除)
  • accessibility:("public" | "private" | "protected"默认值:js,从构建函数中排除)
  • declare:(boolean默认值:js,从构建函数中排除)
  • definite:(boolean默认值:js,从构建函数中排除)
  • optional:(boolean默认值:js,从构建函数中排除)
  • override:(boolean默认值:false,从构建函数中排除)
  • readonly:(boolean默认值:js,从构建函数中排除)
  • variance:(Variance默认值:js,从构建函数中排除)

别名: Standardized ,Property (opens new window)

# 条件表达式

JavaScript

t.conditionalExpression(test, consequent, alternate);

另见t.isConditionalExpression(node, opts)t.assertConditionalExpression(node, opts)

AST节点ConditionalExpression形状:

  • test: Expression(必填)
  • consequent: Expression(必填)
  • alternate: Expression(必填)

别名:Standardized (opens new window) , Expression ,Conditional (opens new window)

# continue语句

JavaScript

t.continueStatement(label);

另见t.isContinueStatement(node, opts)t.assertContinueStatement(node, opts)

AST节点ContinueStatement形状:

  • label: Identifier(默认: js)

别名:Standardized (opens new window) , Statement , Terminatorless ,CompletionStatement (opens new window)

# debuggerStatement

JavaScript

t.debuggerStatement();

另见t.isDebuggerStatement(node, opts)t.assertDebuggerStatement(node, opts)

别名: Standardized ,Statement (opens new window)

# 十进制文字

JavaScript

t.decimalLiteral(value);

另见t.isDecimalLiteral(node, opts)t.assertDecimalLiteral(node, opts)

AST节点DecimalLiteral形状:

  • value: string(必填)

别名:Expression (opens new window) , Pureish , Literal ,Immutable (opens new window)

# 声明类

JavaScript

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

另见t.isDeclareClass(node, opts)t.assertDeclareClass(node, opts)

AST节点DeclareClass形状:

  • id: Identifier(必填)
  • typeParameters: TypeParameterDeclaration(默认: js)
  • extends: Array<InterfaceExtends>(默认: js)
  • body: ObjectTypeAnnotation(必填)
  • implements:(Array<ClassImplements>默认值:js,从构建函数中排除)
  • mixins:(Array<InterfaceExtends>默认值:js,从构建函数中排除)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# declareExportAllDeclaration

JavaScript

t.declareExportAllDeclaration(source);

另见t.isDeclareExportAllDeclaration(node, opts)t.assertDeclareExportAllDeclaration(node, opts)

AST节点DeclareExportAllDeclaration形状:

  • source: StringLiteral(必填)
  • exportKind:("type" | "value"默认值:js,从构建函数中排除)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# declareExportDeclaration

JavaScript

t.declareExportDeclaration(declaration, specifiers, source);

另见t.isDeclareExportDeclaration(node, opts)t.assertDeclareExportDeclaration(node, opts)

AST节点DeclareExportDeclaration形状:

  • declaration: Flow(默认: js)
  • specifiers: Array<ExportSpecifier | ExportNamespaceSpecifier>(默认: js)
  • source: StringLiteral(默认: js)
  • default:(boolean默认值:js,从构建函数中排除)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# 声明函数

JavaScript

t.declareFunction(id);

另见t.isDeclareFunction(node, opts)t.assertDeclareFunction(node, opts)

AST节点DeclareFunction形状:

  • id: Identifier(必填)
  • predicate:(DeclaredPredicate默认值:js,从构建函数中排除)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# 声明接口

JavaScript

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

另见t.isDeclareInterface(node, opts)t.assertDeclareInterface(node, opts)

AST节点DeclareInterface形状:

  • id: Identifier(必填)
  • typeParameters: TypeParameterDeclaration(默认: js)
  • extends: Array<InterfaceExtends>(默认: js)
  • body: ObjectTypeAnnotation(必填)
  • implements:(Array<ClassImplements>默认值:js,从构建函数中排除)
  • mixins:(Array<InterfaceExtends>默认值:js,从构建函数中排除)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# 声明模块

JavaScript

t.declareModule(id, body, kind);

另见t.isDeclareModule(node, opts)t.assertDeclareModule(node, opts)

AST节点DeclareModule形状:

  • id: Identifier | StringLiteral(必填)
  • body: BlockStatement(必填)
  • kind: "CommonJS" | "ES"(默认: js)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# declareModuleExports

JavaScript

t.declareModuleExports(typeAnnotation);

另见t.isDeclareModuleExports(node, opts)t.assertDeclareModuleExports(node, opts)

AST节点DeclareModuleExports形状:

  • typeAnnotation: TypeAnnotation(必填)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# 声明不透明类型

JavaScript

t.declareOpaqueType(id, typeParameters, supertype);

另见t.isDeclareOpaqueType(node, opts)t.assertDeclareOpaqueType(node, opts)

AST节点DeclareOpaqueType形状:

  • id: Identifier(必填)
  • typeParameters: TypeParameterDeclaration(默认: js)
  • supertype: FlowType(默认: js)
  • impltype:(FlowType默认值:js,从构建函数中排除)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# 声明类型别名

JavaScript

t.declareTypeAlias(id, typeParameters, right);

另见t.isDeclareTypeAlias(node, opts)t.assertDeclareTypeAlias(node, opts)

AST节点DeclareTypeAlias形状:

  • id: Identifier(必填)
  • typeParameters: TypeParameterDeclaration(默认: js)
  • right: FlowType(必填)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# 声明变量

JavaScript

t.declareVariable(id);

另见t.isDeclareVariable(node, opts)t.assertDeclareVariable(node, opts)

AST节点DeclareVariable形状:

  • id: Identifier(必填)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# 声明谓词

JavaScript

t.declaredPredicate(value);

另见t.isDeclaredPredicate(node, opts)t.assertDeclaredPredicate(node, opts)

AST节点DeclaredPredicate形状:

  • value: Flow(必填)

别名: Flow ,FlowPredicate (opens new window)

# 装饰器

JavaScript

t.decorator(expression);

另见t.isDecorator(node, opts)t.assertDecorator(node, opts)

AST节点Decorator形状:

  • expression: Expression(必填)

# 指令

JavaScript

t.directive(value);

另见t.isDirective(node, opts)t.assertDirective(node, opts)

AST节点Directive形状:

  • value: DirectiveLiteral(必填)

别名:Standardized (opens new window)

# 指令文字

JavaScript

t.directiveLiteral(value);

另见t.isDirectiveLiteral(node, opts)t.assertDirectiveLiteral(node, opts)

AST节点DirectiveLiteral形状:

  • value: string(必填)

别名:Standardized (opens new window)

# 做表达式

JavaScript

t.doExpression(body, async);

另见t.isDoExpression(node, opts)t.assertDoExpression(node, opts)

AST节点DoExpression形状:

  • body: BlockStatement(必填)
  • async: boolean(默认: false)

别名:Expression (opens new window)

# doWhile语句

JavaScript

t.doWhileStatement(test, body);

另见t.isDoWhileStatement(node, opts)t.assertDoWhileStatement(node, opts)

AST节点DoWhileStatement形状:

  • test: Expression(必填)
  • body: Statement(必填)

别名:Standardized (opens new window) , Statement , BlockParent , Loop , While ,Scopable (opens new window)

# 空语句

JavaScript

t.emptyStatement();

另见t.isEmptyStatement(node, opts)t.assertEmptyStatement(node, opts)

别名: Standardized ,Statement (opens new window)

# emptyTypeAnnotation

JavaScript

t.emptyTypeAnnotation();

另见t.isEmptyTypeAnnotation(node, opts)t.assertEmptyTypeAnnotation(node, opts)

别名:Flow (opens new window) , FlowType ,FlowBaseAnnotation (opens new window)

# 枚举布尔体

JavaScript

t.enumBooleanBody(members);

另见t.isEnumBooleanBody(node, opts)t.assertEnumBooleanBody(node, opts)

AST节点EnumBooleanBody形状:

  • members: Array<EnumBooleanMember>(必填)
  • explicitType: boolean(必填)
  • hasUnknownMembers: boolean(必填)

别名: Flow ,EnumBody (opens new window)

# 枚举布尔成员

JavaScript

t.enumBooleanMember(id);

另见t.isEnumBooleanMember(node, opts)t.assertEnumBooleanMember(node, opts)

AST节点EnumBooleanMember形状:

  • id: Identifier(必填)
  • init: BooleanLiteral(必填)

别名: Flow ,EnumMember (opens new window)

# 枚举声明

JavaScript

t.enumDeclaration(id, body);

另见t.isEnumDeclaration(node, opts)t.assertEnumDeclaration(node, opts)

AST节点EnumDeclaration形状:

  • id: Identifier(必填)
  • body: EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody(必填)

别名:Flow (opens new window) , Statement ,Declaration (opens new window)

# 枚举默认成员

JavaScript

t.enumDefaultedMember(id);

另见t.isEnumDefaultedMember(node, opts)t.assertEnumDefaultedMember(node, opts)

AST节点EnumDefaultedMember形状:

  • id: Identifier(必填)

别名: Flow ,EnumMember (opens new window)

# enumNumberBody

JavaScript

t.enumNumberBody(members);

另见t.isEnumNumberBody(node, opts)t.assertEnumNumberBody(node, opts)

AST节点EnumNumberBody形状:

  • members: Array<EnumNumberMember>(必填)
  • explicitType: boolean(必填)
  • hasUnknownMembers: boolean(必填)

别名: Flow ,EnumBody (opens new window)

# enumNumberMember

JavaScript

t.enumNumberMember(id, init);

另见t.isEnumNumberMember(node, opts)t.assertEnumNumberMember(node, opts)

AST节点EnumNumberMember形状:

  • id: Identifier(必填)
  • init: NumericLiteral(必填)

别名: Flow ,EnumMember (opens new window)

# 枚举字符串体

JavaScript

t.enumStringBody(members);

另见t.isEnumStringBody(node, opts)t.assertEnumStringBody(node, opts)

AST节点EnumStringBody形状:

  • members: Array<EnumStringMember | EnumDefaultedMember>(必填)
  • explicitType: boolean(必填)
  • hasUnknownMembers: boolean(必填)

别名: Flow ,EnumBody (opens new window)

# 枚举字符串成员

JavaScript

t.enumStringMember(id, init);

另见t.isEnumStringMember(node, opts)t.assertEnumStringMember(node, opts)

AST节点EnumStringMember形状:

  • id: Identifier(必填)
  • init: StringLiteral(必填)

别名: Flow ,EnumMember (opens new window)

# 枚举符号体

JavaScript

t.enumSymbolBody(members);

另见t.isEnumSymbolBody(node, opts)t.assertEnumSymbolBody(node, opts)

AST节点EnumSymbolBody形状:

  • members: Array<EnumDefaultedMember>(必填)
  • hasUnknownMembers: boolean(必填)

别名: Flow ,EnumBody (opens new window)

# existsTypeAnnotation

JavaScript

t.existsTypeAnnotation();

另见t.isExistsTypeAnnotation(node, opts)t.assertExistsTypeAnnotation(node, opts)

别名: Flow ,FlowType (opens new window)

# exportAllDeclaration

JavaScript

t.exportAllDeclaration(source);

另见t.isExportAllDeclaration(node, opts)t.assertExportAllDeclaration(node, opts)

AST节点ExportAllDeclaration形状:

  • source: StringLiteral(必填)
  • assertions:(Array<ImportAttribute>默认值:js,从构建函数中排除)
  • exportKind:("type" | "value"默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Statement , Declaration , ImportOrExportDeclaration ,ExportDeclaration (opens new window)

# 导出默认声明

JavaScript

t.exportDefaultDeclaration(declaration);

另见t.isExportDefaultDeclaration(node, opts)t.assertExportDefaultDeclaration(node, opts)

AST节点ExportDefaultDeclaration形状:

  • declaration: TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression(必填)
  • exportKind:("value"默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Statement , Declaration , ImportOrExportDeclaration ,ExportDeclaration (opens new window)

# exportDefaultSpecifier

JavaScript

t.exportDefaultSpecifier(exported);

另见t.isExportDefaultSpecifier(node, opts)t.assertExportDefaultSpecifier(node, opts)

AST节点ExportDefaultSpecifier形状:

  • exported: Identifier(必填)

别名:ModuleSpecifier (opens new window)

# exportNamedDeclaration

JavaScript

t.exportNamedDeclaration(declaration, specifiers, source);

另见t.isExportNamedDeclaration(node, opts)t.assertExportNamedDeclaration(node, opts)

AST节点ExportNamedDeclaration形状:

  • declaration: Declaration(默认: js)
  • specifiers: Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier>(默认: [])
  • source: StringLiteral(默认: js)
  • assertions:(Array<ImportAttribute>默认值:js,从构建函数中排除)
  • exportKind:("type" | "value"默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Statement , Declaration , ImportOrExportDeclaration ,ExportDeclaration (opens new window)

# exportNamespaceSpecifier

JavaScript

t.exportNamespaceSpecifier(exported);

另见t.isExportNamespaceSpecifier(node, opts)t.assertExportNamespaceSpecifier(node, opts)

AST节点ExportNamespaceSpecifier形状:

  • exported: Identifier(必填)

别名: Standardized ,ModuleSpecifier (opens new window)

# 导出说明符

JavaScript

t.exportSpecifier(local, exported);

另见t.isExportSpecifier(node, opts)t.assertExportSpecifier(node, opts)

AST节点ExportSpecifier形状:

  • local: Identifier(必填)
  • exported: Identifier | StringLiteral(必填)
  • exportKind:("type" | "value"默认值:js,从构建函数中排除)

别名: Standardized ,ModuleSpecifier (opens new window)

# 表达式语句

JavaScript

t.expressionStatement(expression);

另见t.isExpressionStatement(node, opts)t.assertExpressionStatement(node, opts)

AST节点ExpressionStatement形状:

  • expression: Expression(必填)

别名:Standardized (opens new window) , Statement ,ExpressionWrapper (opens new window)

# 文件

JavaScript

t.file(program, comments, tokens);

另见t.isFile(node, opts)t.assertFile(node, opts)

AST节点File形状:

  • program: Program(必填)
  • comments: Array<CommentBlock | CommentLine>(默认: js)
  • tokens: Array<any>(默认: js)

别名:Standardized (opens new window)

# forIn语句

JavaScript

t.forInStatement(left, right, body);

另见t.isForInStatement(node, opts)t.assertForInStatement(node, opts)

AST节点ForInStatement形状:

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

别名:Standardized (opens new window) , Scopable , Statement , For , BlockParent , Loop ,ForXStatement (opens new window)

# forOf语句

JavaScript

t.forOfStatement(left, right, body, await);

另见t.isForOfStatement(node, opts)t.assertForOfStatement(node, opts)

AST节点ForOfStatement形状:

  • left: VariableDeclaration | LVal(必填)
  • right: Expression(必填)
  • body: Statement(必填)
  • await: boolean(默认: false)

别名:Standardized (opens new window) , Scopable , Statement , For , BlockParent , Loop ,ForXStatement (opens new window)

# for语句

JavaScript

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

另见t.isForStatement(node, opts)t.assertForStatement(node, opts)

AST节点ForStatement形状:

  • init: VariableDeclaration | Expression(默认: js)
  • test: Expression(默认: js)
  • update: Expression(默认: js)
  • body: Statement(必填)

别名:Standardized (opens new window) , Scopable , Statement , For , BlockParent ,Loop (opens new window)

# 函数声明

JavaScript

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

另见t.isFunctionDeclaration(node, opts)t.assertFunctionDeclaration(node, opts)

AST节点FunctionDeclaration形状:

  • id: Identifier(默认: js)
  • params: Array<Identifier | Pattern | RestElement>(必填)
  • body: BlockStatement(必填)
  • generator: boolean(默认: false)
  • async: boolean(默认: false)
  • declare:(boolean默认值:js,从构建函数中排除)
  • predicate:(DeclaredPredicate | InferredPredicate默认值:js,从构建函数中排除)
  • returnType:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)
  • typeParameters:(TypeParameterDeclaration | TSTypeParameterDeclaration | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Scopable , Function , BlockParent , FunctionParent , Statement , Pureish ,Declaration (opens new window)

# 函数表达式

JavaScript

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

另见t.isFunctionExpression(node, opts)t.assertFunctionExpression(node, opts)

AST节点FunctionExpression形状:

  • id: Identifier(默认: js)
  • params: Array<Identifier | Pattern | RestElement>(必填)
  • body: BlockStatement(必填)
  • generator: boolean(默认: false)
  • async: boolean(默认: false)
  • predicate:(DeclaredPredicate | InferredPredicate默认值:js,从构建函数中排除)
  • returnType:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)
  • typeParameters:(TypeParameterDeclaration | TSTypeParameterDeclaration | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Scopable , Function , BlockParent , FunctionParent , Expression ,Pureish (opens new window)

# 函数类型注解

JavaScript

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

另见t.isFunctionTypeAnnotation(node, opts)t.assertFunctionTypeAnnotation(node, opts)

AST节点FunctionTypeAnnotation形状:

  • typeParameters: TypeParameterDeclaration(默认: js)
  • params: Array<FunctionTypeParam>(必填)
  • rest: FunctionTypeParam(默认: js)
  • returnType: FlowType(必填)
  • this:(FunctionTypeParam默认值:js,从构建函数中排除)

别名: Flow ,FlowType (opens new window)

# 函数类型参数

JavaScript

t.functionTypeParam(name, typeAnnotation);

另见t.isFunctionTypeParam(node, opts)t.assertFunctionTypeParam(node, opts)

AST节点FunctionTypeParam形状:

  • name: Identifier(默认: js)
  • typeAnnotation: FlowType(必填)
  • optional:(boolean默认值:js,从构建函数中排除)

别名:Flow (opens new window)

# genericTypeAnnotation

JavaScript

t.genericTypeAnnotation(id, typeParameters);

另见t.isGenericTypeAnnotation(node, opts)t.assertGenericTypeAnnotation(node, opts)

AST节点GenericTypeAnnotation形状:

  • id: Identifier | QualifiedTypeIdentifier(必填)
  • typeParameters: TypeParameterInstantiation(默认: js)

别名: Flow ,FlowType (opens new window)

# 标识符

JavaScript

t.identifier(name);

另见t.isIdentifier(node, opts)t.assertIdentifier(node, opts)

AST节点Identifier形状:

  • name: string(必填)
  • decorators:(Array<Decorator>默认值:js,从构建函数中排除)
  • optional:(boolean默认值:js,从构建函数中排除)
  • typeAnnotation:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Expression , PatternLike , LVal ,TSEntityName (opens new window)

# if语句

JavaScript

t.ifStatement(test, consequent, alternate);

另见t.isIfStatement(node, opts)t.assertIfStatement(node, opts)

AST节点IfStatement形状:

  • test: Expression(必填)
  • consequent: Statement(必填)
  • alternate: Statement(默认: js)

别名:Standardized (opens new window) , Statement ,Conditional (opens new window)

# 导入

JavaScript

t.import();

另见t.isImport(node, opts)t.assertImport(node, opts)

别名: Standardized ,Expression (opens new window)

# 导入属性

JavaScript

t.importAttribute(key, value);

另见t.isImportAttribute(node, opts)t.assertImportAttribute(node, opts)

AST节点ImportAttribute形状:

  • key: Identifier | StringLiteral(必填)
  • value: StringLiteral(必填)

# 进口申报

JavaScript

t.importDeclaration(specifiers, source);

历史| | | | :--- | :--- | | | |

另见t.isImportDeclaration(node, opts)t.assertImportDeclaration(node, opts)

AST节点ImportDeclaration形状:

  • specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>(必填)
  • source: StringLiteral(必填)
  • assertions:(Array<ImportAttribute>默认值:js,从构建函数中排除)
  • importKind:("type" | "typeof" | "value"默认值:js,从构建函数中排除)
  • module:(boolean默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , Statement , Declaration ,ImportOrExportDeclaration (opens new window)

# importDefaultSpecifier

JavaScript

t.importDefaultSpecifier(local);

另见t.isImportDefaultSpecifier(node, opts)t.assertImportDefaultSpecifier(node, opts)

AST节点ImportDefaultSpecifier形状:

  • local: Identifier(必填)

别名: Standardized ,ModuleSpecifier (opens new window)

# importNamespaceSpecifier

JavaScript

t.importNamespaceSpecifier(local);

另见t.isImportNamespaceSpecifier(node, opts)t.assertImportNamespaceSpecifier(node, opts)

AST节点ImportNamespaceSpecifier形状:

  • local: Identifier(必填)

别名: Standardized ,ModuleSpecifier (opens new window)

# 导入说明符

JavaScript

t.importSpecifier(local, imported);

另见t.isImportSpecifier(node, opts)t.assertImportSpecifier(node, opts)

AST节点ImportSpecifier形状:

  • local: Identifier(必填)
  • imported: Identifier | StringLiteral(必填)
  • importKind:("type" | "typeof" | "value"默认值:js,从构建函数中排除)

别名: Standardized ,ModuleSpecifier (opens new window)

# indexedAccessType

JavaScript

t.indexedAccessType(objectType, indexType);

另见t.isIndexedAccessType(node, opts)t.assertIndexedAccessType(node, opts)

AST节点IndexedAccessType形状:

  • objectType: FlowType(必填)
  • indexType: FlowType(必填)

别名: Flow ,FlowType (opens new window)

# 推断谓词

JavaScript

t.inferredPredicate();

另见t.isInferredPredicate(node, opts)t.assertInferredPredicate(node, opts)

别名: Flow ,FlowPredicate (opens new window)

# 接口声明

JavaScript

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

另见t.isInterfaceDeclaration(node, opts)t.assertInterfaceDeclaration(node, opts)

AST节点InterfaceDeclaration形状:

  • id: Identifier(必填)
  • typeParameters: TypeParameterDeclaration(默认: js)
  • extends: Array<InterfaceExtends>(默认: js)
  • body: ObjectTypeAnnotation(必填)
  • implements:(Array<ClassImplements>默认值:js,从构建函数中排除)
  • mixins:(Array<InterfaceExtends>默认值:js,从构建函数中排除)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# 接口扩展

JavaScript

t.interfaceExtends(id, typeParameters);

另见t.isInterfaceExtends(node, opts)t.assertInterfaceExtends(node, opts)

AST节点InterfaceExtends形状:

  • id: Identifier | QualifiedTypeIdentifier(必填)
  • typeParameters: TypeParameterInstantiation(默认: js)

别名:Flow (opens new window)

# 接口类型注解

JavaScript

t.interfaceTypeAnnotation(extends, body);

另见t.isInterfaceTypeAnnotation(node, opts)t.assertInterfaceTypeAnnotation(node, opts)

AST节点InterfaceTypeAnnotation形状:

  • extends: Array<InterfaceExtends>(默认: js)
  • body: ObjectTypeAnnotation(必填)

别名: Flow ,FlowType (opens new window)

# 解释器指令

JavaScript

t.interpreterDirective(value);

另见t.isInterpreterDirective(node, opts)t.assertInterpreterDirective(node, opts)

AST节点InterpreterDirective形状:

  • value: string(必填)

别名:Standardized (opens new window)

# intersectionTypeAnnotation

JavaScript

t.intersectionTypeAnnotation(types);

另见t.isIntersectionTypeAnnotation(node, opts)t.assertIntersectionTypeAnnotation(node, opts)

AST节点IntersectionTypeAnnotation形状:

  • types: Array<FlowType>(必填)

别名: Flow ,FlowType (opens new window)

# jsx属性

JavaScript

t.jsxAttribute(name, value);

另见t.isJSXAttribute(node, opts)t.assertJSXAttribute(node, opts)

AST节点JSXAttribute形状:

  • name: JSXIdentifier | JSXNamespacedName(必填)
  • value: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer(默认: js)

别名: JSX ,Immutable (opens new window)

# jsxClosingElement

JavaScript

t.jsxClosingElement(name);

另见t.isJSXClosingElement(node, opts)t.assertJSXClosingElement(node, opts)

AST节点JSXClosingElement形状:

  • name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName(必填)

别名: JSX ,Immutable (opens new window)

# jsxClosingFragment

JavaScript

t.jsxClosingFragment();

另见t.isJSXClosingFragment(node, opts)t.assertJSXClosingFragment(node, opts)

别名: JSX ,Immutable (opens new window)

# jsx元素

JavaScript

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

另见t.isJSXElement(node, opts)t.assertJSXElement(node, opts)

AST节点JSXElement形状:

  • openingElement: JSXOpeningElement(必填)
  • closingElement: JSXClosingElement(默认: js)
  • children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>(必填)
  • selfClosing: boolean(默认: js)

别名:JSX (opens new window) , Immutable ,Expression (opens new window)

# jsxEmptyExpression

JavaScript

t.jsxEmptyExpression();

另见t.isJSXEmptyExpression(node, opts)t.assertJSXEmptyExpression(node, opts)

别名:JSX (opens new window)

# jsxExpressionContainer

JavaScript

t.jsxExpressionContainer(expression);

另见t.isJSXExpressionContainer(node, opts)t.assertJSXExpressionContainer(node, opts)

AST节点JSXExpressionContainer形状:

  • expression: Expression | JSXEmptyExpression(必填)

别名: JSX ,Immutable (opens new window)

# jsx片段

JavaScript

t.jsxFragment(openingFragment, closingFragment, children);

另见t.isJSXFragment(node, opts)t.assertJSXFragment(node, opts)

AST节点JSXFragment形状:

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

别名:JSX (opens new window) , Immutable ,Expression (opens new window)

# jsx标识符

JavaScript

t.jsxIdentifier(name);

另见t.isJSXIdentifier(node, opts)t.assertJSXIdentifier(node, opts)

AST节点JSXIdentifier形状:

  • name: string(必填)

别名:JSX (opens new window)

# jsxMemberExpression

JavaScript

t.jsxMemberExpression(object, property);

另见t.isJSXMemberExpression(node, opts)t.assertJSXMemberExpression(node, opts)

AST节点JSXMemberExpression形状:

  • object: JSXMemberExpression | JSXIdentifier(必填)
  • property: JSXIdentifier(必填)

别名:JSX (opens new window)

# jsxNamespacedName

JavaScript

t.jsxNamespacedName(namespace, name);

另见t.isJSXNamespacedName(node, opts)t.assertJSXNamespacedName(node, opts)

AST节点JSXNamespacedName形状:

  • namespace: JSXIdentifier(必填)
  • name: JSXIdentifier(必填)

别名:JSX (opens new window)

# jsxOpeningElement

JavaScript

t.jsxOpeningElement(name, attributes, selfClosing);

另见t.isJSXOpeningElement(node, opts)t.assertJSXOpeningElement(node, opts)

AST节点JSXOpeningElement形状:

  • name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName(必填)
  • attributes: Array<JSXAttribute | JSXSpreadAttribute>(必填)
  • selfClosing: boolean(默认: false)
  • typeParameters:(TypeParameterInstantiation | TSTypeParameterInstantiation默认值:js,从构建函数中排除)

别名: JSX ,Immutable (opens new window)

# jsxOpeningFragment

JavaScript

t.jsxOpeningFragment();

另见t.isJSXOpeningFragment(node, opts)t.assertJSXOpeningFragment(node, opts)

别名: JSX ,Immutable (opens new window)

# jsxSpreadAttribute

JavaScript

t.jsxSpreadAttribute(argument);

另见t.isJSXSpreadAttribute(node, opts)t.assertJSXSpreadAttribute(node, opts)

AST节点JSXSpreadAttribute形状:

  • argument: Expression(必填)

别名:JSX (opens new window)

# jsxSpreadChild

JavaScript

t.jsxSpreadChild(expression);

另见t.isJSXSpreadChild(node, opts)t.assertJSXSpreadChild(node, opts)

AST节点JSXSpreadChild形状:

  • expression: Expression(必填)

别名: JSX ,Immutable (opens new window)

# jsx文本

JavaScript

t.jsxText(value);

另见t.isJSXText(node, opts)t.assertJSXText(node, opts)

AST节点JSXText形状:

  • value: string(必填)

别名: JSX ,Immutable (opens new window)

# 标签声明

JavaScript

t.labeledStatement(label, body);

另见t.isLabeledStatement(node, opts)t.assertLabeledStatement(node, opts)

AST节点LabeledStatement形状:

  • label: Identifier(必填)
  • body: Statement(必填)

别名: Standardized ,Statement (opens new window)

# 逻辑表达式

JavaScript

t.logicalExpression(operator, left, right);

另见t.isLogicalExpression(node, opts)t.assertLogicalExpression(node, opts)

AST节点LogicalExpression形状:

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

别名:Standardized (opens new window) , Binary ,Expression (opens new window)

# 成员表达式

JavaScript

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

另见t.isMemberExpression(node, opts)t.assertMemberExpression(node, opts)

AST节点MemberExpression形状:

  • object: Expression | Super(必填)
  • property: if computed then Expressionelse Identifier(必填)
  • computed: boolean(默认: false)
  • optional: true | false(默认: js)

别名:Standardized (opens new window) , Expression ,LVal (opens new window)

# 元属性

JavaScript

t.metaProperty(meta, property);

另见t.isMetaProperty(node, opts)t.assertMetaProperty(node, opts)

AST节点MetaProperty形状:

  • meta: Identifier(必填)
  • property: Identifier(必填)

别名: Standardized ,Expression (opens new window)

# 混合类型注解

JavaScript

t.mixedTypeAnnotation();

另见t.isMixedTypeAnnotation(node, opts)t.assertMixedTypeAnnotation(node, opts)

别名:Flow (opens new window) , FlowType ,FlowBaseAnnotation (opens new window)

# 模块表达式

JavaScript

t.moduleExpression(body);

另见t.isModuleExpression(node, opts)t.assertModuleExpression(node, opts)

AST节点ModuleExpression形状:

  • body: Program(必填)

别名:Expression (opens new window)

# 新表达式

JavaScript

t.newExpression(callee, arguments);

另见t.isNewExpression(node, opts)t.assertNewExpression(node, opts)

AST节点NewExpression形状:

  • callee: Expression | Super | V8IntrinsicIdentifier(必填)
  • arguments: Array<Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder>(必填)
  • optional:(true | false默认值:js,从构建函数中排除)
  • typeArguments:(TypeParameterInstantiation默认值:js,从构建函数中排除)
  • typeParameters:(TSTypeParameterInstantiation默认值:js,从构建函数中排除)

别名: Standardized ,Expression (opens new window)

# 没有

JavaScript

t.noop();

另见t.isNoop(node, opts)t.assertNoop(node, opts)

别名:Miscellaneous (opens new window)

# 空文字

JavaScript

t.jsLiteral();

另见t.isNullLiteral(node, opts)t.assertNullLiteral(node, opts)

别名:Standardized (opens new window) , Expression , Pureish , Literal ,Immutable (opens new window)

# jsLiteralTypeAnnotation

JavaScript

t.jsLiteralTypeAnnotation();

另见t.isNullLiteralTypeAnnotation(node, opts)t.assertNullLiteralTypeAnnotation(node, opts)

别名:Flow (opens new window) , FlowType ,FlowBaseAnnotation (opens new window)

# jsableTypeAnnotation

JavaScript

t.jsableTypeAnnotation(typeAnnotation);

另见t.isNullableTypeAnnotation(node, opts)t.assertNullableTypeAnnotation(node, opts)

AST节点NullableTypeAnnotation形状:

  • typeAnnotation: FlowType(必填)

别名: Flow ,FlowType (opens new window)

# numberLiteralTypeAnnotation

JavaScript

t.numberLiteralTypeAnnotation(value);

另见t.isNumberLiteralTypeAnnotation(node, opts)t.assertNumberLiteralTypeAnnotation(node, opts)

AST节点NumberLiteralTypeAnnotation形状:

  • value: number(必填)

别名: Flow ,FlowType (opens new window)

# 数字类型注解

JavaScript

t.numberTypeAnnotation();

另见t.isNumberTypeAnnotation(node, opts)t.assertNumberTypeAnnotation(node, opts)

别名:Flow (opens new window) , FlowType ,FlowBaseAnnotation (opens new window)

# 数字字面量

JavaScript

t.numericLiteral(value);

另见t.isNumericLiteral(node, opts)t.assertNumericLiteral(node, opts)

AST节点NumericLiteral形状:

  • value: number(必填)

别名:Standardized (opens new window) , Expression , Pureish , Literal ,Immutable (opens new window)

# 对象表达式

JavaScript

t.objectExpression(properties);

另见t.isObjectExpression(node, opts)t.assertObjectExpression(node, opts)

AST节点ObjectExpression形状:

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

别名: Standardized ,Expression (opens new window)

# 对象方法

JavaScript

t.objectMethod(kind, key, params, body, computed, generator, async);

另见t.isObjectMethod(node, opts)t.assertObjectMethod(node, opts)

AST节点ObjectMethod形状:

  • kind: "method" | "get" | "set"(默认: 'method')
  • key: if computed then Expressionelse Identifier | Literal(必填)
  • params: Array<Identifier | Pattern | RestElement>(必填)
  • body: BlockStatement(必填)
  • computed: boolean(默认: false)
  • generator: boolean(默认: false)
  • async: boolean(默认: false)
  • decorators:(Array<Decorator>默认值:js,从构建函数中排除)
  • returnType:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)
  • typeParameters:(TypeParameterDeclaration | TSTypeParameterDeclaration | Noop默认值:js,从构建函数中排除)

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

# objectPattern

JavaScript

t.objectPattern(properties);

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

AST Node ObjectPatternshape:

  • properties: Array<RestElement | ObjectProperty>(required)
  • decorators: Array<Decorator>(default: js, excluded from builder function)
  • optional: boolean(default: js, excluded from builder function)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop(default: js, excluded from builder function)

Aliases: Standardized , Pattern , PatternLike , LVal

# objectProperty

JavaScript

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

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

AST Node ObjectPropertyshape:

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

Aliases: Standardized , UserWhitespacable , Property , ObjectMember

# objectTypeAnnotation

JavaScript

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

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

AST Node ObjectTypeAnnotationshape:

  • properties: Array<ObjectTypeProperty | ObjectTypeSpreadProperty>(required)
  • indexers: Array<ObjectTypeIndexer>(default: [])
  • callProperties: Array<ObjectTypeCallProperty>(default: [])
  • internalSlots: Array<ObjectTypeInternalSlot>(default: [])
  • exact: boolean(default: false)
  • inexact: boolean(default: js, excluded from builder function)

Aliases: Flow , FlowType

# objectTypeCallProperty

JavaScript

t.objectTypeCallProperty(value);

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

AST Node ObjectTypeCallPropertyshape:

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

Aliases: Flow , UserWhitespacable

# objectTypeIndexer

JavaScript

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

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

AST Node ObjectTypeIndexershape:

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

Aliases: Flow , UserWhitespacable

# objectTypeInternalSlot

JavaScript

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

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

AST Node ObjectTypeInternalSlotshape:

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

Aliases: Flow , UserWhitespacable

# objectTypeProperty

JavaScript

t.objectTypeProperty(key, value, variance);

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

AST Node ObjectTypePropertyshape:

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

Aliases: Flow , UserWhitespacable

# objectTypeSpreadProperty

JavaScript

t.objectTypeSpreadProperty(argument);

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

AST Node ObjectTypeSpreadPropertyshape:

  • argument: FlowType(required)

Aliases: Flow , UserWhitespacable

# 不透明类型

JavaScript

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

另见t.isOpaqueType(node, opts)t.assertOpaqueType(node, opts)

AST节点OpaqueType形状:

  • id: Identifier(必填)
  • typeParameters: TypeParameterDeclaration(默认: js)
  • supertype: FlowType(默认: js)
  • impltype: FlowType(必填)

别名:Flow (opens new window) , FlowDeclaration , Statement ,Declaration (opens new window)

# optionalCallExpression

JavaScript

t.optionalCallExpression(callee, arguments, optional);

另见t.isOptionalCallExpression(node, opts)t.assertOptionalCallExpression(node, opts)

AST节点OptionalCallExpression形状:

  • callee: Expression(必填)
  • arguments: Array<Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder>(必填)
  • optional: boolean(必填)
  • typeArguments:(TypeParameterInstantiation默认值:js,从构建函数中排除)
  • typeParameters:(TSTypeParameterInstantiation默认值:js,从构建函数中排除)

别名: Standardized ,Expression (opens new window)

# 可选索引访问类型

JavaScript

t.optionalIndexedAccessType(objectType, indexType);

另见t.isOptionalIndexedAccessType(node, opts)t.assertOptionalIndexedAccessType(node, opts)

AST节点OptionalIndexedAccessType形状:

  • objectType: FlowType(必填)
  • indexType: FlowType(必填)
  • optional: boolean(必填)

别名: Flow ,FlowType (opens new window)

# 可选成员表达式

JavaScript

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

另见t.isOptionalMemberExpression(node, opts)t.assertOptionalMemberExpression(node, opts)

AST节点OptionalMemberExpression形状:

  • object: Expression(必填)
  • property: Expression | Identifier(必填)
  • computed: boolean(默认: false)
  • optional: boolean(必填)

别名: Standardized ,Expression (opens new window)

# 括号表达式

JavaScript

t.parenthesizedExpression(expression);

另见t.isParenthesizedExpression(node, opts)t.assertParenthesizedExpression(node, opts)

AST节点ParenthesizedExpression形状:

  • expression: Expression(必填)

别名:Standardized (opens new window) , Expression ,ExpressionWrapper (opens new window)

# pipelineBareFunction

JavaScript

t.pipelineBareFunction(callee);

另见t.isPipelineBareFunction(node, opts)t.assertPipelineBareFunction(node, opts)

AST节点PipelineBareFunction形状:

  • callee: Expression(必填)

别名:Expression (opens new window)

# pipelinePrimaryTopicReference

JavaScript

t.pipelinePrimaryTopicReference();

另见t.isPipelinePrimaryTopicReference(node, opts)t.assertPipelinePrimaryTopicReference(node, opts)

别名:Expression (opens new window)

# pipelineTopicExpression

JavaScript

t.pipelineTopicExpression(expression);

另见t.isPipelineTopicExpression(node, opts)t.assertPipelineTopicExpression(node, opts)

AST节点PipelineTopicExpression形状:

  • expression: Expression(必填)

别名:Expression (opens new window)

# 占位符

JavaScript

t.placeholder(expectedNode, name);

另见t.isPlaceholder(node, opts)t.assertPlaceholder(node, opts)

AST节点Placeholder形状:

  • expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern"(必填)
  • name: Identifier(必填)

别名:Miscellaneous (opens new window)

# 私人姓名

JavaScript

t.privateName(id);

另见t.isPrivateName(node, opts)t.assertPrivateName(node, opts)

AST节点PrivateName形状:

  • id: Identifier(必填)

别名: Standardized ,Private (opens new window)

# 程序

JavaScript

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

另见t.isProgram(node, opts)t.assertProgram(node, opts)

AST节点Program形状:

  • body: Array<Statement>(必填)
  • directives: Array<Directive>(默认: [])
  • sourceType: "script" | "module"(默认: 'script')
  • interpreter: InterpreterDirective(默认: js)
  • sourceFile: string(必填)

别名:Standardized (opens new window) , Scopable , BlockParent ,Block (opens new window)

# 合格类型标识符

JavaScript

t.qualifiedTypeIdentifier(id, qualification);

另见t.isQualifiedTypeIdentifier(node, opts)t.assertQualifiedTypeIdentifier(node, opts)

AST节点QualifiedTypeIdentifier形状:

  • id: Identifier(必填)
  • qualification: Identifier | QualifiedTypeIdentifier(必填)

别名:Flow (opens new window)

# 记录表达式

JavaScript

t.recordExpression(properties);

另见t.isRecordExpression(node, opts)t.assertRecordExpression(node, opts)

AST节点RecordExpression形状:

  • properties: Array<ObjectProperty | SpreadElement>(必填)

别名:Expression (opens new window)

# regExpLiteral

JavaScript

t.regExpLiteral(pattern, flags);

另见t.isRegExpLiteral(node, opts)t.assertRegExpLiteral(node, opts)

AST节点RegExpLiteral形状:

  • pattern: string(必填)
  • flags: string(默认: '')

别名:Standardized (opens new window) , Expression , Pureish ,Literal (opens new window)

# 休息元素

JavaScript

t.restElement(argument);

另见t.isRestElement(node, opts)t.assertRestElement(node, opts)

AST节点RestElement形状:

  • argument: LVal(必填)
  • decorators:(Array<Decorator>默认值:js,从构建函数中排除)
  • optional:(boolean默认值:js,从构建函数中排除)
  • typeAnnotation:(TypeAnnotation | TSTypeAnnotation | Noop默认值:js,从构建函数中排除)

别名:Standardized (opens new window) , LVal ,PatternLike (opens new window)

# 返回语句

JavaScript

t.returnStatement(argument);

另见t.isReturnStatement(node, opts)t.assertReturnStatement(node, opts)

AST节点ReturnStatement形状:

  • argument: Expression(默认: js)

别名:Standardized (opens new window) , Statement , Terminatorless ,CompletionStatement (opens new window)

# 序列表达式

JavaScript

t.sequenceExpression(expressions);

另见t.isSequenceExpression(node, opts)t.assertSequenceExpression(node, opts)

AST节点SequenceExpression形状:

  • expressions: Array<Expression>(必填)

别名: Standardized ,Expression (opens new window)

# 传播元素

JavaScript

t.spreadElement(argument);

另见t.isSpreadElement(node, opts)t.assertSpreadElement(node, opts)

AST节点SpreadElement形状:

  • argument: Expression(必填)

别名: Standardized ,UnaryLike (opens new window)

# 静态块

JavaScript

t.staticBlock(body);

另见t.isStaticBlock(node, opts)t.assertStaticBlock(node, opts)

AST节点StaticBlock形状:

  • body: Array<Statement>(必填)

别名:Standardized (opens new window) , Scopable , BlockParent ,FunctionParent (opens new window)

# 字符串文字

JavaScript

t.stringLiteral(value);

另见t.isStringLiteral(node, opts)t.assertStringLiteral(node, opts)

AST节点StringLiteral形状:

  • value: string(必填)

别名:Standardized (opens new window) , Expression , Pureish , Literal ,Immutable (opens new window)

# stringLiteralTypeAnnotation

JavaScript

t.stringLiteralTypeAnnotation(value);

另见t.isStringLiteralTypeAnnotation(node, opts)t.assertStringLiteralTypeAnnotation(node, opts)

AST节点StringLiteralTypeAnnotation形状:

  • value: string(必填)

别名: Flow ,FlowType (opens new window)

# stringTypeAnnotation

JavaScript

t.stringTypeAnnotation();

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

Aliases: Flow , FlowType , FlowBaseAnnotation

# super

JavaScript

t.super();

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

Aliases: Standardized , Expression

# switchCase

JavaScript

t.switchCase(test, consequent);

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

AST Node SwitchCaseshape:

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

Aliases: Standardized

# switchStatement

JavaScript

t.switchStatement(discriminant, cases);

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

AST Node SwitchStatementshape:

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

Aliases: Standardized , Statement , BlockParent , Scopable

# symbolTypeAnnotation

JavaScript

t.symbolTypeAnnotation();

See also t.isSymbolTypeAnnotation(node, opts)and t.assertSymbolTypeAnnotation(node, opts).

Aliases: Flow , FlowType , FlowBaseAnnotation

# tsAnyKeyword

JavaScript

t.tsAnyKeyword();

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

Aliases: TypeScript , TSType , TSBaseType

# tsArrayType

JavaScript

t.tsArrayType(elementType);

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

AST Node TSArrayTypeshape:

  • elementType: TSType(required)

Aliases: TypeScript , TSType

# tsAsExpression

JavaScript

t.tsAsExpression(expression, typeAnnotation);

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

AST Node TSAsExpressionshape:

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

Aliases: TypeScript , Expression , LVal , PatternLike

# tsBigIntKeyword

JavaScript

t.tsBigIntKeyword();

See also t.isTSBigIntKeyword(node, opts)and t.assertTSBigIntKeyword(node, opts).

Aliases: TypeScript , TSType , TSBaseType

# tsBooleanKeyword

JavaScript

t.tsBooleanKeyword();

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

Aliases: TypeScript , TSType , TSBaseType

# tsCallSignatureDeclaration

JavaScript

t.tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation);

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

AST Node TSCallSignatureDeclarationshape:

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

Aliases: TypeScript , TSTypeElement

# tsConditionalType

JavaScript

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

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

AST Node TSConditionalTypeshape:

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

Aliases: TypeScript , TSType

# tsConstructSignatureDeclaration

JavaScript

t.tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation);

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

AST Node TSConstructSignatureDeclarationshape:

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

Aliases: TypeScript , TSTypeElement

# tsConstructorType

JavaScript

t.tsConstructorType(typeParameters, parameters, typeAnnotation);

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

AST Node TSConstructorTypeshape:

  • typeParameters: TSTypeParameterDeclaration(default: js)
  • parameters: Array<Identifier | RestElement>(required)
  • typeAnnotation: TSTypeAnnotation(default: js)
  • abstract: boolean(default: js, excluded from builder function)

Aliases: TypeScript , TSType

# tsDeclareFunction

JavaScript

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

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

AST Node TSDeclareFunctionshape:

  • id: Identifier(default: js)
  • typeParameters: TSTypeParameterDeclaration | Noop(default: js)
  • params: Array<Identifier | Pattern | RestElement>(required)
  • returnType: TSTypeAnnotation | Noop(default: js)
  • async: boolean(default: false, excluded from builder function)
  • declare: boolean(default: js, excluded from builder function)
  • generator: boolean(default: false, excluded from builder function)

Aliases: TypeScript , Statement , Declaration

# tsDeclareMethod

JavaScript

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

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

AST Node TSDeclareMethodshape:

  • decorators: Array<Decorator>(default: js)
  • key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression(required)
  • typeParameters: TSTypeParameterDeclaration | Noop(default: js)
  • params: Array<Identifier | Pattern | RestElement | TSParameterProperty>(required)
  • returnType: TSTypeAnnotation | Noop(default: js)
  • abstract: boolean(default: js, excluded from builder function)
  • access: "public" | "private" | "protected"(default: js, excluded from builder function)
  • accessibility: "public" | "private" | "protected"(default: js, excluded from builder function)
  • async: boolean(default: false, excluded from builder function)
  • computed: boolean(default: false, excluded from builder function)
  • generator: boolean(default: false, excluded from builder function)
  • kind: "get" | "set" | "method" | "constructor"(default: 'method', excluded from builder function)
  • optional: boolean(default: js, excluded from builder function)
  • override: boolean(default: false, excluded from builder function)
  • static: boolean(default: false, excluded from builder function)

Aliases: TypeScript

# tsEnumDeclaration

JavaScript

t.tsEnumDeclaration(id, members);

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

AST Node TSEnumDeclarationshape:

  • id: Identifier(required)
  • members: Array<TSEnumMember>(required)
  • const: boolean(default: js, excluded from builder function)
  • declare: boolean(default: js, excluded from builder function)
  • initializer: Expression(default: js, excluded from builder function)

Aliases: TypeScript , Statement , Declaration

# tsEnumMember

JavaScript

t.tsEnumMember(id, initializer);

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

AST Node TSEnumMembershape:

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

Aliases: TypeScript

# tsExportAssignment

JavaScript

t.tsExportAssignment(expression);

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

AST Node TSExportAssignmentshape:

  • expression: Expression(required)

Aliases: TypeScript , Statement

# tsExpressionWithTypeArguments

JavaScript

t.tsExpressionWithTypeArguments(expression, typeParameters);

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

AST Node TSExpressionWithTypeArgumentsshape:

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

Aliases: TypeScript , TSType

# tsExternalModuleReference

JavaScript

t.tsExternalModuleReference(expression);

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

AST Node TSExternalModuleReferenceshape:

  • expression: StringLiteral(required)

Aliases: TypeScript

# tsFunctionType

JavaScript

t.tsFunctionType(typeParameters, parameters, typeAnnotation);

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

AST Node TSFunctionTypeshape:

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

Aliases: TypeScript , TSType

# tsImportEqualsDeclaration

JavaScript

t.tsImportEqualsDeclaration(id, moduleReference);

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

AST Node TSImportEqualsDeclarationshape:

  • id: Identifier(required)
  • moduleReference: TSEntityName | TSExternalModuleReference(required)
  • importKind: "type" | "value"(default: js, excluded from builder function)
  • isExport: boolean(required)

Aliases: TypeScript , Statement

# tsImportType

JavaScript

t.tsImportType(argument, qualifier, typeParameters);

See also t.isTSImportType(node, opts)and t.assertTSImportType(node, opts).

AST Node TSImportTypeshape:

  • argument: StringLiteral(required)
  • qualifier: TSEntityName(default: js)
  • typeParameters: TSTypeParameterInstantiation(default: js)

Aliases: TypeScript , TSType

# tsIndexSignature

JavaScript

t.tsIndexSignature(parameters, typeAnnotation);

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

AST Node TSIndexSignatureshape:

  • parameters: Array<Identifier>(required)
  • typeAnnotation: TSTypeAnnotation(default: js)
  • readonly: boolean(default: js, excluded from builder function)
  • static: boolean(default: js, excluded from builder function)

Aliases: TypeScript , TSTypeElement

# tsIndexedAccessType

JavaScript

t.tsIndexedAccessType(objectType, indexType);

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

AST Node TSIndexedAccessTypeshape:

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

Aliases: TypeScript , TSType

# tsInferType

JavaScript

t.tsInferType(typeParameter);

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

AST Node TSInferTypeshape:

  • typeParameter: TSTypeParameter(required)

Aliases: TypeScript , TSType

# tsInstantiationExpression

JavaScript

t.tsInstantiationExpression(expression, typeParameters);

See also t.isTSInstantiationExpression(node, opts)and t.assertTSInstantiationExpression(node, opts).

AST Node TSInstantiationExpressionshape:

  • expression: Expression(required)
  • typeParameters: TSTypeParameterInstantiation(default: js)

Aliases: TypeScript , Expression

# tsInterfaceBody

JavaScript

t.tsInterfaceBody(body);

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

AST Node TSInterfaceBodyshape:

  • body: Array<TSTypeElement>(required)

Aliases: TypeScript

# tsInterfaceDeclaration

JavaScript

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

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

AST Node TSInterfaceDeclarationshape:

  • id: Identifier(required)
  • typeParameters: TSTypeParameterDeclaration(default: js)
  • extends: Array<TSExpressionWithTypeArguments>(default: js)
  • body: TSInterfaceBody(required)
  • declare: boolean(default: js, excluded from builder function)

Aliases: TypeScript , Statement , Declaration

# tsIntersectionType

JavaScript

t.tsIntersectionType(types);

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

AST Node TSIntersectionTypeshape:

  • types: Array<TSType>(required)

Aliases: TypeScript , TSType

# tsIntrinsicKeyword

JavaScript

t.tsIntrinsicKeyword();

See also t.isTSIntrinsicKeyword(node, opts)and t.assertTSIntrinsicKeyword(node, opts).

Aliases: TypeScript , TSType , TSBaseType

# tsLiteralType

JavaScript

t.tsLiteralType(literal);

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

AST Node TSLiteralTypeshape:

  • literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TemplateLiteral | UnaryExpression(required)

Aliases: TypeScript , TSType , TSBaseType

# tsMappedType

JavaScript

t.tsMappedType(typeParameter, typeAnnotation, nameType);

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

AST Node TSMappedTypeshape:

  • typeParameter: TSTypeParameter(required)
  • typeAnnotation: TSType(default: js)
  • nameType: TSType(default: js)
  • optional: true | false | "+" | "-"(default: js, excluded from builder function)
  • readonly: true | false | "+" | "-"(default: js, excluded from builder function)

Aliases: TypeScript , TSType

# tsMethodSignature

JavaScript

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

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

AST Node TSMethodSignatureshape:

  • key: Expression(required)
  • typeParameters: TSTypeParameterDeclaration(default: js)
  • parameters: Array<Identifier | RestElement>(required)
  • typeAnnotation: TSTypeAnnotation(default: js)
  • computed: boolean(default: false, excluded from builder function)
  • kind: "method" | "get" | "set"(required)
  • optional: boolean(default: js, excluded from builder function)

Aliases: TypeScript , TSTypeElement

# tsModuleBlock

JavaScript

t.tsModuleBlock(body);

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

AST Node TSModuleBlockshape:

  • body: Array<Statement>(required)

Aliases: TypeScript , Scopable , Block , BlockParent , FunctionParent

# tsModuleDeclaration

JavaScript

t.tsModuleDeclaration(id, body);

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

AST Node TSModuleDeclarationshape:

  • id: Identifier | StringLiteral(required)
  • body: TSModuleBlock | TSModuleDeclaration(required)
  • declare: boolean(default: js, excluded from builder function)
  • global: boolean(default: js, excluded from builder function)

Aliases: TypeScript , Statement , Declaration

# tsNamedTupleMember

JavaScript

t.tsNamedTupleMember(label, elementType, optional);

See also t.isTSNamedTupleMember(node, opts)and t.assertTSNamedTupleMember(node, opts).

AST Node TSNamedTupleMembershape:

  • label: Identifier(required)
  • elementType: TSType(required)
  • optional: boolean(default: false)

Aliases: TypeScript

# tsNamespaceExportDeclaration

JavaScript

t.tsNamespaceExportDeclaration(id);

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

AST Node TSNamespaceExportDeclarationshape:

  • id: Identifier(required)

Aliases: TypeScript , Statement

# tsNeverKeyword

JavaScript

t.tsNeverKeyword();

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

Aliases: TypeScript , TSType , TSBaseType

# tsNonNullExpression

JavaScript

t.tsNonNullExpression(expression);

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

AST Node TSNonNullExpressionshape:

  • expression: Expression(required)

Aliases: TypeScript , Expression , LVal , PatternLike

# tsNullKeyword

JavaScript

t.tsNullKeyword();

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

Aliases: TypeScript , TSType , TSBaseType

# tsNumberKeyword

JavaScript

t.tsNumberKeyword();

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

Aliases: TypeScript , TSType , TSBaseType

# tsObjectKeyword

JavaScript

t.tsObjectKeyword();

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

Aliases: TypeScript , TSType , TSBaseType

# tsOptionalType

JavaScript

t.tsOptionalType(typeAnnotation);

See also t.isTSOptionalType(node, opts)and t.assertTSOptionalType(node, opts).

AST Node TSOptionalTypeshape:

  • typeAnnotation: TSType(required)

Aliases: TypeScript , TSType

# tsParameterProperty

JavaScript

t.tsParameterProperty(parameter);

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

AST Node TSParameterPropertyshape:

  • parameter: Identifier | AssignmentPattern(required)
  • accessibility: "public" | "private" | "protected"(default: js, excluded from builder function)
  • decorators: Array<Decorator>(default: js, excluded from builder function)
  • override: boolean(default: js, excluded from builder function)
  • readonly: boolean(default: js, excluded from builder function)

Aliases: TypeScript , LVal

# tsParenthesizedType

JavaScript

t.tsParenthesizedType(typeAnnotation);

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

AST Node TSParenthesizedTypeshape:

  • typeAnnotation: TSType(required)

Aliases: TypeScript , TSType

# tsPropertySignature

JavaScript

t.tsPropertySignature(key, typeAnnotation, initializer);

另见t.isTSPropertySignature(node, opts)t.assertTSPropertySignature(node, opts)

AST节点TSPropertySignature形状:

  • key: Expression(必填)
  • typeAnnotation: TSTypeAnnotation(默认: js)
  • initializer: Expression(默认: js)
  • computed:(boolean默认值:false,从构建函数中排除)
  • kind: "get" | "set"(必填)
  • optional:(boolean默认值:js,从构建函数中排除)
  • readonly:(boolean默认值:js,从构建函数中排除)

别名: TypeScript ,TSTypeElement (opens new window)

# ts合格名称

JavaScript

t.tsQualifiedName(left, right);

另见t.isTSQualifiedName(node, opts)t.assertTSQualifiedName(node, opts)

AST节点TSQualifiedName形状:

  • left: TSEntityName(必填)
  • right: Identifier(必填)

别名: TypeScript ,TSEntityName (opens new window)

# tsRestType

JavaScript

t.tsRestType(typeAnnotation);

另见t.isTSRestType(node, opts)t.assertTSRestType(node, opts)

AST节点TSRestType形状:

  • typeAnnotation: TSType(必填)

别名: TypeScript ,TSType (opens new window)

# tsSatisfiesExpression

JavaScript

t.tsSatisfiesExpression(expression, typeAnnotation);

历史| | | | :--- | :--- | | ``| |

另见t.isTSSatisfiesExpression(node, opts)t.assertTSSatisfiesExpression(node, opts)

AST节点TSSatisfiesExpression形状:

  • expression: Expression(必填)
  • typeAnnotation: TSType(必填)

别名:TypeScript (opens new window) , Expression , LVal ,PatternLike (opens new window)

# tsString关键字

JavaScript

t.tsStringKeyword();

另见t.isTSStringKeyword(node, opts)t.assertTSStringKeyword(node, opts)

别名:TypeScript (opens new window) , TSType ,TSBaseType (opens new window)

# ts符号关键字

JavaScript

t.tsSymbolKeyword();

另见t.isTSSymbolKeyword(node, opts)t.assertTSSymbolKeyword(node, opts)

别名:TypeScript (opens new window) , TSType ,TSBaseType (opens new window)

# tsThisType

JavaScript

t.tsThisType();

另见t.isTSThisType(node, opts)t.assertTSThisType(node, opts)

别名:TypeScript (opens new window) , TSType ,TSBaseType (opens new window)

# ts元组类型

JavaScript

t.tsTupleType(elementTypes);

另见t.isTSTupleType(node, opts)t.assertTSTupleType(node, opts)

AST节点TSTupleType形状:

  • elementTypes: Array<TSType | TSNamedTupleMember>(必填)

别名: TypeScript ,TSType (opens new window)

# tsTypeAliasDeclaration

JavaScript

t.tsTypeAliasDeclaration(id, typeParameters, typeAnnotation);

另见t.isTSTypeAliasDeclaration(node, opts)t.assertTSTypeAliasDeclaration(node, opts)

AST节点TSTypeAliasDeclaration形状:

  • id: Identifier(必填)
  • typeParameters: TSTypeParameterDeclaration(默认: js)
  • typeAnnotation: TSType(必填)
  • declare:(boolean默认值:js,从构建函数中排除)

别名:TypeScript (opens new window) , Statement ,Declaration (opens new window)

# tsTypeAnnotation

JavaScript

t.tsTypeAnnotation(typeAnnotation);

另见t.isTSTypeAnnotation(node, opts)t.assertTSTypeAnnotation(node, opts)

AST节点TSTypeAnnotation形状:

  • typeAnnotation: TSType(必填)

别名:TypeScript (opens new window)

# tsTypeAssertion

JavaScript

t.tsTypeAssertion(typeAnnotation, expression);

另见t.isTSTypeAssertion(node, opts)t.assertTSTypeAssertion(node, opts)

AST节点TSTypeAssertion形状:

  • typeAnnotation: TSType(必填)
  • expression: Expression(必填)

别名:TypeScript (opens new window) , Expression , LVal ,PatternLike (opens new window)

# tsType文字

JavaScript

t.tsTypeLiteral(members);

另见t.isTSTypeLiteral(node, opts)t.assertTSTypeLiteral(node, opts)

AST节点TSTypeLiteral形状:

  • members: Array<TSTypeElement>(必填)

别名: TypeScript ,TSType (opens new window)

# tsTypeOperator

JavaScript

t.tsTypeOperator(typeAnnotation);

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

AST Node TSTypeOperatorshape:

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

Aliases: TypeScript , TSType

# tsTypeParameter

JavaScript

t.tsTypeParameter(constraint, default, name);

History| | | | :--- | :--- | | | |

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

AST Node TSTypeParametershape:

  • constraint: TSType(default: js)
  • default: TSType(default: js)
  • name: string(required)
  • const: boolean(default: js, excluded from builder function)
  • in: boolean(default: js, excluded from builder function)
  • out: boolean(default: js, excluded from builder function)

Aliases: TypeScript

# tsTypeParameterDeclaration

JavaScript

t.tsTypeParameterDeclaration(params);

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

AST Node TSTypeParameterDeclarationshape:

  • params: Array<TSTypeParameter>(required)

Aliases: TypeScript

# tsTypeParameterInstantiation

JavaScript

t.tsTypeParameterInstantiation(params);

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

AST Node TSTypeParameterInstantiationshape:

  • params: Array<TSType>(required)

Aliases: TypeScript

# tsTypePredicate

JavaScript

t.tsTypePredicate(parameterName, typeAnnotation, asserts);

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

AST Node TSTypePredicateshape:

  • parameterName: Identifier | TSThisType(required)
  • typeAnnotation: TSTypeAnnotation(default: js)
  • asserts: boolean(default: js)

Aliases: TypeScript , TSType

# tsTypeQuery

JavaScript

t.tsTypeQuery(exprName, typeParameters);

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

AST Node TSTypeQueryshape:

  • exprName: TSEntityName | TSImportType(required)
  • typeParameters: TSTypeParameterInstantiation(default: js)

Aliases: TypeScript , TSType

# tsTypeReference

JavaScript

t.tsTypeReference(typeName, typeParameters);

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

AST Node TSTypeReferenceshape:

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

Aliases: TypeScript , TSType

# tsUndefinedKeyword

JavaScript

t.tsUndefinedKeyword();

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

Aliases: TypeScript , TSType , TSBaseType

# tsUnionType

JavaScript

t.tsUnionType(types);

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

AST Node TSUnionTypeshape:

  • types: Array<TSType>(required)

Aliases: TypeScript , TSType

# tsUnknownKeyword

JavaScript

t.tsUnknownKeyword();

See also t.isTSUnknownKeyword(node, opts)and t.assertTSUnknownKeyword(node, opts).

Aliases: TypeScript , TSType , TSBaseType

# tsVoidKeyword

JavaScript

t.tsVoidKeyword();

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

Aliases: TypeScript , TSType , TSBaseType

# taggedTemplateExpression

JavaScript

t.taggedTemplateExpression(tag, quasi);

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

AST Node TaggedTemplateExpressionshape:

  • tag: Expression(required)
  • quasi: TemplateLiteral(required)
  • typeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation(default: js, excluded from builder function)

Aliases: Standardized , Expression

# templateElement

JavaScript

t.templateElement(value, tail);

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

AST Node TemplateElementshape:

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

Aliases: Standardized

# templateLiteral

JavaScript

t.templateLiteral(quasis, expressions);

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

AST Node TemplateLiteralshape:

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

Aliases: Standardized , Expression , Literal

# thisExpression

JavaScript

t.thisExpression();

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

Aliases: Standardized , Expression

# thisTypeAnnotation

JavaScript

t.thisTypeAnnotation();

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

Aliases: Flow , FlowType , FlowBaseAnnotation

# throwStatement

JavaScript

t.throwStatement(argument);

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

AST Node ThrowStatementshape:

  • argument: Expression(required)

Aliases: Standardized , Statement , Terminatorless , CompletionStatement

# topicReference

JavaScript

t.topicReference();

See also t.isTopicReference(node, opts)and t.assertTopicReference(node, opts).

Aliases: Expression

# tryStatement

JavaScript

t.tryStatement(block, handler, finalizer);

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

AST Node TryStatementshape:

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

Aliases: Standardized , Statement

# tupleExpression

JavaScript

t.tupleExpression(elements);

See also t.isTupleExpression(node, opts)and t.assertTupleExpression(node, opts).

AST Node TupleExpressionshape:

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

Aliases: Expression

# tupleTypeAnnotation

JavaScript

t.tupleTypeAnnotation(types);

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

AST Node TupleTypeAnnotationshape:

  • types: Array<FlowType>(required)

Aliases: Flow , FlowType

# typeAlias

JavaScript

t.typeAlias(id, typeParameters, right);

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

AST Node TypeAliasshape:

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

Aliases: Flow , FlowDeclaration , Statement , Declaration

# typeAnnotation

JavaScript

t.typeAnnotation(typeAnnotation);

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

AST Node TypeAnnotationshape:

  • typeAnnotation: FlowType(required)

Aliases: Flow

# typeCastExpression

JavaScript

t.typeCastExpression(expression, typeAnnotation);

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

AST Node TypeCastExpressionshape:

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

Aliases: Flow , ExpressionWrapper , Expression

# typeParameter

JavaScript

t.typeParameter(bound, default, variance);

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

AST Node TypeParametershape:

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

Aliases: Flow

# typeParameterDeclaration

JavaScript

t.typeParameterDeclaration(params);

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

AST Node TypeParameterDeclarationshape:

  • params: Array<TypeParameter>(required)

Aliases: Flow

# typeParameterInstantiation

JavaScript

t.typeParameterInstantiation(params);

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

AST Node TypeParameterInstantiationshape:

  • params: Array<FlowType>(required)

Aliases: Flow

# typeofTypeAnnotation

JavaScript

t.typeofTypeAnnotation(argument);

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

AST Node TypeofTypeAnnotationshape:

  • argument: FlowType(required)

Aliases: Flow , FlowType

# unaryExpression

JavaScript

t.unaryExpression(operator, argument, prefix);

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

AST Node UnaryExpressionshape:

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

Aliases: Standardized , UnaryLike , Expression

# unionTypeAnnotation

JavaScript

t.unionTypeAnnotation(types);

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

AST Node UnionTypeAnnotationshape:

  • types: Array<FlowType>(required)

Aliases: Flow , FlowType

# updateExpression

JavaScript

t.updateExpression(operator, argument, prefix);

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

AST Node UpdateExpressionshape:

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

Aliases: Standardized , Expression

# v8IntrinsicIdentifier

JavaScript

t.v8IntrinsicIdentifier(name);

See also t.isV8IntrinsicIdentifier(node, opts)and t.assertV8IntrinsicIdentifier(node, opts).

AST Node V8IntrinsicIdentifiershape:

  • name: string(required)

Aliases: Miscellaneous

# variableDeclaration

JavaScript

t.variableDeclaration(kind, declarations);

History| | | | :--- | :--- | | | |

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

AST Node VariableDeclarationshape:

  • kind: "var" | "let" | "const" | "using"(required)
  • declarations: Array<VariableDeclarator>(required)
  • declare: boolean(default: js, excluded from builder function)

Aliases: Standardized , Statement , Declaration

# variableDeclarator

JavaScript

t.variableDeclarator(id, init);

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

AST Node VariableDeclaratorshape:

  • id: LVal(required)
  • init: Expression(default: js)
  • definite: boolean(default: js, excluded from builder function)

Aliases: Standardized

# variance

JavaScript

t.variance(kind);

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

AST Node Varianceshape:

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

Aliases: Flow

# voidTypeAnnotation

JavaScript

t.voidTypeAnnotation();

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

Aliases: Flow , FlowType , FlowBaseAnnotation

# whileStatement

JavaScript

t.whileStatement(test, body);

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

AST Node WhileStatementshape:

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

Aliases: Standardized , Statement , BlockParent , Loop , While , Scopable

# withStatement

JavaScript

t.withStatement(object, body);

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

AST Node WithStatementshape:

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

Aliases: Standardized , Statement

# yieldExpression

JavaScript

t.yieldExpression(argument, delegate);

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

AST Node YieldExpressionshape:

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

Aliases: Standardized , Expression , Terminatorless

# Aliases

# Accessor

Deprecated. Will be removed in Babel 8.

JavaScript

t.isAccessor(node);

Covered nodes:

  • ClassAccessorProperty

# Binary

A cover of BinaryExpression and LogicalExpression, which share the same AST shape.

JavaScript

t.isBinary(node);

Covered nodes:

  • BinaryExpression
  • LogicalExpression

# Block

Deprecated. Will be removed in Babel 8.

JavaScript

t.isBlock(node);

Covered nodes:

  • BlockStatement
  • Program
  • TSModuleBlock

# BlockParent

使用新LexicalEnvironment 启动执行上下文的 AST 节点的封面。换句话说,它们定义了范围letconst声明。

JavaScript

t.isBlockParent(node);

覆盖节点:

  • ArrowFunctionExpression
  • BlockStatement
  • CatchClause
  • ClassMethod
  • ClassPrivateMethod
  • DoWhileStatement
  • ForInStatement
  • ForOfStatement
  • ForStatement
  • FunctionDeclaration
  • FunctionExpression
  • ObjectMethod
  • Program
  • StaticBlock
  • SwitchStatement
  • TSModuleBlock
  • WhileStatement

# 班级

ClassExpression 和 ClassDeclaration 的封面,它们共享相同的 AST 形状。

JavaScript

t.isClass(node);

覆盖节点:

  • ClassDeclaration
  • ClassExpression

# 完成声明

表示完成记录的 语句。换句话说,它们定义了程序的控制流,例如循环何时中断或操作何时抛出严重错误。

JavaScript

t.isCompletionStatement(node);

覆盖节点:

  • BreakStatement
  • ContinueStatement
  • ReturnStatement
  • ThrowStatement

# 有条件的

ConditionalExpression 和 IfStatement 的封面,它们共享相同的 AST 形状。

JavaScript

t.isConditional(node);

覆盖节点:

  • ConditionalExpression
  • IfStatement

# 声明

任何声明 的封面。

JavaScript

t.isDeclaration(node);

覆盖节点:

  • ClassDeclaration
  • DeclareClass
  • DeclareExportAllDeclaration
  • DeclareExportDeclaration
  • DeclareFunction
  • DeclareInterface
  • DeclareModule
  • DeclareModuleExports
  • DeclareOpaqueType
  • DeclareTypeAlias
  • DeclareVariable
  • EnumDeclaration
  • ExportAllDeclaration
  • ExportDefaultDeclaration
  • ExportNamedDeclaration
  • FunctionDeclaration
  • ImportDeclaration
  • InterfaceDeclaration
  • OpaqueType
  • TSDeclareFunction
  • TSEnumDeclaration
  • TSInterfaceDeclaration
  • TSModuleDeclaration
  • TSTypeAliasDeclaration
  • TypeAlias
  • VariableDeclaration

# 枚举体

Flow 枚举体的封面。

JavaScript

t.isEnumBody(node);

覆盖节点:

  • EnumBooleanBody
  • EnumNumberBody
  • EnumStringBody
  • EnumSymbolBody

# 枚举成员

Flow 枚举成员的封面。

JavaScript

t.isEnumMember(node);

覆盖节点:

  • EnumBooleanMember
  • EnumDefaultedMember
  • EnumNumberMember
  • EnumStringMember

# 出口报关

任何ExportDeclaration 的封面。

JavaScript

t.isExportDeclaration(node);

覆盖节点:

  • ExportAllDeclaration
  • ExportDefaultDeclaration
  • ExportNamedDeclaration

# 表达

任何Expression 的覆盖。

JavaScript

t.isExpression(node);

覆盖节点:

  • ArrayExpression
  • ArrowFunctionExpression
  • AssignmentExpression
  • AwaitExpression
  • BigIntLiteral
  • BinaryExpression
  • BindExpression
  • BooleanLiteral
  • CallExpression
  • ClassExpression
  • ConditionalExpression
  • DecimalLiteral
  • DoExpression
  • FunctionExpression
  • Identifier
  • Import
  • JSXElement
  • JSXFragment
  • LogicalExpression
  • MemberExpression
  • MetaProperty
  • ModuleExpression
  • NewExpression
  • NullLiteral
  • NumericLiteral
  • ObjectExpression
  • OptionalCallExpression
  • OptionalMemberExpression
  • ParenthesizedExpression
  • PipelineBareFunction
  • PipelinePrimaryTopicReference
  • PipelineTopicExpression
  • RecordExpression
  • RegExpLiteral
  • SequenceExpression
  • StringLiteral
  • Super
  • TSAsExpression
  • TSInstantiationExpression
  • TSNonNullExpression
  • TSSatisfiesExpression
  • TSTypeAssertion
  • TaggedTemplateExpression
  • TemplateLiteral
  • ThisExpression
  • TopicReference
  • TupleExpression
  • TypeCastExpression
  • UnaryExpression
  • UpdateExpression
  • YieldExpression

# 表达式包装器

不具有运行时语义的表达式包装器。

JavaScript

t.isExpressionWrapper(node);

覆盖节点:

  • ExpressionStatement
  • ParenthesizedExpression
  • TypeCastExpression

# 流量

为 Flow 定义的 AST 节点的覆盖。

JavaScript

t.isFlow(node);

覆盖节点:

  • AnyTypeAnnotation
  • ArrayTypeAnnotation
  • BooleanLiteralTypeAnnotation
  • BooleanTypeAnnotation
  • ClassImplements
  • DeclareClass
  • DeclareExportAllDeclaration
  • DeclareExportDeclaration
  • DeclareFunction
  • DeclareInterface
  • DeclareModule
  • DeclareModuleExports
  • DeclareOpaqueType
  • DeclareTypeAlias
  • DeclareVariable
  • DeclaredPredicate
  • EmptyTypeAnnotation
  • EnumBooleanBody
  • EnumBooleanMember
  • EnumDeclaration
  • EnumDefaultedMember
  • EnumNumberBody
  • EnumNumberMember
  • EnumStringBody
  • EnumStringMember
  • EnumSymbolBody
  • ExistsTypeAnnotation
  • FunctionTypeAnnotation
  • FunctionTypeParam
  • GenericTypeAnnotation
  • IndexedAccessType
  • InferredPredicate
  • InterfaceDeclaration
  • InterfaceExtends
  • InterfaceTypeAnnotation
  • IntersectionTypeAnnotation
  • MixedTypeAnnotation
  • NullLiteralTypeAnnotation
  • NullableTypeAnnotation
  • NumberLiteralTypeAnnotation
  • NumberTypeAnnotation
  • ObjectTypeAnnotation
  • ObjectTypeCallProperty
  • ObjectTypeIndexer
  • ObjectTypeInternalSlot
  • ObjectTypeProperty
  • ObjectTypeSpreadProperty
  • OpaqueType
  • OptionalIndexedAccessType
  • QualifiedTypeIdentifier
  • StringLiteralTypeAnnotation
  • StringTypeAnnotation
  • SymbolTypeAnnotation
  • ThisTypeAnnotation
  • TupleTypeAnnotation
  • TypeAlias
  • TypeAnnotation
  • TypeCastExpression
  • TypeParameter
  • TypeParameterDeclaration
  • TypeParameterInstantiation
  • TypeofTypeAnnotation
  • UnionTypeAnnotation
  • Variance
  • VoidTypeAnnotation

# FlowBaseAnnotation

主要流程类型注释的封面。

JavaScript

t.isFlowBaseAnnotation(node);

覆盖节点:

  • AnyTypeAnnotation
  • BooleanTypeAnnotation
  • EmptyTypeAnnotation
  • MixedTypeAnnotation
  • NullLiteralTypeAnnotation
  • NumberTypeAnnotation
  • StringTypeAnnotation
  • SymbolTypeAnnotation
  • ThisTypeAnnotation
  • VoidTypeAnnotation

# 流程声明

Flow 声明的封面。

JavaScript

t.isFlowDeclaration(node);

覆盖节点:

  • DeclareClass
  • DeclareExportAllDeclaration
  • DeclareExportDeclaration
  • DeclareFunction
  • DeclareInterface
  • DeclareModule
  • DeclareModuleExports
  • DeclareOpaqueType
  • DeclareTypeAlias
  • DeclareVariable
  • InterfaceDeclaration
  • OpaqueType
  • TypeAlias

# FlowPredicate

Flow 谓词的覆盖。

JavaScript

t.isFlowPredicate(node);

覆盖节点:

  • DeclaredPredicate
  • InferredPredicate

# 流程类型

Flow 类型注释的封面。

JavaScript

t.isFlowType(node);

覆盖节点:

  • AnyTypeAnnotation
  • ArrayTypeAnnotation
  • BooleanLiteralTypeAnnotation
  • BooleanTypeAnnotation
  • EmptyTypeAnnotation
  • ExistsTypeAnnotation
  • FunctionTypeAnnotation
  • GenericTypeAnnotation
  • IndexedAccessType
  • InterfaceTypeAnnotation
  • IntersectionTypeAnnotation
  • MixedTypeAnnotation
  • NullLiteralTypeAnnotation
  • NullableTypeAnnotation
  • NumberLiteralTypeAnnotation
  • NumberTypeAnnotation
  • ObjectTypeAnnotation
  • OptionalIndexedAccessType
  • StringLiteralTypeAnnotation
  • StringTypeAnnotation
  • SymbolTypeAnnotation
  • ThisTypeAnnotation
  • TupleTypeAnnotation
  • TypeofTypeAnnotation
  • UnionTypeAnnotation
  • VoidTypeAnnotation

# 对于

ForStatementForXStatement (opens new window) 的封面。

JavaScript

t.isFor(node);

覆盖节点:

  • ForInStatement
  • ForOfStatement
  • ForStatement

# ForXStatement

A cover of ForInStatements and ForOfStatements .

JavaScript

t.isForXStatement(node);

Covered nodes:

  • ForInStatement
  • ForOfStatement

# Function

A cover of functions and method s, the must have bodyand params. Note: Functionis different to FunctionParent. For example, a StaticBlockis a FunctionParentbut not Function.

JavaScript

t.isFunction(node);

Covered nodes:

  • ArrowFunctionExpression
  • ClassMethod
  • ClassPrivateMethod
  • FunctionDeclaration
  • FunctionExpression
  • ObjectMethod

# FunctionParent

A cover of AST nodes that start an execution context with new VariableEnvironment . In other words, they define the scope of vardeclarations. FunctionParent did not include Programsince Babel 7.

JavaScript

t.isFunctionParent(node);

Covered nodes:

  • ArrowFunctionExpression
  • ClassMethod
  • ClassPrivateMethod
  • FunctionDeclaration
  • FunctionExpression
  • ObjectMethod
  • StaticBlock
  • TSModuleBlock

# Immutable

A cover of immutable objects and JSX elements. An object is immutable if no other properties can be defined once created.

JavaScript

t.isImmutable(node);

Covered nodes:

  • BigIntLiteral
  • BooleanLiteral
  • DecimalLiteral
  • JSXAttribute
  • JSXClosingElement
  • JSXClosingFragment
  • JSXElement
  • JSXExpressionContainer
  • JSXFragment
  • JSXOpeningElement
  • JSXOpeningFragment
  • JSXSpreadChild
  • JSXText
  • NullLiteral
  • NumericLiteral
  • StringLiteral

# ImportOrExportDeclaration

A cover of ImportDeclaration and ExportDeclaration

JavaScript

t.isImportOrExportDeclaration(node);

Covered nodes:

  • ExportAllDeclaration
  • ExportDefaultDeclaration
  • ExportNamedDeclaration
  • ImportDeclaration

# JSX

A cover of AST nodes defined for JSX .

JavaScript

t.isJSX(node);

Covered nodes:

  • JSXAttribute
  • JSXClosingElement
  • JSXClosingFragment
  • JSXElement
  • JSXEmptyExpression
  • JSXExpressionContainer
  • JSXFragment
  • JSXIdentifier
  • JSXMemberExpression
  • JSXNamespacedName
  • JSXOpeningElement
  • JSXOpeningFragment
  • JSXSpreadAttribute
  • JSXSpreadChild
  • JSXText

# LVal

A cover of left hand side expressions used in the leftof assignment expressions and ForXStatement s.

JavaScript

t.isLVal(node);

Covered nodes:

  • ArrayPattern
  • AssignmentPattern
  • Identifier
  • MemberExpression
  • ObjectPattern
  • RestElement
  • TSAsExpression
  • TSNonNullExpression
  • TSParameterProperty
  • TSSatisfiesExpression
  • TSTypeAssertion

# Literal

A cover of Literal s, Regular Expression Literal s and Template Literal s.

JavaScript

t.isLiteral(node);

Covered nodes:

  • BigIntLiteral
  • BooleanLiteral
  • DecimalLiteral
  • NullLiteral
  • NumericLiteral
  • RegExpLiteral
  • StringLiteral
  • TemplateLiteral

# Loop

A cover of loop statements.

JavaScript

t.isLoop(node);

Covered nodes:

  • DoWhileStatement
  • ForInStatement
  • ForOfStatement
  • ForStatement
  • WhileStatement

# Method

A cover of object methods and class methods.

JavaScript

t.isMethod(node);

Covered nodes:

  • ClassMethod
  • ClassPrivateMethod
  • ObjectMethod

# Miscellaneous

A cover of non-standard AST types that are sometimes useful for development.

JavaScript

t.isMiscellaneous(node);

Covered nodes:

  • Noop
  • Placeholder
  • V8IntrinsicIdentifier

# ModuleDeclaration

History| | | | :--- | :--- | | ``| |

警告 Deprecated, use ImportOrExportDeclaration instead. Check out PR #15266 for migration notes.

JavaScript

t.isModuleDeclaration(node);

Covered nodes:

  • ExportAllDeclaration
  • ExportDefaultDeclaration
  • ExportNamedDeclaration
  • ImportDeclaration

# ModuleSpecifier

A cover of import and export specifiers. Note: It is notthe ModuleSpecifier defined in the spec.

JavaScript

t.isModuleSpecifier(node);

Covered nodes:

  • ExportDefaultSpecifier
  • ExportNamespaceSpecifier
  • ExportSpecifier
  • ImportDefaultSpecifier
  • ImportNamespaceSpecifier
  • ImportSpecifier

# ObjectMember

A cover of members in an object literal.

JavaScript

t.isObjectMember(node);

Covered nodes:

  • ObjectMethod
  • ObjectProperty

# Pattern

A cover of BindingPattern except Identifiers.

JavaScript

t.isPattern(node);

Covered nodes:

  • ArrayPattern
  • AssignmentPattern
  • ObjectPattern

# PatternLike

A cover of BindingPattern s.

JavaScript

t.isPatternLike(node);

Covered nodes:

  • ArrayPattern
  • AssignmentPattern
  • Identifier
  • ObjectPattern
  • RestElement
  • TSAsExpression
  • TSNonNullExpression
  • TSSatisfiesExpression
  • TSTypeAssertion

# Private

A cover of private class elements and private identifiers.

JavaScript

t.isPrivate(node);

Covered nodes:

  • ClassPrivateMethod
  • ClassPrivateProperty
  • PrivateName

# Property

A cover of object properties and class properties.

JavaScript

t.isProperty(node);

Covered nodes:

  • ClassAccessorProperty
  • ClassPrivateProperty
  • ClassProperty
  • ObjectProperty

# Pureish

A cover of AST nodes which do not have side-effects. In other words, there is no observable behaviour changes if they are evaluated more than once.

JavaScript

t.isPureish(node);

Covered nodes:

  • ArrowFunctionExpression
  • BigIntLiteral
  • BooleanLiteral
  • DecimalLiteral
  • FunctionDeclaration
  • FunctionExpression
  • NullLiteral
  • NumericLiteral
  • RegExpLiteral
  • StringLiteral

# Scopable

A cover of FunctionParent and BlockParent .

JavaScript

t.isScopable(node);

Covered nodes:

  • ArrowFunctionExpression
  • BlockStatement
  • CatchClause
  • ClassDeclaration
  • ClassExpression
  • ClassMethod
  • ClassPrivateMethod
  • DoWhileStatement
  • ForInStatement
  • ForOfStatement
  • ForStatement
  • FunctionDeclaration
  • FunctionExpression
  • ObjectMethod
  • Program
  • StaticBlock
  • SwitchStatement
  • TSModuleBlock
  • WhileStatement

# Standardized

A cover of AST nodes which are part of an official ECMAScript specification.

JavaScript

t.isStandardized(node);

Covered nodes:

  • ArrayExpression
  • ArrayPattern
  • ArrowFunctionExpression
  • AssignmentExpression
  • AssignmentPattern
  • AwaitExpression
  • BigIntLiteral
  • BinaryExpression
  • BlockStatement
  • BooleanLiteral
  • BreakStatement
  • CallExpression
  • CatchClause
  • ClassAccessorProperty
  • ClassBody
  • ClassDeclaration
  • ClassExpression
  • ClassMethod
  • ClassPrivateMethod
  • ClassPrivateProperty
  • ClassProperty
  • ConditionalExpression
  • ContinueStatement
  • DebuggerStatement
  • Directive
  • DirectiveLiteral
  • DoWhileStatement
  • EmptyStatement
  • ExportAllDeclaration
  • ExportDefaultDeclaration
  • ExportNamedDeclaration
  • ExportNamespaceSpecifier
  • ExportSpecifier
  • ExpressionStatement
  • File
  • ForInStatement
  • ForOfStatement
  • ForStatement
  • FunctionDeclaration
  • FunctionExpression
  • Identifier
  • IfStatement
  • Import
  • ImportDeclaration
  • ImportDefaultSpecifier
  • ImportNamespaceSpecifier
  • ImportSpecifier
  • InterpreterDirective
  • LabeledStatement
  • LogicalExpression
  • MemberExpression
  • MetaProperty
  • NewExpression
  • NullLiteral
  • NumericLiteral
  • ObjectExpression
  • ObjectMethod
  • ObjectPattern
  • ObjectProperty
  • OptionalCallExpression
  • OptionalMemberExpression
  • ParenthesizedExpression
  • PrivateName
  • Program
  • RegExpLiteral
  • RestElement
  • ReturnStatement
  • SequenceExpression
  • SpreadElement
  • StaticBlock
  • StringLiteral
  • Super
  • SwitchCase
  • SwitchStatement
  • TaggedTemplateExpression
  • TemplateElement
  • TemplateLiteral
  • ThisExpression
  • ThrowStatement
  • TryStatement
  • UnaryExpression
  • UpdateExpression
  • VariableDeclaration
  • VariableDeclarator
  • WhileStatement
  • WithStatement
  • YieldExpression

# Statement

A cover of any Statement s.

JavaScript

t.isStatement(node);

Covered nodes:

  • BlockStatement
  • BreakStatement
  • ClassDeclaration
  • ContinueStatement
  • DebuggerStatement
  • DeclareClass
  • DeclareExportAllDeclaration
  • DeclareExportDeclaration
  • DeclareFunction
  • DeclareInterface
  • DeclareModule
  • DeclareModuleExports
  • DeclareOpaqueType
  • DeclareTypeAlias
  • DeclareVariable
  • DoWhileStatement
  • EmptyStatement
  • EnumDeclaration
  • ExportAllDeclaration
  • ExportDefaultDeclaration
  • ExportNamedDeclaration
  • ExpressionStatement
  • ForInStatement
  • ForOfStatement
  • ForStatement
  • FunctionDeclaration
  • IfStatement
  • ImportDeclaration
  • InterfaceDeclaration
  • LabeledStatement
  • OpaqueType
  • ReturnStatement
  • SwitchStatement
  • TSDeclareFunction
  • TSEnumDeclaration
  • TSExportAssignment
  • TSImportEqualsDeclaration
  • TSInterfaceDeclaration
  • TSModuleDeclaration
  • TSNamespaceExportDeclaration
  • TSTypeAliasDeclaration
  • ThrowStatement
  • TryStatement
  • TypeAlias
  • VariableDeclaration
  • WhileStatement
  • WithStatement

# TSBaseType

A cover of primary TypeScript type annotations.

JavaScript

t.isTSBaseType(node);

Covered nodes:

  • TSAnyKeyword
  • TSBigIntKeyword
  • TSBooleanKeyword
  • TSIntrinsicKeyword
  • TSLiteralType
  • TSNeverKeyword
  • TSNullKeyword
  • TSNumberKeyword
  • TSObjectKeyword
  • TSStringKeyword
  • TSSymbolKeyword
  • TSThisType
  • TSUndefinedKeyword
  • TSUnknownKeyword
  • TSVoidKeyword

# TSEntityName

A cover of ts entities.

JavaScript

t.isTSEntityName(node);

Covered nodes:

  • Identifier
  • TSQualifiedName

# TSType

A cover of TypeScript type annotations.

JavaScript

t.isTSType(node);

Covered nodes:

  • TSAnyKeyword
  • TSArrayType
  • TSBigIntKeyword
  • TSBooleanKeyword
  • TSConditionalType
  • TSConstructorType
  • TSExpressionWithTypeArguments
  • TSFunctionType
  • TSImportType
  • TSIndexedAccessType
  • TSInferType
  • TSIntersectionType
  • TSIntrinsicKeyword
  • TSLiteralType
  • TSMappedType
  • TSNeverKeyword
  • TSNullKeyword
  • TSNumberKeyword
  • TSObjectKeyword
  • TSOptionalType
  • TSParenthesizedType
  • TSRestType
  • TSStringKeyword
  • TSSymbolKeyword
  • TSThisType
  • TSTupleType
  • TSTypeLiteral
  • TSTypeOperator
  • TSTypePredicate
  • TSTypeQuery
  • TSTypeReference
  • TSUndefinedKeyword
  • TSUnionType
  • TSUnknownKeyword
  • TSVoidKeyword

# TSTypeElement

A cover of TypeScript type declarations.

JavaScript

t.isTSTypeElement(node);

Covered nodes:

  • TSCallSignatureDeclaration
  • TSConstructSignatureDeclaration
  • TSIndexSignature
  • TSMethodSignature
  • TSPropertySignature

# Terminatorless

AST 节点的覆盖,当在操作符和操作数之间插入行终止符时,其语义将发生变化。

JavaScript

t.isTerminatorless(node);

覆盖节点:

  • AwaitExpression
  • BreakStatement
  • ContinueStatement
  • ReturnStatement
  • ThrowStatement
  • YieldExpression

# 打字稿

为 TypeScript 定义的 AST 节点的封面。

JavaScript

t.isTypeScript(node);

覆盖节点:

  • TSAnyKeyword
  • TSArrayType
  • TSAsExpression
  • TSBigIntKeyword
  • TSBooleanKeyword
  • TSCallSignatureDeclaration
  • TSConditionalType
  • TSConstructSignatureDeclaration
  • TSConstructorType
  • TSDeclareFunction
  • TSDeclareMethod
  • TSEnumDeclaration
  • TSEnumMember
  • TSExportAssignment
  • TSExpressionWithTypeArguments
  • TSExternalModuleReference
  • TSFunctionType
  • TSImportEqualsDeclaration
  • TSImportType
  • TSIndexSignature
  • TSIndexedAccessType
  • TSInferType
  • TSInstantiationExpression
  • TSInterfaceBody
  • TSInterfaceDeclaration
  • TSIntersectionType
  • TSIntrinsicKeyword
  • TSLiteralType
  • TSMappedType
  • TSMethodSignature
  • TSModuleBlock
  • TSModuleDeclaration
  • TSNamedTupleMember
  • TSNamespaceExportDeclaration
  • TSNeverKeyword
  • TSNonNullExpression
  • TSNullKeyword
  • TSNumberKeyword
  • TSObjectKeyword
  • TSOptionalType
  • TSParameterProperty
  • TSParenthesizedType
  • TSPropertySignature
  • TSQualifiedName
  • TSRestType
  • TSSatisfiesExpression
  • TSStringKeyword
  • TSSymbolKeyword
  • TSThisType
  • TSTupleType
  • TSTypeAliasDeclaration
  • TSTypeAnnotation
  • TSTypeAssertion
  • TSTypeLiteral
  • TSTypeOperator
  • TSTypeParameter
  • TSTypeParameterDeclaration
  • TSTypeParameterInstantiation
  • TSTypePredicate
  • TSTypeQuery
  • TSTypeReference
  • TSUndefinedKeyword
  • TSUnionType
  • TSUnknownKeyword
  • TSVoidKeyword

# 一元类

UnaryExpression 和 SpreadElement 的封面。

JavaScript

t.isUnaryLike(node);

覆盖节点:

  • SpreadElement
  • UnaryExpression

# UserWhitespacable

已弃用。将在 Babel 8 中移除。

JavaScript

t.isUserWhitespacable(node);

覆盖节点:

  • ObjectMethod
  • ObjectProperty
  • ObjectTypeCallProperty
  • ObjectTypeIndexer
  • ObjectTypeInternalSlot
  • ObjectTypeProperty
  • ObjectTypeSpreadProperty

#

DoWhileStatement 和 WhileStatement 的封面,它们共享相同的 AST 形状。

JavaScript

t.isWhile(node);

覆盖节点:

  • DoWhileStatement
  • WhileStatement
Last Updated: 6/7/2023, 9:06:23 AM