@babel/types
Questa pagina è stata tradotta da PageTurner AI (beta). Non ufficialmente approvata dal progetto. Hai trovato un errore? Segnala problema →
Questo modulo contiene metodi per costruire manualmente AST e per verificare i tipi dei nodi AST.
Installazione
- 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
Costruttori di nodi
anyTypeAnnotation
t.anyTypeAnnotation();
Vedi anche t.isAnyTypeAnnotation(node, opts) e t.assertAnyTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
argumentPlaceholder
t.argumentPlaceholder();
Vedi anche t.isArgumentPlaceholder(node, opts) e t.assertArgumentPlaceholder(node, opts).
arrayExpression
t.arrayExpression(elements);
Vedi anche t.isArrayExpression(node, opts) e t.assertArrayExpression(node, opts).
Struttura del nodo AST ArrayExpression:
elements:(null | Expression | SpreadElement)[](predefinito:[])
Alias: Standardized, Expression
arrayPattern
t.arrayPattern(elements);
Vedi anche t.isArrayPattern(node, opts) e t.assertArrayPattern(node, opts).
Struttura del nodo AST ArrayPattern:
-
elements:(null | PatternLike)[](obbligatorio) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, FunctionParameter, Pattern, PatternLike, LVal
arrayTypeAnnotation
t.arrayTypeAnnotation(elementType);
Vedi anche t.isArrayTypeAnnotation(node, opts) e t.assertArrayTypeAnnotation(node, opts).
Struttura del nodo AST ArrayTypeAnnotation:
elementType:FlowType(obbligatorio)
arrowFunctionExpression
t.arrowFunctionExpression(params, body, async);
Vedi anche t.isArrowFunctionExpression(node, opts) e t.assertArrowFunctionExpression(node, opts).
Struttura del nodo AST ArrowFunctionExpression:
-
params:FunctionParameter[](obbligatorio) -
body:BlockStatement | Expression(obbligatorio) -
async:boolean(predefinito:false) -
expression:boolean(obbligatorio) -
generator:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
predicate:DeclaredPredicate | InferredPredicate(predefinito:null, escluso dalla funzione di costruzione) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(predefinito:null, escluso dalla funzione builder)
Aliasi: Standardized, Scopable, Function, BlockParent, FunctionParent, Expression, Pureish
assignmentExpression
t.assignmentExpression(operator, left, right);
Vedi anche t.isAssignmentExpression(node, opts) e t.assertAssignmentExpression(node, opts).
Struttura del nodo AST AssignmentExpression:
-
operator:string(obbligatorio) -
left:LVal | OptionalMemberExpression(obbligatorio) -
right:Expression(obbligatorio)
Alias: Standardized, Expression
assignmentPattern
t.assignmentPattern(left, right);
Vedi anche t.isAssignmentPattern(node, opts) e t.assertAssignmentPattern(node, opts).
Struttura del nodo AST AssignmentPattern:
-
left:Identifier | ObjectPattern | ArrayPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression(obbligatorio) -
right:Expression(obbligatorio) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, FunctionParameter, Pattern, PatternLike, LVal
awaitExpression
t.awaitExpression(argument);
Vedi anche t.isAwaitExpression(node, opts) e t.assertAwaitExpression(node, opts).
Struttura del nodo AST AwaitExpression:
argument:Expression(obbligatorio)
Alias: Standardized, Expression, Terminatorless
bigIntLiteral
t.bigIntLiteral(value);
Vedi anche t.isBigIntLiteral(node, opts) e t.assertBigIntLiteral(node, opts).
Struttura del nodo AST BigIntLiteral:
value:string(obbligatorio)
Alias: Standardized, Expression, Pureish, Literal, Immutable
binaryExpression
t.binaryExpression(operator, left, right);
Vedi anche t.isBinaryExpression(node, opts) e t.assertBinaryExpression(node, opts).
Struttura del nodo AST BinaryExpression:
-
operator:"+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>"(obbligatorio) -
left:Expression | PrivateName(obbligatorio) -
right:Expression(obbligatorio)
Alias: Standardized, Binary, Expression
bindExpression
t.bindExpression(object, callee);
Vedi anche t.isBindExpression(node, opts) e t.assertBindExpression(node, opts).
Forma del nodo AST BindExpression:
-
object:Expression(obbligatorio) -
callee:Expression(obbligatorio)
Alias: Expression
blockStatement
t.blockStatement(body, directives);
Vedi anche t.isBlockStatement(node, opts) e t.assertBlockStatement(node, opts).
Forma del nodo AST BlockStatement:
-
body:Statement[](obbligatorio) -
directives:Directive[](predefinito:[])
Alias: Standardized, Scopable, BlockParent, Block, Statement
booleanLiteral
t.booleanLiteral(value);
Vedi anche t.isBooleanLiteral(node, opts) e t.assertBooleanLiteral(node, opts).
Forma del nodo AST BooleanLiteral:
value:boolean(obbligatorio)
Alias: Standardized, Expression, Pureish, Literal, Immutable
booleanLiteralTypeAnnotation
t.booleanLiteralTypeAnnotation(value);
Vedi anche t.isBooleanLiteralTypeAnnotation(node, opts) e t.assertBooleanLiteralTypeAnnotation(node, opts).
Forma del nodo AST BooleanLiteralTypeAnnotation:
value:boolean(obbligatorio)
booleanTypeAnnotation
t.booleanTypeAnnotation();
Vedi anche t.isBooleanTypeAnnotation(node, opts) e t.assertBooleanTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
breakStatement
t.breakStatement(label);
Vedi anche t.isBreakStatement(node, opts) e t.assertBreakStatement(node, opts).
Forma del nodo AST BreakStatement:
label:Identifier(default:null)
Alias: Standardized, Statement, Terminatorless, CompletionStatement
callExpression
t.callExpression(callee, arguments);
Vedi anche t.isCallExpression(node, opts) e t.assertCallExpression(node, opts).
Forma del nodo AST CallExpression:
-
callee:Expression | Super | V8IntrinsicIdentifier(obbligatorio) -
arguments:(Expression | SpreadElement | ArgumentPlaceholder)[](obbligatorio) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
typeArguments:TypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione) -
typeParameters:TSTypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione)
Alias: Standardized, Expression
catchClause
t.catchClause(param, body);
Vedi anche t.isCatchClause(node, opts) e t.assertCatchClause(node, opts).
Forma del nodo AST CatchClause:
-
param:Identifier | ArrayPattern | ObjectPattern(default:null) -
body:BlockStatement(obbligatorio)
Alias: Standardized, Scopable, BlockParent
classAccessorProperty
t.classAccessorProperty(key, value, typeAnnotation, decorators, computed, static);
Vedi anche t.isClassAccessorProperty(node, opts) e t.assertClassAccessorProperty(node, opts).
Forma del nodo AST ClassAccessorProperty:
-
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName(obbligatorio) -
value:Expression(default:null) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null) -
decorators:Decorator[](predefinito:null) -
computed:boolean(predefinito:false) -
static:boolean(default:false) -
abstract:boolean(valore predefinito:null, escluso dalla funzione di costruzione) -
accessibility:"public" | "private" | "protected"(predefinito:null, escluso dalla funzione builder) -
declare:boolean(predefinito:null, escluso dalla funzione builder) -
definite:boolean(default:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
override:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
readonly:boolean(predefinito:null, escluso dalla funzione builder) -
variance:Variance(default:null, esclusa dalla funzione builder)
Alias: Standardized, Property, Accessor
classBody
t.classBody(body);
Vedi anche t.isClassBody(node, opts) e t.assertClassBody(node, opts).
Forma del nodo AST ClassBody:
body:(ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock)[](obbligatorio)
Alias: Standardized
classDeclaration
t.classDeclaration(id, superClass, body, decorators);
Vedi anche t.isClassDeclaration(node, opts) e t.assertClassDeclaration(node, opts).
Forma del nodo AST ClassDeclaration:
-
id:Identifier(default:null) -
superClass:Expression(predefinito:null) -
body:ClassBody(obbligatorio) -
decorators:Decorator[](predefinito:null) -
abstract:boolean(valore predefinito:null, escluso dalla funzione di costruzione) -
declare:boolean(predefinito:null, escluso dalla funzione builder) -
implements:(TSExpressionWithTypeArguments | ClassImplements)[](predefinito:null, escluso dalla funzione builder) -
mixins:InterfaceExtends(predefinito:null, escluso dalla funzione builder) -
superTypeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(predefinito:null, escluso dalla funzione builder) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Scopable, Class, Statement, Declaration
classExpression
t.classExpression(id, superClass, body, decorators);
Vedi anche t.isClassExpression(node, opts) e t.assertClassExpression(node, opts).
Struttura del nodo AST ClassExpression:
-
id:Identifier(default:null) -
superClass:Expression(predefinito:null) -
body:ClassBody(obbligatorio) -
decorators:Decorator[](predefinito:null) -
implements:(TSExpressionWithTypeArguments | ClassImplements)[](predefinito:null, escluso dalla funzione builder) -
mixins:InterfaceExtends(predefinito:null, escluso dalla funzione builder) -
superTypeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(predefinito:null, escluso dalla funzione builder) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Scopable, Class, Expression
classImplements
t.classImplements(id, typeParameters);
Vedi anche t.isClassImplements(node, opts) e t.assertClassImplements(node, opts).
Struttura del nodo AST ClassImplements:
-
id:Identifier(obbligatorio) -
typeParameters:TypeParameterInstantiation(default:null)
Alias: Flow
classMethod
t.classMethod(kind, key, params, body, computed, static, generator, async);
Vedi anche t.isClassMethod(node, opts) e t.assertClassMethod(node, opts).
Struttura del nodo AST ClassMethod:
-
kind:"get" | "set" | "method" | "constructor"(predefinito:'method') -
key: se computed alloraExpressionaltrimentiIdentifier | Literal(obbligatorio) -
params:(FunctionParameter | TSParameterProperty)[](obbligatorio) -
body:BlockStatement(obbligatorio) -
computed:boolean(predefinito:false) -
static:boolean(default:false) -
generator:boolean(predefinito:false) -
async:boolean(predefinito:false) -
abstract:boolean(valore predefinito:null, escluso dalla funzione di costruzione) -
access:"public" | "private" | "protected"(valore predefinito:null, escluso dalla funzione di costruzione) -
accessibility:"public" | "private" | "protected"(predefinito:null, escluso dalla funzione builder) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
override:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Function, Scopable, BlockParent, FunctionParent, Method
classPrivateMethod
t.classPrivateMethod(kind, key, params, body, static);
Vedi anche t.isClassPrivateMethod(node, opts) e t.assertClassPrivateMethod(node, opts).
Struttura del nodo AST ClassPrivateMethod:
-
kind:"get" | "set" | "method"(valore predefinito:'method') -
key:PrivateName(obbligatorio) -
params:(FunctionParameter | TSParameterProperty)[](obbligatorio) -
body:BlockStatement(obbligatorio) -
static:boolean(default:false) -
abstract:boolean(valore predefinito:null, escluso dalla funzione di costruzione) -
access:"public" | "private" | "protected"(valore predefinito:null, escluso dalla funzione di costruzione) -
accessibility:"public" | "private" | "protected"(predefinito:null, escluso dalla funzione builder) -
async:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
computed: 'false' (valore predefinito:false, escluso dalla funzione builder) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
generator:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
override:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Function, Scopable, BlockParent, FunctionParent, Method, Private
classPrivateProperty
t.classPrivateProperty(key, value, decorators, static);
Vedi anche t.isClassPrivateProperty(node, opts) e t.assertClassPrivateProperty(node, opts).
Struttura del nodo AST ClassPrivateProperty:
-
key:PrivateName(obbligatorio) -
value:Expression(default:null) -
decorators:Decorator[](predefinito:null) -
static:boolean(default:false) -
definite:boolean(default:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
readonly:boolean(predefinito:null, escluso dalla funzione builder) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder) -
variance:Variance(default:null, esclusa dalla funzione builder)
Alias: Standardized, Property, Private
classProperty
t.classProperty(key, value, typeAnnotation, decorators, computed, static);
History
| Version | Changes |
|---|---|
v7.6.0 | Supports static |
Vedi anche t.isClassProperty(node, opts) e t.assertClassProperty(node, opts).
Forma del nodo AST ClassProperty:
-
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression(obbligatorio) -
value:Expression(default:null) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(default:null) -
decorators:Decorator[](predefinito:null) -
computed:boolean(predefinito:false) -
static:boolean(default:false) -
abstract:boolean(valore predefinito:null, escluso dalla funzione di costruzione) -
accessibility:"public" | "private" | "protected"(predefinito:null, escluso dalla funzione builder) -
declare:boolean(predefinito:null, escluso dalla funzione builder) -
definite:boolean(default:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
override:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
readonly:boolean(predefinito:null, escluso dalla funzione builder) -
variance:Variance(default:null, esclusa dalla funzione builder)
Alias: Standardized, Property
conditionalExpression
t.conditionalExpression(test, consequent, alternate);
Vedi anche t.isConditionalExpression(node, opts) e t.assertConditionalExpression(node, opts).
Forma del nodo AST ConditionalExpression:
-
test:Expression(obbligatorio) -
consequent:Expression(obbligatorio) -
alternate:Expression(obbligatorio)
Alias: Standardized, Expression, Conditional
continueStatement
t.continueStatement(label);
Vedi anche t.isContinueStatement(node, opts) e t.assertContinueStatement(node, opts).
Forma del nodo AST ContinueStatement:
label:Identifier(default:null)
Alias: Standardized, Statement, Terminatorless, CompletionStatement
debuggerStatement
t.debuggerStatement();
Vedi anche t.isDebuggerStatement(node, opts) e t.assertDebuggerStatement(node, opts).
Alias: Standardized, Statement
decimalLiteral
t.decimalLiteral(value);
Vedi anche t.isDecimalLiteral(node, opts) e t.assertDecimalLiteral(node, opts).
Forma del nodo AST DecimalLiteral:
value:string(obbligatorio)
Alias: Expression, Pureish, Literal, Immutable
declareClass
t.declareClass(id, typeParameters, extends, body);
Vedi anche t.isDeclareClass(node, opts) e t.assertDeclareClass(node, opts).
Forma del nodo AST DeclareClass:
-
id:Identifier(obbligatorio) -
typeParameters:TypeParameterDeclaration(predefinito:null) -
extends:InterfaceExtends[](predefinito:null) -
body:ObjectTypeAnnotation(obbligatorio) -
implements:ClassImplements[](predefinito:null, escluso dalla funzione builder) -
mixins:InterfaceExtends[](predefinito:null, escluso dalla funzione builder)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareExportAllDeclaration
t.declareExportAllDeclaration(source, attributes);
Vedi anche t.isDeclareExportAllDeclaration(node, opts) e t.assertDeclareExportAllDeclaration(node, opts).
Forma del nodo AST DeclareExportAllDeclaration:
-
source:StringLiteral(obbligatorio) -
attributes:ImportAttribute[](predefinito:null) -
assertions:ImportAttribute[](predefinito:null, escluso dalla funzione builder) -
exportKind:"type" | "value"(predefinito:null, escluso dalla funzione builder)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareExportDeclaration
t.declareExportDeclaration(declaration, specifiers, source, attributes);
Vedi anche t.isDeclareExportDeclaration(node, opts) e t.assertDeclareExportDeclaration(node, opts).
Forma del nodo AST DeclareExportDeclaration:
-
declaration:Flow(default:null) -
specifiers:(ExportSpecifier | ExportNamespaceSpecifier)[](predefinito:null) -
source:StringLiteral(predefinito:null) -
attributes:ImportAttribute[](predefinito:null) -
assertions:ImportAttribute[](predefinito:null, escluso dalla funzione builder) -
default:boolean(default:null, escluso dalla funzione builder)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareFunction
t.declareFunction(id);
Vedi anche t.isDeclareFunction(node, opts) e t.assertDeclareFunction(node, opts).
Forma del nodo AST DeclareFunction:
-
id:Identifier(obbligatorio) -
predicate:DeclaredPredicate(default:null, escluso dalla funzione builder)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareInterface
t.declareInterface(id, typeParameters, extends, body);
Vedi anche t.isDeclareInterface(node, opts) e t.assertDeclareInterface(node, opts).
Forma del nodo AST DeclareInterface:
-
id:Identifier(obbligatorio) -
typeParameters:TypeParameterDeclaration(predefinito:null) -
extends:InterfaceExtends[](predefinito:null) -
body:ObjectTypeAnnotation(obbligatorio)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareModule
t.declareModule(id, body, kind);
Vedi anche t.isDeclareModule(node, opts) e t.assertDeclareModule(node, opts).
Forma del nodo AST DeclareModule:
-
id:Identifier | StringLiteral(obbligatorio) -
body:BlockStatement(obbligatorio) -
kind:"CommonJS" | "ES"(predefinito:null)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareModuleExports
t.declareModuleExports(typeAnnotation);
Vedi anche t.isDeclareModuleExports(node, opts) e t.assertDeclareModuleExports(node, opts).
Forma del nodo AST DeclareModuleExports:
typeAnnotation:TypeAnnotation(obbligatorio)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareOpaqueType
t.declareOpaqueType(id, typeParameters, supertype);
Vedi anche t.isDeclareOpaqueType(node, opts) e t.assertDeclareOpaqueType(node, opts).
Forma del nodo AST DeclareOpaqueType:
-
id:Identifier(obbligatorio) -
typeParameters:TypeParameterDeclaration(predefinito:null) -
supertype:FlowType(predefinito:null) -
impltype:FlowType(predefinito:null, escluso dalla funzione builder)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareTypeAlias
t.declareTypeAlias(id, typeParameters, right);
Vedi anche t.isDeclareTypeAlias(node, opts) e t.assertDeclareTypeAlias(node, opts).
Forma del nodo AST DeclareTypeAlias:
-
id:Identifier(obbligatorio) -
typeParameters:TypeParameterDeclaration(predefinito:null) -
right:FlowType(obbligatorio)
Alias: Flow, FlowDeclaration, Statement, Declaration
declareVariable
t.declareVariable(id);
Vedi anche t.isDeclareVariable(node, opts) e t.assertDeclareVariable(node, opts).
Forma del nodo AST DeclareVariable:
id:Identifier(obbligatorio)
Alias: Flow, FlowDeclaration, Statement, Declaration
declaredPredicate
t.declaredPredicate(value);
Vedi anche t.isDeclaredPredicate(node, opts) e t.assertDeclaredPredicate(node, opts).
Forma del nodo AST DeclaredPredicate:
value:Flow(obbligatorio)
Alias: Flow, FlowPredicate
decorator
t.decorator(expression);
Vedi anche t.isDecorator(node, opts) e t.assertDecorator(node, opts).
Forma del nodo AST Decorator:
expression:Expression(obbligatorio)
directive
t.directive(value);
Vedi anche t.isDirective(node, opts) e t.assertDirective(node, opts).
Forma del nodo AST Directive:
value:DirectiveLiteral(obbligatorio)
Alias: Standardized
directiveLiteral
t.directiveLiteral(value);
Vedi anche t.isDirectiveLiteral(node, opts) e t.assertDirectiveLiteral(node, opts).
Forma del nodo AST DirectiveLiteral:
value:string(obbligatorio)
Alias: Standardized
doExpression
t.doExpression(body, async);
Vedi anche t.isDoExpression(node, opts) e t.assertDoExpression(node, opts).
Forma del nodo AST DoExpression:
-
body:BlockStatement(obbligatorio) -
async:boolean(predefinito:false)
Alias: Expression
doWhileStatement
t.doWhileStatement(test, body);
Vedi anche t.isDoWhileStatement(node, opts) e t.assertDoWhileStatement(node, opts).
Forma del nodo AST DoWhileStatement:
-
test:Expression(obbligatorio) -
body:Statement(obbligatorio)
Alias: Standardized, Statement, BlockParent, Loop, While, Scopable
emptyStatement
t.emptyStatement();
Vedi anche t.isEmptyStatement(node, opts) e t.assertEmptyStatement(node, opts).
Alias: Standardized, Statement
emptyTypeAnnotation
t.emptyTypeAnnotation();
Vedi anche t.isEmptyTypeAnnotation(node, opts) e t.assertEmptyTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
enumBooleanBody
t.enumBooleanBody(members);
Vedi anche t.isEnumBooleanBody(node, opts) e t.assertEnumBooleanBody(node, opts).
Forma del nodo AST EnumBooleanBody:
-
members:EnumBooleanMember[](obbligatorio) -
explicitType:boolean(obbligatorio) -
hasUnknownMembers:boolean(obbligatorio)
enumBooleanMember
t.enumBooleanMember(id);
Vedi anche t.isEnumBooleanMember(node, opts) e t.assertEnumBooleanMember(node, opts).
Struttura del nodo AST EnumBooleanMember:
-
id:Identifier(obbligatorio) -
init:BooleanLiteral(obbligatorio)
Alias: Flow, EnumMember
enumDeclaration
t.enumDeclaration(id, body);
Vedi anche t.isEnumDeclaration(node, opts) e t.assertEnumDeclaration(node, opts).
Struttura del nodo AST EnumDeclaration:
-
id:Identifier(obbligatorio) -
body:EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody(obbligatorio)
Alias: Flow, Statement, Declaration
enumDefaultedMember
t.enumDefaultedMember(id);
Vedi anche t.isEnumDefaultedMember(node, opts) e t.assertEnumDefaultedMember(node, opts).
Struttura del nodo AST EnumDefaultedMember:
id:Identifier(obbligatorio)
Alias: Flow, EnumMember
enumNumberBody
t.enumNumberBody(members);
Vedi anche t.isEnumNumberBody(node, opts) e t.assertEnumNumberBody(node, opts).
Struttura del nodo AST EnumNumberBody:
-
members:EnumNumberMember[](obbligatorio) -
explicitType:boolean(obbligatorio) -
hasUnknownMembers:boolean(obbligatorio)
enumNumberMember
t.enumNumberMember(id, init);
Vedi anche t.isEnumNumberMember(node, opts) e t.assertEnumNumberMember(node, opts).
Struttura del nodo AST EnumNumberMember:
-
id:Identifier(obbligatorio) -
init:NumericLiteral(obbligatorio)
Alias: Flow, EnumMember
enumStringBody
t.enumStringBody(members);
Vedi anche t.isEnumStringBody(node, opts) e t.assertEnumStringBody(node, opts).
Struttura del nodo AST EnumStringBody:
-
members:(EnumStringMember | EnumDefaultedMember)[](obbligatorio) -
explicitType:boolean(obbligatorio) -
hasUnknownMembers:boolean(obbligatorio)
enumStringMember
t.enumStringMember(id, init);
Vedi anche t.isEnumStringMember(node, opts) e t.assertEnumStringMember(node, opts).
Struttura del nodo AST EnumStringMember:
-
id:Identifier(obbligatorio) -
init:StringLiteral(obbligatorio)
Alias: Flow, EnumMember
enumSymbolBody
t.enumSymbolBody(members);
Vedi anche t.isEnumSymbolBody(node, opts) e t.assertEnumSymbolBody(node, opts).
Forma del nodo AST EnumSymbolBody:
-
members:EnumDefaultedMember[](obbligatorio) -
hasUnknownMembers:boolean(obbligatorio)
existsTypeAnnotation
t.existsTypeAnnotation();
Vedi anche t.isExistsTypeAnnotation(node, opts) e t.assertExistsTypeAnnotation(node, opts).
exportAllDeclaration
t.exportAllDeclaration(source, attributes);
History
| Version | Changes |
|---|---|
v7.29.0 | Supports attributes |
Vedi anche t.isExportAllDeclaration(node, opts) e t.assertExportAllDeclaration(node, opts).
Forma del nodo AST ExportAllDeclaration:
-
source:StringLiteral(obbligatorio) -
attributes:ImportAttribute[](predefinito:null) -
assertions:ImportAttribute[](predefinito:null, escluso dalla funzione builder) -
exportKind:"type" | "value"(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
exportDefaultDeclaration
t.exportDefaultDeclaration(declaration);
Vedi anche t.isExportDefaultDeclaration(node, opts) e t.assertExportDefaultDeclaration(node, opts).
Forma del nodo AST ExportDefaultDeclaration:
-
declaration:TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression(obbligatorio) -
exportKind:"value"(predefinito:null, escluso dalla funzione di costruzione)
Alias: Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
exportDefaultSpecifier
t.exportDefaultSpecifier(exported);
Vedi anche t.isExportDefaultSpecifier(node, opts) e t.assertExportDefaultSpecifier(node, opts).
Forma del nodo AST ExportDefaultSpecifier:
exported:Identifier(obbligatorio)
Alias: ModuleSpecifier
exportNamedDeclaration
t.exportNamedDeclaration(declaration, specifiers, source, attributes);
History
| Version | Changes |
|---|---|
v7.29.0 | Supports attributes |
Vedi anche t.isExportNamedDeclaration(node, opts) e t.assertExportNamedDeclaration(node, opts).
Forma del nodo AST ExportNamedDeclaration:
-
declaration:Declaration(predefinito:null) -
specifiers:(ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier)[](predefinito:[]) -
source:StringLiteral(predefinito:null) -
attributes:ImportAttribute[](predefinito:null) -
assertions:ImportAttribute[](predefinito:null, escluso dalla funzione builder) -
exportKind:"type" | "value"(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Statement, Declaration, ImportOrExportDeclaration, ExportDeclaration
exportNamespaceSpecifier
t.exportNamespaceSpecifier(exported);
Vedi anche t.isExportNamespaceSpecifier(node, opts) e t.assertExportNamespaceSpecifier(node, opts).
Forma del nodo AST ExportNamespaceSpecifier:
exported:Identifier(obbligatorio)
Alias: Standardized, ModuleSpecifier
exportSpecifier
t.exportSpecifier(local, exported);
Vedi anche t.isExportSpecifier(node, opts) e t.assertExportSpecifier(node, opts).
Forma del nodo AST ExportSpecifier:
-
local:Identifier(obbligatorio) -
exported:Identifier | StringLiteral(obbligatorio) -
exportKind:"type" | "value"(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, ModuleSpecifier
expressionStatement
t.expressionStatement(expression);
Vedi anche t.isExpressionStatement(node, opts) e t.assertExpressionStatement(node, opts).
Forma del nodo AST ExpressionStatement:
expression:Expression(obbligatorio)
Alias: Standardized, Statement, ExpressionWrapper
file
t.file(program, comments, tokens);
Vedi anche t.isFile(node, opts) e t.assertFile(node, opts).
Forma del nodo AST File:
-
program:Program(obbligatorio) -
comments:(CommentBlock | CommentLine)[](predefinito:null) -
tokens:any[](predefinito:null)
Alias: Standardized
forInStatement
t.forInStatement(left, right, body);
Vedi anche t.isForInStatement(node, opts) e t.assertForInStatement(node, opts).
Forma del nodo AST ForInStatement:
-
left:VariableDeclaration | LVal(obbligatorio) -
right:Expression(obbligatorio) -
body:Statement(obbligatorio)
Aliasi: Standardized, Scopable, Statement, For, BlockParent, Loop, ForXStatement
forOfStatement
t.forOfStatement(left, right, body, await);
Vedi anche t.isForOfStatement(node, opts) e t.assertForOfStatement(node, opts).
Forma del nodo AST ForOfStatement:
-
left:VariableDeclaration | LVal(obbligatorio) -
right:Expression(obbligatorio) -
body:Statement(obbligatorio) -
await:boolean(predefinito:false)
Aliasi: Standardized, Scopable, Statement, For, BlockParent, Loop, ForXStatement
forStatement
t.forStatement(init, test, update, body);
Vedi anche t.isForStatement(node, opts) e t.assertForStatement(node, opts).
Struttura del nodo AST ForStatement:
-
init:VariableDeclaration | Expression(predefinito:null) -
test:Expression(predefinito:null) -
update:Expression(predefinito:null) -
body:Statement(obbligatorio)
Aliasi: Standardized, Scopable, Statement, For, BlockParent, Loop
functionDeclaration
t.functionDeclaration(id, params, body, generator, async);
Vedi anche t.isFunctionDeclaration(node, opts) e t.assertFunctionDeclaration(node, opts).
Struttura del nodo AST FunctionDeclaration:
-
id:Identifier(default:null) -
params:FunctionParameter[](obbligatorio) -
body:BlockStatement(obbligatorio) -
generator:boolean(predefinito:false) -
async:boolean(predefinito:false) -
declare:boolean(predefinito:null, escluso dalla funzione builder) -
predicate:DeclaredPredicate | InferredPredicate(predefinito:null, escluso dalla funzione di costruzione) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(predefinito:null, escluso dalla funzione builder)
Aliasi: Standardized, Scopable, Function, BlockParent, FunctionParent, Statement, Pureish, Declaration
functionExpression
t.functionExpression(id, params, body, generator, async);
Vedi anche t.isFunctionExpression(node, opts) e t.assertFunctionExpression(node, opts).
Struttura del nodo AST FunctionExpression:
-
id:Identifier(default:null) -
params:FunctionParameter[](obbligatorio) -
body:BlockStatement(obbligatorio) -
generator:boolean(predefinito:false) -
async:boolean(predefinito:false) -
predicate:DeclaredPredicate | InferredPredicate(predefinito:null, escluso dalla funzione di costruzione) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(predefinito:null, escluso dalla funzione builder)
Aliasi: Standardized, Scopable, Function, BlockParent, FunctionParent, Expression, Pureish
functionTypeAnnotation
t.functionTypeAnnotation(typeParameters, params, rest, returnType);
Vedi anche t.isFunctionTypeAnnotation(node, opts) e t.assertFunctionTypeAnnotation(node, opts).
Forma del nodo AST FunctionTypeAnnotation:
-
typeParameters:TypeParameterDeclaration(predefinito:null) -
params:FunctionTypeParam[](obbligatorio) -
rest:FunctionTypeParam(predefinito:null) -
returnType:FlowType(obbligatorio) -
this:FunctionTypeParam(predefinito:null, escluso dalla funzione builder)
functionTypeParam
t.functionTypeParam(name, typeAnnotation);
Vedi anche t.isFunctionTypeParam(node, opts) e t.assertFunctionTypeParam(node, opts).
Forma del nodo AST FunctionTypeParam:
-
name:Identifier(predefinito:null) -
typeAnnotation:FlowType(obbligatorio) -
optional:boolean(predefinito:null, escluso dalla funzione builder)
Alias: Flow
genericTypeAnnotation
t.genericTypeAnnotation(id, typeParameters);
Vedi anche t.isGenericTypeAnnotation(node, opts) e t.assertGenericTypeAnnotation(node, opts).
Forma del nodo AST GenericTypeAnnotation:
-
id:Identifier | QualifiedTypeIdentifier(obbligatorio) -
typeParameters:TypeParameterInstantiation(default:null)
identifier
t.identifier(name);
Vedi anche t.isIdentifier(node, opts) e t.assertIdentifier(node, opts).
Forma del nodo AST Identifier:
-
name:string(obbligatorio) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Expression, FunctionParameter, PatternLike, LVal, TSEntityName
ifStatement
t.ifStatement(test, consequent, alternate);
Vedi anche t.isIfStatement(node, opts) e t.assertIfStatement(node, opts).
Forma del nodo AST IfStatement:
-
test:Expression(obbligatorio) -
consequent:Statement(obbligatorio) -
alternate:Statement(predefinito:null)
Alias: Standardized, Statement, Conditional
import
t.import();
Vedi anche t.isImport(node, opts) e t.assertImport(node, opts).
Alias: Standardized, Expression
importAttribute
t.importAttribute(key, value);
Vedi anche t.isImportAttribute(node, opts) e t.assertImportAttribute(node, opts).
Forma del nodo AST ImportAttribute:
-
key:Identifier | StringLiteral(obbligatorio) -
value:StringLiteral(obbligatorio)
Alias: Standardized
importDeclaration
t.importDeclaration(specifiers, source, attributes);
History
| Version | Changes |
|---|---|
v7.20.0 | Supports module |
v7.29.0 | Supports attributes |
Vedi anche t.isImportDeclaration(node, opts) e t.assertImportDeclaration(node, opts).
Forma del nodo AST ImportDeclaration:
-
specifiers:(ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[](obbligatorio) -
source:StringLiteral(obbligatorio) -
attributes:ImportAttribute[](predefinito:null) -
assertions:ImportAttribute[](predefinito:null, escluso dalla funzione builder) -
importKind:"type" | "typeof" | "value"(predefinito:null, escluso dalla funzione builder) -
module:boolean(predefinito:null, escluso dalla funzione builder) -
phase:"source" | "defer"(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Statement, Declaration, ImportOrExportDeclaration
importDefaultSpecifier
t.importDefaultSpecifier(local);
Vedi anche t.isImportDefaultSpecifier(node, opts) e t.assertImportDefaultSpecifier(node, opts).
Forma del nodo AST ImportDefaultSpecifier:
local:Identifier(obbligatorio)
Alias: Standardized, ModuleSpecifier
importExpression
t.importExpression(source, options);
Vedi anche t.isImportExpression(node, opts) e t.assertImportExpression(node, opts).
Forma del nodo AST ImportExpression:
-
source:Expression(obbligatorio) -
options:Expression(predefinito:null) -
phase:"source" | "defer"(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Expression
importNamespaceSpecifier
t.importNamespaceSpecifier(local);
Vedi anche t.isImportNamespaceSpecifier(node, opts) e t.assertImportNamespaceSpecifier(node, opts).
Forma del nodo AST ImportNamespaceSpecifier:
local:Identifier(obbligatorio)
Alias: Standardized, ModuleSpecifier
importSpecifier
t.importSpecifier(local, imported);
Vedi anche t.isImportSpecifier(node, opts) e t.assertImportSpecifier(node, opts).
Forma del nodo AST ImportSpecifier:
-
local:Identifier(obbligatorio) -
imported:Identifier | StringLiteral(obbligatorio) -
importKind:"type" | "typeof" | "value"(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, ModuleSpecifier
indexedAccessType
t.indexedAccessType(objectType, indexType);
Vedi anche t.isIndexedAccessType(node, opts) e t.assertIndexedAccessType(node, opts).
Struttura del nodo AST IndexedAccessType:
-
objectType:FlowType(obbligatorio) -
indexType:FlowType(obbligatorio)
inferredPredicate
t.inferredPredicate();
Vedi anche t.isInferredPredicate(node, opts) e t.assertInferredPredicate(node, opts).
Alias: Flow, FlowPredicate
interfaceDeclaration
t.interfaceDeclaration(id, typeParameters, extends, body);
Vedi anche t.isInterfaceDeclaration(node, opts) e t.assertInterfaceDeclaration(node, opts).
Struttura del nodo AST InterfaceDeclaration:
-
id:Identifier(obbligatorio) -
typeParameters:TypeParameterDeclaration(predefinito:null) -
extends:InterfaceExtends[](predefinito:null) -
body:ObjectTypeAnnotation(obbligatorio)
Alias: Flow, FlowDeclaration, Statement, Declaration
interfaceExtends
t.interfaceExtends(id, typeParameters);
Vedi anche t.isInterfaceExtends(node, opts) e t.assertInterfaceExtends(node, opts).
Struttura del nodo AST InterfaceExtends:
-
id:Identifier | QualifiedTypeIdentifier(obbligatorio) -
typeParameters:TypeParameterInstantiation(default:null)
Alias: Flow
interfaceTypeAnnotation
t.interfaceTypeAnnotation(extends, body);
Vedi anche t.isInterfaceTypeAnnotation(node, opts) e t.assertInterfaceTypeAnnotation(node, opts).
Struttura del nodo AST InterfaceTypeAnnotation:
-
extends:InterfaceExtends[](predefinito:null) -
body:ObjectTypeAnnotation(obbligatorio)
interpreterDirective
t.interpreterDirective(value);
Vedi anche t.isInterpreterDirective(node, opts) e t.assertInterpreterDirective(node, opts).
Struttura del nodo AST InterpreterDirective:
value:string(obbligatorio)
Alias: Standardized
intersectionTypeAnnotation
t.intersectionTypeAnnotation(types);
Vedi anche t.isIntersectionTypeAnnotation(node, opts) e t.assertIntersectionTypeAnnotation(node, opts).
Struttura del nodo AST IntersectionTypeAnnotation:
types:FlowType[](obbligatorio)
jsxAttribute
t.jsxAttribute(name, value);
Vedi anche t.isJSXAttribute(node, opts) e t.assertJSXAttribute(node, opts).
Struttura del nodo AST JSXAttribute:
-
name:JSXIdentifier | JSXNamespacedName(obbligatorio) -
value:JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer(default:null)
jsxClosingElement
t.jsxClosingElement(name);
Vedi anche t.isJSXClosingElement(node, opts) e t.assertJSXClosingElement(node, opts).
Struttura nodo AST JSXClosingElement:
name:JSXIdentifier | JSXMemberExpression | JSXNamespacedName(obbligatorio)
jsxClosingFragment
t.jsxClosingFragment();
Vedi anche t.isJSXClosingFragment(node, opts) e t.assertJSXClosingFragment(node, opts).
jsxElement
t.jsxElement(openingElement, closingElement, children, selfClosing);
Vedi anche t.isJSXElement(node, opts) e t.assertJSXElement(node, opts).
Struttura nodo AST JSXElement:
-
openingElement:JSXOpeningElement(obbligatorio) -
closingElement:JSXClosingElement(default:null) -
children:(JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment)[](obbligatorio) -
selfClosing:boolean(default:null)
Alias: JSX, Immutable, Expression
jsxEmptyExpression
t.jsxEmptyExpression();
Vedi anche t.isJSXEmptyExpression(node, opts) e t.assertJSXEmptyExpression(node, opts).
Aliases: JSX
jsxExpressionContainer
t.jsxExpressionContainer(expression);
Vedi anche t.isJSXExpressionContainer(node, opts) e t.assertJSXExpressionContainer(node, opts).
Struttura nodo AST JSXExpressionContainer:
expression:Expression | JSXEmptyExpression(obbligatorio)
jsxFragment
t.jsxFragment(openingFragment, closingFragment, children);
Vedi anche t.isJSXFragment(node, opts) e t.assertJSXFragment(node, opts).
Struttura nodo AST JSXFragment:
-
openingFragment:JSXOpeningFragment(obbligatorio) -
closingFragment:JSXClosingFragment(obbligatorio) -
children:(JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment)[](obbligatorio)
Alias: JSX, Immutable, Expression
jsxIdentifier
t.jsxIdentifier(name);
Vedi anche t.isJSXIdentifier(node, opts) e t.assertJSXIdentifier(node, opts).
Struttura nodo AST JSXIdentifier:
name:string(obbligatorio)
Aliases: JSX
jsxMemberExpression
t.jsxMemberExpression(object, property);
Vedi anche t.isJSXMemberExpression(node, opts) e t.assertJSXMemberExpression(node, opts).
Forma del nodo AST JSXMemberExpression:
-
object:JSXMemberExpression | JSXIdentifier(obbligatorio) -
property:JSXIdentifier(obbligatorio)
Aliases: JSX
jsxNamespacedName
t.jsxNamespacedName(namespace, name);
Vedi anche t.isJSXNamespacedName(node, opts) e t.assertJSXNamespacedName(node, opts).
Forma del nodo AST JSXNamespacedName:
-
namespace:JSXIdentifier(obbligatorio) -
name:JSXIdentifier(obbligatorio)
Aliases: JSX
jsxOpeningElement
t.jsxOpeningElement(name, attributes, selfClosing);
Vedi anche t.isJSXOpeningElement(node, opts) e t.assertJSXOpeningElement(node, opts).
Forma del nodo AST JSXOpeningElement:
-
name:JSXIdentifier | JSXMemberExpression | JSXNamespacedName(obbligatorio) -
attributes:(JSXAttribute | JSXSpreadAttribute)[](obbligatorio) -
selfClosing:boolean(predefinito:false) -
typeArguments:TypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione) -
typeParameters:TSTypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione)
jsxOpeningFragment
t.jsxOpeningFragment();
Vedi anche t.isJSXOpeningFragment(node, opts) e t.assertJSXOpeningFragment(node, opts).
jsxSpreadAttribute
t.jsxSpreadAttribute(argument);
Vedi anche t.isJSXSpreadAttribute(node, opts) e t.assertJSXSpreadAttribute(node, opts).
Forma del nodo AST JSXSpreadAttribute:
argument:Expression(obbligatorio)
Aliases: JSX
jsxSpreadChild
t.jsxSpreadChild(expression);
Vedi anche t.isJSXSpreadChild(node, opts) e t.assertJSXSpreadChild(node, opts).
Forma del nodo AST JSXSpreadChild:
expression:Expression(obbligatorio)
jsxText
t.jsxText(value);
Vedi anche t.isJSXText(node, opts) e t.assertJSXText(node, opts).
Forma del nodo AST JSXText:
value:string(obbligatorio)
labeledStatement
t.labeledStatement(label, body);
Vedi anche t.isLabeledStatement(node, opts) e t.assertLabeledStatement(node, opts).
Forma del nodo AST LabeledStatement:
-
label:Identifier(obbligatorio) -
body:Statement(obbligatorio)
Alias: Standardized, Statement
logicalExpression
t.logicalExpression(operator, left, right);
Vedi anche t.isLogicalExpression(node, opts) e t.assertLogicalExpression(node, opts).
Forma del nodo AST LogicalExpression:
-
operator:"||" | "&&" | "??"(obbligatorio) -
left:Expression(obbligatorio) -
right:Expression(obbligatorio)
Alias: Standardized, Binary, Expression
memberExpression
t.memberExpression(object, property, computed, optional);
Vedi anche t.isMemberExpression(node, opts) e t.assertMemberExpression(node, opts).
Forma del nodo AST MemberExpression:
-
object:Expression | Super(obbligatorio) -
property: se computatoExpressionaltrimentiIdentifier(obbligatorio) -
computed:boolean(predefinito:false) -
optional:boolean(default:null)
Alias: Standardized, Expression, LVal, PatternLike
metaProperty
t.metaProperty(meta, property);
Vedi anche t.isMetaProperty(node, opts) e t.assertMetaProperty(node, opts).
Forma del nodo AST MetaProperty:
-
meta:Identifier(obbligatorio) -
property:Identifier(obbligatorio)
Alias: Standardized, Expression
mixedTypeAnnotation
t.mixedTypeAnnotation();
Vedi anche t.isMixedTypeAnnotation(node, opts) e t.assertMixedTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
moduleExpression
t.moduleExpression(body);
Vedi anche t.isModuleExpression(node, opts) e t.assertModuleExpression(node, opts).
Forma del nodo AST ModuleExpression:
body:Program(obbligatorio)
Alias: Expression
newExpression
t.newExpression(callee, arguments);
Vedi anche t.isNewExpression(node, opts) e t.assertNewExpression(node, opts).
Forma del nodo AST NewExpression:
-
callee:Expression | Super | V8IntrinsicIdentifier(obbligatorio) -
arguments:(Expression | SpreadElement | ArgumentPlaceholder)[](obbligatorio) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
typeArguments:TypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione) -
typeParameters:TSTypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione)
Alias: Standardized, Expression
noop
t.noop();
Vedi anche t.isNoop(node, opts) e t.assertNoop(node, opts).
Alias: Miscellaneous
nullLiteral
t.nullLiteral();
Vedi anche t.isNullLiteral(node, opts) e t.assertNullLiteral(node, opts).
Alias: Standardized, Expression, Pureish, Literal, Immutable
nullLiteralTypeAnnotation
t.nullLiteralTypeAnnotation();
Vedi anche t.isNullLiteralTypeAnnotation(node, opts) e t.assertNullLiteralTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
nullableTypeAnnotation
t.nullableTypeAnnotation(typeAnnotation);
Vedi anche t.isNullableTypeAnnotation(node, opts) e t.assertNullableTypeAnnotation(node, opts).
Forma del nodo AST NullableTypeAnnotation:
typeAnnotation:FlowType(obbligatorio)
numberLiteralTypeAnnotation
t.numberLiteralTypeAnnotation(value);
Vedi anche t.isNumberLiteralTypeAnnotation(node, opts) e t.assertNumberLiteralTypeAnnotation(node, opts).
Forma del nodo AST NumberLiteralTypeAnnotation:
value:number(obbligatorio)
numberTypeAnnotation
t.numberTypeAnnotation();
Vedi anche t.isNumberTypeAnnotation(node, opts) e t.assertNumberTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
numericLiteral
t.numericLiteral(value);
Vedi anche t.isNumericLiteral(node, opts) e t.assertNumericLiteral(node, opts).
Forma del nodo AST NumericLiteral:
value: unnumberfinito non negativo (obbligatorio)
Alias: Standardized, Expression, Pureish, Literal, Immutable
objectExpression
t.objectExpression(properties);
Vedi anche t.isObjectExpression(node, opts) e t.assertObjectExpression(node, opts).
Forma del nodo AST ObjectExpression:
properties:(ObjectMethod | ObjectProperty | SpreadElement)[](obbligatorio)
Alias: Standardized, Expression
objectMethod
t.objectMethod(kind, key, params, body, computed, generator, async);
Vedi anche t.isObjectMethod(node, opts) e t.assertObjectMethod(node, opts).
Forma del nodo AST ObjectMethod:
-
kind:"method" | "get" | "set"(predefinito:'method') -
key: se computed alloraExpressionaltrimentiIdentifier | Literal(obbligatorio) -
params:FunctionParameter[](obbligatorio) -
body:BlockStatement(obbligatorio) -
computed:boolean(predefinito:false) -
generator:boolean(predefinito:false) -
async:boolean(predefinito:false) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
returnType:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder) -
typeParameters:TypeParameterDeclaration | TSTypeParameterDeclaration | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, UserWhitespacable, Function, Scopable, BlockParent, FunctionParent, Method, ObjectMember
objectPattern
t.objectPattern(properties);
Vedi anche t.isObjectPattern(node, opts) e t.assertObjectPattern(node, opts).
Forma del nodo AST ObjectPattern:
-
properties:(RestElement | ObjectProperty)[](obbligatorio) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, FunctionParameter, Pattern, PatternLike, LVal
objectProperty
t.objectProperty(key, value, computed, shorthand, decorators);
Vedi anche t.isObjectProperty(node, opts) e t.assertObjectProperty(node, opts).
Forma del nodo AST ObjectProperty:
-
key: se computed alloraExpressionaltrimentiIdentifier | Literal(obbligatorio) -
value:Expression | PatternLike(obbligatorio) -
computed:boolean(predefinito:false) -
shorthand:boolean(predefinito:false) -
decorators:Decorator[](predefinito:null)
Alias: Standardized, UserWhitespacable, Property, ObjectMember
objectTypeAnnotation
t.objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact);
Vedi anche t.isObjectTypeAnnotation(node, opts) e t.assertObjectTypeAnnotation(node, opts).
Forma del nodo AST ObjectTypeAnnotation:
-
properties:(ObjectTypeProperty | ObjectTypeSpreadProperty)[](obbligatorio) -
indexers:ObjectTypeIndexer[](predefinito:[]) -
callProperties:ObjectTypeCallProperty[](predefinito:[]) -
internalSlots:ObjectTypeInternalSlot[](predefinito:[]) -
exact:boolean(predefinito:false) -
inexact:boolean(predefinito:null, escluso dalla funzione builder)
objectTypeCallProperty
t.objectTypeCallProperty(value);
Vedi anche t.isObjectTypeCallProperty(node, opts) e t.assertObjectTypeCallProperty(node, opts).
Forma del nodo AST ObjectTypeCallProperty:
-
value:FlowType(obbligatorio) -
static:boolean(obbligatorio)
Alias: Flow, UserWhitespacable
objectTypeIndexer
t.objectTypeIndexer(id, key, value, variance);
Vedi anche t.isObjectTypeIndexer(node, opts) e t.assertObjectTypeIndexer(node, opts).
Forma del nodo AST ObjectTypeIndexer:
-
id:Identifier(default:null) -
key:FlowType(obbligatorio) -
value:FlowType(obbligatorio) -
variance:Variance(predefinito:null) -
static:boolean(obbligatorio)
Alias: Flow, UserWhitespacable
objectTypeInternalSlot
t.objectTypeInternalSlot(id, value, optional, static, method);
Vedi anche t.isObjectTypeInternalSlot(node, opts) e t.assertObjectTypeInternalSlot(node, opts).
Forma del nodo AST ObjectTypeInternalSlot:
-
id:Identifier(obbligatorio) -
value:FlowType(obbligatorio) -
optional:boolean(obbligatorio) -
static:boolean(obbligatorio) -
method:boolean(obbligatorio)
Alias: Flow, UserWhitespacable
objectTypeProperty
t.objectTypeProperty(key, value, variance);
Vedi anche t.isObjectTypeProperty(node, opts) e t.assertObjectTypeProperty(node, opts).
Forma del nodo AST ObjectTypeProperty:
-
key:Identifier | StringLiteral(obbligatorio) -
value:FlowType(obbligatorio) -
variance:Variance(predefinito:null) -
kind:"init" | "get" | "set"(obbligatorio) -
method:boolean(obbligatorio) -
optional:boolean(obbligatorio) -
proto:boolean(obbligatorio) -
static:boolean(obbligatorio)
Alias: Flow, UserWhitespacable
objectTypeSpreadProperty
t.objectTypeSpreadProperty(argument);
Vedi anche t.isObjectTypeSpreadProperty(node, opts) e t.assertObjectTypeSpreadProperty(node, opts).
Forma del nodo AST ObjectTypeSpreadProperty:
argument:FlowType(obbligatorio)
Alias: Flow, UserWhitespacable
opaqueType
t.opaqueType(id, typeParameters, supertype, impltype);
Vedi anche t.isOpaqueType(node, opts) e t.assertOpaqueType(node, opts).
Forma del nodo AST OpaqueType:
-
id:Identifier(obbligatorio) -
typeParameters:TypeParameterDeclaration(predefinito:null) -
supertype:FlowType(predefinito:null) -
impltype:FlowType(obbligatorio)
Alias: Flow, FlowDeclaration, Statement, Declaration
optionalCallExpression
t.optionalCallExpression(callee, arguments, optional);
Vedi anche t.isOptionalCallExpression(node, opts) e t.assertOptionalCallExpression(node, opts).
Struttura nodo AST OptionalCallExpression:
-
callee:Expression(obbligatorio) -
arguments:(Expression | SpreadElement | ArgumentPlaceholder)[](obbligatorio) -
optional:boolean(obbligatorio) -
typeArguments:TypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione) -
typeParameters:TSTypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione)
Alias: Standardized, Expression
optionalIndexedAccessType
t.optionalIndexedAccessType(objectType, indexType);
Vedi anche t.isOptionalIndexedAccessType(node, opts) e t.assertOptionalIndexedAccessType(node, opts).
Struttura nodo AST OptionalIndexedAccessType:
-
objectType:FlowType(obbligatorio) -
indexType:FlowType(obbligatorio) -
optional:boolean(obbligatorio)
optionalMemberExpression
t.optionalMemberExpression(object, property, computed, optional);
Vedi anche t.isOptionalMemberExpression(node, opts) e t.assertOptionalMemberExpression(node, opts).
Struttura nodo AST OptionalMemberExpression:
-
object:Expression(obbligatorio) -
property:Expression | Identifier(obbligatorio) -
computed:boolean(predefinito:false) -
optional:boolean(obbligatorio)
Alias: Standardized, Expression
parenthesizedExpression
t.parenthesizedExpression(expression);
Vedi anche t.isParenthesizedExpression(node, opts) e t.assertParenthesizedExpression(node, opts).
Struttura nodo AST ParenthesizedExpression:
expression:Expression(obbligatorio)
Alias: Standardized, Expression, ExpressionWrapper
pipelineBareFunction
t.pipelineBareFunction(callee);
Vedi anche t.isPipelineBareFunction(node, opts) e t.assertPipelineBareFunction(node, opts).
Struttura nodo AST PipelineBareFunction:
callee:Expression(obbligatorio)
Alias: Expression
pipelinePrimaryTopicReference
t.pipelinePrimaryTopicReference();
Vedi anche t.isPipelinePrimaryTopicReference(node, opts) e t.assertPipelinePrimaryTopicReference(node, opts).
Alias: Expression
pipelineTopicExpression
t.pipelineTopicExpression(expression);
Vedi anche t.isPipelineTopicExpression(node, opts) e t.assertPipelineTopicExpression(node, opts).
Struttura nodo AST PipelineTopicExpression:
expression:Expression(obbligatorio)
Alias: Expression
segnaposto
t.placeholder(expectedNode, name);
Vedi anche t.isPlaceholder(node, opts) e t.assertPlaceholder(node, opts).
Forma del nodo AST Placeholder:
-
expectedNode:"Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern"(obbligatorio) -
name:Identifier(obbligatorio) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Miscellaneous
nome privato
t.privateName(id);
Vedi anche t.isPrivateName(node, opts) e t.assertPrivateName(node, opts).
Forma del nodo AST PrivateName:
id:Identifier(obbligatorio)
Alias: Standardized, Private
programma
t.program(body, directives, sourceType, interpreter);
Vedi anche t.isProgram(node, opts) e t.assertProgram(node, opts).
Forma del nodo AST Program:
-
body:Statement[](obbligatorio) -
directives:Directive[](predefinito:[]) -
sourceType:"script" | "module"(default:'script') -
interpreter:InterpreterDirective(default:null)
Alias: Standardized, Scopable, BlockParent, Block
identificatore di tipo qualificato
t.qualifiedTypeIdentifier(id, qualification);
Vedi anche t.isQualifiedTypeIdentifier(node, opts) e t.assertQualifiedTypeIdentifier(node, opts).
Forma del nodo AST QualifiedTypeIdentifier:
-
id:Identifier(obbligatorio) -
qualification:Identifier | QualifiedTypeIdentifier(obbligatorio)
Alias: Flow
espressione record
t.recordExpression(properties);
Vedi anche t.isRecordExpression(node, opts) e t.assertRecordExpression(node, opts).
Forma del nodo AST RecordExpression:
properties:(ObjectProperty | SpreadElement)[](obbligatorio)
Alias: Expression
letterale regex
t.regExpLiteral(pattern, flags);
Vedi anche t.isRegExpLiteral(node, opts) e t.assertRegExpLiteral(node, opts).
Forma del nodo AST RegExpLiteral:
-
pattern:string(obbligatorio) -
flags:string(default:'')
Alias: Standardized, Expression, Pureish, Literal
elemento rest
t.restElement(argument);
Vedi anche t.isRestElement(node, opts) e t.assertRestElement(node, opts).
Struttura del nodo AST RestElement:
-
argument:Identifier | ArrayPattern | ObjectPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | RestElement | AssignmentPattern(obbligatorio) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
typeAnnotation:TypeAnnotation | TSTypeAnnotation | Noop(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, FunctionParameter, PatternLike, LVal
returnStatement
t.returnStatement(argument);
Vedi anche t.isReturnStatement(node, opts) e t.assertReturnStatement(node, opts).
Struttura del nodo AST ReturnStatement:
argument:Expression(default:null)
Alias: Standardized, Statement, Terminatorless, CompletionStatement
sequenceExpression
t.sequenceExpression(expressions);
Vedi anche t.isSequenceExpression(node, opts) e t.assertSequenceExpression(node, opts).
Struttura del nodo AST SequenceExpression:
expressions:Expression[](obbligatorio)
Alias: Standardized, Expression
spreadElement
t.spreadElement(argument);
Vedi anche t.isSpreadElement(node, opts) e t.assertSpreadElement(node, opts).
Struttura del nodo AST SpreadElement:
argument:Expression(obbligatorio)
Alias: Standardized, UnaryLike
staticBlock
t.staticBlock(body);
Vedi anche t.isStaticBlock(node, opts) e t.assertStaticBlock(node, opts).
Struttura del nodo AST StaticBlock:
body:Statement[](obbligatorio)
Alias: Standardized, Scopable, BlockParent, FunctionParent
stringLiteral
t.stringLiteral(value);
Vedi anche t.isStringLiteral(node, opts) e t.assertStringLiteral(node, opts).
Struttura del nodo AST StringLiteral:
value:string(obbligatorio)
Alias: Standardized, Expression, Pureish, Literal, Immutable
stringLiteralTypeAnnotation
t.stringLiteralTypeAnnotation(value);
Vedi anche t.isStringLiteralTypeAnnotation(node, opts) e t.assertStringLiteralTypeAnnotation(node, opts).
Struttura del nodo AST StringLiteralTypeAnnotation:
value:string(obbligatorio)
stringTypeAnnotation
t.stringTypeAnnotation();
Vedi anche t.isStringTypeAnnotation(node, opts) e t.assertStringTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
super
t.super();
Vedi anche t.isSuper(node, opts) e t.assertSuper(node, opts).
Alias: Standardized, Expression
switchCase
t.switchCase(test, consequent);
Vedi anche t.isSwitchCase(node, opts) e t.assertSwitchCase(node, opts).
Struttura del nodo AST SwitchCase:
-
test:Expression(predefinito:null) -
consequent:Statement[](obbligatorio)
Alias: Standardized
switchStatement
t.switchStatement(discriminant, cases);
Vedi anche t.isSwitchStatement(node, opts) e t.assertSwitchStatement(node, opts).
Struttura del nodo AST SwitchStatement:
-
discriminant:Expression(obbligatorio) -
cases:SwitchCase[](obbligatorio)
Alias: Standardized, Statement, BlockParent, Scopable
symbolTypeAnnotation
t.symbolTypeAnnotation();
Vedi anche t.isSymbolTypeAnnotation(node, opts) e t.assertSymbolTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
tsAnyKeyword
t.tsAnyKeyword();
Vedi anche t.isTSAnyKeyword(node, opts) e t.assertTSAnyKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsArrayType
t.tsArrayType(elementType);
Vedi anche t.isTSArrayType(node, opts) e t.assertTSArrayType(node, opts).
Struttura del nodo AST TSArrayType:
elementType:TSType(obbligatorio)
Alias: TypeScript, TSType
tsAsExpression
t.tsAsExpression(expression, typeAnnotation);
Vedi anche t.isTSAsExpression(node, opts) e t.assertTSAsExpression(node, opts).
Struttura del nodo AST TSAsExpression:
-
expression:Expression(obbligatorio) -
typeAnnotation:TSType(obbligatorio)
Alias: TypeScript, Expression, LVal, PatternLike
tsBigIntKeyword
t.tsBigIntKeyword();
Vedi anche t.isTSBigIntKeyword(node, opts) e t.assertTSBigIntKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsBooleanKeyword
t.tsBooleanKeyword();
Vedi anche t.isTSBooleanKeyword(node, opts) e t.assertTSBooleanKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsCallSignatureDeclaration
t.tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation);
Vedi anche t.isTSCallSignatureDeclaration(node, opts) e t.assertTSCallSignatureDeclaration(node, opts).
Forma del nodo AST TSCallSignatureDeclaration:
-
typeParameters:TSTypeParameterDeclaration(predefinito:null) -
parameters:(ArrayPattern | Identifier | ObjectPattern | RestElement)[](obbligatorio) -
typeAnnotation:TSTypeAnnotation(default:null)
Alias: TypeScript, TSTypeElement
tsConditionalType
t.tsConditionalType(checkType, extendsType, trueType, falseType);
Vedi anche t.isTSConditionalType(node, opts) e t.assertTSConditionalType(node, opts).
Forma del nodo AST TSConditionalType:
-
checkType:TSType(required) -
extendsType:TSType(required) -
trueType:TSType(required) -
falseType:TSType(required)
Alias: TypeScript, TSType
tsConstructSignatureDeclaration
t.tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation);
Vedi anche t.isTSConstructSignatureDeclaration(node, opts) e t.assertTSConstructSignatureDeclaration(node, opts).
Forma del nodo AST TSConstructSignatureDeclaration:
-
typeParameters:TSTypeParameterDeclaration(predefinito:null) -
parameters:(ArrayPattern | Identifier | ObjectPattern | RestElement)[](obbligatorio) -
typeAnnotation:TSTypeAnnotation(default:null)
Alias: TypeScript, TSTypeElement
tsConstructorType
t.tsConstructorType(typeParameters, parameters, typeAnnotation);
Vedi anche t.isTSConstructorType(node, opts) e t.assertTSConstructorType(node, opts).
Forma del nodo AST TSConstructorType:
-
typeParameters:TSTypeParameterDeclaration(predefinito:null) -
parameters:(ArrayPattern | Identifier | ObjectPattern | RestElement)[](obbligatorio) -
typeAnnotation:TSTypeAnnotation(default:null) -
abstract:boolean(valore predefinito:null, escluso dalla funzione di costruzione)
Alias: TypeScript, TSType
tsDeclareFunction
t.tsDeclareFunction(id, typeParameters, params, returnType);
Vedi anche t.isTSDeclareFunction(node, opts) e t.assertTSDeclareFunction(node, opts).
Forma del nodo AST TSDeclareFunction:
-
id:Identifier(default:null) -
typeParameters:TSTypeParameterDeclaration | Noop(valore predefinito:null) -
params:FunctionParameter[](obbligatorio) -
returnType:TSTypeAnnotation | Noop(valore predefinito:null) -
async:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
declare:boolean(predefinito:null, escluso dalla funzione builder) -
generator:boolean(valore predefinito:false, escluso dalla funzione di costruzione)
Alias: TypeScript, Statement, Declaration
tsDeclareMethod
t.tsDeclareMethod(decorators, key, typeParameters, params, returnType);
Vedi anche t.isTSDeclareMethod(node, opts) e t.assertTSDeclareMethod(node, opts).
Forma del nodo AST TSDeclareMethod:
-
decorators:Decorator[](predefinito:null) -
key:Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression(obbligatorio) -
typeParameters:TSTypeParameterDeclaration | Noop(valore predefinito:null) -
params:(FunctionParameter | TSParameterProperty)[](obbligatorio) -
returnType:TSTypeAnnotation | Noop(valore predefinito:null) -
abstract:boolean(valore predefinito:null, escluso dalla funzione di costruzione) -
access:"public" | "private" | "protected"(valore predefinito:null, escluso dalla funzione di costruzione) -
accessibility:"public" | "private" | "protected"(predefinito:null, escluso dalla funzione builder) -
async:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
computed:boolean(predefinito:false, escluso dalla funzione builder) -
generator:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
kind:"get" | "set" | "method" | "constructor"(valore predefinito:'method', escluso dalla funzione di costruzione) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
override:boolean(valore predefinito:false, escluso dalla funzione di costruzione) -
static:boolean(valore predefinito:false, escluso dalla funzione di costruzione)
Alias: TypeScript
tsEnumBody
t.tsEnumBody(members);
Vedi anche t.isTSEnumBody(node, opts) e t.assertTSEnumBody(node, opts).
Forma del nodo AST TSEnumBody:
members:TSEnumMember[](obbligatorio)
Alias: TypeScript
tsEnumDeclaration
t.tsEnumDeclaration(id, members);
Vedi anche t.isTSEnumDeclaration(node, opts) e t.assertTSEnumDeclaration(node, opts).
Forma del nodo AST TSEnumDeclaration:
-
id:Identifier(obbligatorio) -
members:TSEnumMember[](obbligatorio) -
body:TSEnumBody(valore predefinito:null, escluso dalla funzione di costruzione) -
const:boolean(predefinito:null, escluso dalla funzione builder) -
declare:boolean(predefinito:null, escluso dalla funzione builder) -
initializer:Expression(valore predefinito:null, escluso dalla funzione di costruzione)
Alias: TypeScript, Statement, Declaration
tsEnumMember
t.tsEnumMember(id, initializer);
Vedi anche t.isTSEnumMember(node, opts) e t.assertTSEnumMember(node, opts).
Struttura del nodo AST TSEnumMember:
-
id:Identifier | StringLiteral(obbligatorio) -
initializer:Expression(default:null)
Alias: TypeScript
tsExportAssignment
t.tsExportAssignment(expression);
Vedi anche t.isTSExportAssignment(node, opts) e t.assertTSExportAssignment(node, opts).
Struttura del nodo AST TSExportAssignment:
expression:Expression(obbligatorio)
Alias: TypeScript, Statement
tsExpressionWithTypeArguments
t.tsExpressionWithTypeArguments(expression, typeParameters);
Vedi anche t.isTSExpressionWithTypeArguments(node, opts) e t.assertTSExpressionWithTypeArguments(node, opts).
Struttura del nodo AST TSExpressionWithTypeArguments:
-
expression:TSEntityName(obbligatorio) -
typeParameters:TSTypeParameterInstantiation(default:null)
Alias: TypeScript, TSType
tsExternalModuleReference
t.tsExternalModuleReference(expression);
Vedi anche t.isTSExternalModuleReference(node, opts) e t.assertTSExternalModuleReference(node, opts).
Struttura del nodo AST TSExternalModuleReference:
expression:StringLiteral(obbligatorio)
Alias: TypeScript
tsFunctionType
t.tsFunctionType(typeParameters, parameters, typeAnnotation);
Vedi anche t.isTSFunctionType(node, opts) e t.assertTSFunctionType(node, opts).
Struttura del nodo AST TSFunctionType:
-
typeParameters:TSTypeParameterDeclaration(predefinito:null) -
parameters:(ArrayPattern | Identifier | ObjectPattern | RestElement)[](obbligatorio) -
typeAnnotation:TSTypeAnnotation(default:null)
Alias: TypeScript, TSType
tsImportEqualsDeclaration
t.tsImportEqualsDeclaration(id, moduleReference);
Vedi anche t.isTSImportEqualsDeclaration(node, opts) e t.assertTSImportEqualsDeclaration(node, opts).
Struttura del nodo AST TSImportEqualsDeclaration:
-
id:Identifier(obbligatorio) -
moduleReference:TSEntityName | TSExternalModuleReference(obbligatorio) -
importKind:"type" | "value"(default:null, escluso dalla funzione di costruzione) -
isExport:boolean(obbligatorio)
Alias: TypeScript, Statement, Declaration
tsImportType
t.tsImportType(argument, qualifier, typeParameters);
Vedi anche t.isTSImportType(node, opts) e t.assertTSImportType(node, opts).
Struttura del nodo AST TSImportType:
-
argument:StringLiteral(obbligatorio) -
qualifier:TSEntityName(predefinito:null) -
typeParameters:TSTypeParameterInstantiation(default:null) -
options:ObjectExpression(predefinito:null, escluso dalla funzione builder)
Alias: TypeScript, TSType
tsIndexSignature
t.tsIndexSignature(parameters, typeAnnotation);
Vedi anche t.isTSIndexSignature(node, opts) e t.assertTSIndexSignature(node, opts).
Forma del nodo AST TSIndexSignature:
-
parameters:Identifier[](obbligatorio) -
typeAnnotation:TSTypeAnnotation(default:null) -
readonly:boolean(predefinito:null, escluso dalla funzione builder) -
static:boolean(predefinito:null, escluso dalla funzione builder)
Alias: TypeScript, TSTypeElement
tsIndexedAccessType
t.tsIndexedAccessType(objectType, indexType);
Vedi anche t.isTSIndexedAccessType(node, opts) e t.assertTSIndexedAccessType(node, opts).
Forma del nodo AST TSIndexedAccessType:
-
objectType:TSType(obbligatorio) -
indexType:TSType(obbligatorio)
Alias: TypeScript, TSType
tsInferType
t.tsInferType(typeParameter);
Vedi anche t.isTSInferType(node, opts) e t.assertTSInferType(node, opts).
Forma del nodo AST TSInferType:
typeParameter:TSTypeParameter(obbligatorio)
Alias: TypeScript, TSType
tsInstantiationExpression
t.tsInstantiationExpression(expression, typeParameters);
Vedi anche t.isTSInstantiationExpression(node, opts) e t.assertTSInstantiationExpression(node, opts).
Forma del nodo AST TSInstantiationExpression:
-
expression:Expression(obbligatorio) -
typeParameters:TSTypeParameterInstantiation(default:null)
Alias: TypeScript, Expression
tsInterfaceBody
t.tsInterfaceBody(body);
Vedi anche t.isTSInterfaceBody(node, opts) e t.assertTSInterfaceBody(node, opts).
Forma del nodo AST TSInterfaceBody:
body:TSTypeElement[](obbligatorio)
Alias: TypeScript
tsInterfaceDeclaration
t.tsInterfaceDeclaration(id, typeParameters, extends, body);
Vedi anche t.isTSInterfaceDeclaration(node, opts) e t.assertTSInterfaceDeclaration(node, opts).
Forma del nodo AST TSInterfaceDeclaration:
-
id:Identifier(obbligatorio) -
typeParameters:TSTypeParameterDeclaration(predefinito:null) -
extends:TSExpressionWithTypeArguments[](predefinito:null) -
body:TSInterfaceBody(obbligatorio) -
declare:boolean(predefinito:null, escluso dalla funzione builder)
Alias: TypeScript, Statement, Declaration
tsIntersectionType
t.tsIntersectionType(types);
Vedi anche t.isTSIntersectionType(node, opts) e t.assertTSIntersectionType(node, opts).
Forma del nodo AST TSIntersectionType:
types:TSType[](obbligatorio)
Alias: TypeScript, TSType
tsIntrinsicKeyword
t.tsIntrinsicKeyword();
Vedi anche t.isTSIntrinsicKeyword(node, opts) e t.assertTSIntrinsicKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsLiteralType
t.tsLiteralType(literal);
Vedi anche t.isTSLiteralType(node, opts) e t.assertTSLiteralType(node, opts).
Forma del nodo AST TSLiteralType:
literal:NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TemplateLiteral | UnaryExpression(obbligatorio)
Alias: TypeScript, TSType, TSBaseType
tsMappedType
t.tsMappedType(typeParameter, typeAnnotation, nameType);
Vedi anche t.isTSMappedType(node, opts) e t.assertTSMappedType(node, opts).
Forma del nodo AST TSMappedType:
-
typeParameter:TSTypeParameter(obbligatorio) -
typeAnnotation:TSType(predefinito:null) -
nameType:TSType(predefinito:null) -
optional:true | false | "+" | "-"(predefinito:null, escluso dalla funzione di costruzione) -
readonly:true | false | "+" | "-"(predefinito:null, escluso dalla funzione di costruzione)
Alias: TypeScript, TSType
tsMethodSignature
t.tsMethodSignature(key, typeParameters, parameters, typeAnnotation);
Vedi anche t.isTSMethodSignature(node, opts) e t.assertTSMethodSignature(node, opts).
Forma del nodo AST TSMethodSignature:
-
key:Expression(richiesto) -
typeParameters:TSTypeParameterDeclaration(predefinito:null) -
parameters:(ArrayPattern | Identifier | ObjectPattern | RestElement)[](obbligatorio) -
typeAnnotation:TSTypeAnnotation(default:null) -
computed:boolean(predefinito:false, escluso dalla funzione builder) -
kind:"method" | "get" | "set"(obbligatorio) -
optional:boolean(predefinito:null, escluso dalla funzione builder)
Alias: TypeScript, TSTypeElement
tsModuleBlock
t.tsModuleBlock(body);
Vedi anche t.isTSModuleBlock(node, opts) e t.assertTSModuleBlock(node, opts).
Forma del nodo AST TSModuleBlock:
body:Statement[](obbligatorio)
Alias: TypeScript, Scopable, Block, BlockParent, FunctionParent
tsModuleDeclaration
t.tsModuleDeclaration(id, body);
Vedi anche t.isTSModuleDeclaration(node, opts) e t.assertTSModuleDeclaration(node, opts).
Forma del nodo AST TSModuleDeclaration:
-
id:Identifier | StringLiteral(obbligatorio) -
body:TSModuleBlock | TSModuleDeclaration(obbligatorio) -
declare:boolean(predefinito:null, escluso dalla funzione builder) -
global:boolean(predefinito:null, escluso dalla funzione builder) -
kind:"global" | "module" | "namespace"(obbligatorio)
Alias: TypeScript, Statement, Declaration
tsNamedTupleMember
t.tsNamedTupleMember(label, elementType, optional);
Vedi anche t.isTSNamedTupleMember(node, opts) e t.assertTSNamedTupleMember(node, opts).
Forma del nodo AST TSNamedTupleMember:
-
label:Identifier(obbligatorio) -
elementType:TSType(obbligatorio) -
optional:boolean(predefinito:false)
Alias: TypeScript
tsNamespaceExportDeclaration
t.tsNamespaceExportDeclaration(id);
Vedi anche t.isTSNamespaceExportDeclaration(node, opts) e t.assertTSNamespaceExportDeclaration(node, opts).
Forma del nodo AST TSNamespaceExportDeclaration:
id:Identifier(obbligatorio)
Alias: TypeScript, Statement
tsNeverKeyword
t.tsNeverKeyword();
Vedi anche t.isTSNeverKeyword(node, opts) e t.assertTSNeverKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsNonNullExpression
t.tsNonNullExpression(expression);
Vedi anche t.isTSNonNullExpression(node, opts) e t.assertTSNonNullExpression(node, opts).
Forma del nodo AST TSNonNullExpression:
expression:Expression(obbligatorio)
Alias: TypeScript, Expression, LVal, PatternLike
tsNullKeyword
t.tsNullKeyword();
Vedi anche t.isTSNullKeyword(node, opts) e t.assertTSNullKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsNumberKeyword
t.tsNumberKeyword();
Vedi anche t.isTSNumberKeyword(node, opts) e t.assertTSNumberKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsObjectKeyword
t.tsObjectKeyword();
Vedi anche t.isTSObjectKeyword(node, opts) e t.assertTSObjectKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsOptionalType
t.tsOptionalType(typeAnnotation);
Vedi anche t.isTSOptionalType(node, opts) e t.assertTSOptionalType(node, opts).
Struttura del nodo AST TSOptionalType:
typeAnnotation:TSType(obbligatorio)
Alias: TypeScript, TSType
tsParameterProperty
t.tsParameterProperty(parameter);
Vedi anche t.isTSParameterProperty(node, opts) e t.assertTSParameterProperty(node, opts).
Struttura del nodo AST TSParameterProperty:
-
parameter:Identifier | AssignmentPattern(richiesto) -
accessibility:"public" | "private" | "protected"(predefinito:null, escluso dalla funzione builder) -
decorators:Decorator[](predefinito:null, escluso dalla funzione builder) -
override:boolean(predefinito:null, escluso dalla funzione builder) -
readonly:boolean(predefinito:null, escluso dalla funzione builder)
Alias: TypeScript, LVal
tsParenthesizedType
t.tsParenthesizedType(typeAnnotation);
Vedi anche t.isTSParenthesizedType(node, opts) e t.assertTSParenthesizedType(node, opts).
Struttura del nodo AST TSParenthesizedType:
typeAnnotation:TSType(obbligatorio)
Alias: TypeScript, TSType
tsPropertySignature
t.tsPropertySignature(key, typeAnnotation);
Vedi anche t.isTSPropertySignature(node, opts) e t.assertTSPropertySignature(node, opts).
Struttura del nodo AST TSPropertySignature:
-
key:Expression(richiesto) -
typeAnnotation:TSTypeAnnotation(default:null) -
computed:boolean(predefinito:false, escluso dalla funzione builder) -
kind:"get" | "set"(predefinito:null, escluso dalla funzione builder) -
optional:boolean(predefinito:null, escluso dalla funzione builder) -
readonly:boolean(predefinito:null, escluso dalla funzione builder)
Alias: TypeScript, TSTypeElement
tsQualifiedName
t.tsQualifiedName(left, right);
Vedi anche t.isTSQualifiedName(node, opts) e t.assertTSQualifiedName(node, opts).
Struttura del nodo AST TSQualifiedName:
-
left:TSEntityName(richiesto) -
right:Identifier(richiesto)
Alias: TypeScript, TSEntityName
tsRestType
t.tsRestType(typeAnnotation);
Vedi anche t.isTSRestType(node, opts) e t.assertTSRestType(node, opts).
Forma del nodo AST TSRestType:
typeAnnotation:TSType(obbligatorio)
Alias: TypeScript, TSType
tsSatisfiesExpression
t.tsSatisfiesExpression(expression, typeAnnotation);
History
| Version | Changes |
|---|---|
v7.20.0 | Introduced |
Vedi anche t.isTSSatisfiesExpression(node, opts) e t.assertTSSatisfiesExpression(node, opts).
Forma del nodo AST TSSatisfiesExpression:
-
expression:Expression(obbligatorio) -
typeAnnotation:TSType(obbligatorio)
Alias: TypeScript, Expression, LVal, PatternLike
tsStringKeyword
t.tsStringKeyword();
Vedi anche t.isTSStringKeyword(node, opts) e t.assertTSStringKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsSymbolKeyword
t.tsSymbolKeyword();
Vedi anche t.isTSSymbolKeyword(node, opts) e t.assertTSSymbolKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsTemplateLiteralType
t.tsTemplateLiteralType(quasis, types);
Vedi anche t.isTSTemplateLiteralType(node, opts) e t.assertTSTemplateLiteralType(node, opts).
Forma del nodo AST TSTemplateLiteralType:
-
quasis:TemplateElement[](obbligatorio) -
types:TSType[](obbligatorio)
Alias: TypeScript, TSType, TSBaseType
tsThisType
t.tsThisType();
Vedi anche t.isTSThisType(node, opts) e t.assertTSThisType(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsTupleType
t.tsTupleType(elementTypes);
Vedi anche t.isTSTupleType(node, opts) e t.assertTSTupleType(node, opts).
Forma del nodo AST TSTupleType:
elementTypes:(TSType | TSNamedTupleMember)[](obbligatorio)
Alias: TypeScript, TSType
tsTypeAliasDeclaration
t.tsTypeAliasDeclaration(id, typeParameters, typeAnnotation);
Vedi anche t.isTSTypeAliasDeclaration(node, opts) e t.assertTSTypeAliasDeclaration(node, opts).
Forma del nodo AST TSTypeAliasDeclaration:
-
id:Identifier(obbligatorio) -
typeParameters:TSTypeParameterDeclaration(predefinito:null) -
typeAnnotation:TSType(obbligatorio) -
declare:boolean(predefinito:null, escluso dalla funzione builder)
Alias: TypeScript, Statement, Declaration
tsTypeAnnotation
t.tsTypeAnnotation(typeAnnotation);
Vedi anche t.isTSTypeAnnotation(node, opts) e t.assertTSTypeAnnotation(node, opts).
Struttura del nodo AST TSTypeAnnotation:
typeAnnotation:TSType(obbligatorio)
Alias: TypeScript
tsTypeAssertion
t.tsTypeAssertion(typeAnnotation, expression);
Vedi anche t.isTSTypeAssertion(node, opts) e t.assertTSTypeAssertion(node, opts).
Struttura del nodo AST TSTypeAssertion:
-
typeAnnotation:TSType(obbligatorio) -
expression:Expression(obbligatorio)
Alias: TypeScript, Expression, LVal, PatternLike
tsTypeLiteral
t.tsTypeLiteral(members);
Vedi anche t.isTSTypeLiteral(node, opts) e t.assertTSTypeLiteral(node, opts).
Struttura del nodo AST TSTypeLiteral:
members:TSTypeElement[](obbligatorio)
Alias: TypeScript, TSType
tsTypeOperator
t.tsTypeOperator(typeAnnotation, operator);
Vedi anche t.isTSTypeOperator(node, opts) e t.assertTSTypeOperator(node, opts).
Struttura del nodo AST TSTypeOperator:
-
typeAnnotation:TSType(obbligatorio) -
operator:string(predefinito:'keyof')
Alias: TypeScript, TSType
tsTypeParameter
t.tsTypeParameter(constraint, default, name);
History
| Version | Changes |
|---|---|
v7.21.0 | Supports const |
Vedi anche t.isTSTypeParameter(node, opts) e t.assertTSTypeParameter(node, opts).
Struttura del nodo AST TSTypeParameter:
-
constraint:TSType(predefinito:null) -
default:TSType(predefinito:null) -
name:string(obbligatorio) -
const:boolean(predefinito:null, escluso dalla funzione builder) -
in:boolean(predefinito:null, escluso dalla funzione builder) -
out:boolean(predefinito:null, escluso dalla funzione builder)
Alias: TypeScript
tsTypeParameterDeclaration
t.tsTypeParameterDeclaration(params);
Vedi anche t.isTSTypeParameterDeclaration(node, opts) e t.assertTSTypeParameterDeclaration(node, opts).
Struttura del nodo AST TSTypeParameterDeclaration:
params:TSTypeParameter[](obbligatorio)
Alias: TypeScript
tsTypeParameterInstantiation
t.tsTypeParameterInstantiation(params);
Vedi anche t.isTSTypeParameterInstantiation(node, opts) e t.assertTSTypeParameterInstantiation(node, opts).
Struttura del nodo AST TSTypeParameterInstantiation:
params:TSType[](obbligatorio)
Alias: TypeScript
tsTypePredicate
t.tsTypePredicate(parameterName, typeAnnotation, asserts);
Vedi anche t.isTSTypePredicate(node, opts) e t.assertTSTypePredicate(node, opts).
Struttura del nodo AST TSTypePredicate:
-
parameterName:Identifier | TSThisType(obbligatorio) -
typeAnnotation:TSTypeAnnotation(default:null) -
asserts:boolean(default:null)
Alias: TypeScript, TSType
tsTypeQuery
t.tsTypeQuery(exprName, typeParameters);
Vedi anche t.isTSTypeQuery(node, opts) e t.assertTSTypeQuery(node, opts).
Struttura del nodo AST TSTypeQuery:
-
exprName:TSEntityName | TSImportType(obbligatorio) -
typeParameters:TSTypeParameterInstantiation(default:null)
Alias: TypeScript, TSType
tsTypeReference
t.tsTypeReference(typeName, typeParameters);
Vedi anche t.isTSTypeReference(node, opts) e t.assertTSTypeReference(node, opts).
Struttura del nodo AST TSTypeReference:
-
typeName:TSEntityName(obbligatorio) -
typeParameters:TSTypeParameterInstantiation(default:null)
Alias: TypeScript, TSType
tsUndefinedKeyword
t.tsUndefinedKeyword();
Vedi anche t.isTSUndefinedKeyword(node, opts) e t.assertTSUndefinedKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsUnionType
t.tsUnionType(types);
Vedi anche t.isTSUnionType(node, opts) e t.assertTSUnionType(node, opts).
Struttura del nodo AST TSUnionType:
types:TSType[](obbligatorio)
Alias: TypeScript, TSType
tsUnknownKeyword
t.tsUnknownKeyword();
Vedi anche t.isTSUnknownKeyword(node, opts) e t.assertTSUnknownKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
tsVoidKeyword
t.tsVoidKeyword();
Vedi anche t.isTSVoidKeyword(node, opts) e t.assertTSVoidKeyword(node, opts).
Alias: TypeScript, TSType, TSBaseType
Espressione di Template con Tag
t.taggedTemplateExpression(tag, quasi);
Vedi anche t.isTaggedTemplateExpression(node, opts) e t.assertTaggedTemplateExpression(node, opts).
Forma del nodo AST TaggedTemplateExpression:
-
tag:Expression(obbligatorio) -
quasi:TemplateLiteral(obbligatorio) -
typeParameters:TypeParameterInstantiation | TSTypeParameterInstantiation(predefinito:null, escluso dalla funzione di costruzione)
Alias: Standardized, Expression
Elemento Template
t.templateElement(value, tail);
Vedi anche t.isTemplateElement(node, opts) e t.assertTemplateElement(node, opts).
Forma del nodo AST TemplateElement:
-
value:{ raw: string, cooked?: string }(obbligatorio) -
tail:boolean(predefinito:false)
Alias: Standardized
Template Literal
t.templateLiteral(quasis, expressions);
Vedi anche t.isTemplateLiteral(node, opts) e t.assertTemplateLiteral(node, opts).
Forma del nodo AST TemplateLiteral:
-
quasis:TemplateElement[](obbligatorio) -
expressions:(Expression | TSType)[](obbligatorio)
Alias: Standardized, Expression, Literal
Espressione This
t.thisExpression();
Vedi anche t.isThisExpression(node, opts) e t.assertThisExpression(node, opts).
Alias: Standardized, Expression
Annotazione del Tipo This
t.thisTypeAnnotation();
Vedi anche t.isThisTypeAnnotation(node, opts) e t.assertThisTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
Istruzione Throw
t.throwStatement(argument);
Vedi anche t.isThrowStatement(node, opts) e t.assertThrowStatement(node, opts).
Forma del nodo AST ThrowStatement:
argument:Expression(obbligatorio)
Alias: Standardized, Statement, Terminatorless, CompletionStatement
Riferimento all'Argomento
t.topicReference();
Vedi anche t.isTopicReference(node, opts) e t.assertTopicReference(node, opts).
Alias: Expression
Istruzione Try
t.tryStatement(block, handler, finalizer);
Vedi anche t.isTryStatement(node, opts) e t.assertTryStatement(node, opts).
Forma del nodo AST TryStatement:
-
block:BlockStatement(obbligatorio) -
handler:CatchClause(predefinito:null) -
finalizer:BlockStatement(predefinito:null)
Alias: Standardized, Statement
Espressione Tupla
t.tupleExpression(elements);
Vedi anche t.isTupleExpression(node, opts) e t.assertTupleExpression(node, opts).
Forma del nodo AST TupleExpression:
elements:(Expression | SpreadElement)[](predefinito:[])
Alias: Expression
tupleTypeAnnotation
t.tupleTypeAnnotation(types);
Vedi anche t.isTupleTypeAnnotation(node, opts) e t.assertTupleTypeAnnotation(node, opts).
Forma del nodo AST TupleTypeAnnotation:
types:FlowType[](obbligatorio)
typeAlias
t.typeAlias(id, typeParameters, right);
Vedi anche t.isTypeAlias(node, opts) e t.assertTypeAlias(node, opts).
Forma del nodo AST TypeAlias:
-
id:Identifier(obbligatorio) -
typeParameters:TypeParameterDeclaration(predefinito:null) -
right:FlowType(obbligatorio)
Alias: Flow, FlowDeclaration, Statement, Declaration
typeAnnotation
t.typeAnnotation(typeAnnotation);
Vedi anche t.isTypeAnnotation(node, opts) e t.assertTypeAnnotation(node, opts).
Forma del nodo AST TypeAnnotation:
typeAnnotation:FlowType(obbligatorio)
Alias: Flow
typeCastExpression
t.typeCastExpression(expression, typeAnnotation);
Vedi anche t.isTypeCastExpression(node, opts) e t.assertTypeCastExpression(node, opts).
Forma del nodo AST TypeCastExpression:
-
expression:Expression(obbligatorio) -
typeAnnotation:TypeAnnotation(obbligatorio)
Alias: Flow, ExpressionWrapper, Expression
typeParameter
t.typeParameter(bound, default, variance);
Vedi anche t.isTypeParameter(node, opts) e t.assertTypeParameter(node, opts).
Forma del nodo AST TypeParameter:
-
bound:TypeAnnotation(predefinito:null) -
default:FlowType(predefinito:null) -
variance:Variance(predefinito:null) -
name:string(obbligatorio)
Alias: Flow
typeParameterDeclaration
t.typeParameterDeclaration(params);
Vedi anche t.isTypeParameterDeclaration(node, opts) e t.assertTypeParameterDeclaration(node, opts).
Forma del nodo AST TypeParameterDeclaration:
params:TypeParameter[](obbligatorio)
Alias: Flow
typeParameterInstantiation
t.typeParameterInstantiation(params);
Vedi anche t.isTypeParameterInstantiation(node, opts) e t.assertTypeParameterInstantiation(node, opts).
Forma del nodo AST TypeParameterInstantiation:
params:FlowType[](obbligatorio)
Alias: Flow
typeofTypeAnnotation
t.typeofTypeAnnotation(argument);
Vedi anche t.isTypeofTypeAnnotation(node, opts) e t.assertTypeofTypeAnnotation(node, opts).
Forma del nodo AST TypeofTypeAnnotation:
argument:FlowType(obbligatorio)
unaryExpression
t.unaryExpression(operator, argument, prefix);
Vedi anche t.isUnaryExpression(node, opts) e t.assertUnaryExpression(node, opts).
Forma del nodo AST UnaryExpression:
-
operator:"void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof"(obbligatorio) -
argument:Expression(obbligatorio) -
prefix:boolean(predefinito:true)
Alias: Standardized, UnaryLike, Expression
unionTypeAnnotation
t.unionTypeAnnotation(types);
Vedi anche t.isUnionTypeAnnotation(node, opts) e t.assertUnionTypeAnnotation(node, opts).
Forma del nodo AST UnionTypeAnnotation:
types:FlowType[](obbligatorio)
updateExpression
t.updateExpression(operator, argument, prefix);
Vedi anche t.isUpdateExpression(node, opts) e t.assertUpdateExpression(node, opts).
Forma del nodo AST UpdateExpression:
-
operator:"++" | "--"(obbligatorio) -
argument:Expression(obbligatorio) -
prefix:boolean(predefinito:false)
Alias: Standardized, Expression
v8IntrinsicIdentifier
t.v8IntrinsicIdentifier(name);
Vedi anche t.isV8IntrinsicIdentifier(node, opts) e t.assertV8IntrinsicIdentifier(node, opts).
Forma del nodo AST V8IntrinsicIdentifier:
name:string(obbligatorio)
Alias: Miscellaneous
variableDeclaration
t.variableDeclaration(kind, declarations);
History
| Version | Changes |
|---|---|
v7.20.0 | kind can be "using". |
v7.22.0 | kind can be "await using". |
Vedi anche t.isVariableDeclaration(node, opts) e t.assertVariableDeclaration(node, opts).
Forma del nodo AST VariableDeclaration:
-
kind:"var" | "let" | "const" | "using" | "await using"(obbligatorio) -
declarations:VariableDeclarator[](obbligatorio) -
declare:boolean(predefinito:null, escluso dalla funzione builder)
Alias: Standardized, Statement, Declaration
variableDeclarator
t.variableDeclarator(id, init);
Vedi anche t.isVariableDeclarator(node, opts) e t.assertVariableDeclarator(node, opts).
Forma del nodo AST VariableDeclarator:
-
id:LVal | VoidPattern(obbligatorio) -
init:Expression(default:null) -
definite:boolean(default:null, escluso dalla funzione builder)
Alias: Standardized
variance
t.variance(kind);
Vedi anche t.isVariance(node, opts) e t.assertVariance(node, opts).
Forma del nodo AST Variance:
kind:"minus" | "plus"(obbligatorio)
Alias: Flow
voidPattern
t.voidPattern();
History
| Version | Changes |
|---|---|
v7.28.0 | Introduced |
Vedi anche t.isVoidPattern(node, opts) e t.assertVoidPattern(node, opts).
Alias: Pattern, PatternLike, FunctionParameter
voidTypeAnnotation
t.voidTypeAnnotation();
Vedi anche t.isVoidTypeAnnotation(node, opts) e t.assertVoidTypeAnnotation(node, opts).
Alias: Flow, FlowType, FlowBaseAnnotation
whileStatement
t.whileStatement(test, body);
Vedi anche t.isWhileStatement(node, opts) e t.assertWhileStatement(node, opts).
Forma del nodo AST WhileStatement:
-
test:Expression(obbligatorio) -
body:Statement(obbligatorio)
Alias: Standardized, Statement, BlockParent, Loop, While, Scopable
withStatement
t.withStatement(object, body);
Vedi anche t.isWithStatement(node, opts) e t.assertWithStatement(node, opts).
Forma del nodo AST WithStatement:
-
object:Expression(obbligatorio) -
body:Statement(obbligatorio)
Alias: Standardized, Statement
yieldExpression
t.yieldExpression(argument, delegate);
Vedi anche t.isYieldExpression(node, opts) e t.assertYieldExpression(node, opts).
Forma del nodo AST YieldExpression:
-
argument:Expression(default:null) -
delegate:boolean(default:false)
Alias: Standardized, Expression, Terminatorless
Alias
Accessor
Deprecato. Verrà rimosso in Babel 8.
t.isAccessor(node);
Nodi inclusi:
Binary
Copertura per BinaryExpression e LogicalExpression, che condividono la stessa forma AST.
t.isBinary(node);
Nodi inclusi:
Block
Deprecato. Verrà rimosso in Babel 8.
t.isBlock(node);
Nodi inclusi:
BlockParent
Copertura di nodi AST che iniziano un contesto di esecuzione con un nuovo LexicalEnvironment. In altre parole, definiscono l'ambito delle dichiarazioni let e const.
t.isBlockParent(node);
Nodi inclusi:
Class
Copertura di ClassExpression e ClassDeclaration, che condividono la stessa struttura AST.
t.isClass(node);
Nodi inclusi:
CompletionStatement
Istruzione che indica i record di completamento. In altre parole, definiscono il flusso di controllo del programma, ad esempio quando un ciclo deve interrompersi o un'azione genera errori critici.
t.isCompletionStatement(node);
Nodi inclusi:
Conditional
Copertura di ConditionalExpression e IfStatement, che condividono la stessa struttura AST.
t.isConditional(node);
Nodi inclusi:
Declaration
Copertura di qualsiasi Dichiarazione.
t.isDeclaration(node);
Nodi inclusi:
EnumBody
Una copertura dei corpi di enum di Flow.
t.isEnumBody(node);
Nodi inclusi:
EnumMember
Una copertura dei membri di enum di Flow.
t.isEnumMember(node);
Nodi inclusi:
ExportDeclaration
Una copertura per qualsiasi ExportDeclaration.
t.isExportDeclaration(node);
Nodi inclusi:
Expression
Una copertura per qualsiasi Expression.
t.isExpression(node);
Nodi inclusi:
ExpressionWrapper
Un involucro per espressioni privo di semantica runtime.
t.isExpressionWrapper(node);
Nodi inclusi:
Flow
Raccolta di nodi AST definiti per Flow.
t.isFlow(node);
Nodi inclusi:
FlowBaseAnnotation
Categoria delle annotazioni di tipo primarie in Flow.
t.isFlowBaseAnnotation(node);
Nodi inclusi:
FlowDeclaration
Categoria delle dichiarazioni Flow.
t.isFlowDeclaration(node);
Nodi inclusi:
FlowPredicate
Categoria dei predicati Flow.
t.isFlowPredicate(node);
Nodi inclusi:
FlowType
Categoria delle annotazioni di tipo Flow.
t.isFlowType(node);
Nodi inclusi:
For
Raggruppa le istruzioni ForStatement e ForXStatement.
t.isFor(node);
Nodi inclusi:
ForXStatement
Raggruppa le istruzioni ForIn e ForOf.
t.isForXStatement(node);
Nodi inclusi:
Function
Raggruppa funzioni e metodi, che devono avere body e params. Nota: Function è diverso da FunctionParent. Ad esempio, uno StaticBlock è un FunctionParent ma non una Function.
t.isFunction(node);
Nodi inclusi:
FunctionParameter
Raggruppa i parametri di funzione, che sono elementi della FormalParameterList.
t.isFunctionParameter(node);
Nodi inclusi:
FunctionParent
Un insieme di nodi AST che avviano un contesto di esecuzione con un nuovo VariableEnvironment. In altre parole, definiscono l'ambito delle dichiarazioni var. FunctionParent non includeva Program a partire da Babel 7.
t.isFunctionParent(node);
Nodi inclusi:
Immutabile
Un insieme di oggetti immutabili ed elementi JSX. Un oggetto è considerato immutabile se non è possibile definire altre proprietà dopo la sua creazione.
t.isImmutable(node);
Nodi inclusi:
ImportOrExportDeclaration
History
| Version | Changes |
|---|---|
v7.21.0 | Introduced |
Un insieme che comprende ImportDeclaration e ExportDeclaration.
t.isImportOrExportDeclaration(node);
Nodi inclusi:
JSX
Un insieme di nodi AST definiti per JSX.
t.isJSX(node);
Nodi inclusi:
LVal
Raggruppa le espressioni del lato sinistro (left-hand side) utilizzate nel membro left delle espressioni di assegnamento e nei cicli ForXStatement.
t.isLVal(node);
Nodi inclusi:
Literal
Raggruppa i Literal, Regular Expression Literal e Template Literal.
t.isLiteral(node);
Nodi inclusi:
Loop
Raggruppa le istruzioni di ciclo.
t.isLoop(node);
Nodi inclusi:
Method
Raggruppa i metodi di oggetto e di classe.
t.isMethod(node);
Nodi inclusi:
Varie
Raggruppa tipi AST non standard utili per lo sviluppo.
t.isMiscellaneous(node);
Nodi inclusi:
ModuleDeclaration
History
| Version | Changes |
|---|---|
v7.21.0 | Deprecated |
Deprecato, utilizza invece ImportOrExportDeclaration. Consulta PR #15266 per le note di migrazione.
t.isModuleDeclaration(node);
Nodi inclusi:
ModuleSpecifier
Copre gli specificatori di importazione ed esportazione. Nota: non è il ModuleSpecifier definito nello standard.
t.isModuleSpecifier(node);
Nodi inclusi:
ObjectMember
Copre i membri in un oggetto letterale.
t.isObjectMember(node);
Nodi inclusi:
Pattern
Copre i BindingPattern eccetto gli Identifiers.
t.isPattern(node);
Nodi inclusi:
PatternLike
Copre i BindingPattern.
t.isPatternLike(node);
Nodi inclusi:
Private
Copre gli elementi privati delle classi e gli identificatori privati.
t.isPrivate(node);
Nodi inclusi:
Property
Copre le proprietà degli oggetti e le proprietà delle classi.
t.isProperty(node);
Nodi inclusi:
Pureish
Una categoria di nodi AST che non producono effetti collaterali. In altre parole, non causano cambiamenti osservabili nel comportamento se valutati più volte.
t.isPureish(node);
Nodi inclusi:
Ambito
Una categoria che include FunctionParent e BlockParent.
t.isScopable(node);
Nodi inclusi:
Standardizzati
Una categoria di nodi AST che fanno parte di una specifica ECMAScript ufficiale.
t.isStandardized(node);
Nodi inclusi:
Istruzione
Include ogni tipo di Statement.
t.isStatement(node);
Nodi inclusi:
TSBaseType
Una categoria delle annotazioni di tipo primarie di TypeScript.
t.isTSBaseType(node);
Nodi inclusi:
TSEntityName
Una categoria delle entità di TypeScript.
t.isTSEntityName(node);
Nodi inclusi:
TSType
Una categoria delle annotazioni di tipo di TypeScript.
t.isTSType(node);
Nodi inclusi:
TSTypeElement
Un insieme di dichiarazioni di tipo TypeScript.
t.isTSTypeElement(node);
Nodi inclusi:
Terminatorless
Un insieme di nodi AST la cui semantica cambia quando viene inserito un terminatore di riga tra l'operatore e l'operando.
t.isTerminatorless(node);
Nodi inclusi:
TypeScript
Un insieme di nodi AST definiti per TypeScript.
t.isTypeScript(node);
Nodi inclusi:
Operatori Unari e Simili
Una categoria che comprende UnaryExpression e SpreadElement.
t.isUnaryLike(node);
Nodi inclusi:
Elementi con Spaziature Utente
Deprecato. Verrà rimosso in Babel 8.
t.isUserWhitespacable(node);
Nodi inclusi:
Cicli While
Una categoria che comprende DoWhileStatement e WhileStatement, che condividono la stessa struttura AST.
t.isWhile(node);
Nodi inclusi: