@babel/types
このモジュールは、ASTを手動で構築するためのメソッドと、ASTノードの型をチェックするためのメソッドを含んでいます。
インストール
- npm
- Yarn
- pnpm
npm install --save-dev @babel/types
yarn add --dev @babel/types
pnpm add --save-dev @babel/types
API
ノードビルダー
anyTypeAnnotation
t.anyTypeAnnotation();
t.isAnyTypeAnnotation(node, opts) と t.assertAnyTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
argumentPlaceholder
t.argumentPlaceholder();
t.isArgumentPlaceholder(node, opts) と t.assertArgumentPlaceholder(node, opts) も参照してください。
arrayExpression
t.arrayExpression(elements);
t.isArrayExpression(node, opts) と t.assertArrayExpression(node, opts) も参照してください。
ASTノード `ArrayExpression` の形状
elements:Array<null | Expression | SpreadElement>(デフォルト:[])
エイリアス: Standardized、Expression
arrayPattern
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、ビルダー関数から除外)
エイリアス: Standardized、Pattern、PatternLike、LVal
arrayTypeAnnotation
t.arrayTypeAnnotation(elementType);
t.isArrayTypeAnnotation(node, opts) と t.assertArrayTypeAnnotation(node, opts) も参照してください。
ASTノード `ArrayTypeAnnotation` の形状
elementType:FlowType(必須)
arrowFunctionExpression
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、ビルダー関数から除外)
エイリアス: Standardized、Scopable、Function、BlockParent、FunctionParent、Expression、Pureish
assignmentExpression
t.assignmentExpression(operator, left, right);
t.isAssignmentExpression(node, opts) と t.assertAssignmentExpression(node, opts) も参照してください。
ASTノード `AssignmentExpression` の形状
operator:string(必須)left:LVal | OptionalMemberExpression(必須)right:Expression(必須)
エイリアス: Standardized、Expression
assignmentPattern
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、ビルダー関数から除外)
エイリアス: Standardized、Pattern、PatternLike、LVal
awaitExpression
t.awaitExpression(argument);
t.isAwaitExpression(node, opts) と t.assertAwaitExpression(node, opts) も参照してください。
ASTノード `AwaitExpression` の形状
argument:Expression(必須)
エイリアス: Standardized、Expression、Terminatorless
bigIntLiteral
t.bigIntLiteral(value);
t.isBigIntLiteral(node, opts) と t.assertBigIntLiteral(node, opts) も参照してください。
ASTノード `BigIntLiteral` の形状
value:string(必須)
エイリアス: Standardized、Expression、Pureish、Literal、Immutable
binaryExpression
t.binaryExpression(operator, left, right);
t.isBinaryExpression(node, opts) と t.assertBinaryExpression(node, opts) も参照してください。
ASTノード `BinaryExpression` の形状
operator:"+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>"(必須)left:Expression | PrivateName(必須)right:Expression(必須)
エイリアス: Standardized、Binary、Expression
bindExpression
t.bindExpression(object, callee);
t.isBindExpression(node, opts) と t.assertBindExpression(node, opts) も参照してください。
ASTノード `BindExpression` の形状
object:Expression(必須)callee:Expression(必須)
エイリアス: Expression
blockStatement
t.blockStatement(body, directives);
t.isBlockStatement(node, opts) と t.assertBlockStatement(node, opts) も参照してください。
ASTノード `BlockStatement` の形状
body:Array<Statement>(必須)directives:Array<Directive>(デフォルト:[])
エイリアス: Standardized、Scopable、BlockParent、Block、Statement
booleanLiteral
t.booleanLiteral(value);
t.isBooleanLiteral(node, opts) と t.assertBooleanLiteral(node, opts) も参照してください。
ASTノード `BooleanLiteral` の形状
value:boolean(必須)
エイリアス: Standardized、Expression、Pureish、Literal、Immutable
booleanLiteralTypeAnnotation
t.booleanLiteralTypeAnnotation(value);
t.isBooleanLiteralTypeAnnotation(node, opts) と t.assertBooleanLiteralTypeAnnotation(node, opts) も参照してください。
ASTノード `BooleanLiteralTypeAnnotation` の形状
value:boolean(必須)
booleanTypeAnnotation
t.booleanTypeAnnotation();
t.isBooleanTypeAnnotation(node, opts) と t.assertBooleanTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
breakStatement
t.breakStatement(label);
t.isBreakStatement(node, opts) と t.assertBreakStatement(node, opts) も参照してください。
ASTノード `BreakStatement` の形状
label:Identifier(デフォルト:null)
エイリアス: Standardized、Statement、Terminatorless、CompletionStatement
callExpression
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、ビルダー関数から除外)
エイリアス: Standardized、Expression
catchClause
t.catchClause(param, body);
t.isCatchClause(node, opts) と t.assertCatchClause(node, opts) も参照してください。
ASTノード `CatchClause` の形状
param:Identifier | ArrayPattern | ObjectPattern(デフォルト:null)body:BlockStatement(必須)
エイリアス: Standardized、Scopable、BlockParent
classAccessorProperty
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、ビルダー関数から除外)
エイリアス: Standardized、Property、Accessor
classBody
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
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、ビルダー関数から除外)
エイリアス: Standardized、Scopable、Class、Statement、Declaration
classExpression
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、ビルダー関数から除外)
エイリアス: Standardized、Scopable、Class、Expression
classImplements
t.classImplements(id, typeParameters);
t.isClassImplements(node, opts) と t.assertClassImplements(node, opts) も参照してください。
ASTノードClassImplementsの形状
id:Identifier(必須)typeParameters:TypeParameterInstantiation(デフォルト:null)
エイリアス: Flow
classMethod
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、ビルダー関数から除外)
エイリアス: Standardized、Function、Scopable、BlockParent、FunctionParent、Method
classPrivateMethod
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、ビルダー関数から除外)
エイリアス: Standardized、Function、Scopable、BlockParent、FunctionParent、Method、Private
classPrivateProperty
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、ビルダー関数から除外)
エイリアス: Standardized、Property、Private
classProperty
t.classProperty(key, value, typeAnnotation, decorators, computed, static);
履歴
| バージョン | 変更点 |
|---|---|
v7.6.0 | static をサポート |
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、ビルダー関数から除外)
エイリアス: Standardized、Property
conditionalExpression
t.conditionalExpression(test, consequent, alternate);
t.isConditionalExpression(node, opts) と t.assertConditionalExpression(node, opts) も参照してください。
ASTノードConditionalExpressionの形状
test:Expression(必須)consequent:Expression(必須)alternate:Expression(必須)
エイリアス: Standardized、Expression、Conditional
continueStatement
t.continueStatement(label);
t.isContinueStatement(node, opts) と t.assertContinueStatement(node, opts) も参照してください。
ASTノードContinueStatementの形状
label:Identifier(デフォルト:null)
エイリアス: Standardized、Statement、Terminatorless、CompletionStatement
debuggerStatement
t.debuggerStatement();
t.isDebuggerStatement(node, opts) と t.assertDebuggerStatement(node, opts) も参照してください。
エイリアス: Standardized、Statement
decimalLiteral
t.decimalLiteral(value);
t.isDecimalLiteral(node, opts) と t.assertDecimalLiteral(node, opts) も参照してください。
ASTノードDecimalLiteralの形状
value:string(必須)
エイリアス: Expression、Pureish、Literal、Immutable
declareClass
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、ビルダー関数から除外)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareExportAllDeclaration
t.declareExportAllDeclaration(source);
t.isDeclareExportAllDeclaration(node, opts) と t.assertDeclareExportAllDeclaration(node, opts) も参照してください。
ASTノードDeclareExportAllDeclarationの形状
source:StringLiteral(必須)exportKind:"type" | "value"(デフォルト:null、ビルダー関数から除外)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareExportDeclaration
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、ビルダー関数から除外)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareFunction
t.declareFunction(id);
t.isDeclareFunction(node, opts) と t.assertDeclareFunction(node, opts) も参照してください。
ASTノードDeclareFunctionの形状
id:Identifier(必須)predicate:DeclaredPredicate(デフォルト:null、ビルダー関数から除外)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareInterface
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(必須)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareModule
t.declareModule(id, body, kind);
t.isDeclareModule(node, opts) と t.assertDeclareModule(node, opts) も参照してください。
ASTノードDeclareModuleの形状
id:Identifier | StringLiteral(必須)body:BlockStatement(必須)kind:"CommonJS" | "ES"(デフォルト:null)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareModuleExports
t.declareModuleExports(typeAnnotation);
t.isDeclareModuleExports(node, opts) と t.assertDeclareModuleExports(node, opts) も参照してください。
ASTノードDeclareModuleExportsの形状
typeAnnotation:TypeAnnotation(必須)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareOpaqueType
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、ビルダー関数から除外)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareTypeAlias
t.declareTypeAlias(id, typeParameters, right);
t.isDeclareTypeAlias(node, opts) と t.assertDeclareTypeAlias(node, opts) も参照してください。
ASTノードDeclareTypeAliasの形状
id:Identifier(必須)typeParameters:TypeParameterDeclaration(デフォルト:null)right:FlowType(必須)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declareVariable
t.declareVariable(id);
t.isDeclareVariable(node, opts) と t.assertDeclareVariable(node, opts) も参照してください。
ASTノードDeclareVariableの形状
id:Identifier(必須)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
declaredPredicate
t.declaredPredicate(value);
t.isDeclaredPredicate(node, opts) と t.assertDeclaredPredicate(node, opts) も参照してください。
ASTノードDeclaredPredicateの形状
value:Flow(必須)
エイリアス: Flow、FlowPredicate
decorator
t.decorator(expression);
t.isDecorator(node, opts) と t.assertDecorator(node, opts) も参照してください。
ASTノードDecoratorの形状
expression:Expression(必須)
directive
t.directive(value);
t.isDirective(node, opts) と t.assertDirective(node, opts) も参照してください。
ASTノードDirectiveの形状
value:DirectiveLiteral(必須)
エイリアス: Standardized
directiveLiteral
t.directiveLiteral(value);
t.isDirectiveLiteral(node, opts) と t.assertDirectiveLiteral(node, opts) も参照してください。
ASTノードDirectiveLiteralの形状
value:string(必須)
エイリアス: Standardized
doExpression
t.doExpression(body, async);
関連: t.isDoExpression(node, opts) と t.assertDoExpression(node, opts)。
ASTノードDoExpressionの形状
body:BlockStatement(必須)async:boolean(デフォルト:false)
エイリアス: Expression
doWhileStatement
t.doWhileStatement(test, body);
関連: t.isDoWhileStatement(node, opts) と t.assertDoWhileStatement(node, opts)。
ASTノードDoWhileStatementの形状
test:Expression(必須)body:Statement(必須)
エイリアス: Standardized、Statement、BlockParent、Loop、While、Scopable
emptyStatement
t.emptyStatement();
関連: t.isEmptyStatement(node, opts) と t.assertEmptyStatement(node, opts)。
エイリアス: Standardized、Statement
emptyTypeAnnotation
t.emptyTypeAnnotation();
関連: t.isEmptyTypeAnnotation(node, opts) と t.assertEmptyTypeAnnotation(node, opts)。
エイリアス: Flow、FlowType、FlowBaseAnnotation
enumBooleanBody
t.enumBooleanBody(members);
関連: t.isEnumBooleanBody(node, opts) と t.assertEnumBooleanBody(node, opts)。
ASTノードEnumBooleanBodyの形状
members:Array<EnumBooleanMember>(必須)explicitType:boolean(必須)hasUnknownMembers:boolean(必須)
enumBooleanMember
t.enumBooleanMember(id);
関連: t.isEnumBooleanMember(node, opts) と t.assertEnumBooleanMember(node, opts)。
ASTノードEnumBooleanMemberの形状
id:Identifier(必須)init:BooleanLiteral(必須)
エイリアス: Flow、EnumMember
enumDeclaration
t.enumDeclaration(id, body);
関連: t.isEnumDeclaration(node, opts) と t.assertEnumDeclaration(node, opts)。
ASTノードEnumDeclarationの形状
id:Identifier(必須)body:EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody(必須)
エイリアス: Flow、Statement、Declaration
enumDefaultedMember
t.enumDefaultedMember(id);
関連: t.isEnumDefaultedMember(node, opts) と t.assertEnumDefaultedMember(node, opts)。
ASTノードEnumDefaultedMemberの形状
id:Identifier(必須)
エイリアス: Flow、EnumMember
enumNumberBody
t.enumNumberBody(members);
関連: t.isEnumNumberBody(node, opts) と t.assertEnumNumberBody(node, opts)。
ASTノードEnumNumberBodyの形状
members:Array<EnumNumberMember>(必須)explicitType:boolean(必須)hasUnknownMembers:boolean(必須)
enumNumberMember
t.enumNumberMember(id, init);
関連: t.isEnumNumberMember(node, opts) と t.assertEnumNumberMember(node, opts)。
ASTノードEnumNumberMemberの形状
id:Identifier(必須)init:NumericLiteral(必須)
エイリアス: Flow、EnumMember
enumStringBody
t.enumStringBody(members);
関連: t.isEnumStringBody(node, opts) と t.assertEnumStringBody(node, opts)。
ASTノードEnumStringBodyの形状
members:Array<EnumStringMember | EnumDefaultedMember>(必須)explicitType:boolean(必須)hasUnknownMembers:boolean(必須)
enumStringMember
t.enumStringMember(id, init);
関連: t.isEnumStringMember(node, opts) と t.assertEnumStringMember(node, opts)。
ASTノードEnumStringMemberの形状
id:Identifier(必須)init:StringLiteral(必須)
エイリアス: Flow、EnumMember
enumSymbolBody
t.enumSymbolBody(members);
関連: t.isEnumSymbolBody(node, opts) と t.assertEnumSymbolBody(node, opts)。
ASTノードEnumSymbolBodyの形状
members:Array<EnumDefaultedMember>(必須)hasUnknownMembers:boolean(必須)
existsTypeAnnotation
t.existsTypeAnnotation();
関連: t.isExistsTypeAnnotation(node, opts) と t.assertExistsTypeAnnotation(node, opts)。
exportAllDeclaration
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、ビルダー関数から除外)
エイリアス: Standardized、Statement、Declaration、ImportOrExportDeclaration、ExportDeclaration
exportDefaultDeclaration
t.exportDefaultDeclaration(declaration);
関連: t.isExportDefaultDeclaration(node, opts) と t.assertExportDefaultDeclaration(node, opts)。
ASTノードExportDefaultDeclarationの形状
declaration:TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression(必須)exportKind:"value"(デフォルト:null、ビルダー関数から除外)
エイリアス: Standardized、Statement、Declaration、ImportOrExportDeclaration、ExportDeclaration
exportDefaultSpecifier
t.exportDefaultSpecifier(exported);
関連: t.isExportDefaultSpecifier(node, opts) と t.assertExportDefaultSpecifier(node, opts)。
ASTノードExportDefaultSpecifierの形状
exported:Identifier(必須)
エイリアス: ModuleSpecifier
exportNamedDeclaration
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、ビルダー関数から除外)
エイリアス: Standardized、Statement、Declaration、ImportOrExportDeclaration、ExportDeclaration
exportNamespaceSpecifier
t.exportNamespaceSpecifier(exported);
関連: t.isExportNamespaceSpecifier(node, opts) と t.assertExportNamespaceSpecifier(node, opts)。
ASTノードExportNamespaceSpecifierの形状
exported:Identifier(必須)
エイリアス: Standardized、ModuleSpecifier
exportSpecifier
t.exportSpecifier(local, exported);
関連: t.isExportSpecifier(node, opts) と t.assertExportSpecifier(node, opts)。
ASTノードExportSpecifierの形状
local:Identifier(必須)exported:Identifier | StringLiteral(必須)exportKind:"type" | "value"(デフォルト:null、ビルダー関数から除外)
エイリアス: Standardized、ModuleSpecifier
expressionStatement
t.expressionStatement(expression);
関連: t.isExpressionStatement(node, opts) と t.assertExpressionStatement(node, opts)。
ASTノードExpressionStatementの形状
expression:Expression(必須)
エイリアス: Standardized、Statement、ExpressionWrapper
file
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
t.forInStatement(left, right, body);
関連: t.isForInStatement(node, opts) と t.assertForInStatement(node, opts)。
ASTノードForInStatementの形状
left:VariableDeclaration | LVal(必須)right:Expression(必須)body:Statement(必須)
エイリアス: Standardized、Scopable、Statement、For、BlockParent、Loop、ForXStatement
forOfStatement
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、Scopable、Statement、For、BlockParent、Loop、ForXStatement
forStatement
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(必須)
エイリアス: Standardized、Scopable、Statement、For、BlockParent、Loop
functionDeclaration
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、ビルダー関数から除外)
エイリアス: Standardized、Scopable、Function、BlockParent、FunctionParent、Statement、Pureish、Declaration
functionExpression
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、ビルダー関数から除外)
エイリアス: Standardized、Scopable、Function、BlockParent、FunctionParent、Expression、Pureish
functionTypeAnnotation
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、ビルダー関数から除外)
functionTypeParam
t.functionTypeParam(name, typeAnnotation);
関連: t.isFunctionTypeParam(node, opts) と t.assertFunctionTypeParam(node, opts)。
ASTノードFunctionTypeParamの形状
name:Identifier(デフォルト:null)typeAnnotation:FlowType(必須)optional:boolean(デフォルト:null、ビルダー関数から除外)
エイリアス: Flow
genericTypeAnnotation
t.genericTypeAnnotation(id, typeParameters);
t.isGenericTypeAnnotation(node, opts) および t.assertGenericTypeAnnotation(node, opts) も参照してください。
ASTノードGenericTypeAnnotationの形状
id:Identifier | QualifiedTypeIdentifier(必須)typeParameters:TypeParameterInstantiation(デフォルト:null)
identifier
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、ビルダー関数から除外)
エイリアス: Standardized、Expression、PatternLike、LVal、TSEntityName
ifStatement
t.ifStatement(test, consequent, alternate);
t.isIfStatement(node, opts) および t.assertIfStatement(node, opts) も参照してください。
ASTノードIfStatementの形状
test:Expression(必須)consequent:Statement(必須)alternate:Statement(デフォルト:null)
エイリアス: Standardized、Statement、Conditional
import
t.import();
t.isImport(node, opts) および t.assertImport(node, opts) も参照してください。
エイリアス: Standardized、Expression
importAttribute
t.importAttribute(key, value);
t.isImportAttribute(node, opts) および t.assertImportAttribute(node, opts) も参照してください。
ASTノードImportAttributeの形状
key:Identifier | StringLiteral(必須)value:StringLiteral(必須)
importDeclaration
t.importDeclaration(specifiers, source);
履歴
| バージョン | 変更点 |
|---|---|
v7.20.0 | moduleをサポート |
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、ビルダー関数からは除外)
エイリアス: Standardized、Statement、Declaration、ImportOrExportDeclaration
importDefaultSpecifier
t.importDefaultSpecifier(local);
t.isImportDefaultSpecifier(node, opts) および t.assertImportDefaultSpecifier(node, opts) も参照してください。
ASTノードImportDefaultSpecifierの形状
local:Identifier(必須)
エイリアス: Standardized、ModuleSpecifier
importExpression
t.importExpression(source, options);
t.isImportExpression(node, opts) および t.assertImportExpression(node, opts) も参照してください。
ASTノードImportExpressionの形状
source:Expression(必須)options:Expression(デフォルト:null)phase:"source" | "defer"(デフォルト:null、ビルダー関数からは除外)
エイリアス: Standardized、Expression
importNamespaceSpecifier
t.importNamespaceSpecifier(local);
t.isImportNamespaceSpecifier(node, opts) および t.assertImportNamespaceSpecifier(node, opts) も参照してください。
ASTノードImportNamespaceSpecifierの形状
local:Identifier(必須)
エイリアス: Standardized、ModuleSpecifier
importSpecifier
t.importSpecifier(local, imported);
t.isImportSpecifier(node, opts) および t.assertImportSpecifier(node, opts) も参照してください。
ASTノードImportSpecifierの形状
local:Identifier(必須)imported:Identifier | StringLiteral(必須)importKind:"type" | "typeof" | "value"(デフォルト:null、ビルダー関数からは除外)
エイリアス: Standardized、ModuleSpecifier
indexedAccessType
t.indexedAccessType(objectType, indexType);
t.isIndexedAccessType(node, opts) および t.assertIndexedAccessType(node, opts) も参照してください。
ASTノードIndexedAccessTypeの形状
objectType:FlowType(必須)indexType:FlowType(必須)
inferredPredicate
t.inferredPredicate();
t.isInferredPredicate(node, opts) および t.assertInferredPredicate(node, opts) も参照してください。
エイリアス: Flow、FlowPredicate
interfaceDeclaration
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(必須)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
interfaceExtends
t.interfaceExtends(id, typeParameters);
t.isInterfaceExtends(node, opts) および t.assertInterfaceExtends(node, opts) も参照してください。
ASTノードInterfaceExtendsの形状
id:Identifier | QualifiedTypeIdentifier(必須)typeParameters:TypeParameterInstantiation(デフォルト:null)
エイリアス: Flow
interfaceTypeAnnotation
t.interfaceTypeAnnotation(extends, body);
t.isInterfaceTypeAnnotation(node, opts) および t.assertInterfaceTypeAnnotation(node, opts) も参照してください。
ASTノードInterfaceTypeAnnotationの形状
extends:Array<InterfaceExtends>(デフォルト:null)body:ObjectTypeAnnotation(必須)
interpreterDirective
t.interpreterDirective(value);
t.isInterpreterDirective(node, opts) および t.assertInterpreterDirective(node, opts) も参照してください。
ASTノードInterpreterDirectiveの形状
value:string(必須)
エイリアス: Standardized
intersectionTypeAnnotation
t.intersectionTypeAnnotation(types);
t.isIntersectionTypeAnnotation(node, opts) および t.assertIntersectionTypeAnnotation(node, opts) も参照してください。
ASTノードIntersectionTypeAnnotationの形状
types:Array<FlowType>(必須)
jsxAttribute
t.jsxAttribute(name, value);
t.isJSXAttribute(node, opts) および t.assertJSXAttribute(node, opts) も参照してください。
ASTノードJSXAttributeの形状
name:JSXIdentifier | JSXNamespacedName(必須)value:JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer(デフォルト:null)
jsxClosingElement
t.jsxClosingElement(name);
t.isJSXClosingElement(node, opts) および t.assertJSXClosingElement(node, opts) も参照してください。
ASTノードJSXClosingElementの形状
name:JSXIdentifier | JSXMemberExpression | JSXNamespacedName(必須)
jsxClosingFragment
t.jsxClosingFragment();
t.isJSXClosingFragment(node, opts) および t.assertJSXClosingFragment(node, opts) も参照してください。
jsxElement
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)
エイリアス: JSX、Immutable、Expression
jsxEmptyExpression
t.jsxEmptyExpression();
t.isJSXEmptyExpression(node, opts) および t.assertJSXEmptyExpression(node, opts) も参照してください。
エイリアス: JSX
jsxExpressionContainer
t.jsxExpressionContainer(expression);
t.isJSXExpressionContainer(node, opts) および t.assertJSXExpressionContainer(node, opts) も参照してください。
ASTノードJSXExpressionContainerの形状
expression:Expression | JSXEmptyExpression(必須)
jsxFragment
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、Immutable、Expression
jsxIdentifier
t.jsxIdentifier(name);
t.isJSXIdentifier(node, opts) および t.assertJSXIdentifier(node, opts) も参照してください。
ASTノードJSXIdentifierの形状
name:string(必須)
エイリアス: JSX
jsxMemberExpression
t.jsxMemberExpression(object, property);
t.isJSXMemberExpression(node, opts) および t.assertJSXMemberExpression(node, opts) も参照してください。
ASTノードJSXMemberExpressionの形状
object:JSXMemberExpression | JSXIdentifier(必須)property: 計算された場合Expression、それ以外の場合はIdentifier(必須)
エイリアス: JSX
jsxNamespacedName
t.jsxNamespacedName(namespace, name);
t.isJSXNamespacedName(node, opts) および t.assertJSXNamespacedName(node, opts) も参照してください。
ASTノードJSXNamespacedNameの形状
namespace:JSXIdentifier(必須)name:JSXIdentifier(必須)
エイリアス: JSX
jsxOpeningElement
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、ビルダー関数からは除外)
jsxOpeningFragment
t.jsxOpeningFragment();
t.isJSXOpeningFragment(node, opts) および t.assertJSXOpeningFragment(node, opts) も参照してください。
jsxSpreadAttribute
t.jsxSpreadAttribute(argument);
t.isJSXSpreadAttribute(node, opts) および t.assertJSXSpreadAttribute(node, opts) も参照してください。
ASTノードJSXSpreadAttributeの形状
argument:Expression(必須)
エイリアス: JSX
jsxSpreadChild
t.jsxSpreadChild(expression);
t.isJSXSpreadChild(node, opts) および t.assertJSXSpreadChild(node, opts) も参照してください。
ASTノードJSXSpreadChildの形状
expression:Expression(必須)
jsxText
t.jsxText(value);
t.isJSXText(node, opts) および t.assertJSXText(node, opts) も参照してください。
ASTノードJSXTextの形状
value:string(必須)
labeledStatement
t.labeledStatement(label, body);
t.isLabeledStatement(node, opts) および t.assertLabeledStatement(node, opts) も参照してください。
ASTノードLabeledStatementの形状
label:Identifier(必須)body:Statement(必須)
エイリアス: Standardized、Statement
logicalExpression
t.logicalExpression(operator, left, right);
t.isLogicalExpression(node, opts) および t.assertLogicalExpression(node, opts) も参照してください。
ASTノードLogicalExpressionの形状
operator:"||" | "&&" | "??"(必須)left:Expression(必須)right:Expression(必須)
エイリアス: Standardized、Binary、Expression
memberExpression
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)
エイリアス: Standardized、Expression、LVal
metaProperty
t.metaProperty(meta, property);
t.isMetaProperty(node, opts) と t.assertMetaProperty(node, opts) も参照してください。
ASTノードMetaPropertyの形状
meta:Identifier(必須)property:Identifier(必須)
エイリアス: Standardized、Expression
mixedTypeAnnotation
t.mixedTypeAnnotation();
t.isMixedTypeAnnotation(node, opts) と t.assertMixedTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
moduleExpression
t.moduleExpression(body);
t.isModuleExpression(node, opts) と t.assertModuleExpression(node, opts) も参照してください。
ASTノードModuleExpressionの形状
body:Program(必須)
エイリアス: Expression
newExpression
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、ビルダー関数から除外)
エイリアス: Standardized、Expression
noop
t.noop();
t.isNoop(node, opts) と t.assertNoop(node, opts) も参照してください。
エイリアス: Miscellaneous
nullLiteral
t.nullLiteral();
t.isNullLiteral(node, opts) と t.assertNullLiteral(node, opts) も参照してください。
エイリアス: Standardized、Expression、Pureish、Literal、Immutable
nullLiteralTypeAnnotation
t.nullLiteralTypeAnnotation();
t.isNullLiteralTypeAnnotation(node, opts) と t.assertNullLiteralTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
nullableTypeAnnotation
t.nullableTypeAnnotation(typeAnnotation);
t.isNullableTypeAnnotation(node, opts) と t.assertNullableTypeAnnotation(node, opts) も参照してください。
ASTノードNullableTypeAnnotationの形状
typeAnnotation:FlowType(必須)
numberLiteralTypeAnnotation
t.numberLiteralTypeAnnotation(value);
t.isNumberLiteralTypeAnnotation(node, opts) と t.assertNumberLiteralTypeAnnotation(node, opts) も参照してください。
ASTノードNumberLiteralTypeAnnotationの形状
value:number(必須)
numberTypeAnnotation
t.numberTypeAnnotation();
t.isNumberTypeAnnotation(node, opts) と t.assertNumberTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
numericLiteral
t.numericLiteral(value);
t.isNumericLiteral(node, opts) と t.assertNumericLiteral(node, opts) も参照してください。
ASTノードNumericLiteralの形状
value: 非負の有限なnumber(必須)
エイリアス: Standardized、Expression、Pureish、Literal、Immutable
objectExpression
t.objectExpression(properties);
t.isObjectExpression(node, opts) と t.assertObjectExpression(node, opts) も参照してください。
ASTノードObjectExpressionの形状
properties:Array<ObjectMethod | ObjectProperty | SpreadElement>(必須)
エイリアス: Standardized、Expression
objectMethod
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
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、ビルダー関数から除外)
エイリアス: Standardized、Pattern、PatternLike、LVal
objectProperty
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
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、ビルダー関数からは除外)
objectTypeCallProperty
t.objectTypeCallProperty(value);
t.isObjectTypeCallProperty(node, opts) と t.assertObjectTypeCallProperty(node, opts) も参照してください。
ASTノードObjectTypeCallPropertyの形状
value:FlowType(必須)static:boolean(必須)
エイリアス: Flow, UserWhitespacable
objectTypeIndexer
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
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
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
t.objectTypeSpreadProperty(argument);
t.isObjectTypeSpreadProperty(node, opts) と t.assertObjectTypeSpreadProperty(node, opts) も参照してください。
ASTノードObjectTypeSpreadPropertyの形状
argument:FlowType(必須)
エイリアス: Flow, UserWhitespacable
opaqueType
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(必須)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
optionalCallExpression
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、ビルダー関数から除外)
エイリアス: Standardized、Expression
optionalIndexedAccessType
t.optionalIndexedAccessType(objectType, indexType);
t.isOptionalIndexedAccessType(node, opts) と t.assertOptionalIndexedAccessType(node, opts) も参照してください。
ASTノードOptionalIndexedAccessTypeの形状
objectType:FlowType(必須)indexType:FlowType(必須)optional:boolean(必須)
optionalMemberExpression
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
parenthesizedExpression
t.parenthesizedExpression(expression);
t.isParenthesizedExpression(node, opts) と t.assertParenthesizedExpression(node, opts) も参照してください。
ASTノードParenthesizedExpressionの形状
expression:Expression(必須)
エイリアス: Standardized, Expression, ExpressionWrapper
pipelineBareFunction
t.pipelineBareFunction(callee);
t.isPipelineBareFunction(node, opts) と t.assertPipelineBareFunction(node, opts) も参照してください。
ASTノードPipelineBareFunctionの形状
callee:Expression(必須)
エイリアス: Expression
pipelinePrimaryTopicReference
t.pipelinePrimaryTopicReference();
t.isPipelinePrimaryTopicReference(node, opts) と t.assertPipelinePrimaryTopicReference(node, opts) も参照してください。
エイリアス: Expression
pipelineTopicExpression
t.pipelineTopicExpression(expression);
t.isPipelineTopicExpression(node, opts) と t.assertPipelineTopicExpression(node, opts) も参照してください。
ASTノードPipelineTopicExpressionの形状
expression:Expression(必須)
エイリアス: Expression
placeholder
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
t.privateName(id);
t.isPrivateName(node, opts) と t.assertPrivateName(node, opts) も参照してください。
ASTノードPrivateNameの形状
id:Identifier(必須)
エイリアス: Standardized, Private
program
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
t.qualifiedTypeIdentifier(id, qualification);
t.isQualifiedTypeIdentifier(node, opts) と t.assertQualifiedTypeIdentifier(node, opts) も参照してください。
ASTノードQualifiedTypeIdentifierの形状
id:Identifier(必須)qualification:Identifier | QualifiedTypeIdentifier(必須)
エイリアス: Flow
recordExpression
t.recordExpression(properties);
t.isRecordExpression(node, opts) と t.assertRecordExpression(node, opts) も参照してください。
ASTノードRecordExpressionの形状
properties:Array<ObjectProperty | SpreadElement>(必須)
エイリアス: Expression
regExpLiteral
t.regExpLiteral(pattern, flags);
t.isRegExpLiteral(node, opts) と t.assertRegExpLiteral(node, opts) も参照してください。
ASTノードRegExpLiteralの形状
pattern:string(必須)flags:string(デフォルト:'')
別名: Standardized、Expression、Pureish、Literal
restElement
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、ビルダー関数から除外)
別名: Standardized、LVal、PatternLike
returnStatement
t.returnStatement(argument);
t.isReturnStatement(node, opts) と t.assertReturnStatement(node, opts) も参照してください。
ASTノードReturnStatementの形状
argument:Expression(デフォルト:null)
エイリアス: Standardized、Statement、Terminatorless、CompletionStatement
sequenceExpression
t.sequenceExpression(expressions);
t.isSequenceExpression(node, opts) と t.assertSequenceExpression(node, opts) も参照してください。
ASTノードSequenceExpressionの形状
expressions:Array<Expression>(必須)
エイリアス: Standardized、Expression
spreadElement
t.spreadElement(argument);
t.isSpreadElement(node, opts) と t.assertSpreadElement(node, opts) も参照してください。
ASTノードSpreadElementの形状
argument:Expression(必須)
staticBlock
t.staticBlock(body);
t.isStaticBlock(node, opts) と t.assertStaticBlock(node, opts) も参照してください。
ASTノードStaticBlockの形状
body:Array<Statement>(必須)
別名: Standardized、Scopable、BlockParent、FunctionParent
stringLiteral
t.stringLiteral(value);
t.isStringLiteral(node, opts) と t.assertStringLiteral(node, opts) も参照してください。
ASTノードStringLiteralの形状
value:string(必須)
エイリアス: Standardized、Expression、Pureish、Literal、Immutable
stringLiteralTypeAnnotation
t.stringLiteralTypeAnnotation(value);
t.isStringLiteralTypeAnnotation(node, opts) と t.assertStringLiteralTypeAnnotation(node, opts) も参照してください。
ASTノードStringLiteralTypeAnnotationの形状
value:string(必須)
stringTypeAnnotation
t.stringTypeAnnotation();
t.isStringTypeAnnotation(node, opts) と t.assertStringTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
super
t.super();
t.isSuper(node, opts) と t.assertSuper(node, opts) も参照してください。
エイリアス: Standardized、Expression
switchCase
t.switchCase(test, consequent);
t.isSwitchCase(node, opts) と t.assertSwitchCase(node, opts) も参照してください。
ASTノードSwitchCaseの形状
test:Expression(デフォルト:null)consequent:Array<Statement>(必須)
エイリアス: Standardized
switchStatement
t.switchStatement(discriminant, cases);
t.isSwitchStatement(node, opts) と t.assertSwitchStatement(node, opts) も参照してください。
ASTノードSwitchStatementの形状
discriminant:Expression(必須)cases:Array<SwitchCase>(必須)
別名: Standardized、Statement、BlockParent、Scopable
symbolTypeAnnotation
t.symbolTypeAnnotation();
t.isSymbolTypeAnnotation(node, opts) と t.assertSymbolTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
tsAnyKeyword
t.tsAnyKeyword();
t.isTSAnyKeyword(node, opts) と t.assertTSAnyKeyword(node, opts) も参照してください。
別名: TypeScript、TSType、TSBaseType
tsArrayType
t.tsArrayType(elementType);
t.isTSArrayType(node, opts) と t.assertTSArrayType(node, opts) も参照してください。
ASTノードTSArrayTypeの形状
elementType:TSType(必須)
別名: TypeScript、TSType
tsAsExpression
t.tsAsExpression(expression, typeAnnotation);
t.isTSAsExpression(node, opts) と t.assertTSAsExpression(node, opts) も参照してください。
ASTノードTSAsExpressionの形状
expression:Expression(必須)typeAnnotation:TSType(必須)
別名: TypeScript、Expression、LVal、PatternLike
tsBigIntKeyword
t.tsBigIntKeyword();
t.isTSBigIntKeyword(node, opts) と t.assertTSBigIntKeyword(node, opts) も参照してください。
別名: TypeScript、TSType、TSBaseType
tsBooleanKeyword
t.tsBooleanKeyword();
t.isTSBooleanKeyword(node, opts) と t.assertTSBooleanKeyword(node, opts) も参照してください。
別名: TypeScript、TSType、TSBaseType
tsCallSignatureDeclaration
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)
tsConditionalType
t.tsConditionalType(checkType, extendsType, trueType, falseType);
t.isTSConditionalType(node, opts) と t.assertTSConditionalType(node, opts) も参照してください。
ASTノードTSConditionalTypeの形状
checkType:TSType(必須)extendsType:TSType(必須)trueType:TSType(必須)falseType:TSType(必須)
別名: TypeScript、TSType
tsConstructSignatureDeclaration
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)
tsConstructorType
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、ビルダー関数から除外)
別名: TypeScript、TSType
tsDeclareFunction
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、ビルダー関数から除外)
別名: TypeScript、Statement、Declaration
tsDeclareMethod
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
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、ビルダー関数から除外)
別名: TypeScript、Statement、Declaration
tsEnumMember
t.tsEnumMember(id, initializer);
t.isTSEnumMember(node, opts) と t.assertTSEnumMember(node, opts) も参照してください。
ASTノードTSEnumMemberの形状
id:Identifier | StringLiteral(必須)initializer:Expression(デフォルト:null)
別名: TypeScript
tsExportAssignment
t.tsExportAssignment(expression);
t.isTSExportAssignment(node, opts) と t.assertTSExportAssignment(node, opts) も参照してください。
ASTノードTSExportAssignmentの形状
expression:Expression(必須)
別名: TypeScript、Statement
tsExpressionWithTypeArguments
t.tsExpressionWithTypeArguments(expression, typeParameters);
t.isTSExpressionWithTypeArguments(node, opts) と t.assertTSExpressionWithTypeArguments(node, opts) も参照してください。
ASTノードTSExpressionWithTypeArgumentsの形状
expression:TSEntityName(必須)typeParameters:TSTypeParameterInstantiation(デフォルト:null)
別名: TypeScript、TSType
tsExternalModuleReference
t.tsExternalModuleReference(expression);
t.isTSExternalModuleReference(node, opts) と t.assertTSExternalModuleReference(node, opts) も参照してください。
ASTノードTSExternalModuleReferenceの形状
expression:StringLiteral(必須)
別名: TypeScript
tsFunctionType
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)
別名: TypeScript、TSType
tsImportEqualsDeclaration
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(必須)
別名: TypeScript、Statement
tsImportType
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、ビルダー関数から除外)
別名: TypeScript、TSType
tsIndexSignature
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、ビルダー関数から除外)
tsIndexedAccessType
t.tsIndexedAccessType(objectType, indexType);
t.isTSIndexedAccessType(node, opts) と t.assertTSIndexedAccessType(node, opts) も参照してください。
ASTノードTSIndexedAccessTypeの形状
objectType:TSType(必須)indexType:TSType(必須)
別名: TypeScript、TSType
tsInferType
t.tsInferType(typeParameter);
t.isTSInferType(node, opts) と t.assertTSInferType(node, opts) も参照してください。
ASTノードTSInferTypeの形状
typeParameter:TSTypeParameter(必須)
別名: TypeScript、TSType
tsInstantiationExpression
t.tsInstantiationExpression(expression, typeParameters);
t.isTSInstantiationExpression(node, opts) と t.assertTSInstantiationExpression(node, opts) も参照してください。
ASTノードTSInstantiationExpressionの形状
expression:Expression(必須)typeParameters:TSTypeParameterInstantiation(デフォルト:null)
別名: TypeScript、Expression
tsInterfaceBody
t.tsInterfaceBody(body);
t.isTSInterfaceBody(node, opts)およびt.assertTSInterfaceBody(node, opts)も参照してください。
ASTノードTSInterfaceBodyの形状
body:Array<TSTypeElement>(必須)
別名: TypeScript
tsInterfaceDeclaration
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、ビルダー関数から除外)
別名: TypeScript、Statement、Declaration
tsIntersectionType
t.tsIntersectionType(types);
t.isTSIntersectionType(node, opts)およびt.assertTSIntersectionType(node, opts)も参照してください。
ASTノードTSIntersectionTypeの形状
types:Array<TSType>(必須)
別名: TypeScript、TSType
tsIntrinsicKeyword
t.tsIntrinsicKeyword();
t.isTSIntrinsicKeyword(node, opts)およびt.assertTSIntrinsicKeyword(node, opts)も参照してください。
別名: TypeScript、TSType、TSBaseType
tsLiteralType
t.tsLiteralType(literal);
t.isTSLiteralType(node, opts)およびt.assertTSLiteralType(node, opts)も参照してください。
ASTノードTSLiteralTypeの形状
literal:NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TemplateLiteral | UnaryExpression(必須)
別名: TypeScript、TSType、TSBaseType
tsMappedType
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、ビルダー関数からは除外)
別名: TypeScript、TSType
tsMethodSignature
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、ビルダー関数から除外)
tsModuleBlock
t.tsModuleBlock(body);
t.isTSModuleBlock(node, opts)およびt.assertTSModuleBlock(node, opts)も参照してください。
ASTノードTSModuleBlockの形状
body:Array<Statement>(必須)
エイリアス: TypeScript、Scopable、Block、BlockParent、FunctionParent
tsModuleDeclaration
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、ビルダー関数からは除外)
別名: TypeScript、Statement、Declaration
tsNamedTupleMember
t.tsNamedTupleMember(label, elementType, optional);
t.isTSNamedTupleMember(node, opts)およびt.assertTSNamedTupleMember(node, opts)も参照してください。
ASTノードTSNamedTupleMemberの形状
label:Identifier(必須)elementType:TSType(必須)optional:boolean(デフォルト:false)
別名: TypeScript
tsNamespaceExportDeclaration
t.tsNamespaceExportDeclaration(id);
t.isTSNamespaceExportDeclaration(node, opts)およびt.assertTSNamespaceExportDeclaration(node, opts)も参照してください。
ASTノードTSNamespaceExportDeclarationの形状
id:Identifier(必須)
別名: TypeScript、Statement
tsNeverKeyword
t.tsNeverKeyword();
t.isTSNeverKeyword(node, opts)およびt.assertTSNeverKeyword(node, opts)も参照してください。
別名: TypeScript、TSType、TSBaseType
tsNonNullExpression
t.tsNonNullExpression(expression);
t.isTSNonNullExpression(node, opts)およびt.assertTSNonNullExpression(node, opts)も参照してください。
ASTノードTSNonNullExpressionの形状
expression:Expression(必須)
別名: TypeScript、Expression、LVal、PatternLike
tsNullKeyword
t.tsNullKeyword();
t.isTSNullKeyword(node, opts)およびt.assertTSNullKeyword(node, opts)も参照してください。
別名: TypeScript、TSType、TSBaseType
tsNumberKeyword
t.tsNumberKeyword();
t.isTSNumberKeyword(node, opts)およびt.assertTSNumberKeyword(node, opts)も参照してください。
別名: TypeScript、TSType、TSBaseType
tsObjectKeyword
t.tsObjectKeyword();
t.isTSObjectKeyword(node, opts)およびt.assertTSObjectKeyword(node, opts)も参照してください。
別名: TypeScript、TSType、TSBaseType
tsOptionalType
t.tsOptionalType(typeAnnotation);
t.isTSOptionalType(node, opts)およびt.assertTSOptionalType(node, opts)も参照してください。
ASTノードTSOptionalTypeの形状
typeAnnotation:TSType(必須)
別名: TypeScript、TSType
tsParameterProperty
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、ビルダー関数から除外)
エイリアス: TypeScript、LVal
tsParenthesizedType
t.tsParenthesizedType(typeAnnotation);
t.isTSParenthesizedType(node, opts)およびt.assertTSParenthesizedType(node, opts)も参照してください。
ASTノードTSParenthesizedTypeの形状
typeAnnotation:TSType(必須)
別名: TypeScript、TSType
tsPropertySignature
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、ビルダー関数から除外)
tsQualifiedName
t.tsQualifiedName(left, right);
t.isTSQualifiedName(node, opts)およびt.assertTSQualifiedName(node, opts)も参照してください。
ASTノードTSQualifiedNameの形状
left:TSEntityName(必須)right:Identifier(必須)
エイリアス: TypeScript、TSEntityName
tsRestType
t.tsRestType(typeAnnotation);
t.isTSRestType(node, opts)およびt.assertTSRestType(node, opts)も参照してください。
ASTノードTSRestTypeの形状
typeAnnotation:TSType(必須)
別名: TypeScript、TSType
tsSatisfiesExpression
t.tsSatisfiesExpression(expression, typeAnnotation);
履歴
| バージョン | 変更点 |
|---|---|
v7.20.0 | 導入 |
t.isTSSatisfiesExpression(node, opts)およびt.assertTSSatisfiesExpression(node, opts)も参照してください。
ASTノードTSSatisfiesExpressionの形状
expression:Expression(必須)typeAnnotation:TSType(必須)
別名: TypeScript、Expression、LVal、PatternLike
tsStringKeyword
t.tsStringKeyword();
t.isTSStringKeyword(node, opts)およびt.assertTSStringKeyword(node, opts)も参照してください。
別名: TypeScript、TSType、TSBaseType
tsSymbolKeyword
t.tsSymbolKeyword();
t.isTSSymbolKeyword(node, opts)およびt.assertTSSymbolKeyword(node, opts)も参照してください。
別名: TypeScript、TSType、TSBaseType
tsThisType
t.tsThisType();
t.isTSThisType(node, opts)およびt.assertTSThisType(node, opts)も参照してください。
別名: TypeScript、TSType、TSBaseType
tsTupleType
t.tsTupleType(elementTypes);
t.isTSTupleType(node, opts)およびt.assertTSTupleType(node, opts)も参照してください。
ASTノードTSTupleTypeの形状
elementTypes:Array<TSType | TSNamedTupleMember>(必須)
別名: TypeScript、TSType
tsTypeAliasDeclaration
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、ビルダー関数から除外)
別名: TypeScript、Statement、Declaration
tsTypeAnnotation
t.tsTypeAnnotation(typeAnnotation);
t.isTSTypeAnnotation(node, opts)およびt.assertTSTypeAnnotation(node, opts)も参照してください。
ASTノードTSTypeAnnotationの形状
typeAnnotation:TSType(必須)
別名: TypeScript
tsTypeAssertion
t.tsTypeAssertion(typeAnnotation, expression);
t.isTSTypeAssertion(node, opts)およびt.assertTSTypeAssertion(node, opts)も参照してください。
ASTノードTSTypeAssertionの形状
typeAnnotation:TSType(必須)expression:Expression(必須)
別名: TypeScript、Expression、LVal、PatternLike
tsTypeLiteral
t.tsTypeLiteral(members);
t.isTSTypeLiteral(node, opts)およびt.assertTSTypeLiteral(node, opts)も参照してください。
ASTノードTSTypeLiteralの形状
members:Array<TSTypeElement>(必須)
別名: TypeScript、TSType
tsTypeOperator
t.tsTypeOperator(typeAnnotation);
t.isTSTypeOperator(node, opts)およびt.assertTSTypeOperator(node, opts)も参照してください。
ASTノードTSTypeOperatorの形状
typeAnnotation:TSType(必須)operator:string(必須)
別名: TypeScript、TSType
tsTypeParameter
t.tsTypeParameter(constraint, default, name);
履歴
| バージョン | 変更点 |
|---|---|
v7.21.0 | constをサポート |
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
t.tsTypeParameterDeclaration(params);
t.isTSTypeParameterDeclaration(node, opts)およびt.assertTSTypeParameterDeclaration(node, opts)も参照してください。
ASTノードTSTypeParameterDeclarationの形状
params:Array<TSTypeParameter>(必須)
別名: TypeScript
tsTypeParameterInstantiation
t.tsTypeParameterInstantiation(params);
t.isTSTypeParameterInstantiation(node, opts) および t.assertTSTypeParameterInstantiation(node, opts) も参照してください。
ASTノードTSTypeParameterInstantiationの構造
params:Array<TSType>(必須)
別名: TypeScript
tsTypePredicate
t.tsTypePredicate(parameterName, typeAnnotation, asserts);
t.isTSTypePredicate(node, opts) および t.assertTSTypePredicate(node, opts) も参照してください。
ASTノードTSTypePredicateの構造
parameterName:Identifier | TSThisType(必須)typeAnnotation:TSTypeAnnotation(デフォルト:null)asserts:boolean(デフォルト:null)
別名: TypeScript、TSType
tsTypeQuery
t.tsTypeQuery(exprName, typeParameters);
t.isTSTypeQuery(node, opts) および t.assertTSTypeQuery(node, opts) も参照してください。
ASTノードTSTypeQueryの構造
exprName:TSEntityName | TSImportType(必須)typeParameters:TSTypeParameterInstantiation(デフォルト:null)
別名: TypeScript、TSType
tsTypeReference
t.tsTypeReference(typeName, typeParameters);
t.isTSTypeReference(node, opts) および t.assertTSTypeReference(node, opts) も参照してください。
ASTノードTSTypeReferenceの構造
typeName:TSEntityName(必須)typeParameters:TSTypeParameterInstantiation(デフォルト:null)
別名: TypeScript、TSType
tsUndefinedKeyword
t.tsUndefinedKeyword();
t.isTSUndefinedKeyword(node, opts) および t.assertTSUndefinedKeyword(node, opts) も参照してください。
別名: TypeScript、TSType、TSBaseType
tsUnionType
t.tsUnionType(types);
t.isTSUnionType(node, opts) および t.assertTSUnionType(node, opts) も参照してください。
ASTノードTSUnionTypeの構造
types:Array<TSType>(必須)
別名: TypeScript、TSType
tsUnknownKeyword
t.tsUnknownKeyword();
t.isTSUnknownKeyword(node, opts) および t.assertTSUnknownKeyword(node, opts) も参照してください。
別名: TypeScript、TSType、TSBaseType
tsVoidKeyword
t.tsVoidKeyword();
t.isTSVoidKeyword(node, opts) および t.assertTSVoidKeyword(node, opts) も参照してください。
別名: TypeScript、TSType、TSBaseType
taggedTemplateExpression
t.taggedTemplateExpression(tag, quasi);
t.isTaggedTemplateExpression(node, opts) および t.assertTaggedTemplateExpression(node, opts) も参照してください。
ASTノードTaggedTemplateExpressionの構造
tag:Expression(必須)quasi:TemplateLiteral(必須)typeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(デフォルト:null、ビルダー関数からは除外)
エイリアス: Standardized、Expression
templateElement
t.templateElement(value, tail);
t.isTemplateElement(node, opts) および t.assertTemplateElement(node, opts) も参照してください。
ASTノードTemplateElementの構造
value:{ raw: string, cooked?: string }(必須)tail:boolean(デフォルト:false)
エイリアス: Standardized
templateLiteral
t.templateLiteral(quasis, expressions);
t.isTemplateLiteral(node, opts) および t.assertTemplateLiteral(node, opts) も参照してください。
ASTノードTemplateLiteralの構造
quasis:Array<TemplateElement>(必須)expressions:Array<Expression | TSType>(必須)
別名: Standardized、Expression、Literal
thisExpression
t.thisExpression();
t.isThisExpression(node, opts) および t.assertThisExpression(node, opts) も参照してください。
エイリアス: Standardized、Expression
thisTypeAnnotation
t.thisTypeAnnotation();
t.isThisTypeAnnotation(node, opts) および t.assertThisTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
throwStatement
t.throwStatement(argument);
t.isThrowStatement(node, opts) および t.assertThrowStatement(node, opts) も参照してください。
ASTノードThrowStatementの構造
argument:Expression(必須)
エイリアス: Standardized、Statement、Terminatorless、CompletionStatement
topicReference
t.topicReference();
t.isTopicReference(node, opts) および t.assertTopicReference(node, opts) も参照してください。
エイリアス: Expression
tryStatement
t.tryStatement(block, handler, finalizer);
t.isTryStatement(node, opts) および t.assertTryStatement(node, opts) も参照してください。
ASTノードTryStatementの構造
block:BlockStatement(必須)handler:CatchClause(デフォルト:null)finalizer:BlockStatement(デフォルト:null)
エイリアス: Standardized、Statement
tupleExpression
t.tupleExpression(elements);
t.isTupleExpression(node, opts) および t.assertTupleExpression(node, opts) も参照してください。
ASTノードTupleExpressionの構造
elements:Array<Expression | SpreadElement>(デフォルト:[])
エイリアス: Expression
tupleTypeAnnotation
t.tupleTypeAnnotation(types);
t.isTupleTypeAnnotation(node, opts) および t.assertTupleTypeAnnotation(node, opts) も参照してください。
ASTノードTupleTypeAnnotationの構造
types:Array<FlowType>(必須)
typeAlias
t.typeAlias(id, typeParameters, right);
t.isTypeAlias(node, opts) および t.assertTypeAlias(node, opts) も参照してください。
ASTノードTypeAliasの構造
id:Identifier(必須)typeParameters:TypeParameterDeclaration(デフォルト:null)right:FlowType(必須)
エイリアス: Flow、FlowDeclaration、Statement、Declaration
typeAnnotation
t.typeAnnotation(typeAnnotation);
t.isTypeAnnotation(node, opts) および t.assertTypeAnnotation(node, opts) も参照してください。
ASTノードTypeAnnotationの構造
typeAnnotation:FlowType(必須)
エイリアス: Flow
typeCastExpression
t.typeCastExpression(expression, typeAnnotation);
t.isTypeCastExpression(node, opts) および t.assertTypeCastExpression(node, opts) も参照してください。
ASTノードTypeCastExpressionの構造
expression:Expression(必須)typeAnnotation:TypeAnnotation(必須)
別名: Flow、ExpressionWrapper、Expression
typeParameter
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
t.typeParameterDeclaration(params);
t.isTypeParameterDeclaration(node, opts) および t.assertTypeParameterDeclaration(node, opts) も参照してください。
ASTノードTypeParameterDeclarationの構造
params:Array<TypeParameter>(必須)
エイリアス: Flow
typeParameterInstantiation
t.typeParameterInstantiation(params);
t.isTypeParameterInstantiation(node, opts) および t.assertTypeParameterInstantiation(node, opts) も参照してください。
ASTノードTypeParameterInstantiationの構造
params:Array<FlowType>(必須)
エイリアス: Flow
typeofTypeAnnotation
t.typeofTypeAnnotation(argument);
t.isTypeofTypeAnnotation(node, opts) および t.assertTypeofTypeAnnotation(node, opts) も参照してください。
ASTノードTypeofTypeAnnotationの構造
argument:FlowType(必須)
unaryExpression
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)
別名: Standardized、UnaryLike、Expression
unionTypeAnnotation
t.unionTypeAnnotation(types);
t.isUnionTypeAnnotation(node, opts) および t.assertUnionTypeAnnotation(node, opts) も参照してください。
ASTノードUnionTypeAnnotationの構造
types:Array<FlowType>(必須)
updateExpression
t.updateExpression(operator, argument, prefix);
t.isUpdateExpression(node, opts) および t.assertUpdateExpression(node, opts) も参照してください。
ASTノードUpdateExpressionの構造
operator:"++" | "--"(必須)argument:Expression(必須)prefix:boolean(デフォルト:false)
エイリアス: Standardized、Expression
v8IntrinsicIdentifier
t.v8IntrinsicIdentifier(name);
t.isV8IntrinsicIdentifier(node, opts) および t.assertV8IntrinsicIdentifier(node, opts) も参照してください。
ASTノードV8IntrinsicIdentifierの構造
name:string(必須)
エイリアス: Miscellaneous
variableDeclaration
t.variableDeclaration(kind, declarations);
履歴
| バージョン | 変更点 |
|---|---|
v7.20.0 | kind は "using" を指定できます。 |
t.isVariableDeclaration(node, opts) および t.assertVariableDeclaration(node, opts) も参照してください。
ASTノードVariableDeclarationの構造
kind:"var" | "let" | "const" | "using" | "await using"(必須)declarations:Array<VariableDeclarator>(必須)declare:boolean(デフォルト:null、ビルダー関数から除外)
別名: Standardized、Statement、Declaration
variableDeclarator
t.variableDeclarator(id, init);
t.isVariableDeclarator(node, opts) および t.assertVariableDeclarator(node, opts) も参照してください。
ASTノードVariableDeclaratorの構造
id:LVal(必須)init:Expression(デフォルト:null)definite:boolean(デフォルト:null、ビルダー関数から除外)
エイリアス: Standardized
variance
t.variance(kind);
t.isVariance(node, opts) および t.assertVariance(node, opts) も参照してください。
ASTノードVarianceの構造
kind:"minus" | "plus"(必須)
エイリアス: Flow
voidTypeAnnotation
t.voidTypeAnnotation();
t.isVoidTypeAnnotation(node, opts) および t.assertVoidTypeAnnotation(node, opts) も参照してください。
エイリアス: Flow、FlowType、FlowBaseAnnotation
whileStatement
t.whileStatement(test, body);
t.isWhileStatement(node, opts) および t.assertWhileStatement(node, opts) も参照してください。
ASTノードWhileStatementの構造
test:Expression(必須)body:Statement(必須)
エイリアス: Standardized、Statement、BlockParent、Loop、While、Scopable
withStatement
t.withStatement(object, body);
t.isWithStatement(node, opts) および t.assertWithStatement(node, opts) も参照してください。
ASTノードWithStatementの構造
object:Expression(必須)body:Statement(必須)
エイリアス: Standardized、Statement
yieldExpression
t.yieldExpression(argument, delegate);
t.isYieldExpression(node, opts) および t.assertYieldExpression(node, opts) も参照してください。
ASTノードYieldExpressionの構造
argument:Expression(デフォルト:null)delegate:boolean(デフォルト:false)
エイリアス: Standardized、Expression、Terminatorless
別名
Accessor
非推奨。Babel 8で削除されます。
t.isAccessor(node);
対象ノード
Binary
BinaryExpressionとLogicalExpressionのラッパーです。両者は同じAST構造を共有しています。
t.isBinary(node);
対象ノード
Block
非推奨。Babel 8で削除されます。
t.isBlock(node);
対象ノード
BlockParent
新しいLexicalEnvironmentで実行コンテキストを開始するASTノードのラッパーです。言い換えれば、`let`および`const`宣言のスコープを定義します。
t.isBlockParent(node);
対象ノード
ArrowFunctionExpressionBlockStatementCatchClauseClassMethodClassPrivateMethodDoWhileStatementForInStatementForOfStatementForStatementFunctionDeclarationFunctionExpressionObjectMethodProgramStaticBlockSwitchStatementTSModuleBlockWhileStatement
Class
ClassExpressionとClassDeclarationのラッパーです。両者は同じAST構造を共有しています。
t.isClass(node);
対象ノード
CompletionStatement
完了レコードを示すステートメントです。言い換えれば、ループをいつ中断するか、アクションが重大なエラーをスローする必要があるかなど、プログラムの制御フローを定義します。
t.isCompletionStatement(node);
対象ノード
Conditional
ConditionalExpressionとIfStatementのラッパーです。両者は同じAST構造を共有しています。
t.isConditional(node);
対象ノード
Declaration
あらゆるDeclarationのラッパーです。
t.isDeclaration(node);
対象ノード
ClassDeclarationDeclareClassDeclareExportAllDeclarationDeclareExportDeclarationDeclareFunctionDeclareInterfaceDeclareModuleDeclareModuleExportsDeclareOpaqueTypeDeclareTypeAliasDeclareVariableEnumDeclarationExportAllDeclarationExportDefaultDeclarationExportNamedDeclarationFunctionDeclarationImportDeclarationInterfaceDeclarationOpaqueTypeTSDeclareFunctionTSEnumDeclarationTSInterfaceDeclarationTSModuleDeclarationTSTypeAliasDeclarationTypeAliasVariableDeclaration
EnumBody
Flowのenumボディのラッパーです。
t.isEnumBody(node);
対象ノード
EnumMember
Flowのenumメンバのラッパーです。
t.isEnumMember(node);
対象ノード
ExportDeclaration
あらゆるExportDeclarationのラッパーです。
t.isExportDeclaration(node);
対象ノード
Expression
あらゆるExpressionのラッパーです。
t.isExpression(node);
対象ノード
ArrayExpressionArrowFunctionExpressionAssignmentExpressionAwaitExpressionBigIntLiteralBinaryExpressionBindExpressionBooleanLiteralCallExpressionClassExpressionConditionalExpressionDecimalLiteralDoExpressionFunctionExpressionIdentifierImportImportExpressionJSXElementJSXFragmentLogicalExpressionMemberExpressionMetaPropertyModuleExpressionNewExpressionNullLiteralNumericLiteralObjectExpressionOptionalCallExpressionOptionalMemberExpressionParenthesizedExpressionPipelineBareFunctionPipelinePrimaryTopicReferencePipelineTopicExpressionRecordExpressionRegExpLiteralSequenceExpressionStringLiteralSuperTSAsExpressionTSInstantiationExpressionTSNonNullExpressionTSSatisfiesExpressionTSTypeAssertionTaggedTemplateExpressionTemplateLiteralThisExpressionTopicReferenceTupleExpressionTypeCastExpressionUnaryExpressionUpdateExpressionYieldExpression
ExpressionWrapper
ランタイムセマンティクスを持たない式のラッパーです。
t.isExpressionWrapper(node);
対象ノード
Flow
Flowで定義されたASTノードのラッパーです。
t.isFlow(node);
対象ノード
AnyTypeAnnotationArrayTypeAnnotationBooleanLiteralTypeAnnotationBooleanTypeAnnotationClassImplementsDeclareClassDeclareExportAllDeclarationDeclareExportDeclarationDeclareFunctionDeclareInterfaceDeclareModuleDeclareModuleExportsDeclareOpaqueTypeDeclareTypeAliasDeclareVariableDeclaredPredicateEmptyTypeAnnotationEnumBooleanBodyEnumBooleanMemberEnumDeclarationEnumDefaultedMemberEnumNumberBodyEnumNumberMemberEnumStringBodyEnumStringMemberEnumSymbolBodyExistsTypeAnnotationFunctionTypeAnnotationFunctionTypeParamGenericTypeAnnotationIndexedAccessTypeInferredPredicateInterfaceDeclarationInterfaceExtendsInterfaceTypeAnnotationIntersectionTypeAnnotationMixedTypeAnnotationNullLiteralTypeAnnotationNullableTypeAnnotationNumberLiteralTypeAnnotationNumberTypeAnnotationObjectTypeAnnotationObjectTypeCallPropertyObjectTypeIndexerObjectTypeInternalSlotObjectTypePropertyObjectTypeSpreadPropertyOpaqueTypeOptionalIndexedAccessTypeQualifiedTypeIdentifierStringLiteralTypeAnnotationStringTypeAnnotationSymbolTypeAnnotationThisTypeAnnotationTupleTypeAnnotationTypeAliasTypeAnnotationTypeCastExpressionTypeParameterTypeParameterDeclarationTypeParameterInstantiationTypeofTypeAnnotationUnionTypeAnnotationVarianceVoidTypeAnnotation
FlowBaseAnnotation
主要なFlow型アノテーションのラッパーです。
t.isFlowBaseAnnotation(node);
対象ノード
AnyTypeAnnotationBooleanTypeAnnotationEmptyTypeAnnotationMixedTypeAnnotationNullLiteralTypeAnnotationNumberTypeAnnotationStringTypeAnnotationSymbolTypeAnnotationThisTypeAnnotationVoidTypeAnnotation
FlowDeclaration
Flow宣言のラッパーです。
t.isFlowDeclaration(node);
対象ノード
DeclareClassDeclareExportAllDeclarationDeclareExportDeclarationDeclareFunctionDeclareInterfaceDeclareModuleDeclareModuleExportsDeclareOpaqueTypeDeclareTypeAliasDeclareVariableInterfaceDeclarationOpaqueTypeTypeAlias
FlowPredicate
Flow述語のラッパーです。
t.isFlowPredicate(node);
対象ノード
FlowType
Flow型アノテーションのラッパーです。
t.isFlowType(node);
対象ノード
AnyTypeAnnotationArrayTypeAnnotationBooleanLiteralTypeAnnotationBooleanTypeAnnotationEmptyTypeAnnotationExistsTypeAnnotationFunctionTypeAnnotationGenericTypeAnnotationIndexedAccessTypeInterfaceTypeAnnotationIntersectionTypeAnnotationMixedTypeAnnotationNullLiteralTypeAnnotationNullableTypeAnnotationNumberLiteralTypeAnnotationNumberTypeAnnotationObjectTypeAnnotationOptionalIndexedAccessTypeStringLiteralTypeAnnotationStringTypeAnnotationSymbolTypeAnnotationThisTypeAnnotationTupleTypeAnnotationTypeofTypeAnnotationUnionTypeAnnotationVoidTypeAnnotation
For
ForStatementとForXStatementのラッパーです。
t.isFor(node);
対象ノード
ForXStatement
ForInStatementsとForOfStatementsのラッパーです。
t.isForXStatement(node);
対象ノード
Function
関数とメソッドのラッパーです。`body`と`params`を持たなければなりません。注:`Function`は`FunctionParent`とは異なります。例えば、`StaticBlock`は`FunctionParent`ですが`Function`ではありません。
t.isFunction(node);
対象ノード
ArrowFunctionExpressionClassMethodClassPrivateMethodFunctionDeclarationFunctionExpressionObjectMethod
FunctionParent
新しいVariableEnvironmentで実行コンテキストを開始するASTノードのラッパーです。言い換えれば、`var`宣言のスコープを定義します。Babel 7以降、FunctionParentには`Program`が含まれていません。
t.isFunctionParent(node);
対象ノード
ArrowFunctionExpressionClassMethodClassPrivateMethodFunctionDeclarationFunctionExpressionObjectMethodStaticBlockTSModuleBlock
Immutable
不変オブジェクトとJSX要素のラッパーです。オブジェクトは、作成後に他のプロパティを定義できなければ不変です。
t.isImmutable(node);
対象ノード
BigIntLiteralBooleanLiteralDecimalLiteralJSXAttributeJSXClosingElementJSXClosingFragmentJSXElementJSXExpressionContainerJSXFragmentJSXOpeningElementJSXOpeningFragmentJSXSpreadChildJSXTextNullLiteralNumericLiteralStringLiteral
ImportOrExportDeclaration
履歴
| バージョン | 変更点 |
|---|---|
v7.21.0 | 導入 |
ImportDeclarationとExportDeclarationのラッパーです。
t.isImportOrExportDeclaration(node);
対象ノード
JSX
JSXで定義されたASTノードのラッパーです。
t.isJSX(node);
対象ノード
JSXAttributeJSXClosingElementJSXClosingFragmentJSXElementJSXEmptyExpressionJSXExpressionContainerJSXFragmentJSXIdentifierJSXMemberExpressionJSXNamespacedNameJSXOpeningElementJSXOpeningFragmentJSXSpreadAttributeJSXSpreadChildJSXText
LVal
代入式の`left`とForXStatementで使用される左辺値式のラッパーです。
t.isLVal(node);
対象ノード
ArrayPatternAssignmentPatternIdentifierMemberExpressionObjectPatternRestElementTSAsExpressionTSNonNullExpressionTSParameterPropertyTSSatisfiesExpressionTSTypeAssertion
Literal
リテラル、正規表現リテラル、およびテンプレートリテラルのラッパーです。
t.isLiteral(node);
対象ノード
BigIntLiteralBooleanLiteralDecimalLiteralNullLiteralNumericLiteralRegExpLiteralStringLiteralTemplateLiteral
Loop
ループステートメントのラッパーです。
t.isLoop(node);
対象ノード
Method
オブジェクトメソッドとクラスメソッドのラッパーです。
t.isMethod(node);
対象ノード
Miscellaneous
開発に役立つことがある非標準のASTタイプのラッパーです。
t.isMiscellaneous(node);
対象ノード
ModuleDeclaration
履歴
| バージョン | 変更点 |
|---|---|
v7.21.0 | 非推奨 |
非推奨です。ImportOrExportDeclarationを使用してください。PR #15266で移行に関する注記を確認してください。
t.isModuleDeclaration(node);
対象ノード
ModuleSpecifier
インポートおよびエクスポート指定子のカバー。注記: これは、仕様で定義されているModuleSpecifierではありません。
t.isModuleSpecifier(node);
対象ノード
ExportDefaultSpecifierExportNamespaceSpecifierExportSpecifierImportDefaultSpecifierImportNamespaceSpecifierImportSpecifier
ObjectMember
オブジェクトリテラル内のメンバのカバー。
t.isObjectMember(node);
対象ノード
Pattern
識別子を除くBindingPatternのカバー。
t.isPattern(node);
対象ノード
PatternLike
BindingPatternのカバー。
t.isPatternLike(node);
対象ノード
ArrayPatternAssignmentPatternIdentifierObjectPatternRestElementTSAsExpressionTSNonNullExpressionTSSatisfiesExpressionTSTypeAssertion
Private
プライベートなクラス要素とプライベートな識別子のカバー。
t.isPrivate(node);
対象ノード
Property
オブジェクトのプロパティとクラスのプロパティのカバー。
t.isProperty(node);
対象ノード
Pureish
副作用のないASTノードのカバー。言い換えれば、複数回評価しても、観察可能な動作の変化はありません。
t.isPureish(node);
対象ノード
ArrowFunctionExpressionBigIntLiteralBooleanLiteralDecimalLiteralFunctionDeclarationFunctionExpressionNullLiteralNumericLiteralRegExpLiteralStringLiteral
Scopable
FunctionParentとBlockParentのカバー。
t.isScopable(node);
対象ノード
ArrowFunctionExpressionBlockStatementCatchClauseClassDeclarationClassExpressionClassMethodClassPrivateMethodDoWhileStatementForInStatementForOfStatementForStatementFunctionDeclarationFunctionExpressionObjectMethodProgramStaticBlockSwitchStatementTSModuleBlockWhileStatement
Standardized
公式ECMAScript仕様の一部であるASTノードのカバー。
t.isStandardized(node);
対象ノード
ArrayExpressionArrayPatternArrowFunctionExpressionAssignmentExpressionAssignmentPatternAwaitExpressionBigIntLiteralBinaryExpressionBlockStatementBooleanLiteralBreakStatementCallExpressionCatchClauseClassAccessorPropertyClassBodyClassDeclarationClassExpressionClassMethodClassPrivateMethodClassPrivatePropertyClassPropertyConditionalExpressionContinueStatementDebuggerStatementDirectiveDirectiveLiteralDoWhileStatementEmptyStatementExportAllDeclarationExportDefaultDeclarationExportNamedDeclarationExportNamespaceSpecifierExportSpecifierExpressionStatementFileForInStatementForOfStatementForStatementFunctionDeclarationFunctionExpressionIdentifierIfStatementImportImportDeclarationImportDefaultSpecifierImportExpressionImportNamespaceSpecifierImportSpecifierInterpreterDirectiveLabeledStatementLogicalExpressionMemberExpressionMetaPropertyNewExpressionNullLiteralNumericLiteralObjectExpressionObjectMethodObjectPatternObjectPropertyOptionalCallExpressionOptionalMemberExpressionParenthesizedExpressionPrivateNameProgramRegExpLiteralRestElementReturnStatementSequenceExpressionSpreadElementStaticBlockStringLiteralSuperSwitchCaseSwitchStatementTaggedTemplateExpressionTemplateElementTemplateLiteralThisExpressionThrowStatementTryStatementUnaryExpressionUpdateExpressionVariableDeclarationVariableDeclaratorWhileStatementWithStatementYieldExpression
Statement
任意のStatementのカバー。
t.isStatement(node);
対象ノード
BlockStatementBreakStatementClassDeclarationContinueStatementDebuggerStatementDeclareClassDeclareExportAllDeclarationDeclareExportDeclarationDeclareFunctionDeclareInterfaceDeclareModuleDeclareModuleExportsDeclareOpaqueTypeDeclareTypeAliasDeclareVariableDoWhileStatementEmptyStatementEnumDeclarationExportAllDeclarationExportDefaultDeclarationExportNamedDeclarationExpressionStatementForInStatementForOfStatementForStatementFunctionDeclarationIfStatementImportDeclarationInterfaceDeclarationLabeledStatementOpaqueTypeReturnStatementSwitchStatementTSDeclareFunctionTSEnumDeclarationTSExportAssignmentTSImportEqualsDeclarationTSInterfaceDeclarationTSModuleDeclarationTSNamespaceExportDeclarationTSTypeAliasDeclarationThrowStatementTryStatementTypeAliasVariableDeclarationWhileStatementWithStatement
TSBaseType
主要なTypeScript型アノテーションのカバー。
t.isTSBaseType(node);
対象ノード
TSAnyKeywordTSBigIntKeywordTSBooleanKeywordTSIntrinsicKeywordTSLiteralTypeTSNeverKeywordTSNullKeywordTSNumberKeywordTSObjectKeywordTSStringKeywordTSSymbolKeywordTSThisTypeTSUndefinedKeywordTSUnknownKeywordTSVoidKeyword
TSEntityName
tsエンティティのカバー。
t.isTSEntityName(node);
対象ノード
TSType
TypeScript型アノテーションのカバー。
t.isTSType(node);
対象ノード
TSAnyKeywordTSArrayTypeTSBigIntKeywordTSBooleanKeywordTSConditionalTypeTSConstructorTypeTSExpressionWithTypeArgumentsTSFunctionTypeTSImportTypeTSIndexedAccessTypeTSInferTypeTSIntersectionTypeTSIntrinsicKeywordTSLiteralTypeTSMappedTypeTSNeverKeywordTSNullKeywordTSNumberKeywordTSObjectKeywordTSOptionalTypeTSParenthesizedTypeTSRestTypeTSStringKeywordTSSymbolKeywordTSThisTypeTSTupleTypeTSTypeLiteralTSTypeOperatorTSTypePredicateTSTypeQueryTSTypeReferenceTSUndefinedKeywordTSUnionTypeTSUnknownKeywordTSVoidKeyword
TSTypeElement
TypeScript型宣言のカバー。
t.isTSTypeElement(node);
対象ノード
TSCallSignatureDeclarationTSConstructSignatureDeclarationTSIndexSignatureTSMethodSignatureTSPropertySignature
Terminatorless
演算子とオペランドの間に改行文字が挿入されるとセマンティクスが変化するASTノードのカバー。
t.isTerminatorless(node);
対象ノード
TypeScript
TypeScriptで定義されたASTノードのカバー。
t.isTypeScript(node);
対象ノード
TSAnyKeywordTSArrayTypeTSAsExpressionTSBigIntKeywordTSBooleanKeywordTSCallSignatureDeclarationTSConditionalTypeTSConstructSignatureDeclarationTSConstructorTypeTSDeclareFunctionTSDeclareMethodTSEnumDeclarationTSEnumMemberTSExportAssignmentTSExpressionWithTypeArgumentsTSExternalModuleReferenceTSFunctionTypeTSImportEqualsDeclarationTSImportTypeTSIndexSignatureTSIndexedAccessTypeTSInferTypeTSInstantiationExpressionTSInterfaceBodyTSInterfaceDeclarationTSIntersectionTypeTSIntrinsicKeywordTSLiteralTypeTSMappedTypeTSMethodSignatureTSModuleBlockTSModuleDeclarationTSNamedTupleMemberTSNamespaceExportDeclarationTSNeverKeywordTSNonNullExpressionTSNullKeywordTSNumberKeywordTSObjectKeywordTSOptionalTypeTSParameterPropertyTSParenthesizedTypeTSPropertySignatureTSQualifiedNameTSRestTypeTSSatisfiesExpressionTSStringKeywordTSSymbolKeywordTSThisTypeTSTupleTypeTSTypeAliasDeclarationTSTypeAnnotationTSTypeAssertionTSTypeLiteralTSTypeOperatorTSTypeParameterTSTypeParameterDeclarationTSTypeParameterInstantiationTSTypePredicateTSTypeQueryTSTypeReferenceTSUndefinedKeywordTSUnionTypeTSUnknownKeywordTSVoidKeyword
UnaryLike
UnaryExpressionとSpreadElementのカバー。
t.isUnaryLike(node);
対象ノード
UserWhitespacable
非推奨。Babel 8で削除されます。
t.isUserWhitespacable(node);
対象ノード
ObjectMethodObjectPropertyObjectTypeCallPropertyObjectTypeIndexerObjectTypeInternalSlotObjectTypePropertyObjectTypeSpreadProperty
While
同じAST形状を共有するDoWhileStatementとWhileStatementのカバー。
t.isWhile(node);
対象ノード