本文へ移動

@babel/types

このモジュールは、ASTを手動で構築するためのメソッドと、ASTノードの型をチェックするためのメソッドを含んでいます。

インストール

npm install --save-dev @babel/types

API

ノードビルダー

anyTypeAnnotation

JavaScript
t.anyTypeAnnotation();

t.isAnyTypeAnnotation(node, opts)t.assertAnyTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


argumentPlaceholder

JavaScript
t.argumentPlaceholder();

t.isArgumentPlaceholder(node, opts)t.assertArgumentPlaceholder(node, opts) も参照してください。


arrayExpression

JavaScript
t.arrayExpression(elements);

t.isArrayExpression(node, opts)t.assertArrayExpression(node, opts) も参照してください。

ASTノード `ArrayExpression` の形状

  • elements: Array<null | Expression | SpreadElement> (デフォルト: [])

エイリアス: StandardizedExpression


arrayPattern

JavaScript
t.arrayPattern(elements);

t.isArrayPattern(node, opts)t.assertArrayPattern(node, opts) も参照してください。

ASTノード `ArrayPattern` の形状

  • elements: Array<null | PatternLike | LVal> (必須)
  • decorators: Array<Decorator> (デフォルト: null、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedPatternPatternLikeLVal


arrayTypeAnnotation

JavaScript
t.arrayTypeAnnotation(elementType);

t.isArrayTypeAnnotation(node, opts)t.assertArrayTypeAnnotation(node, opts) も参照してください。

ASTノード `ArrayTypeAnnotation` の形状

  • elementType: FlowType (必須)

エイリアス: FlowFlowType


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 (デフォルト: null、ビルダー関数から除外)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedScopableFunctionBlockParentFunctionParentExpressionPureish


assignmentExpression

JavaScript
t.assignmentExpression(operator, left, right);

t.isAssignmentExpression(node, opts)t.assertAssignmentExpression(node, opts) も参照してください。

ASTノード `AssignmentExpression` の形状

  • operator: string (必須)
  • left: LVal | OptionalMemberExpression (必須)
  • right: Expression (必須)

エイリアス: StandardizedExpression


assignmentPattern

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> (デフォルト: null、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedPatternPatternLikeLVal


awaitExpression

JavaScript
t.awaitExpression(argument);

t.isAwaitExpression(node, opts)t.assertAwaitExpression(node, opts) も参照してください。

ASTノード `AwaitExpression` の形状

  • argument: Expression (必須)

エイリアス: StandardizedExpressionTerminatorless


bigIntLiteral

JavaScript
t.bigIntLiteral(value);

t.isBigIntLiteral(node, opts)t.assertBigIntLiteral(node, opts) も参照してください。

ASTノード `BigIntLiteral` の形状

  • value: string (必須)

エイリアス: StandardizedExpressionPureishLiteralImmutable


binaryExpression

JavaScript
t.binaryExpression(operator, left, right);

t.isBinaryExpression(node, opts)t.assertBinaryExpression(node, opts) も参照してください。

ASTノード `BinaryExpression` の形状

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

エイリアス: StandardizedBinaryExpression


bindExpression

JavaScript
t.bindExpression(object, callee);

t.isBindExpression(node, opts)t.assertBindExpression(node, opts) も参照してください。

ASTノード `BindExpression` の形状

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

エイリアス: Expression


blockStatement

JavaScript
t.blockStatement(body, directives);

t.isBlockStatement(node, opts)t.assertBlockStatement(node, opts) も参照してください。

ASTノード `BlockStatement` の形状

  • body: Array<Statement> (必須)
  • directives: Array<Directive> (デフォルト: [])

エイリアス: StandardizedScopableBlockParentBlockStatement


booleanLiteral

JavaScript
t.booleanLiteral(value);

t.isBooleanLiteral(node, opts)t.assertBooleanLiteral(node, opts) も参照してください。

ASTノード `BooleanLiteral` の形状

  • value: boolean (必須)

エイリアス: StandardizedExpressionPureishLiteralImmutable


booleanLiteralTypeAnnotation

JavaScript
t.booleanLiteralTypeAnnotation(value);

t.isBooleanLiteralTypeAnnotation(node, opts)t.assertBooleanLiteralTypeAnnotation(node, opts) も参照してください。

ASTノード `BooleanLiteralTypeAnnotation` の形状

  • value: boolean (必須)

エイリアス: FlowFlowType


booleanTypeAnnotation

JavaScript
t.booleanTypeAnnotation();

t.isBooleanTypeAnnotation(node, opts)t.assertBooleanTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


breakStatement

JavaScript
t.breakStatement(label);

t.isBreakStatement(node, opts)t.assertBreakStatement(node, opts) も参照してください。

ASTノード `BreakStatement` の形状

  • label: Identifier (デフォルト: null)

エイリアス: StandardizedStatementTerminatorlessCompletionStatement


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 (デフォルト: null、ビルダー関数から除外)
  • typeArguments: TypeParameterInstantiation (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TSTypeParameterInstantiation (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedExpression


catchClause

JavaScript
t.catchClause(param, body);

t.isCatchClause(node, opts)t.assertCatchClause(node, opts) も参照してください。

ASTノード `CatchClause` の形状

  • param: Identifier | ArrayPattern | ObjectPattern (デフォルト: null)
  • body: BlockStatement (必須)

エイリアス: StandardizedScopableBlockParent


classAccessorProperty

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 (デフォルト: null)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null)
  • decorators: Array<Decorator> (デフォルト: null)
  • computed: boolean (デフォルト: false)
  • static: boolean (デフォルト: false)
  • abstract: boolean (デフォルト: null、ビルダー関数から除外)
  • accessibility: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)
  • definite: boolean (デフォルト: null、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • override: boolean (デフォルト: false、ビルダー関数から除外)
  • readonly: boolean (デフォルト: null、ビルダー関数から除外)
  • variance: Variance (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedPropertyAccessor


classBody

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


classDeclaration

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

t.isClassDeclaration(node, opts)t.assertClassDeclaration(node, opts) も参照してください。

ASTノードClassDeclarationの形状

  • id: Identifier (デフォルト: null)
  • superClass: Expression (デフォルト: null)
  • body: ClassBody (必須)
  • decorators: Array<Decorator> (デフォルト: null)
  • abstract: boolean (デフォルト: null、ビルダー関数から除外)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)
  • implements: Array<TSExpressionWithTypeArguments | ClassImplements> (デフォルト: null、ビルダー関数から除外)
  • mixins: InterfaceExtends (デフォルト: null、ビルダー関数から除外)
  • superTypeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedScopableClassStatementDeclaration


classExpression

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

t.isClassExpression(node, opts)t.assertClassExpression(node, opts) も参照してください。

ASTノードClassExpressionの形状

  • id: Identifier (デフォルト: null)
  • superClass: Expression (デフォルト: null)
  • body: ClassBody (必須)
  • decorators: Array<Decorator> (デフォルト: null)
  • implements: Array<TSExpressionWithTypeArguments | ClassImplements> (デフォルト: null、ビルダー関数から除外)
  • mixins: InterfaceExtends (デフォルト: null、ビルダー関数から除外)
  • superTypeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedScopableClassExpression


classImplements

JavaScript
t.classImplements(id, typeParameters);

t.isClassImplements(node, opts)t.assertClassImplements(node, opts) も参照してください。

ASTノードClassImplementsの形状

  • id: Identifier (必須)
  • typeParameters: TypeParameterInstantiation (デフォルト: null)

エイリアス: Flow


classMethod

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: 計算された場合はExpression、そうでない場合はIdentifier | Literal (必須)
  • params: Array<Identifier | Pattern | RestElement | TSParameterProperty> (必須)
  • body: BlockStatement (必須)
  • computed: boolean (デフォルト: false)
  • static: boolean (デフォルト: false)
  • generator: boolean (デフォルト: false)
  • async: boolean (デフォルト: false)
  • abstract: boolean (デフォルト: null、ビルダー関数から除外)
  • access: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • accessibility: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • decorators: Array<Decorator> (デフォルト: null、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • override: boolean (デフォルト: false、ビルダー関数から除外)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedFunctionScopableBlockParentFunctionParentMethod


classPrivateMethod

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 (デフォルト: null、ビルダー関数から除外)
  • access: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • accessibility: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • async: boolean (デフォルト: false、ビルダー関数から除外)
  • computed: 'false' (デフォルト: false、ビルダー関数から除外)
  • decorators: Array<Decorator> (デフォルト: null、ビルダー関数から除外)
  • generator: boolean (デフォルト: false、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • override: boolean (デフォルト: false、ビルダー関数から除外)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedFunctionScopableBlockParentFunctionParentMethodPrivate


classPrivateProperty

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

t.isClassPrivateProperty(node, opts)t.assertClassPrivateProperty(node, opts) も参照してください。

ASTノードClassPrivatePropertyの形状

  • key: PrivateName (必須)
  • value: Expression (デフォルト: null)
  • decorators: Array<Decorator> (デフォルト: null)
  • static: boolean (デフォルト: false)
  • definite: boolean (デフォルト: null、ビルダー関数から除外)
  • readonly: boolean (デフォルト: null、ビルダー関数から除外)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)
  • variance: Variance (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedPropertyPrivate


classProperty

JavaScript
t.classProperty(key, value, typeAnnotation, decorators, computed, static);
履歴
バージョン変更点
v7.6.0static をサポート

t.isClassProperty(node, opts)t.assertClassProperty(node, opts) も参照してください。

ASTノードClassPropertyの形状

  • key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression (必須)
  • value: Expression (デフォルト: null)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null)
  • decorators: Array<Decorator> (デフォルト: null)
  • computed: boolean (デフォルト: false)
  • static: boolean (デフォルト: false)
  • abstract: boolean (デフォルト: null、ビルダー関数から除外)
  • accessibility: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)
  • definite: boolean (デフォルト: null、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • override: boolean (デフォルト: false、ビルダー関数から除外)
  • readonly: boolean (デフォルト: null、ビルダー関数から除外)
  • variance: Variance (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedProperty


conditionalExpression

JavaScript
t.conditionalExpression(test, consequent, alternate);

t.isConditionalExpression(node, opts)t.assertConditionalExpression(node, opts) も参照してください。

ASTノードConditionalExpressionの形状

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

エイリアス: StandardizedExpressionConditional


continueStatement

JavaScript
t.continueStatement(label);

t.isContinueStatement(node, opts)t.assertContinueStatement(node, opts) も参照してください。

ASTノードContinueStatementの形状

  • label: Identifier (デフォルト: null)

エイリアス: StandardizedStatementTerminatorlessCompletionStatement


debuggerStatement

JavaScript
t.debuggerStatement();

t.isDebuggerStatement(node, opts)t.assertDebuggerStatement(node, opts) も参照してください。

エイリアス: StandardizedStatement


decimalLiteral

JavaScript
t.decimalLiteral(value);

t.isDecimalLiteral(node, opts)t.assertDecimalLiteral(node, opts) も参照してください。

ASTノードDecimalLiteralの形状

  • value: string (必須)

エイリアス: ExpressionPureishLiteralImmutable


declareClass

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

t.isDeclareClass(node, opts)t.assertDeclareClass(node, opts) も参照してください。

ASTノードDeclareClassの形状

  • id: Identifier (必須)
  • typeParameters: TypeParameterDeclaration (デフォルト: null)
  • extends: Array<InterfaceExtends> (デフォルト: null)
  • body: ObjectTypeAnnotation (必須)
  • implements: Array<ClassImplements> (デフォルト: null、ビルダー関数から除外)
  • mixins: Array<InterfaceExtends> (デフォルト: null、ビルダー関数から除外)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareExportAllDeclaration

JavaScript
t.declareExportAllDeclaration(source);

t.isDeclareExportAllDeclaration(node, opts)t.assertDeclareExportAllDeclaration(node, opts) も参照してください。

ASTノードDeclareExportAllDeclarationの形状

  • source: StringLiteral (必須)
  • exportKind: "type" | "value" (デフォルト: null、ビルダー関数から除外)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareExportDeclaration

JavaScript
t.declareExportDeclaration(declaration, specifiers, source);

t.isDeclareExportDeclaration(node, opts)t.assertDeclareExportDeclaration(node, opts) も参照してください。

ASTノードDeclareExportDeclarationの形状

  • declaration: Flow (デフォルト: null)
  • specifiers: Array<ExportSpecifier | ExportNamespaceSpecifier> (デフォルト: null)
  • source: StringLiteral (デフォルト: null)
  • default: boolean (デフォルト: null、ビルダー関数から除外)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareFunction

JavaScript
t.declareFunction(id);

t.isDeclareFunction(node, opts)t.assertDeclareFunction(node, opts) も参照してください。

ASTノードDeclareFunctionの形状

  • id: Identifier (必須)
  • predicate: DeclaredPredicate (デフォルト: null、ビルダー関数から除外)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareInterface

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

t.isDeclareInterface(node, opts)t.assertDeclareInterface(node, opts) も参照してください。

ASTノードDeclareInterfaceの形状

  • id: Identifier (必須)
  • typeParameters: TypeParameterDeclaration (デフォルト: null)
  • extends: Array<InterfaceExtends> (デフォルト: null)
  • body: ObjectTypeAnnotation (必須)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareModule

JavaScript
t.declareModule(id, body, kind);

t.isDeclareModule(node, opts)t.assertDeclareModule(node, opts) も参照してください。

ASTノードDeclareModuleの形状

  • id: Identifier | StringLiteral (必須)
  • body: BlockStatement (必須)
  • kind: "CommonJS" | "ES" (デフォルト: null)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareModuleExports

JavaScript
t.declareModuleExports(typeAnnotation);

t.isDeclareModuleExports(node, opts)t.assertDeclareModuleExports(node, opts) も参照してください。

ASTノードDeclareModuleExportsの形状

  • typeAnnotation: TypeAnnotation (必須)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareOpaqueType

JavaScript
t.declareOpaqueType(id, typeParameters, supertype);

t.isDeclareOpaqueType(node, opts)t.assertDeclareOpaqueType(node, opts) も参照してください。

ASTノードDeclareOpaqueTypeの形状

  • id: Identifier (必須)
  • typeParameters: TypeParameterDeclaration (デフォルト: null)
  • supertype: FlowType (デフォルト: null)
  • impltype: FlowType (デフォルト: null、ビルダー関数から除外)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareTypeAlias

JavaScript
t.declareTypeAlias(id, typeParameters, right);

t.isDeclareTypeAlias(node, opts)t.assertDeclareTypeAlias(node, opts) も参照してください。

ASTノードDeclareTypeAliasの形状

  • id: Identifier (必須)
  • typeParameters: TypeParameterDeclaration (デフォルト: null)
  • right: FlowType (必須)

エイリアス: FlowFlowDeclarationStatementDeclaration


declareVariable

JavaScript
t.declareVariable(id);

t.isDeclareVariable(node, opts)t.assertDeclareVariable(node, opts) も参照してください。

ASTノードDeclareVariableの形状

  • id: Identifier (必須)

エイリアス: FlowFlowDeclarationStatementDeclaration


declaredPredicate

JavaScript
t.declaredPredicate(value);

t.isDeclaredPredicate(node, opts)t.assertDeclaredPredicate(node, opts) も参照してください。

ASTノードDeclaredPredicateの形状

  • value: Flow (必須)

エイリアス: FlowFlowPredicate


decorator

JavaScript
t.decorator(expression);

t.isDecorator(node, opts)t.assertDecorator(node, opts) も参照してください。

ASTノードDecoratorの形状

  • expression: Expression (必須)

directive

JavaScript
t.directive(value);

t.isDirective(node, opts)t.assertDirective(node, opts) も参照してください。

ASTノードDirectiveの形状

  • value: DirectiveLiteral (必須)

エイリアス: Standardized


directiveLiteral

JavaScript
t.directiveLiteral(value);

t.isDirectiveLiteral(node, opts)t.assertDirectiveLiteral(node, opts) も参照してください。

ASTノードDirectiveLiteralの形状

  • value: string (必須)

エイリアス: Standardized


doExpression

JavaScript
t.doExpression(body, async);

関連: t.isDoExpression(node, opts)t.assertDoExpression(node, opts)

ASTノードDoExpressionの形状

  • body: BlockStatement (必須)
  • async: boolean (デフォルト: false)

エイリアス: Expression


doWhileStatement

JavaScript
t.doWhileStatement(test, body);

関連: t.isDoWhileStatement(node, opts)t.assertDoWhileStatement(node, opts)

ASTノードDoWhileStatementの形状

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

エイリアス: StandardizedStatementBlockParentLoopWhileScopable


emptyStatement

JavaScript
t.emptyStatement();

関連: t.isEmptyStatement(node, opts)t.assertEmptyStatement(node, opts)

エイリアス: StandardizedStatement


emptyTypeAnnotation

JavaScript
t.emptyTypeAnnotation();

関連: t.isEmptyTypeAnnotation(node, opts)t.assertEmptyTypeAnnotation(node, opts)

エイリアス: FlowFlowTypeFlowBaseAnnotation


enumBooleanBody

JavaScript
t.enumBooleanBody(members);

関連: t.isEnumBooleanBody(node, opts)t.assertEnumBooleanBody(node, opts)

ASTノードEnumBooleanBodyの形状

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

エイリアス: FlowEnumBody


enumBooleanMember

JavaScript
t.enumBooleanMember(id);

関連: t.isEnumBooleanMember(node, opts)t.assertEnumBooleanMember(node, opts)

ASTノードEnumBooleanMemberの形状

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

エイリアス: FlowEnumMember


enumDeclaration

JavaScript
t.enumDeclaration(id, body);

関連: t.isEnumDeclaration(node, opts)t.assertEnumDeclaration(node, opts)

ASTノードEnumDeclarationの形状

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

エイリアス: FlowStatementDeclaration


enumDefaultedMember

JavaScript
t.enumDefaultedMember(id);

関連: t.isEnumDefaultedMember(node, opts)t.assertEnumDefaultedMember(node, opts)

ASTノードEnumDefaultedMemberの形状

  • id: Identifier (必須)

エイリアス: FlowEnumMember


enumNumberBody

JavaScript
t.enumNumberBody(members);

関連: t.isEnumNumberBody(node, opts)t.assertEnumNumberBody(node, opts)

ASTノードEnumNumberBodyの形状

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

エイリアス: FlowEnumBody


enumNumberMember

JavaScript
t.enumNumberMember(id, init);

関連: t.isEnumNumberMember(node, opts)t.assertEnumNumberMember(node, opts)

ASTノードEnumNumberMemberの形状

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

エイリアス: FlowEnumMember


enumStringBody

JavaScript
t.enumStringBody(members);

関連: t.isEnumStringBody(node, opts)t.assertEnumStringBody(node, opts)

ASTノードEnumStringBodyの形状

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

エイリアス: FlowEnumBody


enumStringMember

JavaScript
t.enumStringMember(id, init);

関連: t.isEnumStringMember(node, opts)t.assertEnumStringMember(node, opts)

ASTノードEnumStringMemberの形状

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

エイリアス: FlowEnumMember


enumSymbolBody

JavaScript
t.enumSymbolBody(members);

関連: t.isEnumSymbolBody(node, opts)t.assertEnumSymbolBody(node, opts)

ASTノードEnumSymbolBodyの形状

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

エイリアス: FlowEnumBody


existsTypeAnnotation

JavaScript
t.existsTypeAnnotation();

関連: t.isExistsTypeAnnotation(node, opts)t.assertExistsTypeAnnotation(node, opts)

エイリアス: FlowFlowType


exportAllDeclaration

JavaScript
t.exportAllDeclaration(source);

関連: t.isExportAllDeclaration(node, opts)t.assertExportAllDeclaration(node, opts)

ASTノードExportAllDeclarationの形状

  • source: StringLiteral (必須)
  • assertions: Array<ImportAttribute> (デフォルト: null、ビルダー関数から除外)
  • attributes: Array<ImportAttribute> (デフォルト: null、ビルダー関数から除外)
  • exportKind: "type" | "value" (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedStatementDeclarationImportOrExportDeclarationExportDeclaration


exportDefaultDeclaration

JavaScript
t.exportDefaultDeclaration(declaration);

関連: t.isExportDefaultDeclaration(node, opts)t.assertExportDefaultDeclaration(node, opts)

ASTノードExportDefaultDeclarationの形状

  • declaration: TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression (必須)
  • exportKind: "value" (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedStatementDeclarationImportOrExportDeclarationExportDeclaration


exportDefaultSpecifier

JavaScript
t.exportDefaultSpecifier(exported);

関連: t.isExportDefaultSpecifier(node, opts)t.assertExportDefaultSpecifier(node, opts)

ASTノードExportDefaultSpecifierの形状

  • exported: Identifier (必須)

エイリアス: ModuleSpecifier


exportNamedDeclaration

JavaScript
t.exportNamedDeclaration(declaration, specifiers, source);

関連: t.isExportNamedDeclaration(node, opts)t.assertExportNamedDeclaration(node, opts)

ASTノードExportNamedDeclarationの形状

  • declaration: Declaration (デフォルト: null)
  • specifiers: Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier> (デフォルト: [])
  • source: StringLiteral (デフォルト: null)
  • assertions: Array<ImportAttribute> (デフォルト: null、ビルダー関数から除外)
  • attributes: Array<ImportAttribute> (デフォルト: null、ビルダー関数から除外)
  • exportKind: "type" | "value" (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedStatementDeclarationImportOrExportDeclarationExportDeclaration


exportNamespaceSpecifier

JavaScript
t.exportNamespaceSpecifier(exported);

関連: t.isExportNamespaceSpecifier(node, opts)t.assertExportNamespaceSpecifier(node, opts)

ASTノードExportNamespaceSpecifierの形状

  • exported: Identifier (必須)

エイリアス: StandardizedModuleSpecifier


exportSpecifier

JavaScript
t.exportSpecifier(local, exported);

関連: t.isExportSpecifier(node, opts)t.assertExportSpecifier(node, opts)

ASTノードExportSpecifierの形状

  • local: Identifier (必須)
  • exported: Identifier | StringLiteral (必須)
  • exportKind: "type" | "value" (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedModuleSpecifier


expressionStatement

JavaScript
t.expressionStatement(expression);

関連: t.isExpressionStatement(node, opts)t.assertExpressionStatement(node, opts)

ASTノードExpressionStatementの形状

  • expression: Expression (必須)

エイリアス: StandardizedStatementExpressionWrapper


file

JavaScript
t.file(program, comments, tokens);

関連: t.isFile(node, opts)t.assertFile(node, opts)

ASTノードFileの形状

  • program: Program (必須)
  • comments: Array<CommentBlock | CommentLine> (デフォルト: null)
  • tokens: Array<any> (デフォルト: null)

エイリアス: Standardized


forInStatement

JavaScript
t.forInStatement(left, right, body);

関連: t.isForInStatement(node, opts)t.assertForInStatement(node, opts)

ASTノードForInStatementの形状

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

エイリアス: StandardizedScopableStatementForBlockParentLoopForXStatement


forOfStatement

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)

エイリアス: StandardizedScopableStatementForBlockParentLoopForXStatement


forStatement

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

関連: t.isForStatement(node, opts)t.assertForStatement(node, opts)

ASTノードForStatementの形状

  • init: VariableDeclaration | Expression (デフォルト: null)
  • test: Expression (デフォルト: null)
  • update: Expression (デフォルト: null)
  • body: Statement (必須)

エイリアス: StandardizedScopableStatementForBlockParentLoop


functionDeclaration

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

関連: t.isFunctionDeclaration(node, opts)t.assertFunctionDeclaration(node, opts)

ASTノードFunctionDeclarationの形状

  • id: Identifier (デフォルト: null)
  • params: Array<Identifier | Pattern | RestElement> (必須)
  • body: BlockStatement (必須)
  • generator: boolean (デフォルト: false)
  • async: boolean (デフォルト: false)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)
  • predicate: DeclaredPredicate | InferredPredicate (デフォルト: null、ビルダー関数から除外)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedScopableFunctionBlockParentFunctionParentStatementPureishDeclaration


functionExpression

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

関連: t.isFunctionExpression(node, opts)t.assertFunctionExpression(node, opts)

ASTノードFunctionExpressionの形状

  • id: Identifier (デフォルト: null)
  • params: Array<Identifier | Pattern | RestElement> (必須)
  • body: BlockStatement (必須)
  • generator: boolean (デフォルト: false)
  • async: boolean (デフォルト: false)
  • predicate: DeclaredPredicate | InferredPredicate (デフォルト: null、ビルダー関数から除外)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedScopableFunctionBlockParentFunctionParentExpressionPureish


functionTypeAnnotation

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

関連: t.isFunctionTypeAnnotation(node, opts)t.assertFunctionTypeAnnotation(node, opts)

ASTノードFunctionTypeAnnotationの形状

  • typeParameters: TypeParameterDeclaration (デフォルト: null)
  • params: Array<FunctionTypeParam> (必須)
  • rest: FunctionTypeParam (デフォルト: null)
  • returnType: FlowType (必須)
  • this: FunctionTypeParam (デフォルト: null、ビルダー関数から除外)

エイリアス: FlowFlowType


functionTypeParam

JavaScript
t.functionTypeParam(name, typeAnnotation);

関連: t.isFunctionTypeParam(node, opts)t.assertFunctionTypeParam(node, opts)

ASTノードFunctionTypeParamの形状

  • name: Identifier (デフォルト: null)
  • typeAnnotation: FlowType (必須)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)

エイリアス: Flow


genericTypeAnnotation

JavaScript
t.genericTypeAnnotation(id, typeParameters);

t.isGenericTypeAnnotation(node, opts) および t.assertGenericTypeAnnotation(node, opts) も参照してください。

ASTノードGenericTypeAnnotationの形状

  • id: Identifier | QualifiedTypeIdentifier (必須)
  • typeParameters: TypeParameterInstantiation (デフォルト: null)

エイリアス: FlowFlowType


identifier

JavaScript
t.identifier(name);

t.isIdentifier(node, opts) および t.assertIdentifier(node, opts) も参照してください。

ASTノードIdentifierの形状

  • name: string (必須)
  • decorators: Array<Decorator> (デフォルト: null、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedExpressionPatternLikeLValTSEntityName


ifStatement

JavaScript
t.ifStatement(test, consequent, alternate);

t.isIfStatement(node, opts) および t.assertIfStatement(node, opts) も参照してください。

ASTノードIfStatementの形状

  • test: Expression (必須)
  • consequent: Statement (必須)
  • alternate: Statement (デフォルト: null)

エイリアス: StandardizedStatementConditional


import

JavaScript
t.import();

t.isImport(node, opts) および t.assertImport(node, opts) も参照してください。

エイリアス: StandardizedExpression


importAttribute

JavaScript
t.importAttribute(key, value);

t.isImportAttribute(node, opts) および t.assertImportAttribute(node, opts) も参照してください。

ASTノードImportAttributeの形状

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

importDeclaration

JavaScript
t.importDeclaration(specifiers, source);
履歴
バージョン変更点
v7.20.0moduleをサポート

t.isImportDeclaration(node, opts) および t.assertImportDeclaration(node, opts) も参照してください。

ASTノードImportDeclarationの形状

  • specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier> (必須)
  • source: StringLiteral (必須)
  • assertions: Array<ImportAttribute> (デフォルト: null、ビルダー関数から除外)
  • attributes: Array<ImportAttribute> (デフォルト: null、ビルダー関数から除外)
  • importKind: "type" | "typeof" | "value" (デフォルト: null、ビルダー関数からは除外)
  • module: boolean (デフォルト: null、ビルダー関数からは除外)
  • phase: "source" | "defer" (デフォルト: null、ビルダー関数からは除外)

エイリアス: StandardizedStatementDeclarationImportOrExportDeclaration


importDefaultSpecifier

JavaScript
t.importDefaultSpecifier(local);

t.isImportDefaultSpecifier(node, opts) および t.assertImportDefaultSpecifier(node, opts) も参照してください。

ASTノードImportDefaultSpecifierの形状

  • local: Identifier (必須)

エイリアス: StandardizedModuleSpecifier


importExpression

JavaScript
t.importExpression(source, options);

t.isImportExpression(node, opts) および t.assertImportExpression(node, opts) も参照してください。

ASTノードImportExpressionの形状

  • source: Expression (必須)
  • options: Expression (デフォルト: null)
  • phase: "source" | "defer" (デフォルト: null、ビルダー関数からは除外)

エイリアス: StandardizedExpression


importNamespaceSpecifier

JavaScript
t.importNamespaceSpecifier(local);

t.isImportNamespaceSpecifier(node, opts) および t.assertImportNamespaceSpecifier(node, opts) も参照してください。

ASTノードImportNamespaceSpecifierの形状

  • local: Identifier (必須)

エイリアス: StandardizedModuleSpecifier


importSpecifier

JavaScript
t.importSpecifier(local, imported);

t.isImportSpecifier(node, opts) および t.assertImportSpecifier(node, opts) も参照してください。

ASTノードImportSpecifierの形状

  • local: Identifier (必須)
  • imported: Identifier | StringLiteral (必須)
  • importKind: "type" | "typeof" | "value" (デフォルト: null、ビルダー関数からは除外)

エイリアス: StandardizedModuleSpecifier


indexedAccessType

JavaScript
t.indexedAccessType(objectType, indexType);

t.isIndexedAccessType(node, opts) および t.assertIndexedAccessType(node, opts) も参照してください。

ASTノードIndexedAccessTypeの形状

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

エイリアス: FlowFlowType


inferredPredicate

JavaScript
t.inferredPredicate();

t.isInferredPredicate(node, opts) および t.assertInferredPredicate(node, opts) も参照してください。

エイリアス: FlowFlowPredicate


interfaceDeclaration

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

t.isInterfaceDeclaration(node, opts) および t.assertInterfaceDeclaration(node, opts) も参照してください。

ASTノードInterfaceDeclarationの形状

  • id: Identifier (必須)
  • typeParameters: TypeParameterDeclaration (デフォルト: null)
  • extends: Array<InterfaceExtends> (デフォルト: null)
  • body: ObjectTypeAnnotation (必須)

エイリアス: FlowFlowDeclarationStatementDeclaration


interfaceExtends

JavaScript
t.interfaceExtends(id, typeParameters);

t.isInterfaceExtends(node, opts) および t.assertInterfaceExtends(node, opts) も参照してください。

ASTノードInterfaceExtendsの形状

  • id: Identifier | QualifiedTypeIdentifier (必須)
  • typeParameters: TypeParameterInstantiation (デフォルト: null)

エイリアス: Flow


interfaceTypeAnnotation

JavaScript
t.interfaceTypeAnnotation(extends, body);

t.isInterfaceTypeAnnotation(node, opts) および t.assertInterfaceTypeAnnotation(node, opts) も参照してください。

ASTノードInterfaceTypeAnnotationの形状

  • extends: Array<InterfaceExtends> (デフォルト: null)
  • body: ObjectTypeAnnotation (必須)

エイリアス: FlowFlowType


interpreterDirective

JavaScript
t.interpreterDirective(value);

t.isInterpreterDirective(node, opts) および t.assertInterpreterDirective(node, opts) も参照してください。

ASTノードInterpreterDirectiveの形状

  • value: string (必須)

エイリアス: Standardized


intersectionTypeAnnotation

JavaScript
t.intersectionTypeAnnotation(types);

t.isIntersectionTypeAnnotation(node, opts) および t.assertIntersectionTypeAnnotation(node, opts) も参照してください。

ASTノードIntersectionTypeAnnotationの形状

  • types: Array<FlowType> (必須)

エイリアス: FlowFlowType


jsxAttribute

JavaScript
t.jsxAttribute(name, value);

t.isJSXAttribute(node, opts) および t.assertJSXAttribute(node, opts) も参照してください。

ASTノードJSXAttributeの形状

  • name: JSXIdentifier | JSXNamespacedName (必須)
  • value: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer (デフォルト: null)

エイリアス: JSXImmutable


jsxClosingElement

JavaScript
t.jsxClosingElement(name);

t.isJSXClosingElement(node, opts) および t.assertJSXClosingElement(node, opts) も参照してください。

ASTノードJSXClosingElementの形状

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

エイリアス: JSXImmutable


jsxClosingFragment

JavaScript
t.jsxClosingFragment();

t.isJSXClosingFragment(node, opts) および t.assertJSXClosingFragment(node, opts) も参照してください。

エイリアス: JSXImmutable


jsxElement

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

t.isJSXElement(node, opts) および t.assertJSXElement(node, opts) も参照してください。

ASTノードJSXElementの形状

  • openingElement: JSXOpeningElement (必須)
  • closingElement: JSXClosingElement (デフォルト: null)
  • children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment> (必須)
  • selfClosing: boolean (デフォルト: null)

エイリアス: JSXImmutableExpression


jsxEmptyExpression

JavaScript
t.jsxEmptyExpression();

t.isJSXEmptyExpression(node, opts) および t.assertJSXEmptyExpression(node, opts) も参照してください。

エイリアス: JSX


jsxExpressionContainer

JavaScript
t.jsxExpressionContainer(expression);

t.isJSXExpressionContainer(node, opts) および t.assertJSXExpressionContainer(node, opts) も参照してください。

ASTノードJSXExpressionContainerの形状

  • expression: Expression | JSXEmptyExpression (必須)

エイリアス: JSXImmutable


jsxFragment

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> (必須)

エイリアス: JSXImmutableExpression


jsxIdentifier

JavaScript
t.jsxIdentifier(name);

t.isJSXIdentifier(node, opts) および t.assertJSXIdentifier(node, opts) も参照してください。

ASTノードJSXIdentifierの形状

  • name: string (必須)

エイリアス: JSX


jsxMemberExpression

JavaScript
t.jsxMemberExpression(object, property);

t.isJSXMemberExpression(node, opts) および t.assertJSXMemberExpression(node, opts) も参照してください。

ASTノードJSXMemberExpressionの形状

  • object: JSXMemberExpression | JSXIdentifier (必須)
  • property: 計算された場合Expression、それ以外の場合はIdentifier (必須)

エイリアス: JSX


jsxNamespacedName

JavaScript
t.jsxNamespacedName(namespace, name);

t.isJSXNamespacedName(node, opts) および t.assertJSXNamespacedName(node, opts) も参照してください。

ASTノードJSXNamespacedNameの形状

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

エイリアス: JSX


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 (デフォルト: null、ビルダー関数からは除外)

エイリアス: JSXImmutable


jsxOpeningFragment

JavaScript
t.jsxOpeningFragment();

t.isJSXOpeningFragment(node, opts) および t.assertJSXOpeningFragment(node, opts) も参照してください。

エイリアス: JSXImmutable


jsxSpreadAttribute

JavaScript
t.jsxSpreadAttribute(argument);

t.isJSXSpreadAttribute(node, opts) および t.assertJSXSpreadAttribute(node, opts) も参照してください。

ASTノードJSXSpreadAttributeの形状

  • argument: Expression (必須)

エイリアス: JSX


jsxSpreadChild

JavaScript
t.jsxSpreadChild(expression);

t.isJSXSpreadChild(node, opts) および t.assertJSXSpreadChild(node, opts) も参照してください。

ASTノードJSXSpreadChildの形状

  • expression: Expression (必須)

エイリアス: JSXImmutable


jsxText

JavaScript
t.jsxText(value);

t.isJSXText(node, opts) および t.assertJSXText(node, opts) も参照してください。

ASTノードJSXTextの形状

  • value: string (必須)

エイリアス: JSXImmutable


labeledStatement

JavaScript
t.labeledStatement(label, body);

t.isLabeledStatement(node, opts) および t.assertLabeledStatement(node, opts) も参照してください。

ASTノードLabeledStatementの形状

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

エイリアス: StandardizedStatement


logicalExpression

JavaScript
t.logicalExpression(operator, left, right);

t.isLogicalExpression(node, opts) および t.assertLogicalExpression(node, opts) も参照してください。

ASTノードLogicalExpressionの形状

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

エイリアス: StandardizedBinaryExpression


memberExpression

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

t.isMemberExpression(node, opts) および t.assertMemberExpression(node, opts) も参照してください。

ASTノードMemberExpressionの形状

  • object: Expression | Super (必須)
  • property: 計算された場合Expression、それ以外の場合はIdentifier (必須)
  • computed: boolean (デフォルト: false)
  • optional: true | false (デフォルト: null)

エイリアス: StandardizedExpressionLVal


metaProperty

JavaScript
t.metaProperty(meta, property);

t.isMetaProperty(node, opts)t.assertMetaProperty(node, opts) も参照してください。

ASTノードMetaPropertyの形状

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

エイリアス: StandardizedExpression


mixedTypeAnnotation

JavaScript
t.mixedTypeAnnotation();

t.isMixedTypeAnnotation(node, opts)t.assertMixedTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


moduleExpression

JavaScript
t.moduleExpression(body);

t.isModuleExpression(node, opts)t.assertModuleExpression(node, opts) も参照してください。

ASTノードModuleExpressionの形状

  • body: Program (必須)

エイリアス: Expression


newExpression

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 (デフォルト: null、ビルダー関数から除外)
  • typeArguments: TypeParameterInstantiation (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TSTypeParameterInstantiation (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedExpression


noop

JavaScript
t.noop();

t.isNoop(node, opts)t.assertNoop(node, opts) も参照してください。

エイリアス: Miscellaneous


nullLiteral

JavaScript
t.nullLiteral();

t.isNullLiteral(node, opts)t.assertNullLiteral(node, opts) も参照してください。

エイリアス: StandardizedExpressionPureishLiteralImmutable


nullLiteralTypeAnnotation

JavaScript
t.nullLiteralTypeAnnotation();

t.isNullLiteralTypeAnnotation(node, opts)t.assertNullLiteralTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


nullableTypeAnnotation

JavaScript
t.nullableTypeAnnotation(typeAnnotation);

t.isNullableTypeAnnotation(node, opts)t.assertNullableTypeAnnotation(node, opts) も参照してください。

ASTノードNullableTypeAnnotationの形状

  • typeAnnotation: FlowType (必須)

エイリアス: FlowFlowType


numberLiteralTypeAnnotation

JavaScript
t.numberLiteralTypeAnnotation(value);

t.isNumberLiteralTypeAnnotation(node, opts)t.assertNumberLiteralTypeAnnotation(node, opts) も参照してください。

ASTノードNumberLiteralTypeAnnotationの形状

  • value: number (必須)

エイリアス: FlowFlowType


numberTypeAnnotation

JavaScript
t.numberTypeAnnotation();

t.isNumberTypeAnnotation(node, opts)t.assertNumberTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


numericLiteral

JavaScript
t.numericLiteral(value);

t.isNumericLiteral(node, opts)t.assertNumericLiteral(node, opts) も参照してください。

ASTノードNumericLiteralの形状

  • value: 非負の有限なnumber (必須)

エイリアス: StandardizedExpressionPureishLiteralImmutable


objectExpression

JavaScript
t.objectExpression(properties);

t.isObjectExpression(node, opts)t.assertObjectExpression(node, opts) も参照してください。

ASTノードObjectExpressionの形状

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

エイリアス: StandardizedExpression


objectMethod

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: 計算された場合はExpression、そうでない場合はIdentifier | Literal (必須)
  • params: Array<Identifier | Pattern | RestElement> (必須)
  • body: BlockStatement (必須)
  • computed: boolean (デフォルト: false)
  • generator: boolean (デフォルト: false)
  • async: boolean (デフォルト: false)
  • decorators: Array<Decorator> (デフォルト: null、ビルダー関数から除外)
  • returnType: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: Standardized, UserWhitespacable, Function, Scopable, BlockParent, FunctionParent, Method, ObjectMember


objectPattern

JavaScript
t.objectPattern(properties);

t.isObjectPattern(node, opts)t.assertObjectPattern(node, opts) も参照してください。

ASTノードObjectPatternの形状

  • properties: Array<RestElement | ObjectProperty> (必須)
  • decorators: Array<Decorator> (デフォルト: null、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedPatternPatternLikeLVal


objectProperty

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

t.isObjectProperty(node, opts)t.assertObjectProperty(node, opts) も参照してください。

ASTノードObjectPropertyの形状

  • key: 計算された場合はExpression、そうでない場合はIdentifier | Literal (必須)
  • value: Expression | PatternLike (必須)
  • computed: boolean (デフォルト: false)
  • shorthand: boolean (デフォルト: false)
  • decorators: Array<Decorator> (デフォルト: null)

エイリアス: Standardized, UserWhitespacable, Property, ObjectMember


objectTypeAnnotation

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

t.isObjectTypeAnnotation(node, opts)t.assertObjectTypeAnnotation(node, opts) も参照してください。

ASTノードObjectTypeAnnotationの形状

  • properties: Array<ObjectTypeProperty | ObjectTypeSpreadProperty> (必須)
  • indexers: Array<ObjectTypeIndexer> (デフォルト: [])
  • callProperties: Array<ObjectTypeCallProperty> (デフォルト: [])
  • internalSlots: Array<ObjectTypeInternalSlot> (デフォルト: [])
  • exact: boolean (デフォルト: false)
  • inexact: boolean (デフォルト: null、ビルダー関数からは除外)

エイリアス: FlowFlowType


objectTypeCallProperty

JavaScript
t.objectTypeCallProperty(value);

t.isObjectTypeCallProperty(node, opts)t.assertObjectTypeCallProperty(node, opts) も参照してください。

ASTノードObjectTypeCallPropertyの形状

  • value: FlowType (必須)
  • static: boolean (必須)

エイリアス: Flow, UserWhitespacable


objectTypeIndexer

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

t.isObjectTypeIndexer(node, opts)t.assertObjectTypeIndexer(node, opts) も参照してください。

ASTノードObjectTypeIndexerの形状

  • id: Identifier (デフォルト: null)
  • key: FlowType (必須)
  • value: FlowType (必須)
  • variance: Variance (デフォルト: null)
  • static: boolean (必須)

エイリアス: Flow, UserWhitespacable


objectTypeInternalSlot

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

t.isObjectTypeInternalSlot(node, opts)t.assertObjectTypeInternalSlot(node, opts) も参照してください。

ASTノードObjectTypeInternalSlotの形状

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

エイリアス: Flow, UserWhitespacable


objectTypeProperty

JavaScript
t.objectTypeProperty(key, value, variance);

t.isObjectTypeProperty(node, opts)t.assertObjectTypeProperty(node, opts) も参照してください。

ASTノードObjectTypePropertyの形状

  • key: Identifier | StringLiteral (必須)
  • value: FlowType (必須)
  • variance: Variance (デフォルト: null)
  • kind: "init" | "get" | "set" (必須)
  • method: boolean (必須)
  • optional: boolean (必須)
  • proto: boolean (必須)
  • static: boolean (必須)

エイリアス: Flow, UserWhitespacable


objectTypeSpreadProperty

JavaScript
t.objectTypeSpreadProperty(argument);

t.isObjectTypeSpreadProperty(node, opts)t.assertObjectTypeSpreadProperty(node, opts) も参照してください。

ASTノードObjectTypeSpreadPropertyの形状

  • argument: FlowType (必須)

エイリアス: Flow, UserWhitespacable


opaqueType

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

t.isOpaqueType(node, opts)t.assertOpaqueType(node, opts) も参照してください。

ASTノードOpaqueTypeの形状

  • id: Identifier (必須)
  • typeParameters: TypeParameterDeclaration (デフォルト: null)
  • supertype: FlowType (デフォルト: null)
  • impltype: FlowType (必須)

エイリアス: FlowFlowDeclarationStatementDeclaration


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 (デフォルト: null、ビルダー関数から除外)
  • typeParameters: TSTypeParameterInstantiation (デフォルト: null、ビルダー関数から除外)

エイリアス: StandardizedExpression


optionalIndexedAccessType

JavaScript
t.optionalIndexedAccessType(objectType, indexType);

t.isOptionalIndexedAccessType(node, opts)t.assertOptionalIndexedAccessType(node, opts) も参照してください。

ASTノードOptionalIndexedAccessTypeの形状

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

エイリアス: FlowFlowType


optionalMemberExpression

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 (必須)

エイリアス: StandardizedExpression


parenthesizedExpression

JavaScript
t.parenthesizedExpression(expression);

t.isParenthesizedExpression(node, opts)t.assertParenthesizedExpression(node, opts) も参照してください。

ASTノードParenthesizedExpressionの形状

  • expression: Expression (必須)

エイリアス: Standardized, Expression, ExpressionWrapper


pipelineBareFunction

JavaScript
t.pipelineBareFunction(callee);

t.isPipelineBareFunction(node, opts)t.assertPipelineBareFunction(node, opts) も参照してください。

ASTノードPipelineBareFunctionの形状

  • callee: Expression (必須)

エイリアス: Expression


pipelinePrimaryTopicReference

JavaScript
t.pipelinePrimaryTopicReference();

t.isPipelinePrimaryTopicReference(node, opts)t.assertPipelinePrimaryTopicReference(node, opts) も参照してください。

エイリアス: Expression


pipelineTopicExpression

JavaScript
t.pipelineTopicExpression(expression);

t.isPipelineTopicExpression(node, opts)t.assertPipelineTopicExpression(node, opts) も参照してください。

ASTノードPipelineTopicExpressionの形状

  • expression: Expression (必須)

エイリアス: Expression


placeholder

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


privateName

JavaScript
t.privateName(id);

t.isPrivateName(node, opts)t.assertPrivateName(node, opts) も参照してください。

ASTノードPrivateNameの形状

  • id: Identifier (必須)

エイリアス: Standardized, Private


program

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 (デフォルト: null)

エイリアス: Standardized, Scopable, BlockParent, Block


qualifiedTypeIdentifier

JavaScript
t.qualifiedTypeIdentifier(id, qualification);

t.isQualifiedTypeIdentifier(node, opts)t.assertQualifiedTypeIdentifier(node, opts) も参照してください。

ASTノードQualifiedTypeIdentifierの形状

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

エイリアス: Flow


recordExpression

JavaScript
t.recordExpression(properties);

t.isRecordExpression(node, opts)t.assertRecordExpression(node, opts) も参照してください。

ASTノードRecordExpressionの形状

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

エイリアス: Expression


regExpLiteral

JavaScript
t.regExpLiteral(pattern, flags);

t.isRegExpLiteral(node, opts)t.assertRegExpLiteral(node, opts) も参照してください。

ASTノードRegExpLiteralの形状

  • pattern: string (必須)
  • flags: string (デフォルト: '')

別名: StandardizedExpressionPureishLiteral


restElement

JavaScript
t.restElement(argument);

t.isRestElement(node, opts)t.assertRestElement(node, opts) も参照してください。

ASTノードRestElementの形状

  • argument: LVal (必須)
  • decorators: Array<Decorator> (デフォルト: null、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop (デフォルト: null、ビルダー関数から除外)

別名: StandardizedLValPatternLike


returnStatement

JavaScript
t.returnStatement(argument);

t.isReturnStatement(node, opts)t.assertReturnStatement(node, opts) も参照してください。

ASTノードReturnStatementの形状

  • argument: Expression (デフォルト: null)

エイリアス: StandardizedStatementTerminatorlessCompletionStatement


sequenceExpression

JavaScript
t.sequenceExpression(expressions);

t.isSequenceExpression(node, opts)t.assertSequenceExpression(node, opts) も参照してください。

ASTノードSequenceExpressionの形状

  • expressions: Array<Expression> (必須)

エイリアス: StandardizedExpression


spreadElement

JavaScript
t.spreadElement(argument);

t.isSpreadElement(node, opts)t.assertSpreadElement(node, opts) も参照してください。

ASTノードSpreadElementの形状

  • argument: Expression (必須)

別名: StandardizedUnaryLike


staticBlock

JavaScript
t.staticBlock(body);

t.isStaticBlock(node, opts)t.assertStaticBlock(node, opts) も参照してください。

ASTノードStaticBlockの形状

  • body: Array<Statement> (必須)

別名: StandardizedScopableBlockParentFunctionParent


stringLiteral

JavaScript
t.stringLiteral(value);

t.isStringLiteral(node, opts)t.assertStringLiteral(node, opts) も参照してください。

ASTノードStringLiteralの形状

  • value: string (必須)

エイリアス: StandardizedExpressionPureishLiteralImmutable


stringLiteralTypeAnnotation

JavaScript
t.stringLiteralTypeAnnotation(value);

t.isStringLiteralTypeAnnotation(node, opts)t.assertStringLiteralTypeAnnotation(node, opts) も参照してください。

ASTノードStringLiteralTypeAnnotationの形状

  • value: string (必須)

エイリアス: FlowFlowType


stringTypeAnnotation

JavaScript
t.stringTypeAnnotation();

t.isStringTypeAnnotation(node, opts)t.assertStringTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


super

JavaScript
t.super();

t.isSuper(node, opts)t.assertSuper(node, opts) も参照してください。

エイリアス: StandardizedExpression


switchCase

JavaScript
t.switchCase(test, consequent);

t.isSwitchCase(node, opts)t.assertSwitchCase(node, opts) も参照してください。

ASTノードSwitchCaseの形状

  • test: Expression (デフォルト: null)
  • consequent: Array<Statement> (必須)

エイリアス: Standardized


switchStatement

JavaScript
t.switchStatement(discriminant, cases);

t.isSwitchStatement(node, opts)t.assertSwitchStatement(node, opts) も参照してください。

ASTノードSwitchStatementの形状

  • discriminant: Expression (必須)
  • cases: Array<SwitchCase> (必須)

別名: StandardizedStatementBlockParentScopable


symbolTypeAnnotation

JavaScript
t.symbolTypeAnnotation();

t.isSymbolTypeAnnotation(node, opts)t.assertSymbolTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


tsAnyKeyword

JavaScript
t.tsAnyKeyword();

t.isTSAnyKeyword(node, opts)t.assertTSAnyKeyword(node, opts) も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsArrayType

JavaScript
t.tsArrayType(elementType);

t.isTSArrayType(node, opts)t.assertTSArrayType(node, opts) も参照してください。

ASTノードTSArrayTypeの形状

  • elementType: TSType (必須)

別名: TypeScriptTSType


tsAsExpression

JavaScript
t.tsAsExpression(expression, typeAnnotation);

t.isTSAsExpression(node, opts)t.assertTSAsExpression(node, opts) も参照してください。

ASTノードTSAsExpressionの形状

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

別名: TypeScriptExpressionLValPatternLike


tsBigIntKeyword

JavaScript
t.tsBigIntKeyword();

t.isTSBigIntKeyword(node, opts)t.assertTSBigIntKeyword(node, opts) も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsBooleanKeyword

JavaScript
t.tsBooleanKeyword();

t.isTSBooleanKeyword(node, opts)t.assertTSBooleanKeyword(node, opts) も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsCallSignatureDeclaration

JavaScript
t.tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation);

t.isTSCallSignatureDeclaration(node, opts)t.assertTSCallSignatureDeclaration(node, opts) も参照してください。

ASTノードTSCallSignatureDeclarationの形状

  • typeParameters: TSTypeParameterDeclaration (デフォルト: null)
  • parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement> (必須)
  • typeAnnotation: TSTypeAnnotation (デフォルト: null)

別名: TypeScriptTSTypeElement


tsConditionalType

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

t.isTSConditionalType(node, opts)t.assertTSConditionalType(node, opts) も参照してください。

ASTノードTSConditionalTypeの形状

  • checkType: TSType (必須)
  • extendsType: TSType (必須)
  • trueType: TSType (必須)
  • falseType: TSType (必須)

別名: TypeScriptTSType


tsConstructSignatureDeclaration

JavaScript
t.tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation);

t.isTSConstructSignatureDeclaration(node, opts)t.assertTSConstructSignatureDeclaration(node, opts) も参照してください。

ASTノードTSConstructSignatureDeclarationの形状

  • typeParameters: TSTypeParameterDeclaration (デフォルト: null)
  • parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement> (必須)
  • typeAnnotation: TSTypeAnnotation (デフォルト: null)

別名: TypeScriptTSTypeElement


tsConstructorType

JavaScript
t.tsConstructorType(typeParameters, parameters, typeAnnotation);

t.isTSConstructorType(node, opts)t.assertTSConstructorType(node, opts) も参照してください。

ASTノードTSConstructorTypeの形状

  • typeParameters: TSTypeParameterDeclaration (デフォルト: null)
  • parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement> (必須)
  • typeAnnotation: TSTypeAnnotation (デフォルト: null)
  • abstract: boolean (デフォルト: null、ビルダー関数から除外)

別名: TypeScriptTSType


tsDeclareFunction

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

t.isTSDeclareFunction(node, opts)t.assertTSDeclareFunction(node, opts) も参照してください。

ASTノードTSDeclareFunctionの形状

  • id: Identifier (デフォルト: null)
  • typeParameters: TSTypeParameterDeclaration | Noop (デフォルト: null)
  • params: Array<Identifier | Pattern | RestElement> (必須)
  • returnType: TSTypeAnnotation | Noop (デフォルト: null)
  • async: boolean (デフォルト: false、ビルダー関数から除外)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)
  • generator: boolean (デフォルト: false、ビルダー関数から除外)

別名: TypeScriptStatementDeclaration


tsDeclareMethod

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

t.isTSDeclareMethod(node, opts)t.assertTSDeclareMethod(node, opts) も参照してください。

ASTノードTSDeclareMethodの形状

  • decorators: Array<Decorator> (デフォルト: null)
  • key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression (必須)
  • typeParameters: TSTypeParameterDeclaration | Noop (デフォルト: null)
  • params: Array<Identifier | Pattern | RestElement | TSParameterProperty> (必須)
  • returnType: TSTypeAnnotation | Noop (デフォルト: null)
  • abstract: boolean (デフォルト: null、ビルダー関数から除外)
  • access: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • accessibility: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • async: boolean (デフォルト: false、ビルダー関数から除外)
  • computed: boolean (デフォルト: false、ビルダー関数から除外)
  • generator: boolean (デフォルト: false、ビルダー関数から除外)
  • kind: "get" | "set" | "method" | "constructor" (デフォルト: 'method'、ビルダー関数から除外)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • override: boolean (デフォルト: false、ビルダー関数から除外)
  • static: boolean (デフォルト: false、ビルダー関数から除外)

別名: TypeScript


tsEnumDeclaration

JavaScript
t.tsEnumDeclaration(id, members);

t.isTSEnumDeclaration(node, opts)t.assertTSEnumDeclaration(node, opts) も参照してください。

ASTノードTSEnumDeclarationの形状

  • id: Identifier (必須)
  • members: Array<TSEnumMember> (必須)
  • const: boolean (デフォルト: null、ビルダー関数から除外)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)
  • initializer: Expression (デフォルト: null、ビルダー関数から除外)

別名: TypeScriptStatementDeclaration


tsEnumMember

JavaScript
t.tsEnumMember(id, initializer);

t.isTSEnumMember(node, opts)t.assertTSEnumMember(node, opts) も参照してください。

ASTノードTSEnumMemberの形状

  • id: Identifier | StringLiteral (必須)
  • initializer: Expression (デフォルト: null)

別名: TypeScript


tsExportAssignment

JavaScript
t.tsExportAssignment(expression);

t.isTSExportAssignment(node, opts)t.assertTSExportAssignment(node, opts) も参照してください。

ASTノードTSExportAssignmentの形状

  • expression: Expression (必須)

別名: TypeScriptStatement


tsExpressionWithTypeArguments

JavaScript
t.tsExpressionWithTypeArguments(expression, typeParameters);

t.isTSExpressionWithTypeArguments(node, opts)t.assertTSExpressionWithTypeArguments(node, opts) も参照してください。

ASTノードTSExpressionWithTypeArgumentsの形状

  • expression: TSEntityName (必須)
  • typeParameters: TSTypeParameterInstantiation (デフォルト: null)

別名: TypeScriptTSType


tsExternalModuleReference

JavaScript
t.tsExternalModuleReference(expression);

t.isTSExternalModuleReference(node, opts)t.assertTSExternalModuleReference(node, opts) も参照してください。

ASTノードTSExternalModuleReferenceの形状

  • expression: StringLiteral (必須)

別名: TypeScript


tsFunctionType

JavaScript
t.tsFunctionType(typeParameters, parameters, typeAnnotation);

t.isTSFunctionType(node, opts)t.assertTSFunctionType(node, opts) も参照してください。

ASTノードTSFunctionTypeの形状

  • typeParameters: TSTypeParameterDeclaration (デフォルト: null)
  • parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement> (必須)
  • typeAnnotation: TSTypeAnnotation (デフォルト: null)

別名: TypeScriptTSType


tsImportEqualsDeclaration

JavaScript
t.tsImportEqualsDeclaration(id, moduleReference);

t.isTSImportEqualsDeclaration(node, opts)t.assertTSImportEqualsDeclaration(node, opts) も参照してください。

ASTノードTSImportEqualsDeclarationの形状

  • id: Identifier (必須)
  • moduleReference: TSEntityName | TSExternalModuleReference (必須)
  • importKind: "type" | "value" (デフォルト: null、ビルダー関数から除外)
  • isExport: boolean (必須)

別名: TypeScriptStatement


tsImportType

JavaScript
t.tsImportType(argument, qualifier, typeParameters);

t.isTSImportType(node, opts)t.assertTSImportType(node, opts) も参照してください。

ASTノードTSImportTypeの形状

  • argument: StringLiteral (必須)
  • qualifier: TSEntityName (デフォルト: null)
  • typeParameters: TSTypeParameterInstantiation (デフォルト: null)
  • options: Expression (デフォルト: null、ビルダー関数から除外)

別名: TypeScriptTSType


tsIndexSignature

JavaScript
t.tsIndexSignature(parameters, typeAnnotation);

t.isTSIndexSignature(node, opts)t.assertTSIndexSignature(node, opts) も参照してください。

ASTノードTSIndexSignatureの形状

  • parameters: Array<Identifier> (必須)
  • typeAnnotation: TSTypeAnnotation (デフォルト: null)
  • readonly: boolean (デフォルト: null、ビルダー関数から除外)
  • static: boolean (デフォルト: null、ビルダー関数から除外)

別名: TypeScriptTSTypeElement


tsIndexedAccessType

JavaScript
t.tsIndexedAccessType(objectType, indexType);

t.isTSIndexedAccessType(node, opts)t.assertTSIndexedAccessType(node, opts) も参照してください。

ASTノードTSIndexedAccessTypeの形状

  • objectType: TSType (必須)
  • indexType: TSType (必須)

別名: TypeScriptTSType


tsInferType

JavaScript
t.tsInferType(typeParameter);

t.isTSInferType(node, opts)t.assertTSInferType(node, opts) も参照してください。

ASTノードTSInferTypeの形状

  • typeParameter: TSTypeParameter (必須)

別名: TypeScriptTSType


tsInstantiationExpression

JavaScript
t.tsInstantiationExpression(expression, typeParameters);

t.isTSInstantiationExpression(node, opts)t.assertTSInstantiationExpression(node, opts) も参照してください。

ASTノードTSInstantiationExpressionの形状

  • expression: Expression (必須)
  • typeParameters: TSTypeParameterInstantiation (デフォルト: null)

別名: TypeScriptExpression


tsInterfaceBody

JavaScript
t.tsInterfaceBody(body);

t.isTSInterfaceBody(node, opts)およびt.assertTSInterfaceBody(node, opts)も参照してください。

ASTノードTSInterfaceBodyの形状

  • body: Array<TSTypeElement> (必須)

別名: TypeScript


tsInterfaceDeclaration

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

t.isTSInterfaceDeclaration(node, opts)およびt.assertTSInterfaceDeclaration(node, opts)も参照してください。

ASTノードTSInterfaceDeclarationの形状

  • id: Identifier (必須)
  • typeParameters: TSTypeParameterDeclaration (デフォルト: null)
  • extends: Array<TSExpressionWithTypeArguments> (デフォルト: null)
  • body: TSInterfaceBody (必須)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)

別名: TypeScriptStatementDeclaration


tsIntersectionType

JavaScript
t.tsIntersectionType(types);

t.isTSIntersectionType(node, opts)およびt.assertTSIntersectionType(node, opts)も参照してください。

ASTノードTSIntersectionTypeの形状

  • types: Array<TSType> (必須)

別名: TypeScriptTSType


tsIntrinsicKeyword

JavaScript
t.tsIntrinsicKeyword();

t.isTSIntrinsicKeyword(node, opts)およびt.assertTSIntrinsicKeyword(node, opts)も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsLiteralType

JavaScript
t.tsLiteralType(literal);

t.isTSLiteralType(node, opts)およびt.assertTSLiteralType(node, opts)も参照してください。

ASTノードTSLiteralTypeの形状

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

別名: TypeScriptTSTypeTSBaseType


tsMappedType

JavaScript
t.tsMappedType(typeParameter, typeAnnotation, nameType);

t.isTSMappedType(node, opts)およびt.assertTSMappedType(node, opts)も参照してください。

ASTノードTSMappedTypeの形状

  • typeParameter: TSTypeParameter (必須)
  • typeAnnotation: TSType (デフォルト: null)
  • nameType: TSType (デフォルト: null)
  • optional: true | false | "+" | "-" (デフォルト: null、ビルダー関数からは除外)
  • readonly: true | false | "+" | "-" (デフォルト: null、ビルダー関数からは除外)

別名: TypeScriptTSType


tsMethodSignature

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

t.isTSMethodSignature(node, opts)およびt.assertTSMethodSignature(node, opts)も参照してください。

ASTノードTSMethodSignatureの形状

  • key: Expression (必須)
  • typeParameters: TSTypeParameterDeclaration (デフォルト: null)
  • parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement> (必須)
  • typeAnnotation: TSTypeAnnotation (デフォルト: null)
  • computed: boolean (デフォルト: false、ビルダー関数から除外)
  • kind: "method" | "get" | "set" (必須)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)

別名: TypeScriptTSTypeElement


tsModuleBlock

JavaScript
t.tsModuleBlock(body);

t.isTSModuleBlock(node, opts)およびt.assertTSModuleBlock(node, opts)も参照してください。

ASTノードTSModuleBlockの形状

  • body: Array<Statement> (必須)

エイリアス: TypeScriptScopableBlockBlockParentFunctionParent


tsModuleDeclaration

JavaScript
t.tsModuleDeclaration(id, body);

t.isTSModuleDeclaration(node, opts)およびt.assertTSModuleDeclaration(node, opts)も参照してください。

ASTノードTSModuleDeclarationの形状

  • id: Identifier | StringLiteral (必須)
  • body: TSModuleBlock | TSModuleDeclaration (必須)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)
  • global: boolean (デフォルト: null、ビルダー関数からは除外)

別名: TypeScriptStatementDeclaration


tsNamedTupleMember

JavaScript
t.tsNamedTupleMember(label, elementType, optional);

t.isTSNamedTupleMember(node, opts)およびt.assertTSNamedTupleMember(node, opts)も参照してください。

ASTノードTSNamedTupleMemberの形状

  • label: Identifier (必須)
  • elementType: TSType (必須)
  • optional: boolean (デフォルト: false)

別名: TypeScript


tsNamespaceExportDeclaration

JavaScript
t.tsNamespaceExportDeclaration(id);

t.isTSNamespaceExportDeclaration(node, opts)およびt.assertTSNamespaceExportDeclaration(node, opts)も参照してください。

ASTノードTSNamespaceExportDeclarationの形状

  • id: Identifier (必須)

別名: TypeScriptStatement


tsNeverKeyword

JavaScript
t.tsNeverKeyword();

t.isTSNeverKeyword(node, opts)およびt.assertTSNeverKeyword(node, opts)も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsNonNullExpression

JavaScript
t.tsNonNullExpression(expression);

t.isTSNonNullExpression(node, opts)およびt.assertTSNonNullExpression(node, opts)も参照してください。

ASTノードTSNonNullExpressionの形状

  • expression: Expression (必須)

別名: TypeScriptExpressionLValPatternLike


tsNullKeyword

JavaScript
t.tsNullKeyword();

t.isTSNullKeyword(node, opts)およびt.assertTSNullKeyword(node, opts)も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsNumberKeyword

JavaScript
t.tsNumberKeyword();

t.isTSNumberKeyword(node, opts)およびt.assertTSNumberKeyword(node, opts)も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsObjectKeyword

JavaScript
t.tsObjectKeyword();

t.isTSObjectKeyword(node, opts)およびt.assertTSObjectKeyword(node, opts)も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsOptionalType

JavaScript
t.tsOptionalType(typeAnnotation);

t.isTSOptionalType(node, opts)およびt.assertTSOptionalType(node, opts)も参照してください。

ASTノードTSOptionalTypeの形状

  • typeAnnotation: TSType (必須)

別名: TypeScriptTSType


tsParameterProperty

JavaScript
t.tsParameterProperty(parameter);

t.isTSParameterProperty(node, opts)およびt.assertTSParameterProperty(node, opts)も参照してください。

ASTノードTSParameterPropertyの形状

  • parameter: Identifier | AssignmentPattern (必須)
  • accessibility: "public" | "private" | "protected" (デフォルト: null、ビルダー関数から除外)
  • decorators: Array<Decorator> (デフォルト: null、ビルダー関数から除外)
  • override: boolean (デフォルト: null、ビルダー関数からは除外)
  • readonly: boolean (デフォルト: null、ビルダー関数から除外)

エイリアス: TypeScriptLVal


tsParenthesizedType

JavaScript
t.tsParenthesizedType(typeAnnotation);

t.isTSParenthesizedType(node, opts)およびt.assertTSParenthesizedType(node, opts)も参照してください。

ASTノードTSParenthesizedTypeの形状

  • typeAnnotation: TSType (必須)

別名: TypeScriptTSType


tsPropertySignature

JavaScript
t.tsPropertySignature(key, typeAnnotation);

t.isTSPropertySignature(node, opts)およびt.assertTSPropertySignature(node, opts)も参照してください。

ASTノードTSPropertySignatureの形状

  • key: Expression (必須)
  • typeAnnotation: TSTypeAnnotation (デフォルト: null)
  • computed: boolean (デフォルト: false、ビルダー関数から除外)
  • kind: "get" | "set" (必須)
  • optional: boolean (デフォルト: null、ビルダー関数から除外)
  • readonly: boolean (デフォルト: null、ビルダー関数から除外)

別名: TypeScriptTSTypeElement


tsQualifiedName

JavaScript
t.tsQualifiedName(left, right);

t.isTSQualifiedName(node, opts)およびt.assertTSQualifiedName(node, opts)も参照してください。

ASTノードTSQualifiedNameの形状

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

エイリアス: TypeScriptTSEntityName


tsRestType

JavaScript
t.tsRestType(typeAnnotation);

t.isTSRestType(node, opts)およびt.assertTSRestType(node, opts)も参照してください。

ASTノードTSRestTypeの形状

  • typeAnnotation: TSType (必須)

別名: TypeScriptTSType


tsSatisfiesExpression

JavaScript
t.tsSatisfiesExpression(expression, typeAnnotation);
履歴
バージョン変更点
v7.20.0導入

t.isTSSatisfiesExpression(node, opts)およびt.assertTSSatisfiesExpression(node, opts)も参照してください。

ASTノードTSSatisfiesExpressionの形状

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

別名: TypeScriptExpressionLValPatternLike


tsStringKeyword

JavaScript
t.tsStringKeyword();

t.isTSStringKeyword(node, opts)およびt.assertTSStringKeyword(node, opts)も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsSymbolKeyword

JavaScript
t.tsSymbolKeyword();

t.isTSSymbolKeyword(node, opts)およびt.assertTSSymbolKeyword(node, opts)も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsThisType

JavaScript
t.tsThisType();

t.isTSThisType(node, opts)およびt.assertTSThisType(node, opts)も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsTupleType

JavaScript
t.tsTupleType(elementTypes);

t.isTSTupleType(node, opts)およびt.assertTSTupleType(node, opts)も参照してください。

ASTノードTSTupleTypeの形状

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

別名: TypeScriptTSType


tsTypeAliasDeclaration

JavaScript
t.tsTypeAliasDeclaration(id, typeParameters, typeAnnotation);

t.isTSTypeAliasDeclaration(node, opts)およびt.assertTSTypeAliasDeclaration(node, opts)も参照してください。

ASTノードTSTypeAliasDeclarationの形状

  • id: Identifier (必須)
  • typeParameters: TSTypeParameterDeclaration (デフォルト: null)
  • typeAnnotation: TSType (必須)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)

別名: TypeScriptStatementDeclaration


tsTypeAnnotation

JavaScript
t.tsTypeAnnotation(typeAnnotation);

t.isTSTypeAnnotation(node, opts)およびt.assertTSTypeAnnotation(node, opts)も参照してください。

ASTノードTSTypeAnnotationの形状

  • typeAnnotation: TSType (必須)

別名: TypeScript


tsTypeAssertion

JavaScript
t.tsTypeAssertion(typeAnnotation, expression);

t.isTSTypeAssertion(node, opts)およびt.assertTSTypeAssertion(node, opts)も参照してください。

ASTノードTSTypeAssertionの形状

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

別名: TypeScriptExpressionLValPatternLike


tsTypeLiteral

JavaScript
t.tsTypeLiteral(members);

t.isTSTypeLiteral(node, opts)およびt.assertTSTypeLiteral(node, opts)も参照してください。

ASTノードTSTypeLiteralの形状

  • members: Array<TSTypeElement> (必須)

別名: TypeScriptTSType


tsTypeOperator

JavaScript
t.tsTypeOperator(typeAnnotation);

t.isTSTypeOperator(node, opts)およびt.assertTSTypeOperator(node, opts)も参照してください。

ASTノードTSTypeOperatorの形状

  • typeAnnotation: TSType (必須)
  • operator: string (必須)

別名: TypeScriptTSType


tsTypeParameter

JavaScript
t.tsTypeParameter(constraint, default, name);
履歴
バージョン変更点
v7.21.0constをサポート

t.isTSTypeParameter(node, opts)およびt.assertTSTypeParameter(node, opts)も参照してください。

ASTノードTSTypeParameterの形状

  • constraint: TSType (デフォルト: null)
  • default: TSType (デフォルト: null)
  • name: string (必須)
  • const: boolean (デフォルト: null、ビルダー関数から除外)
  • in: boolean (デフォルト: null、ビルダー関数からは除外)
  • out: boolean (デフォルト: null、ビルダー関数からは除外)

別名: TypeScript


tsTypeParameterDeclaration

JavaScript
t.tsTypeParameterDeclaration(params);

t.isTSTypeParameterDeclaration(node, opts)およびt.assertTSTypeParameterDeclaration(node, opts)も参照してください。

ASTノードTSTypeParameterDeclarationの形状

  • params: Array<TSTypeParameter> (必須)

別名: TypeScript


tsTypeParameterInstantiation

JavaScript
t.tsTypeParameterInstantiation(params);

t.isTSTypeParameterInstantiation(node, opts) および t.assertTSTypeParameterInstantiation(node, opts) も参照してください。

ASTノードTSTypeParameterInstantiationの構造

  • params: Array<TSType> (必須)

別名: TypeScript


tsTypePredicate

JavaScript
t.tsTypePredicate(parameterName, typeAnnotation, asserts);

t.isTSTypePredicate(node, opts) および t.assertTSTypePredicate(node, opts) も参照してください。

ASTノードTSTypePredicateの構造

  • parameterName: Identifier | TSThisType (必須)
  • typeAnnotation: TSTypeAnnotation (デフォルト: null)
  • asserts: boolean (デフォルト: null

別名: TypeScriptTSType


tsTypeQuery

JavaScript
t.tsTypeQuery(exprName, typeParameters);

t.isTSTypeQuery(node, opts) および t.assertTSTypeQuery(node, opts) も参照してください。

ASTノードTSTypeQueryの構造

  • exprName: TSEntityName | TSImportType (必須)
  • typeParameters: TSTypeParameterInstantiation (デフォルト: null)

別名: TypeScriptTSType


tsTypeReference

JavaScript
t.tsTypeReference(typeName, typeParameters);

t.isTSTypeReference(node, opts) および t.assertTSTypeReference(node, opts) も参照してください。

ASTノードTSTypeReferenceの構造

  • typeName: TSEntityName (必須)
  • typeParameters: TSTypeParameterInstantiation (デフォルト: null)

別名: TypeScriptTSType


tsUndefinedKeyword

JavaScript
t.tsUndefinedKeyword();

t.isTSUndefinedKeyword(node, opts) および t.assertTSUndefinedKeyword(node, opts) も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsUnionType

JavaScript
t.tsUnionType(types);

t.isTSUnionType(node, opts) および t.assertTSUnionType(node, opts) も参照してください。

ASTノードTSUnionTypeの構造

  • types: Array<TSType> (必須)

別名: TypeScriptTSType


tsUnknownKeyword

JavaScript
t.tsUnknownKeyword();

t.isTSUnknownKeyword(node, opts) および t.assertTSUnknownKeyword(node, opts) も参照してください。

別名: TypeScriptTSTypeTSBaseType


tsVoidKeyword

JavaScript
t.tsVoidKeyword();

t.isTSVoidKeyword(node, opts) および t.assertTSVoidKeyword(node, opts) も参照してください。

別名: TypeScriptTSTypeTSBaseType


taggedTemplateExpression

JavaScript
t.taggedTemplateExpression(tag, quasi);

t.isTaggedTemplateExpression(node, opts) および t.assertTaggedTemplateExpression(node, opts) も参照してください。

ASTノードTaggedTemplateExpressionの構造

  • tag: Expression (必須)
  • quasi: TemplateLiteral (必須)
  • typeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation (デフォルト: null、ビルダー関数からは除外)

エイリアス: StandardizedExpression


templateElement

JavaScript
t.templateElement(value, tail);

t.isTemplateElement(node, opts) および t.assertTemplateElement(node, opts) も参照してください。

ASTノードTemplateElementの構造

  • value: { raw: string, cooked?: string } (必須)
  • tail: boolean (デフォルト: false

エイリアス: Standardized


templateLiteral

JavaScript
t.templateLiteral(quasis, expressions);

t.isTemplateLiteral(node, opts) および t.assertTemplateLiteral(node, opts) も参照してください。

ASTノードTemplateLiteralの構造

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

別名: StandardizedExpressionLiteral


thisExpression

JavaScript
t.thisExpression();

t.isThisExpression(node, opts) および t.assertThisExpression(node, opts) も参照してください。

エイリアス: StandardizedExpression


thisTypeAnnotation

JavaScript
t.thisTypeAnnotation();

t.isThisTypeAnnotation(node, opts) および t.assertThisTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


throwStatement

JavaScript
t.throwStatement(argument);

t.isThrowStatement(node, opts) および t.assertThrowStatement(node, opts) も参照してください。

ASTノードThrowStatementの構造

  • argument: Expression (必須)

エイリアス: StandardizedStatementTerminatorlessCompletionStatement


topicReference

JavaScript
t.topicReference();

t.isTopicReference(node, opts) および t.assertTopicReference(node, opts) も参照してください。

エイリアス: Expression


tryStatement

JavaScript
t.tryStatement(block, handler, finalizer);

t.isTryStatement(node, opts) および t.assertTryStatement(node, opts) も参照してください。

ASTノードTryStatementの構造

  • block: BlockStatement (必須)
  • handler: CatchClause (デフォルト: null
  • finalizer: BlockStatement (デフォルト: null

エイリアス: StandardizedStatement


tupleExpression

JavaScript
t.tupleExpression(elements);

t.isTupleExpression(node, opts) および t.assertTupleExpression(node, opts) も参照してください。

ASTノードTupleExpressionの構造

  • elements: Array<Expression | SpreadElement> (デフォルト: []

エイリアス: Expression


tupleTypeAnnotation

JavaScript
t.tupleTypeAnnotation(types);

t.isTupleTypeAnnotation(node, opts) および t.assertTupleTypeAnnotation(node, opts) も参照してください。

ASTノードTupleTypeAnnotationの構造

  • types: Array<FlowType> (必須)

エイリアス: FlowFlowType


typeAlias

JavaScript
t.typeAlias(id, typeParameters, right);

t.isTypeAlias(node, opts) および t.assertTypeAlias(node, opts) も参照してください。

ASTノードTypeAliasの構造

  • id: Identifier (必須)
  • typeParameters: TypeParameterDeclaration (デフォルト: null)
  • right: FlowType (必須)

エイリアス: FlowFlowDeclarationStatementDeclaration


typeAnnotation

JavaScript
t.typeAnnotation(typeAnnotation);

t.isTypeAnnotation(node, opts) および t.assertTypeAnnotation(node, opts) も参照してください。

ASTノードTypeAnnotationの構造

  • typeAnnotation: FlowType (必須)

エイリアス: Flow


typeCastExpression

JavaScript
t.typeCastExpression(expression, typeAnnotation);

t.isTypeCastExpression(node, opts) および t.assertTypeCastExpression(node, opts) も参照してください。

ASTノードTypeCastExpressionの構造

  • expression: Expression (必須)
  • typeAnnotation: TypeAnnotation (必須)

別名: FlowExpressionWrapperExpression


typeParameter

JavaScript
t.typeParameter(bound, default, variance);

t.isTypeParameter(node, opts) および t.assertTypeParameter(node, opts) も参照してください。

ASTノードTypeParameterの構造

  • bound: TypeAnnotation (デフォルト: null
  • default: FlowType (デフォルト: null
  • variance: Variance (デフォルト: null)
  • name: string (必須)

エイリアス: Flow


typeParameterDeclaration

JavaScript
t.typeParameterDeclaration(params);

t.isTypeParameterDeclaration(node, opts) および t.assertTypeParameterDeclaration(node, opts) も参照してください。

ASTノードTypeParameterDeclarationの構造

  • params: Array<TypeParameter> (必須)

エイリアス: Flow


typeParameterInstantiation

JavaScript
t.typeParameterInstantiation(params);

t.isTypeParameterInstantiation(node, opts) および t.assertTypeParameterInstantiation(node, opts) も参照してください。

ASTノードTypeParameterInstantiationの構造

  • params: Array<FlowType> (必須)

エイリアス: Flow


typeofTypeAnnotation

JavaScript
t.typeofTypeAnnotation(argument);

t.isTypeofTypeAnnotation(node, opts) および t.assertTypeofTypeAnnotation(node, opts) も参照してください。

ASTノードTypeofTypeAnnotationの構造

  • argument: FlowType (必須)

エイリアス: FlowFlowType


unaryExpression

JavaScript
t.unaryExpression(operator, argument, prefix);

t.isUnaryExpression(node, opts) および t.assertUnaryExpression(node, opts) も参照してください。

ASTノードUnaryExpressionの構造

  • operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof" (必須)
  • argument: Expression (必須)
  • prefix: boolean (デフォルト: true

別名: StandardizedUnaryLikeExpression


unionTypeAnnotation

JavaScript
t.unionTypeAnnotation(types);

t.isUnionTypeAnnotation(node, opts) および t.assertUnionTypeAnnotation(node, opts) も参照してください。

ASTノードUnionTypeAnnotationの構造

  • types: Array<FlowType> (必須)

エイリアス: FlowFlowType


updateExpression

JavaScript
t.updateExpression(operator, argument, prefix);

t.isUpdateExpression(node, opts) および t.assertUpdateExpression(node, opts) も参照してください。

ASTノードUpdateExpressionの構造

  • operator: "++" | "--" (必須)
  • argument: Expression (必須)
  • prefix: boolean (デフォルト: false

エイリアス: StandardizedExpression


v8IntrinsicIdentifier

JavaScript
t.v8IntrinsicIdentifier(name);

t.isV8IntrinsicIdentifier(node, opts) および t.assertV8IntrinsicIdentifier(node, opts) も参照してください。

ASTノードV8IntrinsicIdentifierの構造

  • name: string (必須)

エイリアス: Miscellaneous


variableDeclaration

JavaScript
t.variableDeclaration(kind, declarations);
履歴
バージョン変更点
v7.20.0kind は "using" を指定できます。

t.isVariableDeclaration(node, opts) および t.assertVariableDeclaration(node, opts) も参照してください。

ASTノードVariableDeclarationの構造

  • kind: "var" | "let" | "const" | "using" | "await using" (必須)
  • declarations: Array<VariableDeclarator> (必須)
  • declare: boolean (デフォルト: null、ビルダー関数から除外)

別名: StandardizedStatementDeclaration


variableDeclarator

JavaScript
t.variableDeclarator(id, init);

t.isVariableDeclarator(node, opts) および t.assertVariableDeclarator(node, opts) も参照してください。

ASTノードVariableDeclaratorの構造

  • id: LVal (必須)
  • init: Expression (デフォルト: null
  • definite: boolean (デフォルト: null、ビルダー関数から除外)

エイリアス: Standardized


variance

JavaScript
t.variance(kind);

t.isVariance(node, opts) および t.assertVariance(node, opts) も参照してください。

ASTノードVarianceの構造

  • kind: "minus" | "plus" (必須)

エイリアス: Flow


voidTypeAnnotation

JavaScript
t.voidTypeAnnotation();

t.isVoidTypeAnnotation(node, opts) および t.assertVoidTypeAnnotation(node, opts) も参照してください。

エイリアス: FlowFlowTypeFlowBaseAnnotation


whileStatement

JavaScript
t.whileStatement(test, body);

t.isWhileStatement(node, opts) および t.assertWhileStatement(node, opts) も参照してください。

ASTノードWhileStatementの構造

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

エイリアス: StandardizedStatementBlockParentLoopWhileScopable


withStatement

JavaScript
t.withStatement(object, body);

t.isWithStatement(node, opts) および t.assertWithStatement(node, opts) も参照してください。

ASTノードWithStatementの構造

  • object: Expression (必須)
  • body: Statement (必須)

エイリアス: StandardizedStatement


yieldExpression

JavaScript
t.yieldExpression(argument, delegate);

t.isYieldExpression(node, opts) および t.assertYieldExpression(node, opts) も参照してください。

ASTノードYieldExpressionの構造

  • argument: Expression (デフォルト: null)
  • delegate: boolean (デフォルト: false

エイリアス: StandardizedExpressionTerminatorless


別名

Accessor

非推奨。Babel 8で削除されます。

JavaScript
t.isAccessor(node);

対象ノード

Binary

BinaryExpressionとLogicalExpressionのラッパーです。両者は同じAST構造を共有しています。

JavaScript
t.isBinary(node);

対象ノード

Block

非推奨。Babel 8で削除されます。

JavaScript
t.isBlock(node);

対象ノード

BlockParent

新しいLexicalEnvironmentで実行コンテキストを開始するASTノードのラッパーです。言い換えれば、`let`および`const`宣言のスコープを定義します。

JavaScript
t.isBlockParent(node);

対象ノード

Class

ClassExpressionとClassDeclarationのラッパーです。両者は同じAST構造を共有しています。

JavaScript
t.isClass(node);

対象ノード

CompletionStatement

完了レコードを示すステートメントです。言い換えれば、ループをいつ中断するか、アクションが重大なエラーをスローする必要があるかなど、プログラムの制御フローを定義します。

JavaScript
t.isCompletionStatement(node);

対象ノード

Conditional

ConditionalExpressionとIfStatementのラッパーです。両者は同じAST構造を共有しています。

JavaScript
t.isConditional(node);

対象ノード

Declaration

あらゆるDeclarationのラッパーです。

JavaScript
t.isDeclaration(node);

対象ノード

EnumBody

Flowのenumボディのラッパーです。

JavaScript
t.isEnumBody(node);

対象ノード

EnumMember

Flowのenumメンバのラッパーです。

JavaScript
t.isEnumMember(node);

対象ノード

ExportDeclaration

あらゆるExportDeclarationのラッパーです。

JavaScript
t.isExportDeclaration(node);

対象ノード

Expression

あらゆるExpressionのラッパーです。

JavaScript
t.isExpression(node);

対象ノード

ExpressionWrapper

ランタイムセマンティクスを持たない式のラッパーです。

JavaScript
t.isExpressionWrapper(node);

対象ノード

Flow

Flowで定義されたASTノードのラッパーです。

JavaScript
t.isFlow(node);

対象ノード

FlowBaseAnnotation

主要なFlow型アノテーションのラッパーです。

JavaScript
t.isFlowBaseAnnotation(node);

対象ノード

FlowDeclaration

Flow宣言のラッパーです。

JavaScript
t.isFlowDeclaration(node);

対象ノード

FlowPredicate

Flow述語のラッパーです。

JavaScript
t.isFlowPredicate(node);

対象ノード

FlowType

Flow型アノテーションのラッパーです。

JavaScript
t.isFlowType(node);

対象ノード

For

ForStatementForXStatementのラッパーです。

JavaScript
t.isFor(node);

対象ノード

ForXStatement

ForInStatementsとForOfStatementsのラッパーです。

JavaScript
t.isForXStatement(node);

対象ノード

Function

関数とメソッドのラッパーです。`body`と`params`を持たなければなりません。注:`Function`は`FunctionParent`とは異なります。例えば、`StaticBlock`は`FunctionParent`ですが`Function`ではありません。

JavaScript
t.isFunction(node);

対象ノード

FunctionParent

新しいVariableEnvironmentで実行コンテキストを開始するASTノードのラッパーです。言い換えれば、`var`宣言のスコープを定義します。Babel 7以降、FunctionParentには`Program`が含まれていません。

JavaScript
t.isFunctionParent(node);

対象ノード

Immutable

不変オブジェクトとJSX要素のラッパーです。オブジェクトは、作成後に他のプロパティを定義できなければ不変です。

JavaScript
t.isImmutable(node);

対象ノード

ImportOrExportDeclaration

履歴
バージョン変更点
v7.21.0導入

ImportDeclarationとExportDeclarationのラッパーです。

JavaScript
t.isImportOrExportDeclaration(node);

対象ノード

JSX

JSXで定義されたASTノードのラッパーです。

JavaScript
t.isJSX(node);

対象ノード

LVal

代入式の`left`とForXStatementで使用される左辺値式のラッパーです。

JavaScript
t.isLVal(node);

対象ノード

Literal

リテラル正規表現リテラル、およびテンプレートリテラルのラッパーです。

JavaScript
t.isLiteral(node);

対象ノード

Loop

ループステートメントのラッパーです。

JavaScript
t.isLoop(node);

対象ノード

Method

オブジェクトメソッドとクラスメソッドのラッパーです。

JavaScript
t.isMethod(node);

対象ノード

Miscellaneous

開発に役立つことがある非標準のASTタイプのラッパーです。

JavaScript
t.isMiscellaneous(node);

対象ノード

ModuleDeclaration

履歴
バージョン変更点
v7.21.0非推奨
注意

非推奨です。ImportOrExportDeclarationを使用してください。PR #15266で移行に関する注記を確認してください。

JavaScript
t.isModuleDeclaration(node);

対象ノード

ModuleSpecifier

インポートおよびエクスポート指定子のカバー。注記: これは、仕様で定義されているModuleSpecifierではありません

JavaScript
t.isModuleSpecifier(node);

対象ノード

ObjectMember

オブジェクトリテラル内のメンバのカバー。

JavaScript
t.isObjectMember(node);

対象ノード

Pattern

識別子を除くBindingPatternのカバー。

JavaScript
t.isPattern(node);

対象ノード

PatternLike

BindingPatternのカバー。

JavaScript
t.isPatternLike(node);

対象ノード

Private

プライベートなクラス要素とプライベートな識別子のカバー。

JavaScript
t.isPrivate(node);

対象ノード

Property

オブジェクトのプロパティとクラスのプロパティのカバー。

JavaScript
t.isProperty(node);

対象ノード

Pureish

副作用のないASTノードのカバー。言い換えれば、複数回評価しても、観察可能な動作の変化はありません。

JavaScript
t.isPureish(node);

対象ノード

Scopable

FunctionParentBlockParentのカバー。

JavaScript
t.isScopable(node);

対象ノード

Standardized

公式ECMAScript仕様の一部であるASTノードのカバー。

JavaScript
t.isStandardized(node);

対象ノード

Statement

任意のStatementのカバー。

JavaScript
t.isStatement(node);

対象ノード

TSBaseType

主要なTypeScript型アノテーションのカバー。

JavaScript
t.isTSBaseType(node);

対象ノード

TSEntityName

tsエンティティのカバー。

JavaScript
t.isTSEntityName(node);

対象ノード

TSType

TypeScript型アノテーションのカバー。

JavaScript
t.isTSType(node);

対象ノード

TSTypeElement

TypeScript型宣言のカバー。

JavaScript
t.isTSTypeElement(node);

対象ノード

Terminatorless

演算子とオペランドの間に改行文字が挿入されるとセマンティクスが変化するASTノードのカバー。

JavaScript
t.isTerminatorless(node);

対象ノード

TypeScript

TypeScriptで定義されたASTノードのカバー。

JavaScript
t.isTypeScript(node);

対象ノード

UnaryLike

UnaryExpressionとSpreadElementのカバー。

JavaScript
t.isUnaryLike(node);

対象ノード

UserWhitespacable

非推奨。Babel 8で削除されます。

JavaScript
t.isUserWhitespacable(node);

対象ノード

While

同じAST形状を共有するDoWhileStatementとWhileStatementのカバー。

JavaScript
t.isWhile(node);

対象ノード