@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);
対象ノード
ArrowFunctionExpression
BlockStatement
CatchClause
ClassMethod
ClassPrivateMethod
DoWhileStatement
ForInStatement
ForOfStatement
ForStatement
FunctionDeclaration
FunctionExpression
ObjectMethod
Program
StaticBlock
SwitchStatement
TSModuleBlock
WhileStatement
Class
ClassExpressionとClassDeclarationのラッパーです。両者は同じAST構造を共有しています。
t.isClass(node);
対象ノード
CompletionStatement
完了レコードを示すステートメントです。言い換えれば、ループをいつ中断するか、アクションが重大なエラーをスローする必要があるかなど、プログラムの制御フローを定義します。
t.isCompletionStatement(node);
対象ノード
Conditional
ConditionalExpressionとIfStatementのラッパーです。両者は同じAST構造を共有しています。
t.isConditional(node);
対象ノード
Declaration
あらゆるDeclarationのラッパーです。
t.isDeclaration(node);
対象ノード
ClassDeclaration
DeclareClass
DeclareExportAllDeclaration
DeclareExportDeclaration
DeclareFunction
DeclareInterface
DeclareModule
DeclareModuleExports
DeclareOpaqueType
DeclareTypeAlias
DeclareVariable
EnumDeclaration
ExportAllDeclaration
ExportDefaultDeclaration
ExportNamedDeclaration
FunctionDeclaration
ImportDeclaration
InterfaceDeclaration
OpaqueType
TSDeclareFunction
TSEnumDeclaration
TSInterfaceDeclaration
TSModuleDeclaration
TSTypeAliasDeclaration
TypeAlias
VariableDeclaration
EnumBody
Flowのenumボディのラッパーです。
t.isEnumBody(node);
対象ノード
EnumMember
Flowのenumメンバのラッパーです。
t.isEnumMember(node);
対象ノード
ExportDeclaration
あらゆるExportDeclarationのラッパーです。
t.isExportDeclaration(node);
対象ノード
Expression
あらゆるExpressionのラッパーです。
t.isExpression(node);
対象ノード
ArrayExpression
ArrowFunctionExpression
AssignmentExpression
AwaitExpression
BigIntLiteral
BinaryExpression
BindExpression
BooleanLiteral
CallExpression
ClassExpression
ConditionalExpression
DecimalLiteral
DoExpression
FunctionExpression
Identifier
Import
ImportExpression
JSXElement
JSXFragment
LogicalExpression
MemberExpression
MetaProperty
ModuleExpression
NewExpression
NullLiteral
NumericLiteral
ObjectExpression
OptionalCallExpression
OptionalMemberExpression
ParenthesizedExpression
PipelineBareFunction
PipelinePrimaryTopicReference
PipelineTopicExpression
RecordExpression
RegExpLiteral
SequenceExpression
StringLiteral
Super
TSAsExpression
TSInstantiationExpression
TSNonNullExpression
TSSatisfiesExpression
TSTypeAssertion
TaggedTemplateExpression
TemplateLiteral
ThisExpression
TopicReference
TupleExpression
TypeCastExpression
UnaryExpression
UpdateExpression
YieldExpression
ExpressionWrapper
ランタイムセマンティクスを持たない式のラッパーです。
t.isExpressionWrapper(node);
対象ノード
Flow
Flowで定義されたASTノードのラッパーです。
t.isFlow(node);
対象ノード
AnyTypeAnnotation
ArrayTypeAnnotation
BooleanLiteralTypeAnnotation
BooleanTypeAnnotation
ClassImplements
DeclareClass
DeclareExportAllDeclaration
DeclareExportDeclaration
DeclareFunction
DeclareInterface
DeclareModule
DeclareModuleExports
DeclareOpaqueType
DeclareTypeAlias
DeclareVariable
DeclaredPredicate
EmptyTypeAnnotation
EnumBooleanBody
EnumBooleanMember
EnumDeclaration
EnumDefaultedMember
EnumNumberBody
EnumNumberMember
EnumStringBody
EnumStringMember
EnumSymbolBody
ExistsTypeAnnotation
FunctionTypeAnnotation
FunctionTypeParam
GenericTypeAnnotation
IndexedAccessType
InferredPredicate
InterfaceDeclaration
InterfaceExtends
InterfaceTypeAnnotation
IntersectionTypeAnnotation
MixedTypeAnnotation
NullLiteralTypeAnnotation
NullableTypeAnnotation
NumberLiteralTypeAnnotation
NumberTypeAnnotation
ObjectTypeAnnotation
ObjectTypeCallProperty
ObjectTypeIndexer
ObjectTypeInternalSlot
ObjectTypeProperty
ObjectTypeSpreadProperty
OpaqueType
OptionalIndexedAccessType
QualifiedTypeIdentifier
StringLiteralTypeAnnotation
StringTypeAnnotation
SymbolTypeAnnotation
ThisTypeAnnotation
TupleTypeAnnotation
TypeAlias
TypeAnnotation
TypeCastExpression
TypeParameter
TypeParameterDeclaration
TypeParameterInstantiation
TypeofTypeAnnotation
UnionTypeAnnotation
Variance
VoidTypeAnnotation
FlowBaseAnnotation
主要なFlow型アノテーションのラッパーです。
t.isFlowBaseAnnotation(node);
対象ノード
AnyTypeAnnotation
BooleanTypeAnnotation
EmptyTypeAnnotation
MixedTypeAnnotation
NullLiteralTypeAnnotation
NumberTypeAnnotation
StringTypeAnnotation
SymbolTypeAnnotation
ThisTypeAnnotation
VoidTypeAnnotation
FlowDeclaration
Flow宣言のラッパーです。
t.isFlowDeclaration(node);
対象ノード
DeclareClass
DeclareExportAllDeclaration
DeclareExportDeclaration
DeclareFunction
DeclareInterface
DeclareModule
DeclareModuleExports
DeclareOpaqueType
DeclareTypeAlias
DeclareVariable
InterfaceDeclaration
OpaqueType
TypeAlias
FlowPredicate
Flow述語のラッパーです。
t.isFlowPredicate(node);
対象ノード
FlowType
Flow型アノテーションのラッパーです。
t.isFlowType(node);
対象ノード
AnyTypeAnnotation
ArrayTypeAnnotation
BooleanLiteralTypeAnnotation
BooleanTypeAnnotation
EmptyTypeAnnotation
ExistsTypeAnnotation
FunctionTypeAnnotation
GenericTypeAnnotation
IndexedAccessType
InterfaceTypeAnnotation
IntersectionTypeAnnotation
MixedTypeAnnotation
NullLiteralTypeAnnotation
NullableTypeAnnotation
NumberLiteralTypeAnnotation
NumberTypeAnnotation
ObjectTypeAnnotation
OptionalIndexedAccessType
StringLiteralTypeAnnotation
StringTypeAnnotation
SymbolTypeAnnotation
ThisTypeAnnotation
TupleTypeAnnotation
TypeofTypeAnnotation
UnionTypeAnnotation
VoidTypeAnnotation
For
ForStatementとForXStatementのラッパーです。
t.isFor(node);
対象ノード
ForXStatement
ForInStatementsとForOfStatementsのラッパーです。
t.isForXStatement(node);
対象ノード
Function
関数とメソッドのラッパーです。`body`と`params`を持たなければなりません。注:`Function`は`FunctionParent`とは異なります。例えば、`StaticBlock`は`FunctionParent`ですが`Function`ではありません。
t.isFunction(node);
対象ノード
ArrowFunctionExpression
ClassMethod
ClassPrivateMethod
FunctionDeclaration
FunctionExpression
ObjectMethod
FunctionParent
新しいVariableEnvironmentで実行コンテキストを開始するASTノードのラッパーです。言い換えれば、`var`宣言のスコープを定義します。Babel 7以降、FunctionParentには`Program`が含まれていません。
t.isFunctionParent(node);
対象ノード
ArrowFunctionExpression
ClassMethod
ClassPrivateMethod
FunctionDeclaration
FunctionExpression
ObjectMethod
StaticBlock
TSModuleBlock
Immutable
不変オブジェクトとJSX要素のラッパーです。オブジェクトは、作成後に他のプロパティを定義できなければ不変です。
t.isImmutable(node);
対象ノード
BigIntLiteral
BooleanLiteral
DecimalLiteral
JSXAttribute
JSXClosingElement
JSXClosingFragment
JSXElement
JSXExpressionContainer
JSXFragment
JSXOpeningElement
JSXOpeningFragment
JSXSpreadChild
JSXText
NullLiteral
NumericLiteral
StringLiteral
ImportOrExportDeclaration
履歴
バージョン | 変更点 |
---|---|
v7.21.0 | 導入 |
ImportDeclarationとExportDeclarationのラッパーです。
t.isImportOrExportDeclaration(node);
対象ノード
JSX
JSXで定義されたASTノードのラッパーです。
t.isJSX(node);
対象ノード
JSXAttribute
JSXClosingElement
JSXClosingFragment
JSXElement
JSXEmptyExpression
JSXExpressionContainer
JSXFragment
JSXIdentifier
JSXMemberExpression
JSXNamespacedName
JSXOpeningElement
JSXOpeningFragment
JSXSpreadAttribute
JSXSpreadChild
JSXText
LVal
代入式の`left`とForXStatementで使用される左辺値式のラッパーです。
t.isLVal(node);
対象ノード
ArrayPattern
AssignmentPattern
Identifier
MemberExpression
ObjectPattern
RestElement
TSAsExpression
TSNonNullExpression
TSParameterProperty
TSSatisfiesExpression
TSTypeAssertion
Literal
リテラル、正規表現リテラル、およびテンプレートリテラルのラッパーです。
t.isLiteral(node);
対象ノード
BigIntLiteral
BooleanLiteral
DecimalLiteral
NullLiteral
NumericLiteral
RegExpLiteral
StringLiteral
TemplateLiteral
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);
対象ノード
ExportDefaultSpecifier
ExportNamespaceSpecifier
ExportSpecifier
ImportDefaultSpecifier
ImportNamespaceSpecifier
ImportSpecifier
ObjectMember
オブジェクトリテラル内のメンバのカバー。
t.isObjectMember(node);
対象ノード
Pattern
識別子を除くBindingPatternのカバー。
t.isPattern(node);
対象ノード
PatternLike
BindingPatternのカバー。
t.isPatternLike(node);
対象ノード
ArrayPattern
AssignmentPattern
Identifier
ObjectPattern
RestElement
TSAsExpression
TSNonNullExpression
TSSatisfiesExpression
TSTypeAssertion
Private
プライベートなクラス要素とプライベートな識別子のカバー。
t.isPrivate(node);
対象ノード
Property
オブジェクトのプロパティとクラスのプロパティのカバー。
t.isProperty(node);
対象ノード
Pureish
副作用のないASTノードのカバー。言い換えれば、複数回評価しても、観察可能な動作の変化はありません。
t.isPureish(node);
対象ノード
ArrowFunctionExpression
BigIntLiteral
BooleanLiteral
DecimalLiteral
FunctionDeclaration
FunctionExpression
NullLiteral
NumericLiteral
RegExpLiteral
StringLiteral
Scopable
FunctionParentとBlockParentのカバー。
t.isScopable(node);
対象ノード
ArrowFunctionExpression
BlockStatement
CatchClause
ClassDeclaration
ClassExpression
ClassMethod
ClassPrivateMethod
DoWhileStatement
ForInStatement
ForOfStatement
ForStatement
FunctionDeclaration
FunctionExpression
ObjectMethod
Program
StaticBlock
SwitchStatement
TSModuleBlock
WhileStatement
Standardized
公式ECMAScript仕様の一部であるASTノードのカバー。
t.isStandardized(node);
対象ノード
ArrayExpression
ArrayPattern
ArrowFunctionExpression
AssignmentExpression
AssignmentPattern
AwaitExpression
BigIntLiteral
BinaryExpression
BlockStatement
BooleanLiteral
BreakStatement
CallExpression
CatchClause
ClassAccessorProperty
ClassBody
ClassDeclaration
ClassExpression
ClassMethod
ClassPrivateMethod
ClassPrivateProperty
ClassProperty
ConditionalExpression
ContinueStatement
DebuggerStatement
Directive
DirectiveLiteral
DoWhileStatement
EmptyStatement
ExportAllDeclaration
ExportDefaultDeclaration
ExportNamedDeclaration
ExportNamespaceSpecifier
ExportSpecifier
ExpressionStatement
File
ForInStatement
ForOfStatement
ForStatement
FunctionDeclaration
FunctionExpression
Identifier
IfStatement
Import
ImportDeclaration
ImportDefaultSpecifier
ImportExpression
ImportNamespaceSpecifier
ImportSpecifier
InterpreterDirective
LabeledStatement
LogicalExpression
MemberExpression
MetaProperty
NewExpression
NullLiteral
NumericLiteral
ObjectExpression
ObjectMethod
ObjectPattern
ObjectProperty
OptionalCallExpression
OptionalMemberExpression
ParenthesizedExpression
PrivateName
Program
RegExpLiteral
RestElement
ReturnStatement
SequenceExpression
SpreadElement
StaticBlock
StringLiteral
Super
SwitchCase
SwitchStatement
TaggedTemplateExpression
TemplateElement
TemplateLiteral
ThisExpression
ThrowStatement
TryStatement
UnaryExpression
UpdateExpression
VariableDeclaration
VariableDeclarator
WhileStatement
WithStatement
YieldExpression
Statement
任意のStatementのカバー。
t.isStatement(node);
対象ノード
BlockStatement
BreakStatement
ClassDeclaration
ContinueStatement
DebuggerStatement
DeclareClass
DeclareExportAllDeclaration
DeclareExportDeclaration
DeclareFunction
DeclareInterface
DeclareModule
DeclareModuleExports
DeclareOpaqueType
DeclareTypeAlias
DeclareVariable
DoWhileStatement
EmptyStatement
EnumDeclaration
ExportAllDeclaration
ExportDefaultDeclaration
ExportNamedDeclaration
ExpressionStatement
ForInStatement
ForOfStatement
ForStatement
FunctionDeclaration
IfStatement
ImportDeclaration
InterfaceDeclaration
LabeledStatement
OpaqueType
ReturnStatement
SwitchStatement
TSDeclareFunction
TSEnumDeclaration
TSExportAssignment
TSImportEqualsDeclaration
TSInterfaceDeclaration
TSModuleDeclaration
TSNamespaceExportDeclaration
TSTypeAliasDeclaration
ThrowStatement
TryStatement
TypeAlias
VariableDeclaration
WhileStatement
WithStatement
TSBaseType
主要なTypeScript型アノテーションのカバー。
t.isTSBaseType(node);
対象ノード
TSAnyKeyword
TSBigIntKeyword
TSBooleanKeyword
TSIntrinsicKeyword
TSLiteralType
TSNeverKeyword
TSNullKeyword
TSNumberKeyword
TSObjectKeyword
TSStringKeyword
TSSymbolKeyword
TSThisType
TSUndefinedKeyword
TSUnknownKeyword
TSVoidKeyword
TSEntityName
tsエンティティのカバー。
t.isTSEntityName(node);
対象ノード
TSType
TypeScript型アノテーションのカバー。
t.isTSType(node);
対象ノード
TSAnyKeyword
TSArrayType
TSBigIntKeyword
TSBooleanKeyword
TSConditionalType
TSConstructorType
TSExpressionWithTypeArguments
TSFunctionType
TSImportType
TSIndexedAccessType
TSInferType
TSIntersectionType
TSIntrinsicKeyword
TSLiteralType
TSMappedType
TSNeverKeyword
TSNullKeyword
TSNumberKeyword
TSObjectKeyword
TSOptionalType
TSParenthesizedType
TSRestType
TSStringKeyword
TSSymbolKeyword
TSThisType
TSTupleType
TSTypeLiteral
TSTypeOperator
TSTypePredicate
TSTypeQuery
TSTypeReference
TSUndefinedKeyword
TSUnionType
TSUnknownKeyword
TSVoidKeyword
TSTypeElement
TypeScript型宣言のカバー。
t.isTSTypeElement(node);
対象ノード
TSCallSignatureDeclaration
TSConstructSignatureDeclaration
TSIndexSignature
TSMethodSignature
TSPropertySignature
Terminatorless
演算子とオペランドの間に改行文字が挿入されるとセマンティクスが変化するASTノードのカバー。
t.isTerminatorless(node);
対象ノード
TypeScript
TypeScriptで定義されたASTノードのカバー。
t.isTypeScript(node);
対象ノード
TSAnyKeyword
TSArrayType
TSAsExpression
TSBigIntKeyword
TSBooleanKeyword
TSCallSignatureDeclaration
TSConditionalType
TSConstructSignatureDeclaration
TSConstructorType
TSDeclareFunction
TSDeclareMethod
TSEnumDeclaration
TSEnumMember
TSExportAssignment
TSExpressionWithTypeArguments
TSExternalModuleReference
TSFunctionType
TSImportEqualsDeclaration
TSImportType
TSIndexSignature
TSIndexedAccessType
TSInferType
TSInstantiationExpression
TSInterfaceBody
TSInterfaceDeclaration
TSIntersectionType
TSIntrinsicKeyword
TSLiteralType
TSMappedType
TSMethodSignature
TSModuleBlock
TSModuleDeclaration
TSNamedTupleMember
TSNamespaceExportDeclaration
TSNeverKeyword
TSNonNullExpression
TSNullKeyword
TSNumberKeyword
TSObjectKeyword
TSOptionalType
TSParameterProperty
TSParenthesizedType
TSPropertySignature
TSQualifiedName
TSRestType
TSSatisfiesExpression
TSStringKeyword
TSSymbolKeyword
TSThisType
TSTupleType
TSTypeAliasDeclaration
TSTypeAnnotation
TSTypeAssertion
TSTypeLiteral
TSTypeOperator
TSTypeParameter
TSTypeParameterDeclaration
TSTypeParameterInstantiation
TSTypePredicate
TSTypeQuery
TSTypeReference
TSUndefinedKeyword
TSUnionType
TSUnknownKeyword
TSVoidKeyword
UnaryLike
UnaryExpressionとSpreadElementのカバー。
t.isUnaryLike(node);
対象ノード
UserWhitespacable
非推奨。Babel 8で削除されます。
t.isUserWhitespacable(node);
対象ノード
ObjectMethod
ObjectProperty
ObjectTypeCallProperty
ObjectTypeIndexer
ObjectTypeInternalSlot
ObjectTypeProperty
ObjectTypeSpreadProperty
While
同じAST形状を共有するDoWhileStatementとWhileStatementのカバー。
t.isWhile(node);
対象ノード