| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029 |
- # babel-types
- > This module contains methods for building ASTs manually and for checking the types of AST nodes.
- ## Install
- ```sh
- npm install --save-dev babel-types
- ```
- ## API
- <!-- begin generated section -->
- ### anyTypeAnnotation
- ```javascript
- t.anyTypeAnnotation()
- ```
- See also `t.isAnyTypeAnnotation(node, opts)` and `t.assertAnyTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### arrayExpression
- ```javascript
- t.arrayExpression(elements)
- ```
- See also `t.isArrayExpression(node, opts)` and `t.assertArrayExpression(node, opts)`.
- Aliases: `Expression`
- - `elements`: `Array<null | Expression | SpreadElement>` (default: `[]`)
- ---
- ### arrayPattern
- ```javascript
- t.arrayPattern(elements, typeAnnotation)
- ```
- See also `t.isArrayPattern(node, opts)` and `t.assertArrayPattern(node, opts)`.
- Aliases: `Pattern`, `LVal`
- - `elements`: `Array<Identifier | Pattern | RestElement>` (required)
- - `typeAnnotation` (required)
- - `decorators`: `Array<Decorator>` (default: `null`)
- ---
- ### arrayTypeAnnotation
- ```javascript
- t.arrayTypeAnnotation(elementType)
- ```
- See also `t.isArrayTypeAnnotation(node, opts)` and `t.assertArrayTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `elementType` (required)
- ---
- ### arrowFunctionExpression
- ```javascript
- t.arrowFunctionExpression(params, body, async)
- ```
- See also `t.isArrowFunctionExpression(node, opts)` and `t.assertArrowFunctionExpression(node, opts)`.
- Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish`
- - `params`: `Array<LVal>` (required)
- - `body`: `BlockStatement | Expression` (required)
- - `async`: `boolean` (default: `false`)
- - `returnType` (default: `null`)
- - `typeParameters` (default: `null`)
- ---
- ### assignmentExpression
- ```javascript
- t.assignmentExpression(operator, left, right)
- ```
- See also `t.isAssignmentExpression(node, opts)` and `t.assertAssignmentExpression(node, opts)`.
- Aliases: `Expression`
- - `operator`: `string` (required)
- - `left`: `LVal` (required)
- - `right`: `Expression` (required)
- ---
- ### assignmentPattern
- ```javascript
- t.assignmentPattern(left, right)
- ```
- See also `t.isAssignmentPattern(node, opts)` and `t.assertAssignmentPattern(node, opts)`.
- Aliases: `Pattern`, `LVal`
- - `left`: `Identifier` (required)
- - `right`: `Expression` (required)
- - `decorators`: `Array<Decorator>` (default: `null`)
- ---
- ### awaitExpression
- ```javascript
- t.awaitExpression(argument)
- ```
- See also `t.isAwaitExpression(node, opts)` and `t.assertAwaitExpression(node, opts)`.
- Aliases: `Expression`, `Terminatorless`
- - `argument`: `Expression` (required)
- ---
- ### binaryExpression
- ```javascript
- t.binaryExpression(operator, left, right)
- ```
- See also `t.isBinaryExpression(node, opts)` and `t.assertBinaryExpression(node, opts)`.
- Aliases: `Binary`, `Expression`
- - `operator`: `'+' | '-' | '/' | '%' | '*' | '**' | '&' | '|' | '>>' | '>>>' | '<<' | '^' | '==' | '===' | '!=' | '!==' | 'in' | 'instanceof' | '>' | '<' | '>=' | '<='` (required)
- - `left`: `Expression` (required)
- - `right`: `Expression` (required)
- ---
- ### bindExpression
- ```javascript
- t.bindExpression(object, callee)
- ```
- See also `t.isBindExpression(node, opts)` and `t.assertBindExpression(node, opts)`.
- Aliases: `Expression`
- - `object` (required)
- - `callee` (required)
- ---
- ### blockStatement
- ```javascript
- t.blockStatement(body, directives)
- ```
- See also `t.isBlockStatement(node, opts)` and `t.assertBlockStatement(node, opts)`.
- Aliases: `Scopable`, `BlockParent`, `Block`, `Statement`
- - `body`: `Array<Statement>` (required)
- - `directives`: `Array<Directive>` (default: `[]`)
- ---
- ### booleanLiteral
- ```javascript
- t.booleanLiteral(value)
- ```
- See also `t.isBooleanLiteral(node, opts)` and `t.assertBooleanLiteral(node, opts)`.
- Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
- - `value`: `boolean` (required)
- ---
- ### booleanLiteralTypeAnnotation
- ```javascript
- t.booleanLiteralTypeAnnotation()
- ```
- See also `t.isBooleanLiteralTypeAnnotation(node, opts)` and `t.assertBooleanLiteralTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- ---
- ### booleanTypeAnnotation
- ```javascript
- t.booleanTypeAnnotation()
- ```
- See also `t.isBooleanTypeAnnotation(node, opts)` and `t.assertBooleanTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### breakStatement
- ```javascript
- t.breakStatement(label)
- ```
- See also `t.isBreakStatement(node, opts)` and `t.assertBreakStatement(node, opts)`.
- Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
- - `label`: `Identifier` (default: `null`)
- ---
- ### callExpression
- ```javascript
- t.callExpression(callee, arguments)
- ```
- See also `t.isCallExpression(node, opts)` and `t.assertCallExpression(node, opts)`.
- Aliases: `Expression`
- - `callee`: `Expression` (required)
- - `arguments`: `Array<Expression | SpreadElement>` (required)
- ---
- ### catchClause
- ```javascript
- t.catchClause(param, body)
- ```
- See also `t.isCatchClause(node, opts)` and `t.assertCatchClause(node, opts)`.
- Aliases: `Scopable`
- - `param`: `Identifier` (required)
- - `body`: `BlockStatement` (required)
- ---
- ### classBody
- ```javascript
- t.classBody(body)
- ```
- See also `t.isClassBody(node, opts)` and `t.assertClassBody(node, opts)`.
- - `body`: `Array<ClassMethod | ClassProperty>` (required)
- ---
- ### classDeclaration
- ```javascript
- t.classDeclaration(id, superClass, body, decorators)
- ```
- See also `t.isClassDeclaration(node, opts)` and `t.assertClassDeclaration(node, opts)`.
- Aliases: `Scopable`, `Class`, `Statement`, `Declaration`, `Pureish`
- - `id`: `Identifier` (required)
- - `superClass`: `Expression` (default: `null`)
- - `body`: `ClassBody` (required)
- - `decorators`: `Array<Decorator>` (required)
- - `implements` (default: `null`)
- - `mixins` (default: `null`)
- - `superTypeParameters` (default: `null`)
- - `typeParameters` (default: `null`)
- ---
- ### classExpression
- ```javascript
- t.classExpression(id, superClass, body, decorators)
- ```
- See also `t.isClassExpression(node, opts)` and `t.assertClassExpression(node, opts)`.
- Aliases: `Scopable`, `Class`, `Expression`, `Pureish`
- - `id`: `Identifier` (default: `null`)
- - `superClass`: `Expression` (default: `null`)
- - `body`: `ClassBody` (required)
- - `decorators`: `Array<Decorator>` (required)
- - `implements` (default: `null`)
- - `mixins` (default: `null`)
- - `superTypeParameters` (default: `null`)
- - `typeParameters` (default: `null`)
- ---
- ### classImplements
- ```javascript
- t.classImplements(id, typeParameters)
- ```
- See also `t.isClassImplements(node, opts)` and `t.assertClassImplements(node, opts)`.
- Aliases: `Flow`
- - `id` (required)
- - `typeParameters` (required)
- ---
- ### classMethod
- ```javascript
- t.classMethod(kind, key, params, body, computed, static)
- ```
- See also `t.isClassMethod(node, opts)` and `t.assertClassMethod(node, opts)`.
- Aliases: `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`
- - `kind`: `"get" | "set" | "method" | "constructor"` (default: `'method'`)
- - `key`if computed then `Expression` else `Identifier | Literal` (required)
- - `params`: `Array<LVal>` (required)
- - `body`: `BlockStatement` (required)
- - `computed`: `boolean` (default: `false`)
- - `static`: `boolean` (default: `false`)
- - `async`: `boolean` (default: `false`)
- - `decorators` (default: `null`)
- - `generator`: `boolean` (default: `false`)
- - `returnType` (default: `null`)
- - `typeParameters` (default: `null`)
- ---
- ### classProperty
- ```javascript
- t.classProperty(key, value, typeAnnotation, decorators, computed)
- ```
- See also `t.isClassProperty(node, opts)` and `t.assertClassProperty(node, opts)`.
- Aliases: `Property`
- - `key` (required)
- - `value` (required)
- - `typeAnnotation` (required)
- - `decorators` (required)
- - `computed`: `boolean` (default: `false`)
- ---
- ### conditionalExpression
- ```javascript
- t.conditionalExpression(test, consequent, alternate)
- ```
- See also `t.isConditionalExpression(node, opts)` and `t.assertConditionalExpression(node, opts)`.
- Aliases: `Expression`, `Conditional`
- - `test`: `Expression` (required)
- - `consequent`: `Expression` (required)
- - `alternate`: `Expression` (required)
- ---
- ### continueStatement
- ```javascript
- t.continueStatement(label)
- ```
- See also `t.isContinueStatement(node, opts)` and `t.assertContinueStatement(node, opts)`.
- Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
- - `label`: `Identifier` (default: `null`)
- ---
- ### debuggerStatement
- ```javascript
- t.debuggerStatement()
- ```
- See also `t.isDebuggerStatement(node, opts)` and `t.assertDebuggerStatement(node, opts)`.
- Aliases: `Statement`
- ---
- ### declareClass
- ```javascript
- t.declareClass(id, typeParameters, extends, body)
- ```
- See also `t.isDeclareClass(node, opts)` and `t.assertDeclareClass(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- - `typeParameters` (required)
- - `extends` (required)
- - `body` (required)
- ---
- ### declareExportDeclaration
- ```javascript
- t.declareExportDeclaration(declaration, specifiers, source)
- ```
- See also `t.isDeclareExportDeclaration(node, opts)` and `t.assertDeclareExportDeclaration(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `declaration` (required)
- - `specifiers` (required)
- - `source` (required)
- ---
- ### declareFunction
- ```javascript
- t.declareFunction(id)
- ```
- See also `t.isDeclareFunction(node, opts)` and `t.assertDeclareFunction(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- ---
- ### declareInterface
- ```javascript
- t.declareInterface(id, typeParameters, extends, body)
- ```
- See also `t.isDeclareInterface(node, opts)` and `t.assertDeclareInterface(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- - `typeParameters` (required)
- - `extends` (required)
- - `body` (required)
- ---
- ### declareModule
- ```javascript
- t.declareModule(id, body)
- ```
- See also `t.isDeclareModule(node, opts)` and `t.assertDeclareModule(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- - `body` (required)
- ---
- ### declareModuleExports
- ```javascript
- t.declareModuleExports(typeAnnotation)
- ```
- See also `t.isDeclareModuleExports(node, opts)` and `t.assertDeclareModuleExports(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `typeAnnotation` (required)
- ---
- ### declareOpaqueType
- ```javascript
- t.declareOpaqueType(id, typeParameters, supertype)
- ```
- See also `t.isDeclareOpaqueType(node, opts)` and `t.assertDeclareOpaqueType(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- - `typeParameters` (required)
- - `supertype` (required)
- ---
- ### declareTypeAlias
- ```javascript
- t.declareTypeAlias(id, typeParameters, right)
- ```
- See also `t.isDeclareTypeAlias(node, opts)` and `t.assertDeclareTypeAlias(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- - `typeParameters` (required)
- - `right` (required)
- ---
- ### declareVariable
- ```javascript
- t.declareVariable(id)
- ```
- See also `t.isDeclareVariable(node, opts)` and `t.assertDeclareVariable(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- ---
- ### decorator
- ```javascript
- t.decorator(expression)
- ```
- See also `t.isDecorator(node, opts)` and `t.assertDecorator(node, opts)`.
- - `expression`: `Expression` (required)
- ---
- ### directive
- ```javascript
- t.directive(value)
- ```
- See also `t.isDirective(node, opts)` and `t.assertDirective(node, opts)`.
- - `value`: `DirectiveLiteral` (required)
- ---
- ### directiveLiteral
- ```javascript
- t.directiveLiteral(value)
- ```
- See also `t.isDirectiveLiteral(node, opts)` and `t.assertDirectiveLiteral(node, opts)`.
- - `value`: `string` (required)
- ---
- ### doExpression
- ```javascript
- t.doExpression(body)
- ```
- See also `t.isDoExpression(node, opts)` and `t.assertDoExpression(node, opts)`.
- Aliases: `Expression`
- - `body`: `BlockStatement` (required)
- ---
- ### doWhileStatement
- ```javascript
- t.doWhileStatement(test, body)
- ```
- See also `t.isDoWhileStatement(node, opts)` and `t.assertDoWhileStatement(node, opts)`.
- Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable`
- - `test`: `Expression` (required)
- - `body`: `Statement` (required)
- ---
- ### emptyStatement
- ```javascript
- t.emptyStatement()
- ```
- See also `t.isEmptyStatement(node, opts)` and `t.assertEmptyStatement(node, opts)`.
- Aliases: `Statement`
- ---
- ### emptyTypeAnnotation
- ```javascript
- t.emptyTypeAnnotation()
- ```
- See also `t.isEmptyTypeAnnotation(node, opts)` and `t.assertEmptyTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### existentialTypeParam
- ```javascript
- t.existentialTypeParam()
- ```
- See also `t.isExistentialTypeParam(node, opts)` and `t.assertExistentialTypeParam(node, opts)`.
- Aliases: `Flow`
- ---
- ### exportAllDeclaration
- ```javascript
- t.exportAllDeclaration(source)
- ```
- See also `t.isExportAllDeclaration(node, opts)` and `t.assertExportAllDeclaration(node, opts)`.
- Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
- - `source`: `StringLiteral` (required)
- ---
- ### exportDefaultDeclaration
- ```javascript
- t.exportDefaultDeclaration(declaration)
- ```
- See also `t.isExportDefaultDeclaration(node, opts)` and `t.assertExportDefaultDeclaration(node, opts)`.
- Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
- - `declaration`: `FunctionDeclaration | ClassDeclaration | Expression` (required)
- ---
- ### exportDefaultSpecifier
- ```javascript
- t.exportDefaultSpecifier(exported)
- ```
- See also `t.isExportDefaultSpecifier(node, opts)` and `t.assertExportDefaultSpecifier(node, opts)`.
- Aliases: `ModuleSpecifier`
- - `exported`: `Identifier` (required)
- ---
- ### exportNamedDeclaration
- ```javascript
- t.exportNamedDeclaration(declaration, specifiers, source)
- ```
- See also `t.isExportNamedDeclaration(node, opts)` and `t.assertExportNamedDeclaration(node, opts)`.
- Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
- - `declaration`: `Declaration` (default: `null`)
- - `specifiers`: `Array<ExportSpecifier>` (required)
- - `source`: `StringLiteral` (default: `null`)
- ---
- ### exportNamespaceSpecifier
- ```javascript
- t.exportNamespaceSpecifier(exported)
- ```
- See also `t.isExportNamespaceSpecifier(node, opts)` and `t.assertExportNamespaceSpecifier(node, opts)`.
- Aliases: `ModuleSpecifier`
- - `exported`: `Identifier` (required)
- ---
- ### exportSpecifier
- ```javascript
- t.exportSpecifier(local, exported)
- ```
- See also `t.isExportSpecifier(node, opts)` and `t.assertExportSpecifier(node, opts)`.
- Aliases: `ModuleSpecifier`
- - `local`: `Identifier` (required)
- - `exported`: `Identifier` (required)
- ---
- ### expressionStatement
- ```javascript
- t.expressionStatement(expression)
- ```
- See also `t.isExpressionStatement(node, opts)` and `t.assertExpressionStatement(node, opts)`.
- Aliases: `Statement`, `ExpressionWrapper`
- - `expression`: `Expression` (required)
- ---
- ### file
- ```javascript
- t.file(program, comments, tokens)
- ```
- See also `t.isFile(node, opts)` and `t.assertFile(node, opts)`.
- - `program`: `Program` (required)
- - `comments` (required)
- - `tokens` (required)
- ---
- ### forAwaitStatement
- ```javascript
- t.forAwaitStatement(left, right, body)
- ```
- See also `t.isForAwaitStatement(node, opts)` and `t.assertForAwaitStatement(node, opts)`.
- Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
- - `left`: `VariableDeclaration | LVal` (required)
- - `right`: `Expression` (required)
- - `body`: `Statement` (required)
- ---
- ### forInStatement
- ```javascript
- t.forInStatement(left, right, body)
- ```
- See also `t.isForInStatement(node, opts)` and `t.assertForInStatement(node, opts)`.
- Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
- - `left`: `VariableDeclaration | LVal` (required)
- - `right`: `Expression` (required)
- - `body`: `Statement` (required)
- ---
- ### forOfStatement
- ```javascript
- t.forOfStatement(left, right, body)
- ```
- See also `t.isForOfStatement(node, opts)` and `t.assertForOfStatement(node, opts)`.
- Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
- - `left`: `VariableDeclaration | LVal` (required)
- - `right`: `Expression` (required)
- - `body`: `Statement` (required)
- ---
- ### forStatement
- ```javascript
- t.forStatement(init, test, update, body)
- ```
- See also `t.isForStatement(node, opts)` and `t.assertForStatement(node, opts)`.
- Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`
- - `init`: `VariableDeclaration | Expression` (default: `null`)
- - `test`: `Expression` (default: `null`)
- - `update`: `Expression` (default: `null`)
- - `body`: `Statement` (required)
- ---
- ### functionDeclaration
- ```javascript
- t.functionDeclaration(id, params, body, generator, async)
- ```
- See also `t.isFunctionDeclaration(node, opts)` and `t.assertFunctionDeclaration(node, opts)`.
- Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Statement`, `Pureish`, `Declaration`
- - `id`: `Identifier` (required)
- - `params`: `Array<LVal>` (required)
- - `body`: `BlockStatement` (required)
- - `generator`: `boolean` (default: `false`)
- - `async`: `boolean` (default: `false`)
- - `returnType` (default: `null`)
- - `typeParameters` (default: `null`)
- ---
- ### functionExpression
- ```javascript
- t.functionExpression(id, params, body, generator, async)
- ```
- See also `t.isFunctionExpression(node, opts)` and `t.assertFunctionExpression(node, opts)`.
- Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish`
- - `id`: `Identifier` (default: `null`)
- - `params`: `Array<LVal>` (required)
- - `body`: `BlockStatement` (required)
- - `generator`: `boolean` (default: `false`)
- - `async`: `boolean` (default: `false`)
- - `returnType` (default: `null`)
- - `typeParameters` (default: `null`)
- ---
- ### functionTypeAnnotation
- ```javascript
- t.functionTypeAnnotation(typeParameters, params, rest, returnType)
- ```
- See also `t.isFunctionTypeAnnotation(node, opts)` and `t.assertFunctionTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `typeParameters` (required)
- - `params` (required)
- - `rest` (required)
- - `returnType` (required)
- ---
- ### functionTypeParam
- ```javascript
- t.functionTypeParam(name, typeAnnotation)
- ```
- See also `t.isFunctionTypeParam(node, opts)` and `t.assertFunctionTypeParam(node, opts)`.
- Aliases: `Flow`
- - `name` (required)
- - `typeAnnotation` (required)
- ---
- ### genericTypeAnnotation
- ```javascript
- t.genericTypeAnnotation(id, typeParameters)
- ```
- See also `t.isGenericTypeAnnotation(node, opts)` and `t.assertGenericTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `id` (required)
- - `typeParameters` (required)
- ---
- ### identifier
- ```javascript
- t.identifier(name)
- ```
- See also `t.isIdentifier(node, opts)` and `t.assertIdentifier(node, opts)`.
- Aliases: `Expression`, `LVal`
- - `name``string` (required)
- - `decorators`: `Array<Decorator>` (default: `null`)
- - `typeAnnotation` (default: `null`)
- ---
- ### ifStatement
- ```javascript
- t.ifStatement(test, consequent, alternate)
- ```
- See also `t.isIfStatement(node, opts)` and `t.assertIfStatement(node, opts)`.
- Aliases: `Statement`, `Conditional`
- - `test`: `Expression` (required)
- - `consequent`: `Statement` (required)
- - `alternate`: `Statement` (default: `null`)
- ---
- ### import
- ```javascript
- t.import()
- ```
- See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.
- Aliases: `Expression`
- ---
- ### importDeclaration
- ```javascript
- t.importDeclaration(specifiers, source)
- ```
- See also `t.isImportDeclaration(node, opts)` and `t.assertImportDeclaration(node, opts)`.
- Aliases: `Statement`, `Declaration`, `ModuleDeclaration`
- - `specifiers`: `Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>` (required)
- - `source`: `StringLiteral` (required)
- ---
- ### importDefaultSpecifier
- ```javascript
- t.importDefaultSpecifier(local)
- ```
- See also `t.isImportDefaultSpecifier(node, opts)` and `t.assertImportDefaultSpecifier(node, opts)`.
- Aliases: `ModuleSpecifier`
- - `local`: `Identifier` (required)
- ---
- ### importNamespaceSpecifier
- ```javascript
- t.importNamespaceSpecifier(local)
- ```
- See also `t.isImportNamespaceSpecifier(node, opts)` and `t.assertImportNamespaceSpecifier(node, opts)`.
- Aliases: `ModuleSpecifier`
- - `local`: `Identifier` (required)
- ---
- ### importSpecifier
- ```javascript
- t.importSpecifier(local, imported)
- ```
- See also `t.isImportSpecifier(node, opts)` and `t.assertImportSpecifier(node, opts)`.
- Aliases: `ModuleSpecifier`
- - `local`: `Identifier` (required)
- - `imported`: `Identifier` (required)
- - `importKind`: `null | 'type' | 'typeof'` (default: `null`)
- ---
- ### interfaceDeclaration
- ```javascript
- t.interfaceDeclaration(id, typeParameters, extends, body)
- ```
- See also `t.isInterfaceDeclaration(node, opts)` and `t.assertInterfaceDeclaration(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- - `typeParameters` (required)
- - `extends` (required)
- - `body` (required)
- ---
- ### interfaceExtends
- ```javascript
- t.interfaceExtends(id, typeParameters)
- ```
- See also `t.isInterfaceExtends(node, opts)` and `t.assertInterfaceExtends(node, opts)`.
- Aliases: `Flow`
- - `id` (required)
- - `typeParameters` (required)
- ---
- ### intersectionTypeAnnotation
- ```javascript
- t.intersectionTypeAnnotation(types)
- ```
- See also `t.isIntersectionTypeAnnotation(node, opts)` and `t.assertIntersectionTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `types` (required)
- ---
- ### jSXAttribute
- ```javascript
- t.jSXAttribute(name, value)
- ```
- See also `t.isJSXAttribute(node, opts)` and `t.assertJSXAttribute(node, opts)`.
- Aliases: `JSX`, `Immutable`
- - `name`: `JSXIdentifier | JSXNamespacedName` (required)
- - `value`: `JSXElement | StringLiteral | JSXExpressionContainer` (default: `null`)
- ---
- ### jSXClosingElement
- ```javascript
- t.jSXClosingElement(name)
- ```
- See also `t.isJSXClosingElement(node, opts)` and `t.assertJSXClosingElement(node, opts)`.
- Aliases: `JSX`, `Immutable`
- - `name`: `JSXIdentifier | JSXMemberExpression` (required)
- ---
- ### jSXElement
- ```javascript
- t.jSXElement(openingElement, closingElement, children, selfClosing)
- ```
- See also `t.isJSXElement(node, opts)` and `t.assertJSXElement(node, opts)`.
- Aliases: `JSX`, `Immutable`, `Expression`
- - `openingElement`: `JSXOpeningElement` (required)
- - `closingElement`: `JSXClosingElement` (default: `null`)
- - `children`: `Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement>` (required)
- - `selfClosing` (required)
- ---
- ### jSXEmptyExpression
- ```javascript
- t.jSXEmptyExpression()
- ```
- See also `t.isJSXEmptyExpression(node, opts)` and `t.assertJSXEmptyExpression(node, opts)`.
- Aliases: `JSX`, `Expression`
- ---
- ### jSXExpressionContainer
- ```javascript
- t.jSXExpressionContainer(expression)
- ```
- See also `t.isJSXExpressionContainer(node, opts)` and `t.assertJSXExpressionContainer(node, opts)`.
- Aliases: `JSX`, `Immutable`
- - `expression`: `Expression` (required)
- ---
- ### jSXIdentifier
- ```javascript
- t.jSXIdentifier(name)
- ```
- See also `t.isJSXIdentifier(node, opts)` and `t.assertJSXIdentifier(node, opts)`.
- Aliases: `JSX`, `Expression`
- - `name`: `string` (required)
- ---
- ### jSXMemberExpression
- ```javascript
- t.jSXMemberExpression(object, property)
- ```
- See also `t.isJSXMemberExpression(node, opts)` and `t.assertJSXMemberExpression(node, opts)`.
- Aliases: `JSX`, `Expression`
- - `object`: `JSXMemberExpression | JSXIdentifier` (required)
- - `property`: `JSXIdentifier` (required)
- ---
- ### jSXNamespacedName
- ```javascript
- t.jSXNamespacedName(namespace, name)
- ```
- See also `t.isJSXNamespacedName(node, opts)` and `t.assertJSXNamespacedName(node, opts)`.
- Aliases: `JSX`
- - `namespace`: `JSXIdentifier` (required)
- - `name`: `JSXIdentifier` (required)
- ---
- ### jSXOpeningElement
- ```javascript
- t.jSXOpeningElement(name, attributes, selfClosing)
- ```
- See also `t.isJSXOpeningElement(node, opts)` and `t.assertJSXOpeningElement(node, opts)`.
- Aliases: `JSX`, `Immutable`
- - `name`: `JSXIdentifier | JSXMemberExpression` (required)
- - `attributes`: `Array<JSXAttribute | JSXSpreadAttribute>` (required)
- - `selfClosing`: `boolean` (default: `false`)
- ---
- ### jSXSpreadAttribute
- ```javascript
- t.jSXSpreadAttribute(argument)
- ```
- See also `t.isJSXSpreadAttribute(node, opts)` and `t.assertJSXSpreadAttribute(node, opts)`.
- Aliases: `JSX`
- - `argument`: `Expression` (required)
- ---
- ### jSXSpreadChild
- ```javascript
- t.jSXSpreadChild(expression)
- ```
- See also `t.isJSXSpreadChild(node, opts)` and `t.assertJSXSpreadChild(node, opts)`.
- Aliases: `JSX`, `Immutable`
- - `expression`: `Expression` (required)
- ---
- ### jSXText
- ```javascript
- t.jSXText(value)
- ```
- See also `t.isJSXText(node, opts)` and `t.assertJSXText(node, opts)`.
- Aliases: `JSX`, `Immutable`
- - `value`: `string` (required)
- ---
- ### labeledStatement
- ```javascript
- t.labeledStatement(label, body)
- ```
- See also `t.isLabeledStatement(node, opts)` and `t.assertLabeledStatement(node, opts)`.
- Aliases: `Statement`
- - `label`: `Identifier` (required)
- - `body`: `Statement` (required)
- ---
- ### logicalExpression
- ```javascript
- t.logicalExpression(operator, left, right)
- ```
- See also `t.isLogicalExpression(node, opts)` and `t.assertLogicalExpression(node, opts)`.
- Aliases: `Binary`, `Expression`
- - `operator`: `'||' | '&&'` (required)
- - `left`: `Expression` (required)
- - `right`: `Expression` (required)
- ---
- ### memberExpression
- ```javascript
- t.memberExpression(object, property, computed)
- ```
- See also `t.isMemberExpression(node, opts)` and `t.assertMemberExpression(node, opts)`.
- Aliases: `Expression`, `LVal`
- - `object`: `Expression` (required)
- - `property`if computed then `Expression` else `Identifier` (required)
- - `computed`: `boolean` (default: `false`)
- ---
- ### metaProperty
- ```javascript
- t.metaProperty(meta, property)
- ```
- See also `t.isMetaProperty(node, opts)` and `t.assertMetaProperty(node, opts)`.
- Aliases: `Expression`
- - `meta`: `string` (required)
- - `property`: `string` (required)
- ---
- ### mixedTypeAnnotation
- ```javascript
- t.mixedTypeAnnotation()
- ```
- See also `t.isMixedTypeAnnotation(node, opts)` and `t.assertMixedTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### newExpression
- ```javascript
- t.newExpression(callee, arguments)
- ```
- See also `t.isNewExpression(node, opts)` and `t.assertNewExpression(node, opts)`.
- Aliases: `Expression`
- - `callee`: `Expression` (required)
- - `arguments`: `Array<Expression | SpreadElement>` (required)
- ---
- ### noop
- ```javascript
- t.noop()
- ```
- See also `t.isNoop(node, opts)` and `t.assertNoop(node, opts)`.
- ---
- ### nullLiteral
- ```javascript
- t.nullLiteral()
- ```
- See also `t.isNullLiteral(node, opts)` and `t.assertNullLiteral(node, opts)`.
- Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
- ---
- ### nullLiteralTypeAnnotation
- ```javascript
- t.nullLiteralTypeAnnotation()
- ```
- See also `t.isNullLiteralTypeAnnotation(node, opts)` and `t.assertNullLiteralTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### nullableTypeAnnotation
- ```javascript
- t.nullableTypeAnnotation(typeAnnotation)
- ```
- See also `t.isNullableTypeAnnotation(node, opts)` and `t.assertNullableTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `typeAnnotation` (required)
- ---
- ### numberTypeAnnotation
- ```javascript
- t.numberTypeAnnotation()
- ```
- See also `t.isNumberTypeAnnotation(node, opts)` and `t.assertNumberTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### numericLiteral
- ```javascript
- t.numericLiteral(value)
- ```
- See also `t.isNumericLiteral(node, opts)` and `t.assertNumericLiteral(node, opts)`.
- Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
- - `value`: `number` (required)
- ---
- ### numericLiteralTypeAnnotation
- ```javascript
- t.numericLiteralTypeAnnotation()
- ```
- See also `t.isNumericLiteralTypeAnnotation(node, opts)` and `t.assertNumericLiteralTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- ---
- ### objectExpression
- ```javascript
- t.objectExpression(properties)
- ```
- See also `t.isObjectExpression(node, opts)` and `t.assertObjectExpression(node, opts)`.
- Aliases: `Expression`
- - `properties`: `Array<ObjectMethod | ObjectProperty | SpreadProperty>` (required)
- ---
- ### objectMethod
- ```javascript
- t.objectMethod(kind, key, params, body, computed)
- ```
- See also `t.isObjectMethod(node, opts)` and `t.assertObjectMethod(node, opts)`.
- Aliases: `UserWhitespacable`, `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`, `ObjectMember`
- - `kind`: `"method" | "get" | "set"` (default: `'method'`)
- - `key`if computed then `Expression` else `Identifier | Literal` (required)
- - `params` (required)
- - `body`: `BlockStatement` (required)
- - `computed`: `boolean` (default: `false`)
- - `async`: `boolean` (default: `false`)
- - `decorators`: `Array<Decorator>` (default: `null`)
- - `generator`: `boolean` (default: `false`)
- - `returnType` (default: `null`)
- - `typeParameters` (default: `null`)
- ---
- ### objectPattern
- ```javascript
- t.objectPattern(properties, typeAnnotation)
- ```
- See also `t.isObjectPattern(node, opts)` and `t.assertObjectPattern(node, opts)`.
- Aliases: `Pattern`, `LVal`
- - `properties`: `Array<RestProperty | Property>` (required)
- - `typeAnnotation` (required)
- - `decorators`: `Array<Decorator>` (default: `null`)
- ---
- ### objectProperty
- ```javascript
- t.objectProperty(key, value, computed, shorthand, decorators)
- ```
- See also `t.isObjectProperty(node, opts)` and `t.assertObjectProperty(node, opts)`.
- Aliases: `UserWhitespacable`, `Property`, `ObjectMember`
- - `key`if computed then `Expression` else `Identifier | Literal` (required)
- - `value`: `Expression | Pattern | RestElement` (required)
- - `computed`: `boolean` (default: `false`)
- - `shorthand`: `boolean` (default: `false`)
- - `decorators`: `Array<Decorator>` (default: `null`)
- ---
- ### objectTypeAnnotation
- ```javascript
- t.objectTypeAnnotation(properties, indexers, callProperties)
- ```
- See also `t.isObjectTypeAnnotation(node, opts)` and `t.assertObjectTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `properties` (required)
- - `indexers` (required)
- - `callProperties` (required)
- ---
- ### objectTypeCallProperty
- ```javascript
- t.objectTypeCallProperty(value)
- ```
- See also `t.isObjectTypeCallProperty(node, opts)` and `t.assertObjectTypeCallProperty(node, opts)`.
- Aliases: `Flow`, `UserWhitespacable`
- - `value` (required)
- ---
- ### objectTypeIndexer
- ```javascript
- t.objectTypeIndexer(id, key, value)
- ```
- See also `t.isObjectTypeIndexer(node, opts)` and `t.assertObjectTypeIndexer(node, opts)`.
- Aliases: `Flow`, `UserWhitespacable`
- - `id` (required)
- - `key` (required)
- - `value` (required)
- ---
- ### objectTypeProperty
- ```javascript
- t.objectTypeProperty(key, value)
- ```
- See also `t.isObjectTypeProperty(node, opts)` and `t.assertObjectTypeProperty(node, opts)`.
- Aliases: `Flow`, `UserWhitespacable`
- - `key` (required)
- - `value` (required)
- ---
- ### objectTypeSpreadProperty
- ```javascript
- t.objectTypeSpreadProperty(argument)
- ```
- See also `t.isObjectTypeSpreadProperty(node, opts)` and `t.assertObjectTypeSpreadProperty(node, opts)`.
- Aliases: `Flow`, `UserWhitespacable`
- - `argument` (required)
- ---
- ### opaqueType
- ```javascript
- t.opaqueType(id, typeParameters, impltype, supertype)
- ```
- See also `t.isOpaqueType(node, opts)` and `t.assertOpaqueType(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- - `typeParameters` (required)
- - `impltype` (required)
- - `supertype` (required)
- ---
- ### parenthesizedExpression
- ```javascript
- t.parenthesizedExpression(expression)
- ```
- See also `t.isParenthesizedExpression(node, opts)` and `t.assertParenthesizedExpression(node, opts)`.
- Aliases: `Expression`, `ExpressionWrapper`
- - `expression`: `Expression` (required)
- ---
- ### program
- ```javascript
- t.program(body, directives)
- ```
- See also `t.isProgram(node, opts)` and `t.assertProgram(node, opts)`.
- Aliases: `Scopable`, `BlockParent`, `Block`, `FunctionParent`
- - `body`: `Array<Statement>` (required)
- - `directives`: `Array<Directive>` (default: `[]`)
- ---
- ### qualifiedTypeIdentifier
- ```javascript
- t.qualifiedTypeIdentifier(id, qualification)
- ```
- See also `t.isQualifiedTypeIdentifier(node, opts)` and `t.assertQualifiedTypeIdentifier(node, opts)`.
- Aliases: `Flow`
- - `id` (required)
- - `qualification` (required)
- ---
- ### regExpLiteral
- ```javascript
- t.regExpLiteral(pattern, flags)
- ```
- See also `t.isRegExpLiteral(node, opts)` and `t.assertRegExpLiteral(node, opts)`.
- Aliases: `Expression`, `Literal`
- - `pattern`: `string` (required)
- - `flags`: `string` (default: `''`)
- ---
- ### restElement
- ```javascript
- t.restElement(argument, typeAnnotation)
- ```
- See also `t.isRestElement(node, opts)` and `t.assertRestElement(node, opts)`.
- Aliases: `LVal`
- - `argument`: `LVal` (required)
- - `typeAnnotation` (required)
- - `decorators`: `Array<Decorator>` (default: `null`)
- ---
- ### restProperty
- ```javascript
- t.restProperty(argument)
- ```
- See also `t.isRestProperty(node, opts)` and `t.assertRestProperty(node, opts)`.
- Aliases: `UnaryLike`
- - `argument`: `LVal` (required)
- ---
- ### returnStatement
- ```javascript
- t.returnStatement(argument)
- ```
- See also `t.isReturnStatement(node, opts)` and `t.assertReturnStatement(node, opts)`.
- Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
- - `argument`: `Expression` (default: `null`)
- ---
- ### sequenceExpression
- ```javascript
- t.sequenceExpression(expressions)
- ```
- See also `t.isSequenceExpression(node, opts)` and `t.assertSequenceExpression(node, opts)`.
- Aliases: `Expression`
- - `expressions`: `Array<Expression>` (required)
- ---
- ### spreadElement
- ```javascript
- t.spreadElement(argument)
- ```
- See also `t.isSpreadElement(node, opts)` and `t.assertSpreadElement(node, opts)`.
- Aliases: `UnaryLike`
- - `argument`: `Expression` (required)
- ---
- ### spreadProperty
- ```javascript
- t.spreadProperty(argument)
- ```
- See also `t.isSpreadProperty(node, opts)` and `t.assertSpreadProperty(node, opts)`.
- Aliases: `UnaryLike`
- - `argument`: `Expression` (required)
- ---
- ### stringLiteral
- ```javascript
- t.stringLiteral(value)
- ```
- See also `t.isStringLiteral(node, opts)` and `t.assertStringLiteral(node, opts)`.
- Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
- - `value`: `string` (required)
- ---
- ### stringLiteralTypeAnnotation
- ```javascript
- t.stringLiteralTypeAnnotation()
- ```
- See also `t.isStringLiteralTypeAnnotation(node, opts)` and `t.assertStringLiteralTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- ---
- ### stringTypeAnnotation
- ```javascript
- t.stringTypeAnnotation()
- ```
- See also `t.isStringTypeAnnotation(node, opts)` and `t.assertStringTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### super
- ```javascript
- t.super()
- ```
- See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.
- Aliases: `Expression`
- ---
- ### switchCase
- ```javascript
- t.switchCase(test, consequent)
- ```
- See also `t.isSwitchCase(node, opts)` and `t.assertSwitchCase(node, opts)`.
- - `test`: `Expression` (default: `null`)
- - `consequent`: `Array<Statement>` (required)
- ---
- ### switchStatement
- ```javascript
- t.switchStatement(discriminant, cases)
- ```
- See also `t.isSwitchStatement(node, opts)` and `t.assertSwitchStatement(node, opts)`.
- Aliases: `Statement`, `BlockParent`, `Scopable`
- - `discriminant`: `Expression` (required)
- - `cases`: `Array<SwitchCase>` (required)
- ---
- ### taggedTemplateExpression
- ```javascript
- t.taggedTemplateExpression(tag, quasi)
- ```
- See also `t.isTaggedTemplateExpression(node, opts)` and `t.assertTaggedTemplateExpression(node, opts)`.
- Aliases: `Expression`
- - `tag`: `Expression` (required)
- - `quasi`: `TemplateLiteral` (required)
- ---
- ### templateElement
- ```javascript
- t.templateElement(value, tail)
- ```
- See also `t.isTemplateElement(node, opts)` and `t.assertTemplateElement(node, opts)`.
- - `value` (required)
- - `tail`: `boolean` (default: `false`)
- ---
- ### templateLiteral
- ```javascript
- t.templateLiteral(quasis, expressions)
- ```
- See also `t.isTemplateLiteral(node, opts)` and `t.assertTemplateLiteral(node, opts)`.
- Aliases: `Expression`, `Literal`
- - `quasis`: `Array<TemplateElement>` (required)
- - `expressions`: `Array<Expression>` (required)
- ---
- ### thisExpression
- ```javascript
- t.thisExpression()
- ```
- See also `t.isThisExpression(node, opts)` and `t.assertThisExpression(node, opts)`.
- Aliases: `Expression`
- ---
- ### thisTypeAnnotation
- ```javascript
- t.thisTypeAnnotation()
- ```
- See also `t.isThisTypeAnnotation(node, opts)` and `t.assertThisTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### throwStatement
- ```javascript
- t.throwStatement(argument)
- ```
- See also `t.isThrowStatement(node, opts)` and `t.assertThrowStatement(node, opts)`.
- Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
- - `argument`: `Expression` (required)
- ---
- ### tryStatement
- ```javascript
- t.tryStatement(block, handler, finalizer)
- ```
- See also `t.isTryStatement(node, opts)` and `t.assertTryStatement(node, opts)`.
- Aliases: `Statement`
- - `block` (required)
- - `handler` (default: `null`)
- - `finalizer`: `BlockStatement` (default: `null`)
- - `body`: `BlockStatement` (default: `null`)
- ---
- ### tupleTypeAnnotation
- ```javascript
- t.tupleTypeAnnotation(types)
- ```
- See also `t.isTupleTypeAnnotation(node, opts)` and `t.assertTupleTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `types` (required)
- ---
- ### typeAlias
- ```javascript
- t.typeAlias(id, typeParameters, right)
- ```
- See also `t.isTypeAlias(node, opts)` and `t.assertTypeAlias(node, opts)`.
- Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
- - `id` (required)
- - `typeParameters` (required)
- - `right` (required)
- ---
- ### typeAnnotation
- ```javascript
- t.typeAnnotation(typeAnnotation)
- ```
- See also `t.isTypeAnnotation(node, opts)` and `t.assertTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `typeAnnotation` (required)
- ---
- ### typeCastExpression
- ```javascript
- t.typeCastExpression(expression, typeAnnotation)
- ```
- See also `t.isTypeCastExpression(node, opts)` and `t.assertTypeCastExpression(node, opts)`.
- Aliases: `Flow`, `ExpressionWrapper`, `Expression`
- - `expression` (required)
- - `typeAnnotation` (required)
- ---
- ### typeParameter
- ```javascript
- t.typeParameter(bound)
- ```
- See also `t.isTypeParameter(node, opts)` and `t.assertTypeParameter(node, opts)`.
- Aliases: `Flow`
- - `bound` (required)
- ---
- ### typeParameterDeclaration
- ```javascript
- t.typeParameterDeclaration(params)
- ```
- See also `t.isTypeParameterDeclaration(node, opts)` and `t.assertTypeParameterDeclaration(node, opts)`.
- Aliases: `Flow`
- - `params` (required)
- ---
- ### typeParameterInstantiation
- ```javascript
- t.typeParameterInstantiation(params)
- ```
- See also `t.isTypeParameterInstantiation(node, opts)` and `t.assertTypeParameterInstantiation(node, opts)`.
- Aliases: `Flow`
- - `params` (required)
- ---
- ### typeofTypeAnnotation
- ```javascript
- t.typeofTypeAnnotation(argument)
- ```
- See also `t.isTypeofTypeAnnotation(node, opts)` and `t.assertTypeofTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `argument` (required)
- ---
- ### unaryExpression
- ```javascript
- t.unaryExpression(operator, argument, prefix)
- ```
- See also `t.isUnaryExpression(node, opts)` and `t.assertUnaryExpression(node, opts)`.
- Aliases: `UnaryLike`, `Expression`
- - `operator`: `'void' | 'delete' | '!' | '+' | '-' | '++' | '--' | '~' | 'typeof'` (required)
- - `argument`: `Expression` (required)
- - `prefix`: `boolean` (default: `true`)
- ---
- ### unionTypeAnnotation
- ```javascript
- t.unionTypeAnnotation(types)
- ```
- See also `t.isUnionTypeAnnotation(node, opts)` and `t.assertUnionTypeAnnotation(node, opts)`.
- Aliases: `Flow`
- - `types` (required)
- ---
- ### updateExpression
- ```javascript
- t.updateExpression(operator, argument, prefix)
- ```
- See also `t.isUpdateExpression(node, opts)` and `t.assertUpdateExpression(node, opts)`.
- Aliases: `Expression`
- - `operator`: `'++' | '--'` (required)
- - `argument`: `Expression` (required)
- - `prefix`: `boolean` (default: `false`)
- ---
- ### variableDeclaration
- ```javascript
- t.variableDeclaration(kind, declarations)
- ```
- See also `t.isVariableDeclaration(node, opts)` and `t.assertVariableDeclaration(node, opts)`.
- Aliases: `Statement`, `Declaration`
- - `kind`: `"var" | "let" | "const"` (required)
- - `declarations`: `Array<VariableDeclarator>` (required)
- ---
- ### variableDeclarator
- ```javascript
- t.variableDeclarator(id, init)
- ```
- See also `t.isVariableDeclarator(node, opts)` and `t.assertVariableDeclarator(node, opts)`.
- - `id`: `LVal` (required)
- - `init`: `Expression` (default: `null`)
- ---
- ### voidTypeAnnotation
- ```javascript
- t.voidTypeAnnotation()
- ```
- See also `t.isVoidTypeAnnotation(node, opts)` and `t.assertVoidTypeAnnotation(node, opts)`.
- Aliases: `Flow`, `FlowBaseAnnotation`
- ---
- ### whileStatement
- ```javascript
- t.whileStatement(test, body)
- ```
- See also `t.isWhileStatement(node, opts)` and `t.assertWhileStatement(node, opts)`.
- Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable`
- - `test`: `Expression` (required)
- - `body`: `BlockStatement | Statement` (required)
- ---
- ### withStatement
- ```javascript
- t.withStatement(object, body)
- ```
- See also `t.isWithStatement(node, opts)` and `t.assertWithStatement(node, opts)`.
- Aliases: `Statement`
- - `object` (required)
- - `body`: `BlockStatement | Statement` (required)
- ---
- ### yieldExpression
- ```javascript
- t.yieldExpression(argument, delegate)
- ```
- See also `t.isYieldExpression(node, opts)` and `t.assertYieldExpression(node, opts)`.
- Aliases: `Expression`, `Terminatorless`
- - `argument`: `Expression` (default: `null`)
- - `delegate`: `boolean` (default: `false`)
- ---
- <!-- end generated section -->
|