@babel/types
该模块包含手动构建 AST 和检查 AST 节点类型的方法。
¥This module contains methods for building ASTs manually and for checking the types of AST nodes.
安装
¥Install
- npm
- Yarn
- pnpm
- Bun
npm install --save-dev @babel/types
yarn add --dev @babel/types
pnpm add --save-dev @babel/types
bun add --dev @babel/types
API
Node 构建器
¥Node Builders
anyTypeAnnotation
t.anyTypeAnnotation();
另见 t.isAnyTypeAnnotation(node, opts) 和 t.assertAnyTypeAnnotation(node, opts)。
¥See also t.isAnyTypeAnnotation(node, opts) and t.assertAnyTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
argumentPlaceholder
t.argumentPlaceholder();
另见 t.isArgumentPlaceholder(node, opts) 和 t.assertArgumentPlaceholder(node, opts)。
¥See also t.isArgumentPlaceholder(node, opts) and t.assertArgumentPlaceholder(node, opts).
arrayExpression
t.arrayExpression(elements);
另见 t.isArrayExpression(node, opts) 和 t.assertArrayExpression(node, opts)。
¥See also t.isArrayExpression(node, opts) and t.assertArrayExpression(node, opts).
AST 节点 ArrayExpression 形状:
¥AST Node ArrayExpression shape:
-
elements:Array<null | Expression | SpreadElement>(默认:[])¥
elements:Array<null | Expression | SpreadElement>(default:[])
¥Aliases: Standardized, Expression
arrayPattern
t.arrayPattern(elements);
另见 t.isArrayPattern(node, opts) 和 t.assertArrayPattern(node, opts)。
¥See also t.isArrayPattern(node, opts) and t.assertArrayPattern(node, opts).
AST 节点 ArrayPattern 形状:
¥AST Node ArrayPattern shape:
-
elements:Array<null | PatternLike>(必填)¥
elements:Array<null | PatternLike>(required) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function)
别名:Standardized, FunctionParameter, Pattern, PatternLike, LVal
¥Aliases: Standardized, FunctionParameter, Pattern, PatternLike, LVal
arrayTypeAnnotation
t.arrayTypeAnnotation(elementType);
另见 t.isArrayTypeAnnotation(node, opts) 和 t.assertArrayTypeAnnotation(node, opts)。
¥See also t.isArrayTypeAnnotation(node, opts) and t.assertArrayTypeAnnotation(node, opts).
AST 节点 ArrayTypeAnnotation 形状:
¥AST Node ArrayTypeAnnotation shape:
-
elementType:FlowType(必填)¥
elementType:FlowType(required)
arrowFunctionExpression
t.arrowFunctionExpression(params, body, async);
另见 t.isArrowFunctionExpression(node, opts) 和 t.assertArrowFunctionExpression(node, opts)。
¥See also t.isArrowFunctionExpression(node, opts) and t.assertArrowFunctionExpression(node, opts).
AST 节点 ArrowFunctionExpression 形状:
¥AST Node ArrowFunctionExpression shape:
-
params:Array<FunctionParameter>(必填)¥
params:Array<FunctionParameter>(required) -
body:BlockStatement | Expression(必填)¥
body:BlockStatement | Expression(required) -
async:boolean(默认:false)¥
async:boolean(default:false) -
expression:boolean(必填)¥
expression:boolean(required) -
generator:boolean(默认值:false,从构建器功能中排除)¥
generator:boolean(default:false, excluded from builder function) -
predicate:DeclaredPredicate | InferredPredicate(默认值:null,从构建器功能中排除)¥
predicate:DeclaredPredicate | InferredPredicate(default:null, excluded from builder function) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
returnType:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(default:null, excluded from builder function)
别名:Standardized, Scopable, Function, BlockParent, FunctionParent, Expression, Pureish
¥Aliases: Standardized, Scopable, Function, BlockParent, FunctionParent, Expression, Pureish
assignmentExpression
t.assignmentExpression(operator, left, right);
另见 t.isAssignmentExpression(node, opts) 和 t.assertAssignmentExpression(node, opts)。
¥See also t.isAssignmentExpression(node, opts) and t.assertAssignmentExpression(node, opts).
AST 节点 AssignmentExpression 形状:
¥AST Node AssignmentExpression shape:
-
operator:string(必填)¥
operator:string(required) -
left:LVal | OptionalMemberExpression(必填)¥
left:LVal | OptionalMemberExpression(required) -
right:Expression(必填)¥
right:Expression(required)
¥Aliases: Standardized, Expression
assignmentPattern
t.assignmentPattern(left, right);
另见 t.isAssignmentPattern(node, opts) 和 t.assertAssignmentPattern(node, opts)。
¥See also t.isAssignmentPattern(node, opts) and t.assertAssignmentPattern(node, opts).
AST 节点 AssignmentPattern 形状:
¥AST Node AssignmentPattern shape:
-
left:Identifier | ObjectPattern | ArrayPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression(必填)¥
left:Identifier | ObjectPattern | ArrayPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression(required) -
right:Expression(必填)¥
right:Expression(required) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function)
别名:Standardized, FunctionParameter, Pattern, PatternLike, LVal
¥Aliases: Standardized, FunctionParameter, Pattern, PatternLike, LVal
awaitExpression
t.awaitExpression(argument);
另见 t.isAwaitExpression(node, opts) 和 t.assertAwaitExpression(node, opts)。
¥See also t.isAwaitExpression(node, opts) and t.assertAwaitExpression(node, opts).
AST 节点 AwaitExpression 形状:
¥AST Node AwaitExpression shape:
-
argument:Expression(必填)¥
argument:Expression(required)
别名:Standardized, Expression, Terminatorless
¥Aliases: Standardized, Expression, Terminatorless
bigIntLiteral
t.bigIntLiteral(value);
另见 t.isBigIntLiteral(node, opts) 和 t.assertBigIntLiteral(node, opts)。
¥See also t.isBigIntLiteral(node, opts) and t.assertBigIntLiteral(node, opts).
AST 节点 BigIntLiteral 形状:
¥AST Node BigIntLiteral shape:
-
value:string(必填)¥
value:string(required)
别名:Standardized, Expression, Pureish, Literal, Immutable
¥Aliases: Standardized, Expression, Pureish, Literal, Immutable
binaryExpression
t.binaryExpression(operator, left, right);
另见 t.isBinaryExpression(node, opts) 和 t.assertBinaryExpression(node, opts)。
¥See also t.isBinaryExpression(node, opts) and t.assertBinaryExpression(node, opts).
AST 节点 BinaryExpression 形状:
¥AST Node BinaryExpression shape:
-
operator:"+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>"(必填)¥
operator:"+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>"(required) -
left:Expression | PrivateName(必填)¥
left:Expression | PrivateName(required) -
right:Expression(必填)¥
right:Expression(required)
别名:Standardized, Binary, Expression
¥Aliases: Standardized, Binary, Expression
bindExpression
t.bindExpression(object, callee);
另见 t.isBindExpression(node, opts) 和 t.assertBindExpression(node, opts)。
¥See also t.isBindExpression(node, opts) and t.assertBindExpression(node, opts).
AST 节点 BindExpression 形状:
¥AST Node BindExpression shape:
-
object:Expression(必填)¥
object:Expression(required) -
callee:Expression(必填)¥
callee:Expression(required)
别名:Expression
¥Aliases: Expression
blockStatement
t.blockStatement(body, directives);
另见 t.isBlockStatement(node, opts) 和 t.assertBlockStatement(node, opts)。
¥See also t.isBlockStatement(node, opts) and t.assertBlockStatement(node, opts).
AST 节点 BlockStatement 形状:
¥AST Node BlockStatement shape:
-
body:Array<Statement>(必填)¥
body:Array<Statement>(required) -
directives:Array<Directive>(默认:[])¥
directives:Array<Directive>(default:[])
别名:Standardized, Scopable, BlockParent, Block, Statement
¥Aliases: Standardized, Scopable, BlockParent, Block, Statement
booleanLiteral
t.booleanLiteral(value);
另见 t.isBooleanLiteral(node, opts) 和 t.assertBooleanLiteral(node, opts)。
¥See also t.isBooleanLiteral(node, opts) and t.assertBooleanLiteral(node, opts).
AST 节点 BooleanLiteral 形状:
¥AST Node BooleanLiteral shape:
-
value:boolean(必填)¥
value:boolean(required)
别名:Standardized, Expression, Pureish, Literal, Immutable
¥Aliases: Standardized, Expression, Pureish, Literal, Immutable
booleanLiteralTypeAnnotation
t.booleanLiteralTypeAnnotation(value);
另见 t.isBooleanLiteralTypeAnnotation(node, opts) 和 t.assertBooleanLiteralTypeAnnotation(node, opts)。
¥See also t.isBooleanLiteralTypeAnnotation(node, opts) and t.assertBooleanLiteralTypeAnnotation(node, opts).
AST 节点 BooleanLiteralTypeAnnotation 形状:
¥AST Node BooleanLiteralTypeAnnotation shape:
-
value:boolean(必填)¥
value:boolean(required)
booleanTypeAnnotation
t.booleanTypeAnnotation();
另见 t.isBooleanTypeAnnotation(node, opts) 和 t.assertBooleanTypeAnnotation(node, opts)。
¥See also t.isBooleanTypeAnnotation(node, opts) and t.assertBooleanTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
breakStatement
t.breakStatement(label);
另见 t.isBreakStatement(node, opts) 和 t.assertBreakStatement(node, opts)。
¥See also t.isBreakStatement(node, opts) and t.assertBreakStatement(node, opts).
AST 节点 BreakStatement 形状:
¥AST Node BreakStatement shape:
-
label:Identifier(默认:null)¥
label:Identifier(default:null)
别名:Standardized, Statement, Terminatorless, CompletionStatement
¥Aliases: Standardized, Statement, Terminatorless, CompletionStatement
callExpression
t.callExpression(callee, arguments);
另见 t.isCallExpression(node, opts) 和 t.assertCallExpression(node, opts)。
¥See also t.isCallExpression(node, opts) and t.assertCallExpression(node, opts).
AST 节点 CallExpression 形状:
¥AST Node CallExpression shape:
-
callee:Expression | Super | V8IntrinsicIdentifier(必填)¥
callee:Expression | Super | V8IntrinsicIdentifier(required) -
arguments:Array<Expression | SpreadElement | ArgumentPlaceholder>(必填)¥
arguments:Array<Expression | SpreadElement | ArgumentPlaceholder>(required) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
typeArguments:TypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeArguments:TypeParameterInstantiation(default:null, excluded from builder function) -
typeParameters:TSTypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeParameters:TSTypeParameterInstantiation(default:null, excluded from builder function)
¥Aliases: Standardized, Expression
catchClause
t.catchClause(param, body);
另见 t.isCatchClause(node, opts) 和 t.assertCatchClause(node, opts)。
¥See also t.isCatchClause(node, opts) and t.assertCatchClause(node, opts).
AST 节点 CatchClause 形状:
¥AST Node CatchClause shape:
-
param:Identifier | ArrayPattern | ObjectPattern(默认:null)¥
param:Identifier | ArrayPattern | ObjectPattern(default:null) -
body:BlockStatement(必填)¥
body:BlockStatement(required)
别名:Standardized, Scopable, BlockParent
¥Aliases: Standardized, Scopable, BlockParent
classAccessorProperty
t.classAccessorProperty(key, value, typeAnnotation, decorators, computed, static);
另见 t.isClassAccessorProperty(node, opts) 和 t.assertClassAccessorProperty(node, opts)。
¥See also t.isClassAccessorProperty(node, opts) and t.assertClassAccessorProperty(node, opts).
AST 节点 ClassAccessorProperty 形状:
¥AST Node ClassAccessorProperty shape:
-
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName(必填)¥
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName(required) -
value:Expression(默认:null)¥
value:Expression(default:null) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认:null)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null) -
decorators:Array<Decorator>(默认:null)¥
decorators:Array<Decorator>(default:null) -
computed:boolean(默认:false)¥
computed:boolean(default:false) -
static:boolean(默认:false)¥
static:boolean(default:false) -
abstract:boolean(默认值:null,从构建器功能中排除)¥
abstract:boolean(default:null, excluded from builder function) -
accessibility:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
accessibility:"public" | "private" | "protected"(default:null, excluded from builder function) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function) -
definite:boolean(默认值:null,从构建器功能中排除)¥
definite:boolean(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
override:boolean(默认值:false,从构建器功能中排除)¥
override:boolean(default:false, excluded from builder function) -
readonly:boolean(默认值:null,从构建器功能中排除)¥
readonly:boolean(default:null, excluded from builder function) -
variance:Variance(默认值:null,从构建器功能中排除)¥
variance:Variance(default:null, excluded from builder function)
别名:Standardized, Property, Accessor
¥Aliases: Standardized, Property, Accessor
classBody
t.classBody(body);
另见 t.isClassBody(node, opts) 和 t.assertClassBody(node, opts)。
¥See also t.isClassBody(node, opts) and t.assertClassBody(node, opts).
AST 节点 ClassBody 形状:
¥AST Node ClassBody shape:
-
body:Array<ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock>(必填)¥
body:Array<ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock>(required)
别名:Standardized
¥Aliases: Standardized
classDeclaration
t.classDeclaration(id, superClass, body, decorators);
另见 t.isClassDeclaration(node, opts) 和 t.assertClassDeclaration(node, opts)。
¥See also t.isClassDeclaration(node, opts) and t.assertClassDeclaration(node, opts).
AST 节点 ClassDeclaration 形状:
¥AST Node ClassDeclaration shape:
-
id:Identifier(默认:null)¥
id:Identifier(default:null) -
superClass:Expression(默认:null)¥
superClass:Expression(default:null) -
body:ClassBody(必填)¥
body:ClassBody(required) -
decorators:Array<Decorator>(默认:null)¥
decorators:Array<Decorator>(default:null) -
abstract:boolean(默认值:null,从构建器功能中排除)¥
abstract:boolean(default:null, excluded from builder function) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function) -
implements:Array<TSExpressionWithTypeArguments | ClassImplements>(默认值:null,从构建器功能中排除)¥
implements:Array<TSExpressionWithTypeArguments | ClassImplements>(default:null, excluded from builder function) -
mixins:InterfaceExtends(默认值:null,从构建器功能中排除)¥
mixins:InterfaceExtends(default:null, excluded from builder function) -
superTypeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
superTypeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(default:null, excluded from builder function) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(default:null, excluded from builder function)
别名:Standardized, Scopable, Class, Statement, Declaration
¥Aliases: Standardized, Scopable, Class, Statement, Declaration
classExpression
t.classExpression(id, superClass, body, decorators);
另见 t.isClassExpression(node, opts) 和 t.assertClassExpression(node, opts)。
¥See also t.isClassExpression(node, opts) and t.assertClassExpression(node, opts).
AST 节点 ClassExpression 形状:
¥AST Node ClassExpression shape:
-
id:Identifier(默认:null)¥
id:Identifier(default:null) -
superClass:Expression(默认:null)¥
superClass:Expression(default:null) -
body:ClassBody(必填)¥
body:ClassBody(required) -
decorators:Array<Decorator>(默认:null)¥
decorators:Array<Decorator>(default:null) -
implements:Array<TSExpressionWithTypeArguments | ClassImplements>(默认值:null,从构建器功能中排除)¥
implements:Array<TSExpressionWithTypeArguments | ClassImplements>(default:null, excluded from builder function) -
mixins:InterfaceExtends(默认值:null,从构建器功能中排除)¥
mixins:InterfaceExtends(default:null, excluded from builder function) -
superTypeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
superTypeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(default:null, excluded from builder function) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(default:null, excluded from builder function)
别名:Standardized, Scopable, Class, Expression
¥Aliases: Standardized, Scopable, Class, Expression
classImplements
t.classImplements(id, typeParameters);
另见 t.isClassImplements(node, opts) 和 t.assertClassImplements(node, opts)。
¥See also t.isClassImplements(node, opts) and t.assertClassImplements(node, opts).
AST 节点 ClassImplements 形状:
¥AST Node ClassImplements shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TypeParameterInstantiation(默认:null)¥
typeParameters:TypeParameterInstantiation(default:null)
别名:Flow
¥Aliases: Flow
classMethod
t.classMethod(kind, key, params, body, computed, static, generator, async);
另见 t.isClassMethod(node, opts) 和 t.assertClassMethod(node, opts)。
¥See also t.isClassMethod(node, opts) and t.assertClassMethod(node, opts).
AST 节点 ClassMethod 形状:
¥AST Node ClassMethod shape:
-
kind:"get" | "set" | "method" | "constructor"(默认:'method')¥
kind:"get" | "set" | "method" | "constructor"(default:'method') -
key:如果计算则Expression否则Identifier | Literal(必需)¥
key: if computed thenExpressionelseIdentifier | Literal(required) -
params:Array<FunctionParameter | TSParameterProperty>(必填)¥
params:Array<FunctionParameter | TSParameterProperty>(required) -
body:BlockStatement(必填)¥
body:BlockStatement(required) -
computed:boolean(默认:false)¥
computed:boolean(default:false) -
static:boolean(默认:false)¥
static:boolean(default:false) -
generator:boolean(默认:false)¥
generator:boolean(default:false) -
async:boolean(默认:false)¥
async:boolean(default:false) -
abstract:boolean(默认值:null,从构建器功能中排除)¥
abstract:boolean(default:null, excluded from builder function) -
access:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
access:"public" | "private" | "protected"(default:null, excluded from builder function) -
accessibility:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
accessibility:"public" | "private" | "protected"(default:null, excluded from builder function) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
override:boolean(默认值:false,从构建器功能中排除)¥
override:boolean(default:false, excluded from builder function) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
returnType:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(default:null, excluded from builder function)
别名:Standardized, Function, Scopable, BlockParent, FunctionParent, Method
¥Aliases: Standardized, Function, Scopable, BlockParent, FunctionParent, Method
classPrivateMethod
t.classPrivateMethod(kind, key, params, body, static);
另见 t.isClassPrivateMethod(node, opts) 和 t.assertClassPrivateMethod(node, opts)。
¥See also t.isClassPrivateMethod(node, opts) and t.assertClassPrivateMethod(node, opts).
AST 节点 ClassPrivateMethod 形状:
¥AST Node ClassPrivateMethod shape:
-
kind:"get" | "set" | "method"(默认:'method')¥
kind:"get" | "set" | "method"(default:'method') -
key:PrivateName(必填)¥
key:PrivateName(required) -
params:Array<FunctionParameter | TSParameterProperty>(必填)¥
params:Array<FunctionParameter | TSParameterProperty>(required) -
body:BlockStatement(必填)¥
body:BlockStatement(required) -
static:boolean(默认:false)¥
static:boolean(default:false) -
abstract:boolean(默认值:null,从构建器功能中排除)¥
abstract:boolean(default:null, excluded from builder function) -
access:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
access:"public" | "private" | "protected"(default:null, excluded from builder function) -
accessibility:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
accessibility:"public" | "private" | "protected"(default:null, excluded from builder function) -
async:boolean(默认值:false,从构建器功能中排除)¥
async:boolean(default:false, excluded from builder function) -
computed:'false'(默认值:false,从构建器功能中排除)¥
computed: 'false' (default:false, excluded from builder function) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
generator:boolean(默认值:false,从构建器功能中排除)¥
generator:boolean(default:false, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
override:boolean(默认值:false,从构建器功能中排除)¥
override:boolean(default:false, excluded from builder function) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
returnType:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(default:null, excluded from builder function)
别名:Standardized, Function, Scopable, BlockParent, FunctionParent, Method, Private
¥Aliases: Standardized, Function, Scopable, BlockParent, FunctionParent, Method, Private
classPrivateProperty
t.classPrivateProperty(key, value, decorators, static);
另见 t.isClassPrivateProperty(node, opts) 和 t.assertClassPrivateProperty(node, opts)。
¥See also t.isClassPrivateProperty(node, opts) and t.assertClassPrivateProperty(node, opts).
AST 节点 ClassPrivateProperty 形状:
¥AST Node ClassPrivateProperty shape:
-
key:PrivateName(必填)¥
key:PrivateName(required) -
value:Expression(默认:null)¥
value:Expression(default:null) -
decorators:Array<Decorator>(默认:null)¥
decorators:Array<Decorator>(default:null) -
static:boolean(默认:false)¥
static:boolean(default:false) -
definite:boolean(默认值:null,从构建器功能中排除)¥
definite:boolean(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
readonly:boolean(默认值:null,从构建器功能中排除)¥
readonly:boolean(default:null, excluded from builder function) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function) -
variance:Variance(默认值:null,从构建器功能中排除)¥
variance:Variance(default:null, excluded from builder function)
别名:Standardized, Property, Private
¥Aliases: Standardized, Property, Private
classProperty
t.classProperty(key, value, typeAnnotation, decorators, computed, static);
History
| 版本 | 变化 |
|---|---|
v7.6.0 | 支持 static |
另见 t.isClassProperty(node, opts) 和 t.assertClassProperty(node, opts)。
¥See also t.isClassProperty(node, opts) and t.assertClassProperty(node, opts).
AST 节点 ClassProperty 形状:
¥AST Node ClassProperty shape:
-
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression(必填)¥
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression(required) -
value:Expression(默认:null)¥
value:Expression(default:null) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认:null)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null) -
decorators:Array<Decorator>(默认:null)¥
decorators:Array<Decorator>(default:null) -
computed:boolean(默认:false)¥
computed:boolean(default:false) -
static:boolean(默认:false)¥
static:boolean(default:false) -
abstract:boolean(默认值:null,从构建器功能中排除)¥
abstract:boolean(default:null, excluded from builder function) -
accessibility:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
accessibility:"public" | "private" | "protected"(default:null, excluded from builder function) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function) -
definite:boolean(默认值:null,从构建器功能中排除)¥
definite:boolean(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
override:boolean(默认值:false,从构建器功能中排除)¥
override:boolean(default:false, excluded from builder function) -
readonly:boolean(默认值:null,从构建器功能中排除)¥
readonly:boolean(default:null, excluded from builder function) -
variance:Variance(默认值:null,从构建器功能中排除)¥
variance:Variance(default:null, excluded from builder function)
别名:Standardized, Property
¥Aliases: Standardized, Property
conditionalExpression
t.conditionalExpression(test, consequent, alternate);
另见 t.isConditionalExpression(node, opts) 和 t.assertConditionalExpression(node, opts)。
¥See also t.isConditionalExpression(node, opts) and t.assertConditionalExpression(node, opts).
AST 节点 ConditionalExpression 形状:
¥AST Node ConditionalExpression shape:
-
test:Expression(必填)¥
test:Expression(required) -
consequent:Expression(必填)¥
consequent:Expression(required) -
alternate:Expression(必填)¥
alternate:Expression(required)
别名:Standardized, Expression, Conditional
¥Aliases: Standardized, Expression, Conditional
continueStatement
t.continueStatement(label);
另见 t.isContinueStatement(node, opts) 和 t.assertContinueStatement(node, opts)。
¥See also t.isContinueStatement(node, opts) and t.assertContinueStatement(node, opts).
AST 节点 ContinueStatement 形状:
¥AST Node ContinueStatement shape:
-
label:Identifier(默认:null)¥
label:Identifier(default:null)
别名:Standardized, Statement, Terminatorless, CompletionStatement
¥Aliases: Standardized, Statement, Terminatorless, CompletionStatement
debuggerStatement
t.debuggerStatement();
另见 t.isDebuggerStatement(node, opts) 和 t.assertDebuggerStatement(node, opts)。
¥See also t.isDebuggerStatement(node, opts) and t.assertDebuggerStatement(node, opts).
¥Aliases: Standardized, Statement
decimalLiteral
t.decimalLiteral(value);
另见 t.isDecimalLiteral(node, opts) 和 t.assertDecimalLiteral(node, opts)。
¥See also t.isDecimalLiteral(node, opts) and t.assertDecimalLiteral(node, opts).
AST 节点 DecimalLiteral 形状:
¥AST Node DecimalLiteral shape:
-
value:string(必填)¥
value:string(required)
别名:Expression, Pureish, Literal, Immutable
¥Aliases: Expression, Pureish, Literal, Immutable
declareClass
t.declareClass(id, typeParameters, extends, body);
另见 t.isDeclareClass(node, opts) 和 t.assertDeclareClass(node, opts)。
¥See also t.isDeclareClass(node, opts) and t.assertDeclareClass(node, opts).
AST 节点 DeclareClass 形状:
¥AST Node DeclareClass shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TypeParameterDeclaration(默认:null)¥
typeParameters:TypeParameterDeclaration(default:null) -
extends:Array<InterfaceExtends>(默认:null)¥
extends:Array<InterfaceExtends>(default:null) -
body:ObjectTypeAnnotation(必填)¥
body:ObjectTypeAnnotation(required) -
implements:Array<ClassImplements>(默认值:null,从构建器功能中排除)¥
implements:Array<ClassImplements>(default:null, excluded from builder function) -
mixins:Array<InterfaceExtends>(默认值:null,从构建器功能中排除)¥
mixins:Array<InterfaceExtends>(default:null, excluded from builder function)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareExportAllDeclaration
t.declareExportAllDeclaration(source, attributes);
另见 t.isDeclareExportAllDeclaration(node, opts) 和 t.assertDeclareExportAllDeclaration(node, opts)。
¥See also t.isDeclareExportAllDeclaration(node, opts) and t.assertDeclareExportAllDeclaration(node, opts).
AST 节点 DeclareExportAllDeclaration 形状:
¥AST Node DeclareExportAllDeclaration shape:
-
source:StringLiteral(必填)¥
source:StringLiteral(required) -
attributes:Array<ImportAttribute>(默认:null)¥
attributes:Array<ImportAttribute>(default:null) -
assertions:Array<ImportAttribute>(默认值:null,从构建器功能中排除)¥
assertions:Array<ImportAttribute>(default:null, excluded from builder function) -
exportKind:"type" | "value"(默认值:null,从构建器功能中排除)¥
exportKind:"type" | "value"(default:null, excluded from builder function)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareExportDeclaration
t.declareExportDeclaration(declaration, specifiers, source, attributes);
另见 t.isDeclareExportDeclaration(node, opts) 和 t.assertDeclareExportDeclaration(node, opts)。
¥See also t.isDeclareExportDeclaration(node, opts) and t.assertDeclareExportDeclaration(node, opts).
AST 节点 DeclareExportDeclaration 形状:
¥AST Node DeclareExportDeclaration shape:
-
declaration:Flow(默认:null)¥
declaration:Flow(default:null) -
specifiers:Array<ExportSpecifier | ExportNamespaceSpecifier>(默认:null)¥
specifiers:Array<ExportSpecifier | ExportNamespaceSpecifier>(default:null) -
source:StringLiteral(默认:null)¥
source:StringLiteral(default:null) -
attributes:Array<ImportAttribute>(默认:null)¥
attributes:Array<ImportAttribute>(default:null) -
assertions:Array<ImportAttribute>(默认值:null,从构建器功能中排除)¥
assertions:Array<ImportAttribute>(default:null, excluded from builder function) -
default:boolean(默认值:null,从构建器功能中排除)¥
default:boolean(default:null, excluded from builder function)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareFunction
t.declareFunction(id);
另见 t.isDeclareFunction(node, opts) 和 t.assertDeclareFunction(node, opts)。
¥See also t.isDeclareFunction(node, opts) and t.assertDeclareFunction(node, opts).
AST 节点 DeclareFunction 形状:
¥AST Node DeclareFunction shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
predicate:DeclaredPredicate(默认值:null,从构建器功能中排除)¥
predicate:DeclaredPredicate(default:null, excluded from builder function)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareInterface
t.declareInterface(id, typeParameters, extends, body);
另见 t.isDeclareInterface(node, opts) 和 t.assertDeclareInterface(node, opts)。
¥See also t.isDeclareInterface(node, opts) and t.assertDeclareInterface(node, opts).
AST 节点 DeclareInterface 形状:
¥AST Node DeclareInterface shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TypeParameterDeclaration(默认:null)¥
typeParameters:TypeParameterDeclaration(default:null) -
extends:Array<InterfaceExtends>(默认:null)¥
extends:Array<InterfaceExtends>(default:null) -
body:ObjectTypeAnnotation(必填)¥
body:ObjectTypeAnnotation(required)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareModule
t.declareModule(id, body, kind);
另见 t.isDeclareModule(node, opts) 和 t.assertDeclareModule(node, opts)。
¥See also t.isDeclareModule(node, opts) and t.assertDeclareModule(node, opts).
AST 节点 DeclareModule 形状:
¥AST Node DeclareModule shape:
-
id:Identifier | StringLiteral(必填)¥
id:Identifier | StringLiteral(required) -
body:BlockStatement(必填)¥
body:BlockStatement(required) -
kind:"CommonJS" | "ES"(默认:null)¥
kind:"CommonJS" | "ES"(default:null)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareModuleExports
t.declareModuleExports(typeAnnotation);
另见 t.isDeclareModuleExports(node, opts) 和 t.assertDeclareModuleExports(node, opts)。
¥See also t.isDeclareModuleExports(node, opts) and t.assertDeclareModuleExports(node, opts).
AST 节点 DeclareModuleExports 形状:
¥AST Node DeclareModuleExports shape:
-
typeAnnotation:TypeAnnotation(必填)¥
typeAnnotation:TypeAnnotation(required)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareOpaqueType
t.declareOpaqueType(id, typeParameters, supertype);
另见 t.isDeclareOpaqueType(node, opts) 和 t.assertDeclareOpaqueType(node, opts)。
¥See also t.isDeclareOpaqueType(node, opts) and t.assertDeclareOpaqueType(node, opts).
AST 节点 DeclareOpaqueType 形状:
¥AST Node DeclareOpaqueType shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TypeParameterDeclaration(默认:null)¥
typeParameters:TypeParameterDeclaration(default:null) -
supertype:FlowType(默认:null)¥
supertype:FlowType(default:null) -
impltype:FlowType(默认值:null,从构建器功能中排除)¥
impltype:FlowType(default:null, excluded from builder function)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareTypeAlias
t.declareTypeAlias(id, typeParameters, right);
另见 t.isDeclareTypeAlias(node, opts) 和 t.assertDeclareTypeAlias(node, opts)。
¥See also t.isDeclareTypeAlias(node, opts) and t.assertDeclareTypeAlias(node, opts).
AST 节点 DeclareTypeAlias 形状:
¥AST Node DeclareTypeAlias shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TypeParameterDeclaration(默认:null)¥
typeParameters:TypeParameterDeclaration(default:null) -
right:FlowType(必填)¥
right:FlowType(required)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declareVariable
t.declareVariable(id);
另见 t.isDeclareVariable(node, opts) 和 t.assertDeclareVariable(node, opts)。
¥See also t.isDeclareVariable(node, opts) and t.assertDeclareVariable(node, opts).
AST 节点 DeclareVariable 形状:
¥AST Node DeclareVariable shape:
-
id:Identifier(必填)¥
id:Identifier(required)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
declaredPredicate
t.declaredPredicate(value);
另见 t.isDeclaredPredicate(node, opts) 和 t.assertDeclaredPredicate(node, opts)。
¥See also t.isDeclaredPredicate(node, opts) and t.assertDeclaredPredicate(node, opts).
AST 节点 DeclaredPredicate 形状:
¥AST Node DeclaredPredicate shape:
-
value:Flow(必填)¥
value:Flow(required)
别名:Flow, FlowPredicate
¥Aliases: Flow, FlowPredicate
decorator
t.decorator(expression);
另见 t.isDecorator(node, opts) 和 t.assertDecorator(node, opts)。
¥See also t.isDecorator(node, opts) and t.assertDecorator(node, opts).
AST 节点 Decorator 形状:
¥AST Node Decorator shape:
-
expression:Expression(必填)¥
expression:Expression(required)
directive
t.directive(value);
另见 t.isDirective(node, opts) 和 t.assertDirective(node, opts)。
¥See also t.isDirective(node, opts) and t.assertDirective(node, opts).
AST 节点 Directive 形状:
¥AST Node Directive shape:
-
value:DirectiveLiteral(必填)¥
value:DirectiveLiteral(required)
别名:Standardized
¥Aliases: Standardized
directiveLiteral
t.directiveLiteral(value);
另见 t.isDirectiveLiteral(node, opts) 和 t.assertDirectiveLiteral(node, opts)。
¥See also t.isDirectiveLiteral(node, opts) and t.assertDirectiveLiteral(node, opts).
AST 节点 DirectiveLiteral 形状:
¥AST Node DirectiveLiteral shape:
-
value:string(必填)¥
value:string(required)
别名:Standardized
¥Aliases: Standardized
doExpression
t.doExpression(body, async);
另见 t.isDoExpression(node, opts) 和 t.assertDoExpression(node, opts)。
¥See also t.isDoExpression(node, opts) and t.assertDoExpression(node, opts).
AST 节点 DoExpression 形状:
¥AST Node DoExpression shape:
-
body:BlockStatement(必填)¥
body:BlockStatement(required) -
async:boolean(默认:false)¥
async:boolean(default:false)
别名:Expression
¥Aliases: Expression
doWhileStatement
t.doWhileStatement(test, body);
另见 t.isDoWhileStatement(node, opts) 和 t.assertDoWhileStatement(node, opts)。
¥See also t.isDoWhileStatement(node, opts) and t.assertDoWhileStatement(node, opts).
AST 节点 DoWhileStatement 形状:
¥AST Node DoWhileStatement shape:
-
test:Expression(必填)¥
test:Expression(required) -
body:Statement(必填)¥
body:Statement(required)
别名:Standardized, Statement, BlockParent, Loop, While, Scopable
¥Aliases: Standardized, Statement, BlockParent, Loop, While, Scopable
emptyStatement
t.emptyStatement();
另见 t.isEmptyStatement(node, opts) 和 t.assertEmptyStatement(node, opts)。
¥See also t.isEmptyStatement(node, opts) and t.assertEmptyStatement(node, opts).
¥Aliases: Standardized, Statement
emptyTypeAnnotation
t.emptyTypeAnnotation();
另见 t.isEmptyTypeAnnotation(node, opts) 和 t.assertEmptyTypeAnnotation(node, opts)。
¥See also t.isEmptyTypeAnnotation(node, opts) and t.assertEmptyTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
enumBooleanBody
t.enumBooleanBody(members);
另见 t.isEnumBooleanBody(node, opts) 和 t.assertEnumBooleanBody(node, opts)。
¥See also t.isEnumBooleanBody(node, opts) and t.assertEnumBooleanBody(node, opts).
AST 节点 EnumBooleanBody 形状:
¥AST Node EnumBooleanBody shape:
-
members:Array<EnumBooleanMember>(必填)¥
members:Array<EnumBooleanMember>(required) -
explicitType:boolean(必填)¥
explicitType:boolean(required) -
hasUnknownMembers:boolean(必填)¥
hasUnknownMembers:boolean(required)
enumBooleanMember
t.enumBooleanMember(id);
另见 t.isEnumBooleanMember(node, opts) 和 t.assertEnumBooleanMember(node, opts)。
¥See also t.isEnumBooleanMember(node, opts) and t.assertEnumBooleanMember(node, opts).
AST 节点 EnumBooleanMember 形状:
¥AST Node EnumBooleanMember shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
init:BooleanLiteral(必填)¥
init:BooleanLiteral(required)
别名:Flow, EnumMember
¥Aliases: Flow, EnumMember
enumDeclaration
t.enumDeclaration(id, body);
另见 t.isEnumDeclaration(node, opts) 和 t.assertEnumDeclaration(node, opts)。
¥See also t.isEnumDeclaration(node, opts) and t.assertEnumDeclaration(node, opts).
AST 节点 EnumDeclaration 形状:
¥AST Node EnumDeclaration shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
body:EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody(必填)¥
body:EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody(required)
别名:Flow, Statement, Declaration
¥Aliases: Flow, Statement, Declaration
enumDefaultedMember
t.enumDefaultedMember(id);
另见 t.isEnumDefaultedMember(node, opts) 和 t.assertEnumDefaultedMember(node, opts)。
¥See also t.isEnumDefaultedMember(node, opts) and t.assertEnumDefaultedMember(node, opts).
AST 节点 EnumDefaultedMember 形状:
¥AST Node EnumDefaultedMember shape:
-
id:Identifier(必填)¥
id:Identifier(required)
别名:Flow, EnumMember
¥Aliases: Flow, EnumMember
enumNumberBody
t.enumNumberBody(members);
另见 t.isEnumNumberBody(node, opts) 和 t.assertEnumNumberBody(node, opts)。
¥See also t.isEnumNumberBody(node, opts) and t.assertEnumNumberBody(node, opts).
AST 节点 EnumNumberBody 形状:
¥AST Node EnumNumberBody shape:
-
members:Array<EnumNumberMember>(必填)¥
members:Array<EnumNumberMember>(required) -
explicitType:boolean(必填)¥
explicitType:boolean(required) -
hasUnknownMembers:boolean(必填)¥
hasUnknownMembers:boolean(required)
enumNumberMember
t.enumNumberMember(id, init);
另见 t.isEnumNumberMember(node, opts) 和 t.assertEnumNumberMember(node, opts)。
¥See also t.isEnumNumberMember(node, opts) and t.assertEnumNumberMember(node, opts).
AST 节点 EnumNumberMember 形状:
¥AST Node EnumNumberMember shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
init:NumericLiteral(必填)¥
init:NumericLiteral(required)
别名:Flow, EnumMember
¥Aliases: Flow, EnumMember
enumStringBody
t.enumStringBody(members);
另见 t.isEnumStringBody(node, opts) 和 t.assertEnumStringBody(node, opts)。
¥See also t.isEnumStringBody(node, opts) and t.assertEnumStringBody(node, opts).
AST 节点 EnumStringBody 形状:
¥AST Node EnumStringBody shape:
-
members:Array<EnumStringMember | EnumDefaultedMember>(必填)¥
members:Array<EnumStringMember | EnumDefaultedMember>(required) -
explicitType:boolean(必填)¥
explicitType:boolean(required) -
hasUnknownMembers:boolean(必填)¥
hasUnknownMembers:boolean(required)
enumStringMember
t.enumStringMember(id, init);
另见 t.isEnumStringMember(node, opts) 和 t.assertEnumStringMember(node, opts)。
¥See also t.isEnumStringMember(node, opts) and t.assertEnumStringMember(node, opts).
AST 节点 EnumStringMember 形状:
¥AST Node EnumStringMember shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
init:StringLiteral(必填)¥
init:StringLiteral(required)
别名:Flow, EnumMember
¥Aliases: Flow, EnumMember
enumSymbolBody
t.enumSymbolBody(members);
另见 t.isEnumSymbolBody(node, opts) 和 t.assertEnumSymbolBody(node, opts)。
¥See also t.isEnumSymbolBody(node, opts) and t.assertEnumSymbolBody(node, opts).
AST 节点 EnumSymbolBody 形状:
¥AST Node EnumSymbolBody shape:
-
members:Array<EnumDefaultedMember>(必填)¥
members:Array<EnumDefaultedMember>(required) -
hasUnknownMembers:boolean(必填)¥
hasUnknownMembers:boolean(required)
existsTypeAnnotation
t.existsTypeAnnotation();
另见 t.isExistsTypeAnnotation(node, opts) 和 t.assertExistsTypeAnnotation(node, opts)。
¥See also t.isExistsTypeAnnotation(node, opts) and t.assertExistsTypeAnnotation(node, opts).
exportAllDeclaration
t.exportAllDeclaration(source);
另见 t.isExportAllDeclaration(node, opts) 和 t.assertExportAllDeclaration(node, opts)。
¥See also t.isExportAllDeclaration(node, opts) and t.assertExportAllDeclaration(node, opts).
AST 节点 ExportAllDeclaration 形状:
¥AST Node ExportAllDeclaration shape:
-
source:StringLiteral(必填)¥
source:StringLiteral(required) -
assertions:Array<ImportAttribute>(默认值:null,从构建器功能中排除)¥
assertions:Array<ImportAttribute>(default:null, excluded from builder function) -
attributes:Array<ImportAttribute>(默认值:null,从构建器功能中排除)¥
attributes:Array<ImportAttribute>(default:null, excluded from builder function) -
exportKind:"type" | "value"(默认值:null,从构建器功能中排除)¥
exportKind:"type" | "value"(default:null, excluded from builder function)
别名:Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
¥Aliases: Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
exportDefaultDeclaration
t.exportDefaultDeclaration(declaration);
另见 t.isExportDefaultDeclaration(node, opts) 和 t.assertExportDefaultDeclaration(node, opts)。
¥See also t.isExportDefaultDeclaration(node, opts) and t.assertExportDefaultDeclaration(node, opts).
AST 节点 ExportDefaultDeclaration 形状:
¥AST Node ExportDefaultDeclaration shape:
-
declaration:TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression(必填)¥
declaration:TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression(required) -
exportKind:"value"(默认值:null,从构建器功能中排除)¥
exportKind:"value"(default:null, excluded from builder function)
别名:Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
¥Aliases: Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
exportDefaultSpecifier
t.exportDefaultSpecifier(exported);
另见 t.isExportDefaultSpecifier(node, opts) 和 t.assertExportDefaultSpecifier(node, opts)。
¥See also t.isExportDefaultSpecifier(node, opts) and t.assertExportDefaultSpecifier(node, opts).
AST 节点 ExportDefaultSpecifier 形状:
¥AST Node ExportDefaultSpecifier shape:
-
exported:Identifier(必填)¥
exported:Identifier(required)
¥Aliases: ModuleSpecifier
exportNamedDeclaration
t.exportNamedDeclaration(declaration, specifiers, source);
另见 t.isExportNamedDeclaration(node, opts) 和 t.assertExportNamedDeclaration(node, opts)。
¥See also t.isExportNamedDeclaration(node, opts) and t.assertExportNamedDeclaration(node, opts).
AST 节点 ExportNamedDeclaration 形状:
¥AST Node ExportNamedDeclaration shape:
-
declaration:Declaration(默认:null)¥
declaration:Declaration(default:null) -
specifiers:Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier>(默认:[])¥
specifiers:Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier>(default:[]) -
source:StringLiteral(默认:null)¥
source:StringLiteral(default:null) -
assertions:Array<ImportAttribute>(默认值:null,从构建器功能中排除)¥
assertions:Array<ImportAttribute>(default:null, excluded from builder function) -
attributes:Array<ImportAttribute>(默认值:null,从构建器功能中排除)¥
attributes:Array<ImportAttribute>(default:null, excluded from builder function) -
exportKind:"type" | "value"(默认值:null,从构建器功能中排除)¥
exportKind:"type" | "value"(default:null, excluded from builder function)
别名:Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
¥Aliases: Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
exportNamespaceSpecifier
t.exportNamespaceSpecifier(exported);
另见 t.isExportNamespaceSpecifier(node, opts) 和 t.assertExportNamespaceSpecifier(node, opts)。
¥See also t.isExportNamespaceSpecifier(node, opts) and t.assertExportNamespaceSpecifier(node, opts).
AST 节点 ExportNamespaceSpecifier 形状:
¥AST Node ExportNamespaceSpecifier shape:
-
exported:Identifier(必填)¥
exported:Identifier(required)
别名:Standardized, ModuleSpecifier
¥Aliases: Standardized, ModuleSpecifier
exportSpecifier
t.exportSpecifier(local, exported);
另见 t.isExportSpecifier(node, opts) 和 t.assertExportSpecifier(node, opts)。
¥See also t.isExportSpecifier(node, opts) and t.assertExportSpecifier(node, opts).
AST 节点 ExportSpecifier 形状:
¥AST Node ExportSpecifier shape:
-
local:Identifier(必填)¥
local:Identifier(required) -
exported:Identifier | StringLiteral(必填)¥
exported:Identifier | StringLiteral(required) -
exportKind:"type" | "value"(默认值:null,从构建器功能中排除)¥
exportKind:"type" | "value"(default:null, excluded from builder function)
别名:Standardized, ModuleSpecifier
¥Aliases: Standardized, ModuleSpecifier
expressionStatement
t.expressionStatement(expression);
另见 t.isExpressionStatement(node, opts) 和 t.assertExpressionStatement(node, opts)。
¥See also t.isExpressionStatement(node, opts) and t.assertExpressionStatement(node, opts).
AST 节点 ExpressionStatement 形状:
¥AST Node ExpressionStatement shape:
-
expression:Expression(必填)¥
expression:Expression(required)
别名:Standardized, Statement, ExpressionWrapper
¥Aliases: Standardized, Statement, ExpressionWrapper
file
t.file(program, comments, tokens);
另见 t.isFile(node, opts) 和 t.assertFile(node, opts)。
¥See also t.isFile(node, opts) and t.assertFile(node, opts).
AST 节点 File 形状:
¥AST Node File shape:
-
program:Program(必填)¥
program:Program(required) -
comments:Array<CommentBlock | CommentLine>(默认:null)¥
comments:Array<CommentBlock | CommentLine>(default:null) -
tokens:Array<any>(默认:null)¥
tokens:Array<any>(default:null)
别名:Standardized
¥Aliases: Standardized
forInStatement
t.forInStatement(left, right, body);
另见 t.isForInStatement(node, opts) 和 t.assertForInStatement(node, opts)。
¥See also t.isForInStatement(node, opts) and t.assertForInStatement(node, opts).
AST 节点 ForInStatement 形状:
¥AST Node ForInStatement shape:
-
left:VariableDeclaration | LVal(必填)¥
left:VariableDeclaration | LVal(required) -
right:Expression(必填)¥
right:Expression(required) -
body:Statement(必填)¥
body:Statement(required)
别名:Standardized, Scopable, Statement, For, BlockParent, Loop, ForXStatement
¥Aliases: Standardized, Scopable, Statement, For, BlockParent, Loop, ForXStatement
forOfStatement
t.forOfStatement(left, right, body, await);
另见 t.isForOfStatement(node, opts) 和 t.assertForOfStatement(node, opts)。
¥See also t.isForOfStatement(node, opts) and t.assertForOfStatement(node, opts).
AST 节点 ForOfStatement 形状:
¥AST Node ForOfStatement shape:
-
left:VariableDeclaration | LVal(必填)¥
left:VariableDeclaration | LVal(required) -
right:Expression(必填)¥
right:Expression(required) -
body:Statement(必填)¥
body:Statement(required) -
await:boolean(默认:false)¥
await:boolean(default:false)
别名:Standardized, Scopable, Statement, For, BlockParent, Loop, ForXStatement
¥Aliases: Standardized, Scopable, Statement, For, BlockParent, Loop, ForXStatement
forStatement
t.forStatement(init, test, update, body);
另见 t.isForStatement(node, opts) 和 t.assertForStatement(node, opts)。
¥See also t.isForStatement(node, opts) and t.assertForStatement(node, opts).
AST 节点 ForStatement 形状:
¥AST Node ForStatement shape:
-
init:VariableDeclaration | Expression(默认:null)¥
init:VariableDeclaration | Expression(default:null) -
test:Expression(默认:null)¥
test:Expression(default:null) -
update:Expression(默认:null)¥
update:Expression(default:null) -
body:Statement(必填)¥
body:Statement(required)
别名:Standardized, Scopable, Statement, For, BlockParent, Loop
¥Aliases: Standardized, Scopable, Statement, For, BlockParent, Loop
functionDeclaration
t.functionDeclaration(id, params, body, generator, async);
另见 t.isFunctionDeclaration(node, opts) 和 t.assertFunctionDeclaration(node, opts)。
¥See also t.isFunctionDeclaration(node, opts) and t.assertFunctionDeclaration(node, opts).
AST 节点 FunctionDeclaration 形状:
¥AST Node FunctionDeclaration shape:
-
id:Identifier(默认:null)¥
id:Identifier(default:null) -
params:Array<FunctionParameter>(必填)¥
params:Array<FunctionParameter>(required) -
body:BlockStatement(必填)¥
body:BlockStatement(required) -
generator:boolean(默认:false)¥
generator:boolean(default:false) -
async:boolean(默认:false)¥
async:boolean(default:false) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function) -
predicate:DeclaredPredicate | InferredPredicate(默认值:null,从构建器功能中排除)¥
predicate:DeclaredPredicate | InferredPredicate(default:null, excluded from builder function) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
returnType:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(default:null, excluded from builder function)
别名:Standardized, Scopable, Function, BlockParent, FunctionParent, Statement, Pureish, Declaration
¥Aliases: Standardized, Scopable, Function, BlockParent, FunctionParent, Statement, Pureish, Declaration
functionExpression
t.functionExpression(id, params, body, generator, async);
另见 t.isFunctionExpression(node, opts) 和 t.assertFunctionExpression(node, opts)。
¥See also t.isFunctionExpression(node, opts) and t.assertFunctionExpression(node, opts).
AST 节点 FunctionExpression 形状:
¥AST Node FunctionExpression shape:
-
id:Identifier(默认:null)¥
id:Identifier(default:null) -
params:Array<FunctionParameter>(必填)¥
params:Array<FunctionParameter>(required) -
body:BlockStatement(必填)¥
body:BlockStatement(required) -
generator:boolean(默认:false)¥
generator:boolean(default:false) -
async:boolean(默认:false)¥
async:boolean(default:false) -
predicate:DeclaredPredicate | InferredPredicate(默认值:null,从构建器功能中排除)¥
predicate:DeclaredPredicate | InferredPredicate(default:null, excluded from builder function) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
returnType:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(default:null, excluded from builder function)
别名:Standardized, Scopable, Function, BlockParent, FunctionParent, Expression, Pureish
¥Aliases: Standardized, Scopable, Function, BlockParent, FunctionParent, Expression, Pureish
functionTypeAnnotation
t.functionTypeAnnotation(typeParameters, params, rest, returnType);
另见 t.isFunctionTypeAnnotation(node, opts) 和 t.assertFunctionTypeAnnotation(node, opts)。
¥See also t.isFunctionTypeAnnotation(node, opts) and t.assertFunctionTypeAnnotation(node, opts).
AST 节点 FunctionTypeAnnotation 形状:
¥AST Node FunctionTypeAnnotation shape:
-
typeParameters:TypeParameterDeclaration(默认:null)¥
typeParameters:TypeParameterDeclaration(default:null) -
params:Array<FunctionTypeParam>(必填)¥
params:Array<FunctionTypeParam>(required) -
rest:FunctionTypeParam(默认:null)¥
rest:FunctionTypeParam(default:null) -
returnType:FlowType(必填)¥
returnType:FlowType(required) -
this:FunctionTypeParam(默认值:null,从构建器功能中排除)¥
this:FunctionTypeParam(default:null, excluded from builder function)
functionTypeParam
t.functionTypeParam(name, typeAnnotation);
另见 t.isFunctionTypeParam(node, opts) 和 t.assertFunctionTypeParam(node, opts)。
¥See also t.isFunctionTypeParam(node, opts) and t.assertFunctionTypeParam(node, opts).
AST 节点 FunctionTypeParam 形状:
¥AST Node FunctionTypeParam shape:
-
name:Identifier(默认:null)¥
name:Identifier(default:null) -
typeAnnotation:FlowType(必填)¥
typeAnnotation:FlowType(required) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function)
别名:Flow
¥Aliases: Flow
genericTypeAnnotation
t.genericTypeAnnotation(id, typeParameters);
另见 t.isGenericTypeAnnotation(node, opts) 和 t.assertGenericTypeAnnotation(node, opts)。
¥See also t.isGenericTypeAnnotation(node, opts) and t.assertGenericTypeAnnotation(node, opts).
AST 节点 GenericTypeAnnotation 形状:
¥AST Node GenericTypeAnnotation shape:
-
id:Identifier | QualifiedTypeIdentifier(必填)¥
id:Identifier | QualifiedTypeIdentifier(required) -
typeParameters:TypeParameterInstantiation(默认:null)¥
typeParameters:TypeParameterInstantiation(default:null)
identifier
t.identifier(name);
另见 t.isIdentifier(node, opts) 和 t.assertIdentifier(node, opts)。
¥See also t.isIdentifier(node, opts) and t.assertIdentifier(node, opts).
AST 节点 Identifier 形状:
¥AST Node Identifier shape:
-
name:string(必填)¥
name:string(required) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function)
别名:Standardized, Expression, FunctionParameter, PatternLike, LVal, TSEntityName
¥Aliases: Standardized, Expression, FunctionParameter, PatternLike, LVal, TSEntityName
ifStatement
t.ifStatement(test, consequent, alternate);
另见 t.isIfStatement(node, opts) 和 t.assertIfStatement(node, opts)。
¥See also t.isIfStatement(node, opts) and t.assertIfStatement(node, opts).
AST 节点 IfStatement 形状:
¥AST Node IfStatement shape:
-
test:Expression(必填)¥
test:Expression(required) -
consequent:Statement(必填)¥
consequent:Statement(required) -
alternate:Statement(默认:null)¥
alternate:Statement(default:null)
别名:Standardized, Statement, Conditional
¥Aliases: Standardized, Statement, Conditional
import
t.import();
另见 t.isImport(node, opts) 和 t.assertImport(node, opts)。
¥See also t.isImport(node, opts) and t.assertImport(node, opts).
¥Aliases: Standardized, Expression
importAttribute
t.importAttribute(key, value);
另见 t.isImportAttribute(node, opts) 和 t.assertImportAttribute(node, opts)。
¥See also t.isImportAttribute(node, opts) and t.assertImportAttribute(node, opts).
AST 节点 ImportAttribute 形状:
¥AST Node ImportAttribute shape:
-
key:Identifier | StringLiteral(必填)¥
key:Identifier | StringLiteral(required) -
value:StringLiteral(必填)¥
value:StringLiteral(required)
别名:Standardized
¥Aliases: Standardized
importDeclaration
t.importDeclaration(specifiers, source);
History
| 版本 | 变化 |
|---|---|
v7.20.0 | 支持 module |
另见 t.isImportDeclaration(node, opts) 和 t.assertImportDeclaration(node, opts)。
¥See also t.isImportDeclaration(node, opts) and t.assertImportDeclaration(node, opts).
AST 节点 ImportDeclaration 形状:
¥AST Node ImportDeclaration shape:
-
specifiers:Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>(必填)¥
specifiers:Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>(required) -
source:StringLiteral(必填)¥
source:StringLiteral(required) -
assertions:Array<ImportAttribute>(默认值:null,从构建器功能中排除)¥
assertions:Array<ImportAttribute>(default:null, excluded from builder function) -
attributes:Array<ImportAttribute>(默认值:null,从构建器功能中排除)¥
attributes:Array<ImportAttribute>(default:null, excluded from builder function) -
importKind:"type" | "typeof" | "value"(默认值:null,从构建器功能中排除)¥
importKind:"type" | "typeof" | "value"(default:null, excluded from builder function) -
module:boolean(默认值:null,从构建器功能中排除)¥
module:boolean(default:null, excluded from builder function) -
phase:"source" | "defer"(默认值:null,从构建器功能中排除)¥
phase:"source" | "defer"(default:null, excluded from builder function)
别名:Standardized, Statement, Declaration, ImportOrExportDeclaration
¥Aliases: Standardized, Statement, Declaration, ImportOrExportDeclaration
importDefaultSpecifier
t.importDefaultSpecifier(local);
另见 t.isImportDefaultSpecifier(node, opts) 和 t.assertImportDefaultSpecifier(node, opts)。
¥See also t.isImportDefaultSpecifier(node, opts) and t.assertImportDefaultSpecifier(node, opts).
AST 节点 ImportDefaultSpecifier 形状:
¥AST Node ImportDefaultSpecifier shape:
-
local:Identifier(必填)¥
local:Identifier(required)
别名:Standardized, ModuleSpecifier
¥Aliases: Standardized, ModuleSpecifier
importExpression
t.importExpression(source, options);
另见 t.isImportExpression(node, opts) 和 t.assertImportExpression(node, opts)。
¥See also t.isImportExpression(node, opts) and t.assertImportExpression(node, opts).
AST 节点 ImportExpression 形状:
¥AST Node ImportExpression shape:
-
source:Expression(必填)¥
source:Expression(required) -
options:Expression(默认:null)¥
options:Expression(default:null) -
phase:"source" | "defer"(默认值:null,从构建器功能中排除)¥
phase:"source" | "defer"(default:null, excluded from builder function)
¥Aliases: Standardized, Expression
importNamespaceSpecifier
t.importNamespaceSpecifier(local);
另见 t.isImportNamespaceSpecifier(node, opts) 和 t.assertImportNamespaceSpecifier(node, opts)。
¥See also t.isImportNamespaceSpecifier(node, opts) and t.assertImportNamespaceSpecifier(node, opts).
AST 节点 ImportNamespaceSpecifier 形状:
¥AST Node ImportNamespaceSpecifier shape:
-
local:Identifier(必填)¥
local:Identifier(required)
别名:Standardized, ModuleSpecifier
¥Aliases: Standardized, ModuleSpecifier
importSpecifier
t.importSpecifier(local, imported);
另见 t.isImportSpecifier(node, opts) 和 t.assertImportSpecifier(node, opts)。
¥See also t.isImportSpecifier(node, opts) and t.assertImportSpecifier(node, opts).
AST 节点 ImportSpecifier 形状:
¥AST Node ImportSpecifier shape:
-
local:Identifier(必填)¥
local:Identifier(required) -
imported:Identifier | StringLiteral(必填)¥
imported:Identifier | StringLiteral(required) -
importKind:"type" | "typeof" | "value"(默认值:null,从构建器功能中排除)¥
importKind:"type" | "typeof" | "value"(default:null, excluded from builder function)
别名:Standardized, ModuleSpecifier
¥Aliases: Standardized, ModuleSpecifier
indexedAccessType
t.indexedAccessType(objectType, indexType);
另见 t.isIndexedAccessType(node, opts) 和 t.assertIndexedAccessType(node, opts)。
¥See also t.isIndexedAccessType(node, opts) and t.assertIndexedAccessType(node, opts).
AST 节点 IndexedAccessType 形状:
¥AST Node IndexedAccessType shape:
-
objectType:FlowType(必填)¥
objectType:FlowType(required) -
indexType:FlowType(必填)¥
indexType:FlowType(required)
inferredPredicate
t.inferredPredicate();
另见 t.isInferredPredicate(node, opts) 和 t.assertInferredPredicate(node, opts)。
¥See also t.isInferredPredicate(node, opts) and t.assertInferredPredicate(node, opts).
别名:Flow, FlowPredicate
¥Aliases: Flow, FlowPredicate
interfaceDeclaration
t.interfaceDeclaration(id, typeParameters, extends, body);
另见 t.isInterfaceDeclaration(node, opts) 和 t.assertInterfaceDeclaration(node, opts)。
¥See also t.isInterfaceDeclaration(node, opts) and t.assertInterfaceDeclaration(node, opts).
AST 节点 InterfaceDeclaration 形状:
¥AST Node InterfaceDeclaration shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TypeParameterDeclaration(默认:null)¥
typeParameters:TypeParameterDeclaration(default:null) -
extends:Array<InterfaceExtends>(默认:null)¥
extends:Array<InterfaceExtends>(default:null) -
body:ObjectTypeAnnotation(必填)¥
body:ObjectTypeAnnotation(required)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
interfaceExtends
t.interfaceExtends(id, typeParameters);
另见 t.isInterfaceExtends(node, opts) 和 t.assertInterfaceExtends(node, opts)。
¥See also t.isInterfaceExtends(node, opts) and t.assertInterfaceExtends(node, opts).
AST 节点 InterfaceExtends 形状:
¥AST Node InterfaceExtends shape:
-
id:Identifier | QualifiedTypeIdentifier(必填)¥
id:Identifier | QualifiedTypeIdentifier(required) -
typeParameters:TypeParameterInstantiation(默认:null)¥
typeParameters:TypeParameterInstantiation(default:null)
别名:Flow
¥Aliases: Flow
interfaceTypeAnnotation
t.interfaceTypeAnnotation(extends, body);
另见 t.isInterfaceTypeAnnotation(node, opts) 和 t.assertInterfaceTypeAnnotation(node, opts)。
¥See also t.isInterfaceTypeAnnotation(node, opts) and t.assertInterfaceTypeAnnotation(node, opts).
AST 节点 InterfaceTypeAnnotation 形状:
¥AST Node InterfaceTypeAnnotation shape:
-
extends:Array<InterfaceExtends>(默认:null)¥
extends:Array<InterfaceExtends>(default:null) -
body:ObjectTypeAnnotation(必填)¥
body:ObjectTypeAnnotation(required)
interpreterDirective
t.interpreterDirective(value);
另见 t.isInterpreterDirective(node, opts) 和 t.assertInterpreterDirective(node, opts)。
¥See also t.isInterpreterDirective(node, opts) and t.assertInterpreterDirective(node, opts).
AST 节点 InterpreterDirective 形状:
¥AST Node InterpreterDirective shape:
-
value:string(必填)¥
value:string(required)
别名:Standardized
¥Aliases: Standardized
intersectionTypeAnnotation
t.intersectionTypeAnnotation(types);
另见 t.isIntersectionTypeAnnotation(node, opts) 和 t.assertIntersectionTypeAnnotation(node, opts)。
¥See also t.isIntersectionTypeAnnotation(node, opts) and t.assertIntersectionTypeAnnotation(node, opts).
AST 节点 IntersectionTypeAnnotation 形状:
¥AST Node IntersectionTypeAnnotation shape:
-
types:Array<FlowType>(必填)¥
types:Array<FlowType>(required)
jsxAttribute
t.jsxAttribute(name, value);
另见 t.isJSXAttribute(node, opts) 和 t.assertJSXAttribute(node, opts)。
¥See also t.isJSXAttribute(node, opts) and t.assertJSXAttribute(node, opts).
AST 节点 JSXAttribute 形状:
¥AST Node JSXAttribute shape:
-
name:JSXIdentifier | JSXNamespacedName(必填)¥
name:JSXIdentifier | JSXNamespacedName(required) -
value:JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer(默认:null)¥
value:JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer(default:null)
jsxClosingElement
t.jsxClosingElement(name);
另见 t.isJSXClosingElement(node, opts) 和 t.assertJSXClosingElement(node, opts)。
¥See also t.isJSXClosingElement(node, opts) and t.assertJSXClosingElement(node, opts).
AST 节点 JSXClosingElement 形状:
¥AST Node JSXClosingElement shape:
-
name:JSXIdentifier | JSXMemberExpression | JSXNamespacedName(必填)¥
name:JSXIdentifier | JSXMemberExpression | JSXNamespacedName(required)
jsxClosingFragment
t.jsxClosingFragment();
另见 t.isJSXClosingFragment(node, opts) 和 t.assertJSXClosingFragment(node, opts)。
¥See also t.isJSXClosingFragment(node, opts) and t.assertJSXClosingFragment(node, opts).
jsxElement
t.jsxElement(openingElement, closingElement, children, selfClosing);
另见 t.isJSXElement(node, opts) 和 t.assertJSXElement(node, opts)。
¥See also t.isJSXElement(node, opts) and t.assertJSXElement(node, opts).
AST 节点 JSXElement 形状:
¥AST Node JSXElement shape:
-
openingElement:JSXOpeningElement(必填)¥
openingElement:JSXOpeningElement(required) -
closingElement:JSXClosingElement(默认:null)¥
closingElement:JSXClosingElement(default:null) -
children:Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>(必填)¥
children:Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>(required) -
selfClosing:boolean(默认:null)¥
selfClosing:boolean(default:null)
别名:JSX, Immutable, Expression
¥Aliases: JSX, Immutable, Expression
jsxEmptyExpression
t.jsxEmptyExpression();
另见 t.isJSXEmptyExpression(node, opts) 和 t.assertJSXEmptyExpression(node, opts)。
¥See also t.isJSXEmptyExpression(node, opts) and t.assertJSXEmptyExpression(node, opts).
别名:JSX
¥Aliases: JSX
jsxExpressionContainer
t.jsxExpressionContainer(expression);
另见 t.isJSXExpressionContainer(node, opts) 和 t.assertJSXExpressionContainer(node, opts)。
¥See also t.isJSXExpressionContainer(node, opts) and t.assertJSXExpressionContainer(node, opts).
AST 节点 JSXExpressionContainer 形状:
¥AST Node JSXExpressionContainer shape:
-
expression:Expression | JSXEmptyExpression(必填)¥
expression:Expression | JSXEmptyExpression(required)
jsxFragment
t.jsxFragment(openingFragment, closingFragment, children);
另见 t.isJSXFragment(node, opts) 和 t.assertJSXFragment(node, opts)。
¥See also t.isJSXFragment(node, opts) and t.assertJSXFragment(node, opts).
AST 节点 JSXFragment 形状:
¥AST Node JSXFragment shape:
-
openingFragment:JSXOpeningFragment(必填)¥
openingFragment:JSXOpeningFragment(required) -
closingFragment:JSXClosingFragment(必填)¥
closingFragment:JSXClosingFragment(required) -
children:Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>(必填)¥
children:Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>(required)
别名:JSX, Immutable, Expression
¥Aliases: JSX, Immutable, Expression
jsxIdentifier
t.jsxIdentifier(name);
另见 t.isJSXIdentifier(node, opts) 和 t.assertJSXIdentifier(node, opts)。
¥See also t.isJSXIdentifier(node, opts) and t.assertJSXIdentifier(node, opts).
AST 节点 JSXIdentifier 形状:
¥AST Node JSXIdentifier shape:
-
name:string(必填)¥
name:string(required)
别名:JSX
¥Aliases: JSX
jsxMemberExpression
t.jsxMemberExpression(object, property);
另见 t.isJSXMemberExpression(node, opts) 和 t.assertJSXMemberExpression(node, opts)。
¥See also t.isJSXMemberExpression(node, opts) and t.assertJSXMemberExpression(node, opts).
AST 节点 JSXMemberExpression 形状:
¥AST Node JSXMemberExpression shape:
-
object:JSXMemberExpression | JSXIdentifier(必填)¥
object:JSXMemberExpression | JSXIdentifier(required) -
property:JSXIdentifier(必填)¥
property:JSXIdentifier(required)
别名:JSX
¥Aliases: JSX
jsxNamespacedName
t.jsxNamespacedName(namespace, name);
另见 t.isJSXNamespacedName(node, opts) 和 t.assertJSXNamespacedName(node, opts)。
¥See also t.isJSXNamespacedName(node, opts) and t.assertJSXNamespacedName(node, opts).
AST 节点 JSXNamespacedName 形状:
¥AST Node JSXNamespacedName shape:
-
namespace:JSXIdentifier(必填)¥
namespace:JSXIdentifier(required) -
name:JSXIdentifier(必填)¥
name:JSXIdentifier(required)
别名:JSX
¥Aliases: JSX
jsxOpeningElement
t.jsxOpeningElement(name, attributes, selfClosing);
另见 t.isJSXOpeningElement(node, opts) 和 t.assertJSXOpeningElement(node, opts)。
¥See also t.isJSXOpeningElement(node, opts) and t.assertJSXOpeningElement(node, opts).
AST 节点 JSXOpeningElement 形状:
¥AST Node JSXOpeningElement shape:
-
name:JSXIdentifier | JSXMemberExpression | JSXNamespacedName(必填)¥
name:JSXIdentifier | JSXMemberExpression | JSXNamespacedName(required) -
attributes:Array<JSXAttribute | JSXSpreadAttribute>(必填)¥
attributes:Array<JSXAttribute | JSXSpreadAttribute>(required) -
selfClosing:boolean(默认:false)¥
selfClosing:boolean(default:false) -
typeArguments:TypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeArguments:TypeParameterInstantiation(default:null, excluded from builder function) -
typeParameters:TSTypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeParameters:TSTypeParameterInstantiation(default:null, excluded from builder function)
jsxOpeningFragment
t.jsxOpeningFragment();
另见 t.isJSXOpeningFragment(node, opts) 和 t.assertJSXOpeningFragment(node, opts)。
¥See also t.isJSXOpeningFragment(node, opts) and t.assertJSXOpeningFragment(node, opts).
jsxSpreadAttribute
t.jsxSpreadAttribute(argument);
另见 t.isJSXSpreadAttribute(node, opts) 和 t.assertJSXSpreadAttribute(node, opts)。
¥See also t.isJSXSpreadAttribute(node, opts) and t.assertJSXSpreadAttribute(node, opts).
AST 节点 JSXSpreadAttribute 形状:
¥AST Node JSXSpreadAttribute shape:
-
argument:Expression(必填)¥
argument:Expression(required)
别名:JSX
¥Aliases: JSX
jsxSpreadChild
t.jsxSpreadChild(expression);
另见 t.isJSXSpreadChild(node, opts) 和 t.assertJSXSpreadChild(node, opts)。
¥See also t.isJSXSpreadChild(node, opts) and t.assertJSXSpreadChild(node, opts).
AST 节点 JSXSpreadChild 形状:
¥AST Node JSXSpreadChild shape:
-
expression:Expression(必填)¥
expression:Expression(required)
jsxText
t.jsxText(value);
另见 t.isJSXText(node, opts) 和 t.assertJSXText(node, opts)。
¥See also t.isJSXText(node, opts) and t.assertJSXText(node, opts).
AST 节点 JSXText 形状:
¥AST Node JSXText shape:
-
value:string(必填)¥
value:string(required)
labeledStatement
t.labeledStatement(label, body);
另见 t.isLabeledStatement(node, opts) 和 t.assertLabeledStatement(node, opts)。
¥See also t.isLabeledStatement(node, opts) and t.assertLabeledStatement(node, opts).
AST 节点 LabeledStatement 形状:
¥AST Node LabeledStatement shape:
-
label:Identifier(必填)¥
label:Identifier(required) -
body:Statement(必填)¥
body:Statement(required)
¥Aliases: Standardized, Statement
logicalExpression
t.logicalExpression(operator, left, right);
另见 t.isLogicalExpression(node, opts) 和 t.assertLogicalExpression(node, opts)。
¥See also t.isLogicalExpression(node, opts) and t.assertLogicalExpression(node, opts).
AST 节点 LogicalExpression 形状:
¥AST Node LogicalExpression shape:
-
operator:"||" | "&&" | "??"(必填)¥
operator:"||" | "&&" | "??"(required) -
left:Expression(必填)¥
left:Expression(required) -
right:Expression(必填)¥
right:Expression(required)
别名:Standardized, Binary, Expression
¥Aliases: Standardized, Binary, Expression
memberExpression
t.memberExpression(object, property, computed, optional);
另见 t.isMemberExpression(node, opts) 和 t.assertMemberExpression(node, opts)。
¥See also t.isMemberExpression(node, opts) and t.assertMemberExpression(node, opts).
AST 节点 MemberExpression 形状:
¥AST Node MemberExpression shape:
-
object:Expression | Super(必填)¥
object:Expression | Super(required) -
property:如果计算则Expression否则Identifier(必需)¥
property: if computed thenExpressionelseIdentifier(required) -
computed:boolean(默认:false)¥
computed:boolean(default:false) -
optional:boolean(默认:null)¥
optional:boolean(default:null)
别名:Standardized, Expression, LVal, PatternLike
¥Aliases: Standardized, Expression, LVal, PatternLike
metaProperty
t.metaProperty(meta, property);
另见 t.isMetaProperty(node, opts) 和 t.assertMetaProperty(node, opts)。
¥See also t.isMetaProperty(node, opts) and t.assertMetaProperty(node, opts).
AST 节点 MetaProperty 形状:
¥AST Node MetaProperty shape:
-
meta:Identifier(必填)¥
meta:Identifier(required) -
property:Identifier(必填)¥
property:Identifier(required)
¥Aliases: Standardized, Expression
mixedTypeAnnotation
t.mixedTypeAnnotation();
另见 t.isMixedTypeAnnotation(node, opts) 和 t.assertMixedTypeAnnotation(node, opts)。
¥See also t.isMixedTypeAnnotation(node, opts) and t.assertMixedTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
moduleExpression
t.moduleExpression(body);
另见 t.isModuleExpression(node, opts) 和 t.assertModuleExpression(node, opts)。
¥See also t.isModuleExpression(node, opts) and t.assertModuleExpression(node, opts).
AST 节点 ModuleExpression 形状:
¥AST Node ModuleExpression shape:
-
body:Program(必填)¥
body:Program(required)
别名:Expression
¥Aliases: Expression
newExpression
t.newExpression(callee, arguments);
另见 t.isNewExpression(node, opts) 和 t.assertNewExpression(node, opts)。
¥See also t.isNewExpression(node, opts) and t.assertNewExpression(node, opts).
AST 节点 NewExpression 形状:
¥AST Node NewExpression shape:
-
callee:Expression | Super | V8IntrinsicIdentifier(必填)¥
callee:Expression | Super | V8IntrinsicIdentifier(required) -
arguments:Array<Expression | SpreadElement | ArgumentPlaceholder>(必填)¥
arguments:Array<Expression | SpreadElement | ArgumentPlaceholder>(required) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
typeArguments:TypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeArguments:TypeParameterInstantiation(default:null, excluded from builder function) -
typeParameters:TSTypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeParameters:TSTypeParameterInstantiation(default:null, excluded from builder function)
¥Aliases: Standardized, Expression
noop
t.noop();
另见 t.isNoop(node, opts) 和 t.assertNoop(node, opts)。
¥See also t.isNoop(node, opts) and t.assertNoop(node, opts).
¥Aliases: Miscellaneous
nullLiteral
t.nullLiteral();
另见 t.isNullLiteral(node, opts) 和 t.assertNullLiteral(node, opts)。
¥See also t.isNullLiteral(node, opts) and t.assertNullLiteral(node, opts).
别名:Standardized, Expression, Pureish, Literal, Immutable
¥Aliases: Standardized, Expression, Pureish, Literal, Immutable
nullLiteralTypeAnnotation
t.nullLiteralTypeAnnotation();
另见 t.isNullLiteralTypeAnnotation(node, opts) 和 t.assertNullLiteralTypeAnnotation(node, opts)。
¥See also t.isNullLiteralTypeAnnotation(node, opts) and t.assertNullLiteralTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
nullableTypeAnnotation
t.nullableTypeAnnotation(typeAnnotation);
另见 t.isNullableTypeAnnotation(node, opts) 和 t.assertNullableTypeAnnotation(node, opts)。
¥See also t.isNullableTypeAnnotation(node, opts) and t.assertNullableTypeAnnotation(node, opts).
AST 节点 NullableTypeAnnotation 形状:
¥AST Node NullableTypeAnnotation shape:
-
typeAnnotation:FlowType(必填)¥
typeAnnotation:FlowType(required)
numberLiteralTypeAnnotation
t.numberLiteralTypeAnnotation(value);
另见 t.isNumberLiteralTypeAnnotation(node, opts) 和 t.assertNumberLiteralTypeAnnotation(node, opts)。
¥See also t.isNumberLiteralTypeAnnotation(node, opts) and t.assertNumberLiteralTypeAnnotation(node, opts).
AST 节点 NumberLiteralTypeAnnotation 形状:
¥AST Node NumberLiteralTypeAnnotation shape:
-
value:number(必填)¥
value:number(required)
numberTypeAnnotation
t.numberTypeAnnotation();
另见 t.isNumberTypeAnnotation(node, opts) 和 t.assertNumberTypeAnnotation(node, opts)。
¥See also t.isNumberTypeAnnotation(node, opts) and t.assertNumberTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
numericLiteral
t.numericLiteral(value);
另见 t.isNumericLiteral(node, opts) 和 t.assertNumericLiteral(node, opts)。
¥See also t.isNumericLiteral(node, opts) and t.assertNumericLiteral(node, opts).
AST 节点 NumericLiteral 形状:
¥AST Node NumericLiteral shape:
-
value:非负有限number(必需)¥
value: a non-negative finitenumber(required)
别名:Standardized, Expression, Pureish, Literal, Immutable
¥Aliases: Standardized, Expression, Pureish, Literal, Immutable
objectExpression
t.objectExpression(properties);
另见 t.isObjectExpression(node, opts) 和 t.assertObjectExpression(node, opts)。
¥See also t.isObjectExpression(node, opts) and t.assertObjectExpression(node, opts).
AST 节点 ObjectExpression 形状:
¥AST Node ObjectExpression shape:
-
properties:Array<ObjectMethod | ObjectProperty | SpreadElement>(必填)¥
properties:Array<ObjectMethod | ObjectProperty | SpreadElement>(required)
¥Aliases: Standardized, Expression
objectMethod
t.objectMethod(kind, key, params, body, computed, generator, async);
另见 t.isObjectMethod(node, opts) 和 t.assertObjectMethod(node, opts)。
¥See also t.isObjectMethod(node, opts) and t.assertObjectMethod(node, opts).
AST 节点 ObjectMethod 形状:
¥AST Node ObjectMethod shape:
-
kind:"method" | "get" | "set"(默认:'method')¥
kind:"method" | "get" | "set"(default:'method') -
key:如果计算则Expression否则Identifier | Literal(必需)¥
key: if computed thenExpressionelseIdentifier | Literal(required) -
params:Array<FunctionParameter>(必填)¥
params:Array<FunctionParameter>(required) -
body:BlockStatement(必填)¥
body:BlockStatement(required) -
computed:boolean(默认:false)¥
computed:boolean(default:false) -
generator:boolean(默认:false)¥
generator:boolean(default:false) -
async:boolean(默认:false)¥
async:boolean(default:false) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
returnType:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(default:null, excluded from builder function)
别名:Standardized, UserWhitespacable, Function, Scopable, BlockParent, FunctionParent, Method, ObjectMember
¥Aliases: Standardized, UserWhitespacable, Function, Scopable, BlockParent, FunctionParent, Method, ObjectMember
objectPattern
t.objectPattern(properties);
另见 t.isObjectPattern(node, opts) 和 t.assertObjectPattern(node, opts)。
¥See also t.isObjectPattern(node, opts) and t.assertObjectPattern(node, opts).
AST 节点 ObjectPattern 形状:
¥AST Node ObjectPattern shape:
-
properties:Array<RestElement | ObjectProperty>(必填)¥
properties:Array<RestElement | ObjectProperty>(required) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function)
别名:Standardized, FunctionParameter, Pattern, PatternLike, LVal
¥Aliases: Standardized, FunctionParameter, Pattern, PatternLike, LVal
objectProperty
t.objectProperty(key, value, computed, shorthand, decorators);
另见 t.isObjectProperty(node, opts) 和 t.assertObjectProperty(node, opts)。
¥See also t.isObjectProperty(node, opts) and t.assertObjectProperty(node, opts).
AST 节点 ObjectProperty 形状:
¥AST Node ObjectProperty shape:
-
key:如果计算则Expression否则Identifier | Literal(必需)¥
key: if computed thenExpressionelseIdentifier | Literal(required) -
value:Expression | PatternLike(必填)¥
value:Expression | PatternLike(required) -
computed:boolean(默认:false)¥
computed:boolean(default:false) -
shorthand:boolean(默认:false)¥
shorthand:boolean(default:false) -
decorators:Array<Decorator>(默认:null)¥
decorators:Array<Decorator>(default:null)
别名:Standardized, UserWhitespacable, Property, ObjectMember
¥Aliases: Standardized, UserWhitespacable, Property, ObjectMember
objectTypeAnnotation
t.objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact);
另见 t.isObjectTypeAnnotation(node, opts) 和 t.assertObjectTypeAnnotation(node, opts)。
¥See also t.isObjectTypeAnnotation(node, opts) and t.assertObjectTypeAnnotation(node, opts).
AST 节点 ObjectTypeAnnotation 形状:
¥AST Node ObjectTypeAnnotation shape:
-
properties:Array<ObjectTypeProperty | ObjectTypeSpreadProperty>(必填)¥
properties:Array<ObjectTypeProperty | ObjectTypeSpreadProperty>(required) -
indexers:Array<ObjectTypeIndexer>(默认:[])¥
indexers:Array<ObjectTypeIndexer>(default:[]) -
callProperties:Array<ObjectTypeCallProperty>(默认:[])¥
callProperties:Array<ObjectTypeCallProperty>(default:[]) -
internalSlots:Array<ObjectTypeInternalSlot>(默认:[])¥
internalSlots:Array<ObjectTypeInternalSlot>(default:[]) -
exact:boolean(默认:false)¥
exact:boolean(default:false) -
inexact:boolean(默认值:null,从构建器功能中排除)¥
inexact:boolean(default:null, excluded from builder function)
objectTypeCallProperty
t.objectTypeCallProperty(value);
另见 t.isObjectTypeCallProperty(node, opts) 和 t.assertObjectTypeCallProperty(node, opts)。
¥See also t.isObjectTypeCallProperty(node, opts) and t.assertObjectTypeCallProperty(node, opts).
AST 节点 ObjectTypeCallProperty 形状:
¥AST Node ObjectTypeCallProperty shape:
-
value:FlowType(必填)¥
value:FlowType(required) -
static:boolean(必填)¥
static:boolean(required)
¥Aliases: Flow, UserWhitespacable
objectTypeIndexer
t.objectTypeIndexer(id, key, value, variance);
另见 t.isObjectTypeIndexer(node, opts) 和 t.assertObjectTypeIndexer(node, opts)。
¥See also t.isObjectTypeIndexer(node, opts) and t.assertObjectTypeIndexer(node, opts).
AST 节点 ObjectTypeIndexer 形状:
¥AST Node ObjectTypeIndexer shape:
-
id:Identifier(默认:null)¥
id:Identifier(default:null) -
key:FlowType(必填)¥
key:FlowType(required) -
value:FlowType(必填)¥
value:FlowType(required) -
variance:Variance(默认:null)¥
variance:Variance(default:null) -
static:boolean(必填)¥
static:boolean(required)
¥Aliases: Flow, UserWhitespacable
objectTypeInternalSlot
t.objectTypeInternalSlot(id, value, optional, static, method);
另见 t.isObjectTypeInternalSlot(node, opts) 和 t.assertObjectTypeInternalSlot(node, opts)。
¥See also t.isObjectTypeInternalSlot(node, opts) and t.assertObjectTypeInternalSlot(node, opts).
AST 节点 ObjectTypeInternalSlot 形状:
¥AST Node ObjectTypeInternalSlot shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
value:FlowType(必填)¥
value:FlowType(required) -
optional:boolean(必填)¥
optional:boolean(required) -
static:boolean(必填)¥
static:boolean(required) -
method:boolean(必填)¥
method:boolean(required)
¥Aliases: Flow, UserWhitespacable
objectTypeProperty
t.objectTypeProperty(key, value, variance);
另见 t.isObjectTypeProperty(node, opts) 和 t.assertObjectTypeProperty(node, opts)。
¥See also t.isObjectTypeProperty(node, opts) and t.assertObjectTypeProperty(node, opts).
AST 节点 ObjectTypeProperty 形状:
¥AST Node ObjectTypeProperty shape:
-
key:Identifier | StringLiteral(必填)¥
key:Identifier | StringLiteral(required) -
value:FlowType(必填)¥
value:FlowType(required) -
variance:Variance(默认:null)¥
variance:Variance(default:null) -
kind:"init" | "get" | "set"(必填)¥
kind:"init" | "get" | "set"(required) -
method:boolean(必填)¥
method:boolean(required) -
optional:boolean(必填)¥
optional:boolean(required) -
proto:boolean(必填)¥
proto:boolean(required) -
static:boolean(必填)¥
static:boolean(required)
¥Aliases: Flow, UserWhitespacable
objectTypeSpreadProperty
t.objectTypeSpreadProperty(argument);
另见 t.isObjectTypeSpreadProperty(node, opts) 和 t.assertObjectTypeSpreadProperty(node, opts)。
¥See also t.isObjectTypeSpreadProperty(node, opts) and t.assertObjectTypeSpreadProperty(node, opts).
AST 节点 ObjectTypeSpreadProperty 形状:
¥AST Node ObjectTypeSpreadProperty shape:
-
argument:FlowType(必填)¥
argument:FlowType(required)
¥Aliases: Flow, UserWhitespacable
opaqueType
t.opaqueType(id, typeParameters, supertype, impltype);
另见 t.isOpaqueType(node, opts) 和 t.assertOpaqueType(node, opts)。
¥See also t.isOpaqueType(node, opts) and t.assertOpaqueType(node, opts).
AST 节点 OpaqueType 形状:
¥AST Node OpaqueType shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TypeParameterDeclaration(默认:null)¥
typeParameters:TypeParameterDeclaration(default:null) -
supertype:FlowType(默认:null)¥
supertype:FlowType(default:null) -
impltype:FlowType(必填)¥
impltype:FlowType(required)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
optionalCallExpression
t.optionalCallExpression(callee, arguments, optional);
另见 t.isOptionalCallExpression(node, opts) 和 t.assertOptionalCallExpression(node, opts)。
¥See also t.isOptionalCallExpression(node, opts) and t.assertOptionalCallExpression(node, opts).
AST 节点 OptionalCallExpression 形状:
¥AST Node OptionalCallExpression shape:
-
callee:Expression(必填)¥
callee:Expression(required) -
arguments:Array<Expression | SpreadElement | ArgumentPlaceholder>(必填)¥
arguments:Array<Expression | SpreadElement | ArgumentPlaceholder>(required) -
optional:boolean(必填)¥
optional:boolean(required) -
typeArguments:TypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeArguments:TypeParameterInstantiation(default:null, excluded from builder function) -
typeParameters:TSTypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeParameters:TSTypeParameterInstantiation(default:null, excluded from builder function)
¥Aliases: Standardized, Expression
optionalIndexedAccessType
t.optionalIndexedAccessType(objectType, indexType);
另见 t.isOptionalIndexedAccessType(node, opts) 和 t.assertOptionalIndexedAccessType(node, opts)。
¥See also t.isOptionalIndexedAccessType(node, opts) and t.assertOptionalIndexedAccessType(node, opts).
AST 节点 OptionalIndexedAccessType 形状:
¥AST Node OptionalIndexedAccessType shape:
-
objectType:FlowType(必填)¥
objectType:FlowType(required) -
indexType:FlowType(必填)¥
indexType:FlowType(required) -
optional:boolean(必填)¥
optional:boolean(required)
optionalMemberExpression
t.optionalMemberExpression(object, property, computed, optional);
另见 t.isOptionalMemberExpression(node, opts) 和 t.assertOptionalMemberExpression(node, opts)。
¥See also t.isOptionalMemberExpression(node, opts) and t.assertOptionalMemberExpression(node, opts).
AST 节点 OptionalMemberExpression 形状:
¥AST Node OptionalMemberExpression shape:
-
object:Expression(必填)¥
object:Expression(required) -
property:Expression | Identifier(必填)¥
property:Expression | Identifier(required) -
computed:boolean(默认:false)¥
computed:boolean(default:false) -
optional:boolean(必填)¥
optional:boolean(required)
¥Aliases: Standardized, Expression
parenthesizedExpression
t.parenthesizedExpression(expression);
另见 t.isParenthesizedExpression(node, opts) 和 t.assertParenthesizedExpression(node, opts)。
¥See also t.isParenthesizedExpression(node, opts) and t.assertParenthesizedExpression(node, opts).
AST 节点 ParenthesizedExpression 形状:
¥AST Node ParenthesizedExpression shape:
-
expression:Expression(必填)¥
expression:Expression(required)
别名:Standardized, Expression, ExpressionWrapper
¥Aliases: Standardized, Expression, ExpressionWrapper
pipelineBareFunction
t.pipelineBareFunction(callee);
另见 t.isPipelineBareFunction(node, opts) 和 t.assertPipelineBareFunction(node, opts)。
¥See also t.isPipelineBareFunction(node, opts) and t.assertPipelineBareFunction(node, opts).
AST 节点 PipelineBareFunction 形状:
¥AST Node PipelineBareFunction shape:
-
callee:Expression(必填)¥
callee:Expression(required)
别名:Expression
¥Aliases: Expression
pipelinePrimaryTopicReference
t.pipelinePrimaryTopicReference();
另见 t.isPipelinePrimaryTopicReference(node, opts) 和 t.assertPipelinePrimaryTopicReference(node, opts)。
¥See also t.isPipelinePrimaryTopicReference(node, opts) and t.assertPipelinePrimaryTopicReference(node, opts).
别名:Expression
¥Aliases: Expression
pipelineTopicExpression
t.pipelineTopicExpression(expression);
另见 t.isPipelineTopicExpression(node, opts) 和 t.assertPipelineTopicExpression(node, opts)。
¥See also t.isPipelineTopicExpression(node, opts) and t.assertPipelineTopicExpression(node, opts).
AST 节点 PipelineTopicExpression 形状:
¥AST Node PipelineTopicExpression shape:
-
expression:Expression(必填)¥
expression:Expression(required)
别名:Expression
¥Aliases: Expression
placeholder
t.placeholder(expectedNode, name);
另见 t.isPlaceholder(node, opts) 和 t.assertPlaceholder(node, opts)。
¥See also t.isPlaceholder(node, opts) and t.assertPlaceholder(node, opts).
AST 节点 Placeholder 形状:
¥AST Node Placeholder shape:
-
expectedNode:"Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern"(必填)¥
expectedNode:"Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern"(required) -
name:Identifier(必填)¥
name:Identifier(required) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function)
¥Aliases: Miscellaneous
privateName
t.privateName(id);
另见 t.isPrivateName(node, opts) 和 t.assertPrivateName(node, opts)。
¥See also t.isPrivateName(node, opts) and t.assertPrivateName(node, opts).
AST 节点 PrivateName 形状:
¥AST Node PrivateName shape:
-
id:Identifier(必填)¥
id:Identifier(required)
别名:Standardized, Private
¥Aliases: Standardized, Private
program
t.program(body, directives, sourceType, interpreter);
另见 t.isProgram(node, opts) 和 t.assertProgram(node, opts)。
¥See also t.isProgram(node, opts) and t.assertProgram(node, opts).
AST 节点 Program 形状:
¥AST Node Program shape:
-
body:Array<Statement>(必填)¥
body:Array<Statement>(required) -
directives:Array<Directive>(默认:[])¥
directives:Array<Directive>(default:[]) -
sourceType:"script" | "module"(默认:'script')¥
sourceType:"script" | "module"(default:'script') -
interpreter:InterpreterDirective(默认:null)¥
interpreter:InterpreterDirective(default:null)
别名:Standardized, Scopable, BlockParent, Block
¥Aliases: Standardized, Scopable, BlockParent, Block
qualifiedTypeIdentifier
t.qualifiedTypeIdentifier(id, qualification);
另见 t.isQualifiedTypeIdentifier(node, opts) 和 t.assertQualifiedTypeIdentifier(node, opts)。
¥See also t.isQualifiedTypeIdentifier(node, opts) and t.assertQualifiedTypeIdentifier(node, opts).
AST 节点 QualifiedTypeIdentifier 形状:
¥AST Node QualifiedTypeIdentifier shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
qualification:Identifier | QualifiedTypeIdentifier(必填)¥
qualification:Identifier | QualifiedTypeIdentifier(required)
别名:Flow
¥Aliases: Flow
recordExpression
t.recordExpression(properties);
另见 t.isRecordExpression(node, opts) 和 t.assertRecordExpression(node, opts)。
¥See also t.isRecordExpression(node, opts) and t.assertRecordExpression(node, opts).
AST 节点 RecordExpression 形状:
¥AST Node RecordExpression shape:
-
properties:Array<ObjectProperty | SpreadElement>(必填)¥
properties:Array<ObjectProperty | SpreadElement>(required)
别名:Expression
¥Aliases: Expression
regExpLiteral
t.regExpLiteral(pattern, flags);
另见 t.isRegExpLiteral(node, opts) 和 t.assertRegExpLiteral(node, opts)。
¥See also t.isRegExpLiteral(node, opts) and t.assertRegExpLiteral(node, opts).
AST 节点 RegExpLiteral 形状:
¥AST Node RegExpLiteral shape:
-
pattern:string(必填)¥
pattern:string(required) -
flags:string(默认:'')¥
flags:string(default:'')
别名:Standardized, Expression, Pureish, Literal
¥Aliases: Standardized, Expression, Pureish, Literal
restElement
t.restElement(argument);
另见 t.isRestElement(node, opts) 和 t.assertRestElement(node, opts)。
¥See also t.isRestElement(node, opts) and t.assertRestElement(node, opts).
AST 节点 RestElement 形状:
¥AST Node RestElement shape:
-
argument:Identifier | ArrayPattern | ObjectPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | RestElement | AssignmentPattern(必填)¥
argument:Identifier | ArrayPattern | ObjectPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | RestElement | AssignmentPattern(required) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(默认值:null,从构建器功能中排除)¥
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null, excluded from builder function)
别名:Standardized, FunctionParameter, PatternLike, LVal
¥Aliases: Standardized, FunctionParameter, PatternLike, LVal
returnStatement
t.returnStatement(argument);
另见 t.isReturnStatement(node, opts) 和 t.assertReturnStatement(node, opts)。
¥See also t.isReturnStatement(node, opts) and t.assertReturnStatement(node, opts).
AST 节点 ReturnStatement 形状:
¥AST Node ReturnStatement shape:
-
argument:Expression(默认:null)¥
argument:Expression(default:null)
别名:Standardized, Statement, Terminatorless, CompletionStatement
¥Aliases: Standardized, Statement, Terminatorless, CompletionStatement
sequenceExpression
t.sequenceExpression(expressions);
另见 t.isSequenceExpression(node, opts) 和 t.assertSequenceExpression(node, opts)。
¥See also t.isSequenceExpression(node, opts) and t.assertSequenceExpression(node, opts).
AST 节点 SequenceExpression 形状:
¥AST Node SequenceExpression shape:
-
expressions:Array<Expression>(必填)¥
expressions:Array<Expression>(required)
¥Aliases: Standardized, Expression
spreadElement
t.spreadElement(argument);
另见 t.isSpreadElement(node, opts) 和 t.assertSpreadElement(node, opts)。
¥See also t.isSpreadElement(node, opts) and t.assertSpreadElement(node, opts).
AST 节点 SpreadElement 形状:
¥AST Node SpreadElement shape:
-
argument:Expression(必填)¥
argument:Expression(required)
¥Aliases: Standardized, UnaryLike
staticBlock
t.staticBlock(body);
另见 t.isStaticBlock(node, opts) 和 t.assertStaticBlock(node, opts)。
¥See also t.isStaticBlock(node, opts) and t.assertStaticBlock(node, opts).
AST 节点 StaticBlock 形状:
¥AST Node StaticBlock shape:
-
body:Array<Statement>(必填)¥
body:Array<Statement>(required)
别名:Standardized, Scopable, BlockParent, FunctionParent
¥Aliases: Standardized, Scopable, BlockParent, FunctionParent
stringLiteral
t.stringLiteral(value);
另见 t.isStringLiteral(node, opts) 和 t.assertStringLiteral(node, opts)。
¥See also t.isStringLiteral(node, opts) and t.assertStringLiteral(node, opts).
AST 节点 StringLiteral 形状:
¥AST Node StringLiteral shape:
-
value:string(必填)¥
value:string(required)
别名:Standardized, Expression, Pureish, Literal, Immutable
¥Aliases: Standardized, Expression, Pureish, Literal, Immutable
stringLiteralTypeAnnotation
t.stringLiteralTypeAnnotation(value);
另见 t.isStringLiteralTypeAnnotation(node, opts) 和 t.assertStringLiteralTypeAnnotation(node, opts)。
¥See also t.isStringLiteralTypeAnnotation(node, opts) and t.assertStringLiteralTypeAnnotation(node, opts).
AST 节点 StringLiteralTypeAnnotation 形状:
¥AST Node StringLiteralTypeAnnotation shape:
-
value:string(必填)¥
value:string(required)
stringTypeAnnotation
t.stringTypeAnnotation();
另见 t.isStringTypeAnnotation(node, opts) 和 t.assertStringTypeAnnotation(node, opts)。
¥See also t.isStringTypeAnnotation(node, opts) and t.assertStringTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
super
t.super();
另见 t.isSuper(node, opts) 和 t.assertSuper(node, opts)。
¥See also t.isSuper(node, opts) and t.assertSuper(node, opts).
¥Aliases: Standardized, Expression
switchCase
t.switchCase(test, consequent);
另见 t.isSwitchCase(node, opts) 和 t.assertSwitchCase(node, opts)。
¥See also t.isSwitchCase(node, opts) and t.assertSwitchCase(node, opts).
AST 节点 SwitchCase 形状:
¥AST Node SwitchCase shape:
-
test:Expression(默认:null)¥
test:Expression(default:null) -
consequent:Array<Statement>(必填)¥
consequent:Array<Statement>(required)
别名:Standardized
¥Aliases: Standardized
switchStatement
t.switchStatement(discriminant, cases);
另见 t.isSwitchStatement(node, opts) 和 t.assertSwitchStatement(node, opts)。
¥See also t.isSwitchStatement(node, opts) and t.assertSwitchStatement(node, opts).
AST 节点 SwitchStatement 形状:
¥AST Node SwitchStatement shape:
-
discriminant:Expression(必填)¥
discriminant:Expression(required) -
cases:Array<SwitchCase>(必填)¥
cases:Array<SwitchCase>(required)
别名:Standardized, Statement, BlockParent, Scopable
¥Aliases: Standardized, Statement, BlockParent, Scopable
symbolTypeAnnotation
t.symbolTypeAnnotation();
另见 t.isSymbolTypeAnnotation(node, opts) 和 t.assertSymbolTypeAnnotation(node, opts)。
¥See also t.isSymbolTypeAnnotation(node, opts) and t.assertSymbolTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
tsAnyKeyword
t.tsAnyKeyword();
另见 t.isTSAnyKeyword(node, opts) 和 t.assertTSAnyKeyword(node, opts)。
¥See also t.isTSAnyKeyword(node, opts) and t.assertTSAnyKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsArrayType
t.tsArrayType(elementType);
另见 t.isTSArrayType(node, opts) 和 t.assertTSArrayType(node, opts)。
¥See also t.isTSArrayType(node, opts) and t.assertTSArrayType(node, opts).
AST 节点 TSArrayType 形状:
¥AST Node TSArrayType shape:
-
elementType:TSType(必填)¥
elementType:TSType(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsAsExpression
t.tsAsExpression(expression, typeAnnotation);
另见 t.isTSAsExpression(node, opts) 和 t.assertTSAsExpression(node, opts)。
¥See also t.isTSAsExpression(node, opts) and t.assertTSAsExpression(node, opts).
AST 节点 TSAsExpression 形状:
¥AST Node TSAsExpression shape:
-
expression:Expression(必填)¥
expression:Expression(required) -
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required)
别名:TypeScript, Expression, LVal, PatternLike
¥Aliases: TypeScript, Expression, LVal, PatternLike
tsBigIntKeyword
t.tsBigIntKeyword();
另见 t.isTSBigIntKeyword(node, opts) 和 t.assertTSBigIntKeyword(node, opts)。
¥See also t.isTSBigIntKeyword(node, opts) and t.assertTSBigIntKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsBooleanKeyword
t.tsBooleanKeyword();
另见 t.isTSBooleanKeyword(node, opts) 和 t.assertTSBooleanKeyword(node, opts)。
¥See also t.isTSBooleanKeyword(node, opts) and t.assertTSBooleanKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsCallSignatureDeclaration
t.tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation);
另见 t.isTSCallSignatureDeclaration(node, opts) 和 t.assertTSCallSignatureDeclaration(node, opts)。
¥See also t.isTSCallSignatureDeclaration(node, opts) and t.assertTSCallSignatureDeclaration(node, opts).
AST 节点 TSCallSignatureDeclaration 形状:
¥AST Node TSCallSignatureDeclaration shape:
-
typeParameters:TSTypeParameterDeclaration(默认:null)¥
typeParameters:TSTypeParameterDeclaration(default:null) -
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(必填)¥
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(required) -
typeAnnotation:TSTypeAnnotation(默认:null)¥
typeAnnotation:TSTypeAnnotation(default:null)
¥Aliases: TypeScript, TSTypeElement
tsConditionalType
t.tsConditionalType(checkType, extendsType, trueType, falseType);
另见 t.isTSConditionalType(node, opts) 和 t.assertTSConditionalType(node, opts)。
¥See also t.isTSConditionalType(node, opts) and t.assertTSConditionalType(node, opts).
AST 节点 TSConditionalType 形状:
¥AST Node TSConditionalType shape:
-
checkType:TSType(必填)¥
checkType:TSType(required) -
extendsType:TSType(必填)¥
extendsType:TSType(required) -
trueType:TSType(必填)¥
trueType:TSType(required) -
falseType:TSType(必填)¥
falseType:TSType(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsConstructSignatureDeclaration
t.tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation);
另见 t.isTSConstructSignatureDeclaration(node, opts) 和 t.assertTSConstructSignatureDeclaration(node, opts)。
¥See also t.isTSConstructSignatureDeclaration(node, opts) and t.assertTSConstructSignatureDeclaration(node, opts).
AST 节点 TSConstructSignatureDeclaration 形状:
¥AST Node TSConstructSignatureDeclaration shape:
-
typeParameters:TSTypeParameterDeclaration(默认:null)¥
typeParameters:TSTypeParameterDeclaration(default:null) -
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(必填)¥
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(required) -
typeAnnotation:TSTypeAnnotation(默认:null)¥
typeAnnotation:TSTypeAnnotation(default:null)
¥Aliases: TypeScript, TSTypeElement
tsConstructorType
t.tsConstructorType(typeParameters, parameters, typeAnnotation);
另见 t.isTSConstructorType(node, opts) 和 t.assertTSConstructorType(node, opts)。
¥See also t.isTSConstructorType(node, opts) and t.assertTSConstructorType(node, opts).
AST 节点 TSConstructorType 形状:
¥AST Node TSConstructorType shape:
-
typeParameters:TSTypeParameterDeclaration(默认:null)¥
typeParameters:TSTypeParameterDeclaration(default:null) -
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(必填)¥
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(required) -
typeAnnotation:TSTypeAnnotation(默认:null)¥
typeAnnotation:TSTypeAnnotation(default:null) -
abstract:boolean(默认值:null,从构建器功能中排除)¥
abstract:boolean(default:null, excluded from builder function)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsDeclareFunction
t.tsDeclareFunction(id, typeParameters, params, returnType);
另见 t.isTSDeclareFunction(node, opts) 和 t.assertTSDeclareFunction(node, opts)。
¥See also t.isTSDeclareFunction(node, opts) and t.assertTSDeclareFunction(node, opts).
AST 节点 TSDeclareFunction 形状:
¥AST Node TSDeclareFunction shape:
-
id:Identifier(默认:null)¥
id:Identifier(default:null) -
typeParameters:TSTypeParameterDeclaration | Noop(默认:null)¥
typeParameters:TSTypeParameterDeclaration | Noop(default:null) -
params:Array<FunctionParameter>(必填)¥
params:Array<FunctionParameter>(required) -
returnType:TSTypeAnnotation | Noop(默认:null)¥
returnType:TSTypeAnnotation | Noop(default:null) -
async:boolean(默认值:false,从构建器功能中排除)¥
async:boolean(default:false, excluded from builder function) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function) -
generator:boolean(默认值:false,从构建器功能中排除)¥
generator:boolean(default:false, excluded from builder function)
别名:TypeScript, Statement, Declaration
¥Aliases: TypeScript, Statement, Declaration
tsDeclareMethod
t.tsDeclareMethod(decorators, key, typeParameters, params, returnType);
另见 t.isTSDeclareMethod(node, opts) 和 t.assertTSDeclareMethod(node, opts)。
¥See also t.isTSDeclareMethod(node, opts) and t.assertTSDeclareMethod(node, opts).
AST 节点 TSDeclareMethod 形状:
¥AST Node TSDeclareMethod shape:
-
decorators:Array<Decorator>(默认:null)¥
decorators:Array<Decorator>(default:null) -
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression(必填)¥
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression(required) -
typeParameters:TSTypeParameterDeclaration | Noop(默认:null)¥
typeParameters:TSTypeParameterDeclaration | Noop(default:null) -
params:Array<FunctionParameter | TSParameterProperty>(必填)¥
params:Array<FunctionParameter | TSParameterProperty>(required) -
returnType:TSTypeAnnotation | Noop(默认:null)¥
returnType:TSTypeAnnotation | Noop(default:null) -
abstract:boolean(默认值:null,从构建器功能中排除)¥
abstract:boolean(default:null, excluded from builder function) -
access:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
access:"public" | "private" | "protected"(default:null, excluded from builder function) -
accessibility:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
accessibility:"public" | "private" | "protected"(default:null, excluded from builder function) -
async:boolean(默认值:false,从构建器功能中排除)¥
async:boolean(default:false, excluded from builder function) -
computed:boolean(默认值:false,从构建器功能中排除)¥
computed:boolean(default:false, excluded from builder function) -
generator:boolean(默认值:false,从构建器功能中排除)¥
generator:boolean(default:false, excluded from builder function) -
kind:"get" | "set" | "method" | "constructor"(默认值:'method',从构建器功能中排除)¥
kind:"get" | "set" | "method" | "constructor"(default:'method', excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
override:boolean(默认值:false,从构建器功能中排除)¥
override:boolean(default:false, excluded from builder function) -
static:boolean(默认值:false,从构建器功能中排除)¥
static:boolean(default:false, excluded from builder function)
别名:TypeScript
¥Aliases: TypeScript
tsEnumBody
t.tsEnumBody(members);
另见 t.isTSEnumBody(node, opts) 和 t.assertTSEnumBody(node, opts)。
¥See also t.isTSEnumBody(node, opts) and t.assertTSEnumBody(node, opts).
AST 节点 TSEnumBody 形状:
¥AST Node TSEnumBody shape:
-
members:Array<TSEnumMember>(必填)¥
members:Array<TSEnumMember>(required)
别名:TypeScript
¥Aliases: TypeScript
tsEnumDeclaration
t.tsEnumDeclaration(id, members);
另见 t.isTSEnumDeclaration(node, opts) 和 t.assertTSEnumDeclaration(node, opts)。
¥See also t.isTSEnumDeclaration(node, opts) and t.assertTSEnumDeclaration(node, opts).
AST 节点 TSEnumDeclaration 形状:
¥AST Node TSEnumDeclaration shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
members:Array<TSEnumMember>(必填)¥
members:Array<TSEnumMember>(required) -
body:TSEnumBody(默认值:null,从构建器功能中排除)¥
body:TSEnumBody(default:null, excluded from builder function) -
const:boolean(默认值:null,从构建器功能中排除)¥
const:boolean(default:null, excluded from builder function) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function) -
initializer:Expression(默认值:null,从构建器功能中排除)¥
initializer:Expression(default:null, excluded from builder function)
别名:TypeScript, Statement, Declaration
¥Aliases: TypeScript, Statement, Declaration
tsEnumMember
t.tsEnumMember(id, initializer);
另见 t.isTSEnumMember(node, opts) 和 t.assertTSEnumMember(node, opts)。
¥See also t.isTSEnumMember(node, opts) and t.assertTSEnumMember(node, opts).
AST 节点 TSEnumMember 形状:
¥AST Node TSEnumMember shape:
-
id:Identifier | StringLiteral(必填)¥
id:Identifier | StringLiteral(required) -
initializer:Expression(默认:null)¥
initializer:Expression(default:null)
别名:TypeScript
¥Aliases: TypeScript
tsExportAssignment
t.tsExportAssignment(expression);
另见 t.isTSExportAssignment(node, opts) 和 t.assertTSExportAssignment(node, opts)。
¥See also t.isTSExportAssignment(node, opts) and t.assertTSExportAssignment(node, opts).
AST 节点 TSExportAssignment 形状:
¥AST Node TSExportAssignment shape:
-
expression:Expression(必填)¥
expression:Expression(required)
别名:TypeScript, Statement
¥Aliases: TypeScript, Statement
tsExpressionWithTypeArguments
t.tsExpressionWithTypeArguments(expression, typeParameters);
另见 t.isTSExpressionWithTypeArguments(node, opts) 和 t.assertTSExpressionWithTypeArguments(node, opts)。
¥See also t.isTSExpressionWithTypeArguments(node, opts) and t.assertTSExpressionWithTypeArguments(node, opts).
AST 节点 TSExpressionWithTypeArguments 形状:
¥AST Node TSExpressionWithTypeArguments shape:
-
expression:TSEntityName(必填)¥
expression:TSEntityName(required) -
typeParameters:TSTypeParameterInstantiation(默认:null)¥
typeParameters:TSTypeParameterInstantiation(default:null)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsExternalModuleReference
t.tsExternalModuleReference(expression);
另见 t.isTSExternalModuleReference(node, opts) 和 t.assertTSExternalModuleReference(node, opts)。
¥See also t.isTSExternalModuleReference(node, opts) and t.assertTSExternalModuleReference(node, opts).
AST 节点 TSExternalModuleReference 形状:
¥AST Node TSExternalModuleReference shape:
-
expression:StringLiteral(必填)¥
expression:StringLiteral(required)
别名:TypeScript
¥Aliases: TypeScript
tsFunctionType
t.tsFunctionType(typeParameters, parameters, typeAnnotation);
另见 t.isTSFunctionType(node, opts) 和 t.assertTSFunctionType(node, opts)。
¥See also t.isTSFunctionType(node, opts) and t.assertTSFunctionType(node, opts).
AST 节点 TSFunctionType 形状:
¥AST Node TSFunctionType shape:
-
typeParameters:TSTypeParameterDeclaration(默认:null)¥
typeParameters:TSTypeParameterDeclaration(default:null) -
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(必填)¥
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(required) -
typeAnnotation:TSTypeAnnotation(默认:null)¥
typeAnnotation:TSTypeAnnotation(default:null)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsImportEqualsDeclaration
t.tsImportEqualsDeclaration(id, moduleReference);
另见 t.isTSImportEqualsDeclaration(node, opts) 和 t.assertTSImportEqualsDeclaration(node, opts)。
¥See also t.isTSImportEqualsDeclaration(node, opts) and t.assertTSImportEqualsDeclaration(node, opts).
AST 节点 TSImportEqualsDeclaration 形状:
¥AST Node TSImportEqualsDeclaration shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
moduleReference:TSEntityName | TSExternalModuleReference(必填)¥
moduleReference:TSEntityName | TSExternalModuleReference(required) -
importKind:"type" | "value"(默认值:null,从构建器功能中排除)¥
importKind:"type" | "value"(default:null, excluded from builder function) -
isExport:boolean(必填)¥
isExport:boolean(required)
别名:TypeScript, Statement, Declaration
¥Aliases: TypeScript, Statement, Declaration
tsImportType
t.tsImportType(argument, qualifier, typeParameters);
另见 t.isTSImportType(node, opts) 和 t.assertTSImportType(node, opts)。
¥See also t.isTSImportType(node, opts) and t.assertTSImportType(node, opts).
AST 节点 TSImportType 形状:
¥AST Node TSImportType shape:
-
argument:StringLiteral(必填)¥
argument:StringLiteral(required) -
qualifier:TSEntityName(默认:null)¥
qualifier:TSEntityName(default:null) -
typeParameters:TSTypeParameterInstantiation(默认:null)¥
typeParameters:TSTypeParameterInstantiation(default:null) -
options:ObjectExpression(默认值:null,从构建器功能中排除)¥
options:ObjectExpression(default:null, excluded from builder function)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsIndexSignature
t.tsIndexSignature(parameters, typeAnnotation);
另见 t.isTSIndexSignature(node, opts) 和 t.assertTSIndexSignature(node, opts)。
¥See also t.isTSIndexSignature(node, opts) and t.assertTSIndexSignature(node, opts).
AST 节点 TSIndexSignature 形状:
¥AST Node TSIndexSignature shape:
-
parameters:Array<Identifier>(必填)¥
parameters:Array<Identifier>(required) -
typeAnnotation:TSTypeAnnotation(默认:null)¥
typeAnnotation:TSTypeAnnotation(default:null) -
readonly:boolean(默认值:null,从构建器功能中排除)¥
readonly:boolean(default:null, excluded from builder function) -
static:boolean(默认值:null,从构建器功能中排除)¥
static:boolean(default:null, excluded from builder function)
¥Aliases: TypeScript, TSTypeElement
tsIndexedAccessType
t.tsIndexedAccessType(objectType, indexType);
另见 t.isTSIndexedAccessType(node, opts) 和 t.assertTSIndexedAccessType(node, opts)。
¥See also t.isTSIndexedAccessType(node, opts) and t.assertTSIndexedAccessType(node, opts).
AST 节点 TSIndexedAccessType 形状:
¥AST Node TSIndexedAccessType shape:
-
objectType:TSType(必填)¥
objectType:TSType(required) -
indexType:TSType(必填)¥
indexType:TSType(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsInferType
t.tsInferType(typeParameter);
另见 t.isTSInferType(node, opts) 和 t.assertTSInferType(node, opts)。
¥See also t.isTSInferType(node, opts) and t.assertTSInferType(node, opts).
AST 节点 TSInferType 形状:
¥AST Node TSInferType shape:
-
typeParameter:TSTypeParameter(必填)¥
typeParameter:TSTypeParameter(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsInstantiationExpression
t.tsInstantiationExpression(expression, typeParameters);
另见 t.isTSInstantiationExpression(node, opts) 和 t.assertTSInstantiationExpression(node, opts)。
¥See also t.isTSInstantiationExpression(node, opts) and t.assertTSInstantiationExpression(node, opts).
AST 节点 TSInstantiationExpression 形状:
¥AST Node TSInstantiationExpression shape:
-
expression:Expression(必填)¥
expression:Expression(required) -
typeParameters:TSTypeParameterInstantiation(默认:null)¥
typeParameters:TSTypeParameterInstantiation(default:null)
别名:TypeScript, Expression
¥Aliases: TypeScript, Expression
tsInterfaceBody
t.tsInterfaceBody(body);
另见 t.isTSInterfaceBody(node, opts) 和 t.assertTSInterfaceBody(node, opts)。
¥See also t.isTSInterfaceBody(node, opts) and t.assertTSInterfaceBody(node, opts).
AST 节点 TSInterfaceBody 形状:
¥AST Node TSInterfaceBody shape:
-
body:Array<TSTypeElement>(必填)¥
body:Array<TSTypeElement>(required)
别名:TypeScript
¥Aliases: TypeScript
tsInterfaceDeclaration
t.tsInterfaceDeclaration(id, typeParameters, extends, body);
另见 t.isTSInterfaceDeclaration(node, opts) 和 t.assertTSInterfaceDeclaration(node, opts)。
¥See also t.isTSInterfaceDeclaration(node, opts) and t.assertTSInterfaceDeclaration(node, opts).
AST 节点 TSInterfaceDeclaration 形状:
¥AST Node TSInterfaceDeclaration shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TSTypeParameterDeclaration(默认:null)¥
typeParameters:TSTypeParameterDeclaration(default:null) -
extends:Array<TSExpressionWithTypeArguments>(默认:null)¥
extends:Array<TSExpressionWithTypeArguments>(default:null) -
body:TSInterfaceBody(必填)¥
body:TSInterfaceBody(required) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function)
别名:TypeScript, Statement, Declaration
¥Aliases: TypeScript, Statement, Declaration
tsIntersectionType
t.tsIntersectionType(types);
另见 t.isTSIntersectionType(node, opts) 和 t.assertTSIntersectionType(node, opts)。
¥See also t.isTSIntersectionType(node, opts) and t.assertTSIntersectionType(node, opts).
AST 节点 TSIntersectionType 形状:
¥AST Node TSIntersectionType shape:
-
types:Array<TSType>(必填)¥
types:Array<TSType>(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsIntrinsicKeyword
t.tsIntrinsicKeyword();
另见 t.isTSIntrinsicKeyword(node, opts) 和 t.assertTSIntrinsicKeyword(node, opts)。
¥See also t.isTSIntrinsicKeyword(node, opts) and t.assertTSIntrinsicKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsLiteralType
t.tsLiteralType(literal);
另见 t.isTSLiteralType(node, opts) 和 t.assertTSLiteralType(node, opts)。
¥See also t.isTSLiteralType(node, opts) and t.assertTSLiteralType(node, opts).
AST 节点 TSLiteralType 形状:
¥AST Node TSLiteralType shape:
-
literal:NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TemplateLiteral | UnaryExpression(必填)¥
literal:NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TemplateLiteral | UnaryExpression(required)
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsMappedType
t.tsMappedType(typeParameter, typeAnnotation, nameType);
另见 t.isTSMappedType(node, opts) 和 t.assertTSMappedType(node, opts)。
¥See also t.isTSMappedType(node, opts) and t.assertTSMappedType(node, opts).
AST 节点 TSMappedType 形状:
¥AST Node TSMappedType shape:
-
typeParameter:TSTypeParameter(必填)¥
typeParameter:TSTypeParameter(required) -
typeAnnotation:TSType(默认:null)¥
typeAnnotation:TSType(default:null) -
nameType:TSType(默认:null)¥
nameType:TSType(default:null) -
optional:true | false | "+" | "-"(默认值:null,从构建器功能中排除)¥
optional:true | false | "+" | "-"(default:null, excluded from builder function) -
readonly:true | false | "+" | "-"(默认值:null,从构建器功能中排除)¥
readonly:true | false | "+" | "-"(default:null, excluded from builder function)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsMethodSignature
t.tsMethodSignature(key, typeParameters, parameters, typeAnnotation);
另见 t.isTSMethodSignature(node, opts) 和 t.assertTSMethodSignature(node, opts)。
¥See also t.isTSMethodSignature(node, opts) and t.assertTSMethodSignature(node, opts).
AST 节点 TSMethodSignature 形状:
¥AST Node TSMethodSignature shape:
-
key:Expression(必填)¥
key:Expression(required) -
typeParameters:TSTypeParameterDeclaration(默认:null)¥
typeParameters:TSTypeParameterDeclaration(default:null) -
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(必填)¥
parameters:Array<ArrayPattern | Identifier | ObjectPattern | RestElement>(required) -
typeAnnotation:TSTypeAnnotation(默认:null)¥
typeAnnotation:TSTypeAnnotation(default:null) -
computed:boolean(默认值:false,从构建器功能中排除)¥
computed:boolean(default:false, excluded from builder function) -
kind:"method" | "get" | "set"(必填)¥
kind:"method" | "get" | "set"(required) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function)
¥Aliases: TypeScript, TSTypeElement
tsModuleBlock
t.tsModuleBlock(body);
另见 t.isTSModuleBlock(node, opts) 和 t.assertTSModuleBlock(node, opts)。
¥See also t.isTSModuleBlock(node, opts) and t.assertTSModuleBlock(node, opts).
AST 节点 TSModuleBlock 形状:
¥AST Node TSModuleBlock shape:
-
body:Array<Statement>(必填)¥
body:Array<Statement>(required)
别名:TypeScript, Scopable, Block, BlockParent, FunctionParent
¥Aliases: TypeScript, Scopable, Block, BlockParent, FunctionParent
tsModuleDeclaration
t.tsModuleDeclaration(id, body);
另见 t.isTSModuleDeclaration(node, opts) 和 t.assertTSModuleDeclaration(node, opts)。
¥See also t.isTSModuleDeclaration(node, opts) and t.assertTSModuleDeclaration(node, opts).
AST 节点 TSModuleDeclaration 形状:
¥AST Node TSModuleDeclaration shape:
-
id:Identifier | StringLiteral(必填)¥
id:Identifier | StringLiteral(required) -
body:TSModuleBlock | TSModuleDeclaration(必填)¥
body:TSModuleBlock | TSModuleDeclaration(required) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function) -
global:boolean(默认值:null,从构建器功能中排除)¥
global:boolean(default:null, excluded from builder function) -
kind:"global" | "module" | "namespace"(必填)¥
kind:"global" | "module" | "namespace"(required)
别名:TypeScript, Statement, Declaration
¥Aliases: TypeScript, Statement, Declaration
tsNamedTupleMember
t.tsNamedTupleMember(label, elementType, optional);
另见 t.isTSNamedTupleMember(node, opts) 和 t.assertTSNamedTupleMember(node, opts)。
¥See also t.isTSNamedTupleMember(node, opts) and t.assertTSNamedTupleMember(node, opts).
AST 节点 TSNamedTupleMember 形状:
¥AST Node TSNamedTupleMember shape:
-
label:Identifier(必填)¥
label:Identifier(required) -
elementType:TSType(必填)¥
elementType:TSType(required) -
optional:boolean(默认:false)¥
optional:boolean(default:false)
别名:TypeScript
¥Aliases: TypeScript
tsNamespaceExportDeclaration
t.tsNamespaceExportDeclaration(id);
另见 t.isTSNamespaceExportDeclaration(node, opts) 和 t.assertTSNamespaceExportDeclaration(node, opts)。
¥See also t.isTSNamespaceExportDeclaration(node, opts) and t.assertTSNamespaceExportDeclaration(node, opts).
AST 节点 TSNamespaceExportDeclaration 形状:
¥AST Node TSNamespaceExportDeclaration shape:
-
id:Identifier(必填)¥
id:Identifier(required)
别名:TypeScript, Statement
¥Aliases: TypeScript, Statement
tsNeverKeyword
t.tsNeverKeyword();
另见 t.isTSNeverKeyword(node, opts) 和 t.assertTSNeverKeyword(node, opts)。
¥See also t.isTSNeverKeyword(node, opts) and t.assertTSNeverKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsNonNullExpression
t.tsNonNullExpression(expression);
另见 t.isTSNonNullExpression(node, opts) 和 t.assertTSNonNullExpression(node, opts)。
¥See also t.isTSNonNullExpression(node, opts) and t.assertTSNonNullExpression(node, opts).
AST 节点 TSNonNullExpression 形状:
¥AST Node TSNonNullExpression shape:
-
expression:Expression(必填)¥
expression:Expression(required)
别名:TypeScript, Expression, LVal, PatternLike
¥Aliases: TypeScript, Expression, LVal, PatternLike
tsNullKeyword
t.tsNullKeyword();
另见 t.isTSNullKeyword(node, opts) 和 t.assertTSNullKeyword(node, opts)。
¥See also t.isTSNullKeyword(node, opts) and t.assertTSNullKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsNumberKeyword
t.tsNumberKeyword();
另见 t.isTSNumberKeyword(node, opts) 和 t.assertTSNumberKeyword(node, opts)。
¥See also t.isTSNumberKeyword(node, opts) and t.assertTSNumberKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsObjectKeyword
t.tsObjectKeyword();
另见 t.isTSObjectKeyword(node, opts) 和 t.assertTSObjectKeyword(node, opts)。
¥See also t.isTSObjectKeyword(node, opts) and t.assertTSObjectKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsOptionalType
t.tsOptionalType(typeAnnotation);
另见 t.isTSOptionalType(node, opts) 和 t.assertTSOptionalType(node, opts)。
¥See also t.isTSOptionalType(node, opts) and t.assertTSOptionalType(node, opts).
AST 节点 TSOptionalType 形状:
¥AST Node TSOptionalType shape:
-
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsParameterProperty
t.tsParameterProperty(parameter);
另见 t.isTSParameterProperty(node, opts) 和 t.assertTSParameterProperty(node, opts)。
¥See also t.isTSParameterProperty(node, opts) and t.assertTSParameterProperty(node, opts).
AST 节点 TSParameterProperty 形状:
¥AST Node TSParameterProperty shape:
-
parameter:Identifier | AssignmentPattern(必填)¥
parameter:Identifier | AssignmentPattern(required) -
accessibility:"public" | "private" | "protected"(默认值:null,从构建器功能中排除)¥
accessibility:"public" | "private" | "protected"(default:null, excluded from builder function) -
decorators:Array<Decorator>(默认值:null,从构建器功能中排除)¥
decorators:Array<Decorator>(default:null, excluded from builder function) -
override:boolean(默认值:null,从构建器功能中排除)¥
override:boolean(default:null, excluded from builder function) -
readonly:boolean(默认值:null,从构建器功能中排除)¥
readonly:boolean(default:null, excluded from builder function)
别名:TypeScript, LVal
¥Aliases: TypeScript, LVal
tsParenthesizedType
t.tsParenthesizedType(typeAnnotation);
另见 t.isTSParenthesizedType(node, opts) 和 t.assertTSParenthesizedType(node, opts)。
¥See also t.isTSParenthesizedType(node, opts) and t.assertTSParenthesizedType(node, opts).
AST 节点 TSParenthesizedType 形状:
¥AST Node TSParenthesizedType shape:
-
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsPropertySignature
t.tsPropertySignature(key, typeAnnotation);
另见 t.isTSPropertySignature(node, opts) 和 t.assertTSPropertySignature(node, opts)。
¥See also t.isTSPropertySignature(node, opts) and t.assertTSPropertySignature(node, opts).
AST 节点 TSPropertySignature 形状:
¥AST Node TSPropertySignature shape:
-
key:Expression(必填)¥
key:Expression(required) -
typeAnnotation:TSTypeAnnotation(默认:null)¥
typeAnnotation:TSTypeAnnotation(default:null) -
computed:boolean(默认值:false,从构建器功能中排除)¥
computed:boolean(default:false, excluded from builder function) -
kind:"get" | "set"(默认值:null,从构建器功能中排除)¥
kind:"get" | "set"(default:null, excluded from builder function) -
optional:boolean(默认值:null,从构建器功能中排除)¥
optional:boolean(default:null, excluded from builder function) -
readonly:boolean(默认值:null,从构建器功能中排除)¥
readonly:boolean(default:null, excluded from builder function)
¥Aliases: TypeScript, TSTypeElement
tsQualifiedName
t.tsQualifiedName(left, right);
另见 t.isTSQualifiedName(node, opts) 和 t.assertTSQualifiedName(node, opts)。
¥See also t.isTSQualifiedName(node, opts) and t.assertTSQualifiedName(node, opts).
AST 节点 TSQualifiedName 形状:
¥AST Node TSQualifiedName shape:
-
left:TSEntityName(必填)¥
left:TSEntityName(required) -
right:Identifier(必填)¥
right:Identifier(required)
¥Aliases: TypeScript, TSEntityName
tsRestType
t.tsRestType(typeAnnotation);
另见 t.isTSRestType(node, opts) 和 t.assertTSRestType(node, opts)。
¥See also t.isTSRestType(node, opts) and t.assertTSRestType(node, opts).
AST 节点 TSRestType 形状:
¥AST Node TSRestType shape:
-
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsSatisfiesExpression
t.tsSatisfiesExpression(expression, typeAnnotation);
History
| 版本 | 变化 |
|---|---|
v7.20.0 | 介绍 |
另见 t.isTSSatisfiesExpression(node, opts) 和 t.assertTSSatisfiesExpression(node, opts)。
¥See also t.isTSSatisfiesExpression(node, opts) and t.assertTSSatisfiesExpression(node, opts).
AST 节点 TSSatisfiesExpression 形状:
¥AST Node TSSatisfiesExpression shape:
-
expression:Expression(必填)¥
expression:Expression(required) -
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required)
别名:TypeScript, Expression, LVal, PatternLike
¥Aliases: TypeScript, Expression, LVal, PatternLike
tsStringKeyword
t.tsStringKeyword();
另见 t.isTSStringKeyword(node, opts) 和 t.assertTSStringKeyword(node, opts)。
¥See also t.isTSStringKeyword(node, opts) and t.assertTSStringKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsSymbolKeyword
t.tsSymbolKeyword();
另见 t.isTSSymbolKeyword(node, opts) 和 t.assertTSSymbolKeyword(node, opts)。
¥See also t.isTSSymbolKeyword(node, opts) and t.assertTSSymbolKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsTemplateLiteralType
t.tsTemplateLiteralType(quasis, types);
另见 t.isTSTemplateLiteralType(node, opts) 和 t.assertTSTemplateLiteralType(node, opts)。
¥See also t.isTSTemplateLiteralType(node, opts) and t.assertTSTemplateLiteralType(node, opts).
AST 节点 TSTemplateLiteralType 形状:
¥AST Node TSTemplateLiteralType shape:
-
quasis:Array<TemplateElement>(必填)¥
quasis:Array<TemplateElement>(required) -
types:Array<TSType>(必填)¥
types:Array<TSType>(required)
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsThisType
t.tsThisType();
另见 t.isTSThisType(node, opts) 和 t.assertTSThisType(node, opts)。
¥See also t.isTSThisType(node, opts) and t.assertTSThisType(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsTupleType
t.tsTupleType(elementTypes);
另见 t.isTSTupleType(node, opts) 和 t.assertTSTupleType(node, opts)。
¥See also t.isTSTupleType(node, opts) and t.assertTSTupleType(node, opts).
AST 节点 TSTupleType 形状:
¥AST Node TSTupleType shape:
-
elementTypes:Array<TSType | TSNamedTupleMember>(必填)¥
elementTypes:Array<TSType | TSNamedTupleMember>(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsTypeAliasDeclaration
t.tsTypeAliasDeclaration(id, typeParameters, typeAnnotation);
另见 t.isTSTypeAliasDeclaration(node, opts) 和 t.assertTSTypeAliasDeclaration(node, opts)。
¥See also t.isTSTypeAliasDeclaration(node, opts) and t.assertTSTypeAliasDeclaration(node, opts).
AST 节点 TSTypeAliasDeclaration 形状:
¥AST Node TSTypeAliasDeclaration shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TSTypeParameterDeclaration(默认:null)¥
typeParameters:TSTypeParameterDeclaration(default:null) -
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function)
别名:TypeScript, Statement, Declaration
¥Aliases: TypeScript, Statement, Declaration
tsTypeAnnotation
t.tsTypeAnnotation(typeAnnotation);
另见 t.isTSTypeAnnotation(node, opts) 和 t.assertTSTypeAnnotation(node, opts)。
¥See also t.isTSTypeAnnotation(node, opts) and t.assertTSTypeAnnotation(node, opts).
AST 节点 TSTypeAnnotation 形状:
¥AST Node TSTypeAnnotation shape:
-
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required)
别名:TypeScript
¥Aliases: TypeScript
tsTypeAssertion
t.tsTypeAssertion(typeAnnotation, expression);
另见 t.isTSTypeAssertion(node, opts) 和 t.assertTSTypeAssertion(node, opts)。
¥See also t.isTSTypeAssertion(node, opts) and t.assertTSTypeAssertion(node, opts).
AST 节点 TSTypeAssertion 形状:
¥AST Node TSTypeAssertion shape:
-
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required) -
expression:Expression(必填)¥
expression:Expression(required)
别名:TypeScript, Expression, LVal, PatternLike
¥Aliases: TypeScript, Expression, LVal, PatternLike
tsTypeLiteral
t.tsTypeLiteral(members);
另见 t.isTSTypeLiteral(node, opts) 和 t.assertTSTypeLiteral(node, opts)。
¥See also t.isTSTypeLiteral(node, opts) and t.assertTSTypeLiteral(node, opts).
AST 节点 TSTypeLiteral 形状:
¥AST Node TSTypeLiteral shape:
-
members:Array<TSTypeElement>(必填)¥
members:Array<TSTypeElement>(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsTypeOperator
t.tsTypeOperator(typeAnnotation, operator);
另见 t.isTSTypeOperator(node, opts) 和 t.assertTSTypeOperator(node, opts)。
¥See also t.isTSTypeOperator(node, opts) and t.assertTSTypeOperator(node, opts).
AST 节点 TSTypeOperator 形状:
¥AST Node TSTypeOperator shape:
-
typeAnnotation:TSType(必填)¥
typeAnnotation:TSType(required) -
operator:string(默认:'keyof')¥
operator:string(default:'keyof')
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsTypeParameter
t.tsTypeParameter(constraint, default, name);
History
| 版本 | 变化 |
|---|---|
v7.21.0 | 支持 const |
另见 t.isTSTypeParameter(node, opts) 和 t.assertTSTypeParameter(node, opts)。
¥See also t.isTSTypeParameter(node, opts) and t.assertTSTypeParameter(node, opts).
AST 节点 TSTypeParameter 形状:
¥AST Node TSTypeParameter shape:
-
constraint:TSType(默认:null)¥
constraint:TSType(default:null) -
default:TSType(默认:null)¥
default:TSType(default:null) -
name:string(必填)¥
name:string(required) -
const:boolean(默认值:null,从构建器功能中排除)¥
const:boolean(default:null, excluded from builder function) -
in:boolean(默认值:null,从构建器功能中排除)¥
in:boolean(default:null, excluded from builder function) -
out:boolean(默认值:null,从构建器功能中排除)¥
out:boolean(default:null, excluded from builder function)
别名:TypeScript
¥Aliases: TypeScript
tsTypeParameterDeclaration
t.tsTypeParameterDeclaration(params);
另见 t.isTSTypeParameterDeclaration(node, opts) 和 t.assertTSTypeParameterDeclaration(node, opts)。
¥See also t.isTSTypeParameterDeclaration(node, opts) and t.assertTSTypeParameterDeclaration(node, opts).
AST 节点 TSTypeParameterDeclaration 形状:
¥AST Node TSTypeParameterDeclaration shape:
-
params:Array<TSTypeParameter>(必填)¥
params:Array<TSTypeParameter>(required)
别名:TypeScript
¥Aliases: TypeScript
tsTypeParameterInstantiation
t.tsTypeParameterInstantiation(params);
另见 t.isTSTypeParameterInstantiation(node, opts) 和 t.assertTSTypeParameterInstantiation(node, opts)。
¥See also t.isTSTypeParameterInstantiation(node, opts) and t.assertTSTypeParameterInstantiation(node, opts).
AST 节点 TSTypeParameterInstantiation 形状:
¥AST Node TSTypeParameterInstantiation shape:
-
params:Array<TSType>(必填)¥
params:Array<TSType>(required)
别名:TypeScript
¥Aliases: TypeScript
tsTypePredicate
t.tsTypePredicate(parameterName, typeAnnotation, asserts);
另见 t.isTSTypePredicate(node, opts) 和 t.assertTSTypePredicate(node, opts)。
¥See also t.isTSTypePredicate(node, opts) and t.assertTSTypePredicate(node, opts).
AST 节点 TSTypePredicate 形状:
¥AST Node TSTypePredicate shape:
-
parameterName:Identifier | TSThisType(必填)¥
parameterName:Identifier | TSThisType(required) -
typeAnnotation:TSTypeAnnotation(默认:null)¥
typeAnnotation:TSTypeAnnotation(default:null) -
asserts:boolean(默认:null)¥
asserts:boolean(default:null)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsTypeQuery
t.tsTypeQuery(exprName, typeParameters);
另见 t.isTSTypeQuery(node, opts) 和 t.assertTSTypeQuery(node, opts)。
¥See also t.isTSTypeQuery(node, opts) and t.assertTSTypeQuery(node, opts).
AST 节点 TSTypeQuery 形状:
¥AST Node TSTypeQuery shape:
-
exprName:TSEntityName | TSImportType(必填)¥
exprName:TSEntityName | TSImportType(required) -
typeParameters:TSTypeParameterInstantiation(默认:null)¥
typeParameters:TSTypeParameterInstantiation(default:null)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsTypeReference
t.tsTypeReference(typeName, typeParameters);
另见 t.isTSTypeReference(node, opts) 和 t.assertTSTypeReference(node, opts)。
¥See also t.isTSTypeReference(node, opts) and t.assertTSTypeReference(node, opts).
AST 节点 TSTypeReference 形状:
¥AST Node TSTypeReference shape:
-
typeName:TSEntityName(必填)¥
typeName:TSEntityName(required) -
typeParameters:TSTypeParameterInstantiation(默认:null)¥
typeParameters:TSTypeParameterInstantiation(default:null)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsUndefinedKeyword
t.tsUndefinedKeyword();
另见 t.isTSUndefinedKeyword(node, opts) 和 t.assertTSUndefinedKeyword(node, opts)。
¥See also t.isTSUndefinedKeyword(node, opts) and t.assertTSUndefinedKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsUnionType
t.tsUnionType(types);
另见 t.isTSUnionType(node, opts) 和 t.assertTSUnionType(node, opts)。
¥See also t.isTSUnionType(node, opts) and t.assertTSUnionType(node, opts).
AST 节点 TSUnionType 形状:
¥AST Node TSUnionType shape:
-
types:Array<TSType>(必填)¥
types:Array<TSType>(required)
别名:TypeScript, TSType
¥Aliases: TypeScript, TSType
tsUnknownKeyword
t.tsUnknownKeyword();
另见 t.isTSUnknownKeyword(node, opts) 和 t.assertTSUnknownKeyword(node, opts)。
¥See also t.isTSUnknownKeyword(node, opts) and t.assertTSUnknownKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
tsVoidKeyword
t.tsVoidKeyword();
另见 t.isTSVoidKeyword(node, opts) 和 t.assertTSVoidKeyword(node, opts)。
¥See also t.isTSVoidKeyword(node, opts) and t.assertTSVoidKeyword(node, opts).
别名:TypeScript, TSType, TSBaseType
¥Aliases: TypeScript, TSType, TSBaseType
taggedTemplateExpression
t.taggedTemplateExpression(tag, quasi);
另见 t.isTaggedTemplateExpression(node, opts) 和 t.assertTaggedTemplateExpression(node, opts)。
¥See also t.isTaggedTemplateExpression(node, opts) and t.assertTaggedTemplateExpression(node, opts).
AST 节点 TaggedTemplateExpression 形状:
¥AST Node TaggedTemplateExpression shape:
-
tag:Expression(必填)¥
tag:Expression(required) -
quasi:TemplateLiteral(必填)¥
quasi:TemplateLiteral(required) -
typeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(默认值:null,从构建器功能中排除)¥
typeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(default:null, excluded from builder function)
¥Aliases: Standardized, Expression
templateElement
t.templateElement(value, tail);
另见 t.isTemplateElement(node, opts) 和 t.assertTemplateElement(node, opts)。
¥See also t.isTemplateElement(node, opts) and t.assertTemplateElement(node, opts).
AST 节点 TemplateElement 形状:
¥AST Node TemplateElement shape:
-
value:{ raw: string, cooked?: string }(必填)¥
value:{ raw: string, cooked?: string }(required) -
tail:boolean(默认:false)¥
tail:boolean(default:false)
别名:Standardized
¥Aliases: Standardized
templateLiteral
t.templateLiteral(quasis, expressions);
另见 t.isTemplateLiteral(node, opts) 和 t.assertTemplateLiteral(node, opts)。
¥See also t.isTemplateLiteral(node, opts) and t.assertTemplateLiteral(node, opts).
AST 节点 TemplateLiteral 形状:
¥AST Node TemplateLiteral shape:
-
quasis:Array<TemplateElement>(必填)¥
quasis:Array<TemplateElement>(required) -
expressions:Array<Expression | TSType>(必填)¥
expressions:Array<Expression | TSType>(required)
别名:Standardized, Expression, Literal
¥Aliases: Standardized, Expression, Literal
thisExpression
t.thisExpression();
另见 t.isThisExpression(node, opts) 和 t.assertThisExpression(node, opts)。
¥See also t.isThisExpression(node, opts) and t.assertThisExpression(node, opts).
¥Aliases: Standardized, Expression
thisTypeAnnotation
t.thisTypeAnnotation();
另见 t.isThisTypeAnnotation(node, opts) 和 t.assertThisTypeAnnotation(node, opts)。
¥See also t.isThisTypeAnnotation(node, opts) and t.assertThisTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
throwStatement
t.throwStatement(argument);
另见 t.isThrowStatement(node, opts) 和 t.assertThrowStatement(node, opts)。
¥See also t.isThrowStatement(node, opts) and t.assertThrowStatement(node, opts).
AST 节点 ThrowStatement 形状:
¥AST Node ThrowStatement shape:
-
argument:Expression(必填)¥
argument:Expression(required)
别名:Standardized, Statement, Terminatorless, CompletionStatement
¥Aliases: Standardized, Statement, Terminatorless, CompletionStatement
topicReference
t.topicReference();
另见 t.isTopicReference(node, opts) 和 t.assertTopicReference(node, opts)。
¥See also t.isTopicReference(node, opts) and t.assertTopicReference(node, opts).
别名:Expression
¥Aliases: Expression
tryStatement
t.tryStatement(block, handler, finalizer);
另见 t.isTryStatement(node, opts) 和 t.assertTryStatement(node, opts)。
¥See also t.isTryStatement(node, opts) and t.assertTryStatement(node, opts).
AST 节点 TryStatement 形状:
¥AST Node TryStatement shape:
-
block:BlockStatement(必填)¥
block:BlockStatement(required) -
handler:CatchClause(默认:null)¥
handler:CatchClause(default:null) -
finalizer:BlockStatement(默认:null)¥
finalizer:BlockStatement(default:null)
¥Aliases: Standardized, Statement
tupleExpression
t.tupleExpression(elements);
另见 t.isTupleExpression(node, opts) 和 t.assertTupleExpression(node, opts)。
¥See also t.isTupleExpression(node, opts) and t.assertTupleExpression(node, opts).
AST 节点 TupleExpression 形状:
¥AST Node TupleExpression shape:
-
elements:Array<Expression | SpreadElement>(默认:[])¥
elements:Array<Expression | SpreadElement>(default:[])
别名:Expression
¥Aliases: Expression
tupleTypeAnnotation
t.tupleTypeAnnotation(types);
另见 t.isTupleTypeAnnotation(node, opts) 和 t.assertTupleTypeAnnotation(node, opts)。
¥See also t.isTupleTypeAnnotation(node, opts) and t.assertTupleTypeAnnotation(node, opts).
AST 节点 TupleTypeAnnotation 形状:
¥AST Node TupleTypeAnnotation shape:
-
types:Array<FlowType>(必填)¥
types:Array<FlowType>(required)
typeAlias
t.typeAlias(id, typeParameters, right);
另见 t.isTypeAlias(node, opts) 和 t.assertTypeAlias(node, opts)。
¥See also t.isTypeAlias(node, opts) and t.assertTypeAlias(node, opts).
AST 节点 TypeAlias 形状:
¥AST Node TypeAlias shape:
-
id:Identifier(必填)¥
id:Identifier(required) -
typeParameters:TypeParameterDeclaration(默认:null)¥
typeParameters:TypeParameterDeclaration(default:null) -
right:FlowType(必填)¥
right:FlowType(required)
别名:Flow, FlowDeclaration, Statement, Declaration
¥Aliases: Flow, FlowDeclaration, Statement, Declaration
typeAnnotation
t.typeAnnotation(typeAnnotation);
另见 t.isTypeAnnotation(node, opts) 和 t.assertTypeAnnotation(node, opts)。
¥See also t.isTypeAnnotation(node, opts) and t.assertTypeAnnotation(node, opts).
AST 节点 TypeAnnotation 形状:
¥AST Node TypeAnnotation shape:
-
typeAnnotation:FlowType(必填)¥
typeAnnotation:FlowType(required)
别名:Flow
¥Aliases: Flow
typeCastExpression
t.typeCastExpression(expression, typeAnnotation);
另见 t.isTypeCastExpression(node, opts) 和 t.assertTypeCastExpression(node, opts)。
¥See also t.isTypeCastExpression(node, opts) and t.assertTypeCastExpression(node, opts).
AST 节点 TypeCastExpression 形状:
¥AST Node TypeCastExpression shape:
-
expression:Expression(必填)¥
expression:Expression(required) -
typeAnnotation:TypeAnnotation(必填)¥
typeAnnotation:TypeAnnotation(required)
别名:Flow, ExpressionWrapper, Expression
¥Aliases: Flow, ExpressionWrapper, Expression
typeParameter
t.typeParameter(bound, default, variance);
另见 t.isTypeParameter(node, opts) 和 t.assertTypeParameter(node, opts)。
¥See also t.isTypeParameter(node, opts) and t.assertTypeParameter(node, opts).
AST 节点 TypeParameter 形状:
¥AST Node TypeParameter shape:
-
bound:TypeAnnotation(默认:null)¥
bound:TypeAnnotation(default:null) -
default:FlowType(默认:null)¥
default:FlowType(default:null) -
variance:Variance(默认:null)¥
variance:Variance(default:null) -
name:string(必填)¥
name:string(required)
别名:Flow
¥Aliases: Flow
typeParameterDeclaration
t.typeParameterDeclaration(params);
另见 t.isTypeParameterDeclaration(node, opts) 和 t.assertTypeParameterDeclaration(node, opts)。
¥See also t.isTypeParameterDeclaration(node, opts) and t.assertTypeParameterDeclaration(node, opts).
AST 节点 TypeParameterDeclaration 形状:
¥AST Node TypeParameterDeclaration shape:
-
params:Array<TypeParameter>(必填)¥
params:Array<TypeParameter>(required)
别名:Flow
¥Aliases: Flow
typeParameterInstantiation
t.typeParameterInstantiation(params);
另见 t.isTypeParameterInstantiation(node, opts) 和 t.assertTypeParameterInstantiation(node, opts)。
¥See also t.isTypeParameterInstantiation(node, opts) and t.assertTypeParameterInstantiation(node, opts).
AST 节点 TypeParameterInstantiation 形状:
¥AST Node TypeParameterInstantiation shape:
-
params:Array<FlowType>(必填)¥
params:Array<FlowType>(required)
别名:Flow
¥Aliases: Flow
typeofTypeAnnotation
t.typeofTypeAnnotation(argument);
另见 t.isTypeofTypeAnnotation(node, opts) 和 t.assertTypeofTypeAnnotation(node, opts)。
¥See also t.isTypeofTypeAnnotation(node, opts) and t.assertTypeofTypeAnnotation(node, opts).
AST 节点 TypeofTypeAnnotation 形状:
¥AST Node TypeofTypeAnnotation shape:
-
argument:FlowType(必填)¥
argument:FlowType(required)
unaryExpression
t.unaryExpression(operator, argument, prefix);
另见 t.isUnaryExpression(node, opts) 和 t.assertUnaryExpression(node, opts)。
¥See also t.isUnaryExpression(node, opts) and t.assertUnaryExpression(node, opts).
AST 节点 UnaryExpression 形状:
¥AST Node UnaryExpression shape:
-
operator:"void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof"(必填)¥
operator:"void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof"(required) -
argument:Expression(必填)¥
argument:Expression(required) -
prefix:boolean(默认:true)¥
prefix:boolean(default:true)
别名:Standardized, UnaryLike, Expression
¥Aliases: Standardized, UnaryLike, Expression
unionTypeAnnotation
t.unionTypeAnnotation(types);
另见 t.isUnionTypeAnnotation(node, opts) 和 t.assertUnionTypeAnnotation(node, opts)。
¥See also t.isUnionTypeAnnotation(node, opts) and t.assertUnionTypeAnnotation(node, opts).
AST 节点 UnionTypeAnnotation 形状:
¥AST Node UnionTypeAnnotation shape:
-
types:Array<FlowType>(必填)¥
types:Array<FlowType>(required)
updateExpression
t.updateExpression(operator, argument, prefix);
另见 t.isUpdateExpression(node, opts) 和 t.assertUpdateExpression(node, opts)。
¥See also t.isUpdateExpression(node, opts) and t.assertUpdateExpression(node, opts).
AST 节点 UpdateExpression 形状:
¥AST Node UpdateExpression shape:
-
operator:"++" | "--"(必填)¥
operator:"++" | "--"(required) -
argument:Expression(必填)¥
argument:Expression(required) -
prefix:boolean(默认:false)¥
prefix:boolean(default:false)
¥Aliases: Standardized, Expression
v8IntrinsicIdentifier
t.v8IntrinsicIdentifier(name);
另见 t.isV8IntrinsicIdentifier(node, opts) 和 t.assertV8IntrinsicIdentifier(node, opts)。
¥See also t.isV8IntrinsicIdentifier(node, opts) and t.assertV8IntrinsicIdentifier(node, opts).
AST 节点 V8IntrinsicIdentifier 形状:
¥AST Node V8IntrinsicIdentifier shape:
-
name:string(必填)¥
name:string(required)
¥Aliases: Miscellaneous
variableDeclaration
t.variableDeclaration(kind, declarations);
History
| 版本 | 变化 |
|---|---|
v7.20.0 | kind 可以是 "using"。 |
v7.22.0 | kind 可以是 "await 使用"。 |
另见 t.isVariableDeclaration(node, opts) 和 t.assertVariableDeclaration(node, opts)。
¥See also t.isVariableDeclaration(node, opts) and t.assertVariableDeclaration(node, opts).
AST 节点 VariableDeclaration 形状:
¥AST Node VariableDeclaration shape:
-
kind:"var" | "let" | "const" | "using" | "await using"(必填)¥
kind:"var" | "let" | "const" | "using" | "await using"(required) -
declarations:Array<VariableDeclarator>(必填)¥
declarations:Array<VariableDeclarator>(required) -
declare:boolean(默认值:null,从构建器功能中排除)¥
declare:boolean(default:null, excluded from builder function)
别名:Standardized, Statement, Declaration
¥Aliases: Standardized, Statement, Declaration
variableDeclarator
t.variableDeclarator(id, init);
另见 t.isVariableDeclarator(node, opts) 和 t.assertVariableDeclarator(node, opts)。
¥See also t.isVariableDeclarator(node, opts) and t.assertVariableDeclarator(node, opts).
AST 节点 VariableDeclarator 形状:
¥AST Node VariableDeclarator shape:
-
id:LVal | VoidPattern(必填)¥
id:LVal | VoidPattern(required) -
init:Expression(默认:null)¥
init:Expression(default:null) -
definite:boolean(默认值:null,从构建器功能中排除)¥
definite:boolean(default:null, excluded from builder function)
别名:Standardized
¥Aliases: Standardized
variance
t.variance(kind);
另见 t.isVariance(node, opts) 和 t.assertVariance(node, opts)。
¥See also t.isVariance(node, opts) and t.assertVariance(node, opts).
AST 节点 Variance 形状:
¥AST Node Variance shape:
-
kind:"minus" | "plus"(必填)¥
kind:"minus" | "plus"(required)
别名:Flow
¥Aliases: Flow
voidPattern
t.voidPattern();
History
| 版本 | 变化 |
|---|---|
v7.28.0 | 介绍 |
另见 t.isVoidPattern(node, opts) 和 t.assertVoidPattern(node, opts)。
¥See also t.isVoidPattern(node, opts) and t.assertVoidPattern(node, opts).
别名:Pattern, PatternLike, FunctionParameter
¥Aliases: Pattern, PatternLike, FunctionParameter
voidTypeAnnotation
t.voidTypeAnnotation();
另见 t.isVoidTypeAnnotation(node, opts) 和 t.assertVoidTypeAnnotation(node, opts)。
¥See also t.isVoidTypeAnnotation(node, opts) and t.assertVoidTypeAnnotation(node, opts).
别名:Flow, FlowType, FlowBaseAnnotation
¥Aliases: Flow, FlowType, FlowBaseAnnotation
whileStatement
t.whileStatement(test, body);
另见 t.isWhileStatement(node, opts) 和 t.assertWhileStatement(node, opts)。
¥See also t.isWhileStatement(node, opts) and t.assertWhileStatement(node, opts).
AST 节点 WhileStatement 形状:
¥AST Node WhileStatement shape:
-
test:Expression(必填)¥
test:Expression(required) -
body:Statement(必填)¥
body:Statement(required)
别名:Standardized, Statement, BlockParent, Loop, While, Scopable
¥Aliases: Standardized, Statement, BlockParent, Loop, While, Scopable
withStatement
t.withStatement(object, body);
另见 t.isWithStatement(node, opts) 和 t.assertWithStatement(node, opts)。
¥See also t.isWithStatement(node, opts) and t.assertWithStatement(node, opts).
AST 节点 WithStatement 形状:
¥AST Node WithStatement shape:
-
object:Expression(必填)¥
object:Expression(required) -
body:Statement(必填)¥
body:Statement(required)
¥Aliases: Standardized, Statement
yieldExpression
t.yieldExpression(argument, delegate);
另见 t.isYieldExpression(node, opts) 和 t.assertYieldExpression(node, opts)。
¥See also t.isYieldExpression(node, opts) and t.assertYieldExpression(node, opts).
AST 节点 YieldExpression 形状:
¥AST Node YieldExpression shape:
-
argument:Expression(默认:null)¥
argument:Expression(default:null) -
delegate:boolean(默认:false)¥
delegate:boolean(default:false)
别名:Standardized, Expression, Terminatorless
¥Aliases: Standardized, Expression, Terminatorless
别名
¥Aliases
存取器
¥Accessor
已弃用。将在 Babel 8 中移除。
¥Deprecated. Will be removed in Babel 8.
t.isAccessor(node);
覆盖节点:
¥Covered nodes:
二进制
¥Binary
BinaryExpression 和 LogicalExpression 的封面,它们共享相同的 AST 形状。
¥A cover of BinaryExpression and LogicalExpression, which share the same AST shape.
t.isBinary(node);
覆盖节点:
¥Covered nodes:
堵塞
¥Block
已弃用。将在 Babel 8 中移除。
¥Deprecated. Will be removed in Babel 8.
t.isBlock(node);
覆盖节点:
¥Covered nodes:
BlockParent
以新的 LexicalEnvironment 开始执行上下文的 AST 节点的封面。换句话说,它们定义了 let 和 const 声明的范围。
¥A cover of AST nodes that start an execution context with new LexicalEnvironment. In other words, they define the scope of let and const declarations.
t.isBlockParent(node);
覆盖节点:
¥Covered nodes:
类
¥Class
ClassExpression 和 ClassDeclaration 的封面,它们共享相同的 AST 形状。
¥A cover of ClassExpression and ClassDeclaration, which share the same AST shape.
t.isClass(node);
覆盖节点:
¥Covered nodes:
CompletionStatement
表示 完成记录 的语句。换句话说,它们定义了程序的控制流,例如循环中断或操作何时会引发严重错误。
¥A statement that indicates the completion records. In other words, they define the control flow of the program, such as when should a loop break or an action throws critical errors.
t.isCompletionStatement(node);
覆盖节点:
¥Covered nodes:
有条件的
¥Conditional
ConditionalExpression 和 IfStatement 的封面,它们共享相同的 AST 形状。
¥A cover of ConditionalExpression and IfStatement, which share the same AST shape.
t.isConditional(node);
覆盖节点:
¥Covered nodes:
声明
¥Declaration
任何 声明 的封面。
¥A cover of any Declarations.
t.isDeclaration(node);
覆盖节点:
¥Covered nodes:
EnumBody
Flow 枚举主体的封面。
¥A cover of Flow enum bodies.
t.isEnumBody(node);
覆盖节点:
¥Covered nodes:
EnumMember
Flow 枚举成员的封面。
¥A cover of Flow enum members.
t.isEnumMember(node);
覆盖节点:
¥Covered nodes:
ExportDeclaration
任何 ExportDeclaration 的封面。
¥A cover of any ExportDeclarations.
t.isExportDeclaration(node);
覆盖节点:
¥Covered nodes:
表达
¥Expression
任何 表达 的封面。
¥A cover of any Expressions.
t.isExpression(node);
覆盖节点:
¥Covered nodes:
ExpressionWrapper
没有运行时语义的表达式封装器。
¥A wrapper of expression that does not have runtime semantics.
t.isExpressionWrapper(node);
覆盖节点:
¥Covered nodes:
Flow
为 Flow 定义的 AST 节点的覆盖。
¥A cover of AST nodes defined for Flow.
t.isFlow(node);
覆盖节点:
¥Covered nodes:
FlowBaseAnnotation
主要 Flow 类型注释的封面。
¥A cover of primary Flow type annotations.
t.isFlowBaseAnnotation(node);
覆盖节点:
¥Covered nodes:
FlowDeclaration
Flow 声明的封面。
¥A cover of Flow declarations.
t.isFlowDeclaration(node);
覆盖节点:
¥Covered nodes:
FlowPredicate
Flow 谓词的封面。
¥A cover of Flow predicates.
t.isFlowPredicate(node);
覆盖节点:
¥Covered nodes:
FlowType
Flow 类型注释的封面。
¥A cover of Flow type annotations.
t.isFlowType(node);
覆盖节点:
¥Covered nodes:
为了
¥For
ForStatement 和 ForXStatement 的封面。
¥A cover of ForStatements and ForXStatements.
t.isFor(node);
覆盖节点:
¥Covered nodes:
ForXStatement
ForInStatements 和 ForOfStatements 的封面。
¥A cover of ForInStatements and ForOfStatements.
t.isForXStatement(node);
覆盖节点:
¥Covered nodes:
函数
¥Function
一个覆盖函数和 method,必须有 body 和 params。注意:Function 与 FunctionParent 不同。例如,StaticBlock 是 FunctionParent,但不是 Function。
¥A cover of functions and methods, the must have body and params. Note: Function is different to FunctionParent. For example, a StaticBlock is a FunctionParent but not Function.
t.isFunction(node);
覆盖节点:
¥Covered nodes:
FunctionParameter
函数参数的覆盖。它们是 FormalParameterList 的元素。
¥A cover of function parameters. They are the elements of FormalParameterList.
t.isFunctionParameter(node);
覆盖节点:
¥Covered nodes:
FunctionParent
以新的 VariableEnvironment 开始执行上下文的 AST 节点的封面。换句话说,它们定义了 var 声明的范围。自 Babel 7 以来,FunctionParent 不包括 Program。
¥A cover of AST nodes that start an execution context with new VariableEnvironment. In other words, they define the scope of var declarations. FunctionParent did not include Program since Babel 7.
t.isFunctionParent(node);
覆盖节点:
¥Covered nodes:
不变的
¥Immutable
不可变对象和 JSX 元素的封面。如果创建后无法定义其他属性,则对象为 immutable。
¥A cover of immutable objects and JSX elements. An object is immutable if no other properties can be defined once created.
t.isImmutable(node);
覆盖节点:
¥Covered nodes:
ImportOrExportDeclaration
History
| 版本 | 变化 |
|---|---|
v7.21.0 | 介绍 |
ImportDeclaration 和 ExportDeclaration 的封面。
¥A cover of ImportDeclaration and ExportDeclaration.
t.isImportOrExportDeclaration(node);
覆盖节点:
¥Covered nodes:
JSX
为 JSX 定义的 AST 节点的覆盖。
¥A cover of AST nodes defined for JSX.
t.isJSX(node);
覆盖节点:
¥Covered nodes:
LVal
赋值表达式的 left 和 ForXStatement 中使用的左侧表达式的封面。
¥A cover of left hand side expressions used in the left of assignment expressions and ForXStatements.
t.isLVal(node);
覆盖节点:
¥Covered nodes:
字面量
¥Literal
¥A cover of Literals, Regular Expression Literals and Template Literals.
t.isLiteral(node);
覆盖节点:
¥Covered nodes:
环形
¥Loop
循环语句的封面。
¥A cover of loop statements.
t.isLoop(node);
覆盖节点:
¥Covered nodes:
方法
¥Method
对象方法和类方法的封面。
¥A cover of object methods and class methods.
t.isMethod(node);
覆盖节点:
¥Covered nodes:
各种各样的
¥Miscellaneous
涵盖有时对开发有用的非标准 AST 类型。
¥A cover of non-standard AST types that are sometimes useful for development.
t.isMiscellaneous(node);
覆盖节点:
¥Covered nodes:
ModuleDeclaration
History
| 版本 | 变化 |
|---|---|
v7.21.0 | 弃用 |
已弃用,请改用 ImportOrExportDeclaration。查看 PR #15266 以获取迁移说明。
¥Deprecated, use ImportOrExportDeclaration instead. Check out PR #15266 for migration notes.
t.isModuleDeclaration(node);
覆盖节点:
¥Covered nodes:
ModuleSpecifier
导入和导出说明符的封面。注意:它不是规范中定义的 ModuleSpecifier。
¥A cover of import and export specifiers. Note: It is not the ModuleSpecifier defined in the spec.
t.isModuleSpecifier(node);
覆盖节点:
¥Covered nodes:
ObjectMember
对象字面量中 members 的封面。
¥A cover of members in an object literal.
t.isObjectMember(node);
覆盖节点:
¥Covered nodes:
模式
¥Pattern
BindingPattern 的封面,除了标识符。
¥A cover of BindingPattern except Identifiers.
t.isPattern(node);
覆盖节点:
¥Covered nodes:
PatternLike
BindingPattern 的封面。
¥A cover of BindingPatterns.
t.isPatternLike(node);
覆盖节点:
¥Covered nodes:
私有的
¥Private
私有类元素和私有标识符的封面。
¥A cover of private class elements and private identifiers.
t.isPrivate(node);
覆盖节点:
¥Covered nodes:
属性
¥Property
对象属性和类属性的封面。
¥A cover of object properties and class properties.
t.isProperty(node);
覆盖节点:
¥Covered nodes:
纯粹的
¥Pureish
没有副作用的 AST 节点的覆盖。换句话说,如果对它们进行多次评估,就没有可观察到的行为变化。
¥A cover of AST nodes which do not have side-effects. In other words, there is no observable behaviour changes if they are evaluated more than once.
t.isPureish(node);
覆盖节点:
¥Covered nodes:
适用范围
¥Scopable
FunctionParent 和 BlockParent 的封面。
¥A cover of FunctionParent and BlockParent.
t.isScopable(node);
覆盖节点:
¥Covered nodes:
标准化
¥Standardized
AST 节点的封面,它们是官方 ECMAScript 规范的一部分。
¥A cover of AST nodes which are part of an official ECMAScript specification.
t.isStandardized(node);
覆盖节点:
¥Covered nodes:
陈述
¥Statement
任何 陈述 的封面。
¥A cover of any Statements.
t.isStatement(node);
覆盖节点:
¥Covered nodes:
TSBaseType
主要 TypeScript 类型注释的封面。
¥A cover of primary TypeScript type annotations.
t.isTSBaseType(node);
覆盖节点:
¥Covered nodes:
TSEntityName
ts 实体的封面。
¥A cover of ts entities.
t.isTSEntityName(node);
覆盖节点:
¥Covered nodes:
TSType
TypeScript 类型注释的封面。
¥A cover of TypeScript type annotations.
t.isTSType(node);
覆盖节点:
¥Covered nodes:
TSTypeElement
TypeScript 类型声明的封面。
¥A cover of TypeScript type declarations.
t.isTSTypeElement(node);
覆盖节点:
¥Covered nodes:
无终端
¥Terminatorless
当在运算符和操作数之间插入行终止符时,其语义将发生变化的 AST 节点的覆盖。
¥A cover of AST nodes whose semantic will change when a line terminator is inserted between the operator and the operand.
t.isTerminatorless(node);
覆盖节点:
¥Covered nodes:
TypeScript
为 TypeScript 定义的 AST 节点的封面。
¥A cover of AST nodes defined for TypeScript.
t.isTypeScript(node);
覆盖节点:
¥Covered nodes:
UnaryLike
UnaryExpression 和 SpreadElement 的封面。
¥A cover of UnaryExpression and SpreadElement.
t.isUnaryLike(node);
覆盖节点:
¥Covered nodes:
UserWhitespacable
已弃用。将在 Babel 8 中移除。
¥Deprecated. Will be removed in Babel 8.
t.isUserWhitespacable(node);
覆盖节点:
¥Covered nodes:
尽管
¥While
DoWhileStatement 和 WhileStatement 的封面,它们共享相同的 AST 形状。
¥A cover of DoWhileStatement and WhileStatement, which share the same AST shape.
t.isWhile(node);
覆盖节点:
¥Covered nodes: