98608845ece80bef7d2ca76b1c9ee2e08635ba246d5432c6dae3ac3fb4faefe1fc69e46d668dfec28d8d26c56a7cb363102586356af73f672e4922e704d214 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029
  1. # babel-types
  2. > This module contains methods for building ASTs manually and for checking the types of AST nodes.
  3. ## Install
  4. ```sh
  5. npm install --save-dev babel-types
  6. ```
  7. ## API
  8. <!-- begin generated section -->
  9. ### anyTypeAnnotation
  10. ```javascript
  11. t.anyTypeAnnotation()
  12. ```
  13. See also `t.isAnyTypeAnnotation(node, opts)` and `t.assertAnyTypeAnnotation(node, opts)`.
  14. Aliases: `Flow`, `FlowBaseAnnotation`
  15. ---
  16. ### arrayExpression
  17. ```javascript
  18. t.arrayExpression(elements)
  19. ```
  20. See also `t.isArrayExpression(node, opts)` and `t.assertArrayExpression(node, opts)`.
  21. Aliases: `Expression`
  22. - `elements`: `Array<null | Expression | SpreadElement>` (default: `[]`)
  23. ---
  24. ### arrayPattern
  25. ```javascript
  26. t.arrayPattern(elements, typeAnnotation)
  27. ```
  28. See also `t.isArrayPattern(node, opts)` and `t.assertArrayPattern(node, opts)`.
  29. Aliases: `Pattern`, `LVal`
  30. - `elements`: `Array<Identifier | Pattern | RestElement>` (required)
  31. - `typeAnnotation` (required)
  32. - `decorators`: `Array<Decorator>` (default: `null`)
  33. ---
  34. ### arrayTypeAnnotation
  35. ```javascript
  36. t.arrayTypeAnnotation(elementType)
  37. ```
  38. See also `t.isArrayTypeAnnotation(node, opts)` and `t.assertArrayTypeAnnotation(node, opts)`.
  39. Aliases: `Flow`
  40. - `elementType` (required)
  41. ---
  42. ### arrowFunctionExpression
  43. ```javascript
  44. t.arrowFunctionExpression(params, body, async)
  45. ```
  46. See also `t.isArrowFunctionExpression(node, opts)` and `t.assertArrowFunctionExpression(node, opts)`.
  47. Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish`
  48. - `params`: `Array<LVal>` (required)
  49. - `body`: `BlockStatement | Expression` (required)
  50. - `async`: `boolean` (default: `false`)
  51. - `returnType` (default: `null`)
  52. - `typeParameters` (default: `null`)
  53. ---
  54. ### assignmentExpression
  55. ```javascript
  56. t.assignmentExpression(operator, left, right)
  57. ```
  58. See also `t.isAssignmentExpression(node, opts)` and `t.assertAssignmentExpression(node, opts)`.
  59. Aliases: `Expression`
  60. - `operator`: `string` (required)
  61. - `left`: `LVal` (required)
  62. - `right`: `Expression` (required)
  63. ---
  64. ### assignmentPattern
  65. ```javascript
  66. t.assignmentPattern(left, right)
  67. ```
  68. See also `t.isAssignmentPattern(node, opts)` and `t.assertAssignmentPattern(node, opts)`.
  69. Aliases: `Pattern`, `LVal`
  70. - `left`: `Identifier` (required)
  71. - `right`: `Expression` (required)
  72. - `decorators`: `Array<Decorator>` (default: `null`)
  73. ---
  74. ### awaitExpression
  75. ```javascript
  76. t.awaitExpression(argument)
  77. ```
  78. See also `t.isAwaitExpression(node, opts)` and `t.assertAwaitExpression(node, opts)`.
  79. Aliases: `Expression`, `Terminatorless`
  80. - `argument`: `Expression` (required)
  81. ---
  82. ### binaryExpression
  83. ```javascript
  84. t.binaryExpression(operator, left, right)
  85. ```
  86. See also `t.isBinaryExpression(node, opts)` and `t.assertBinaryExpression(node, opts)`.
  87. Aliases: `Binary`, `Expression`
  88. - `operator`: `'+' | '-' | '/' | '%' | '*' | '**' | '&' | '|' | '>>' | '>>>' | '<<' | '^' | '==' | '===' | '!=' | '!==' | 'in' | 'instanceof' | '>' | '<' | '>=' | '<='` (required)
  89. - `left`: `Expression` (required)
  90. - `right`: `Expression` (required)
  91. ---
  92. ### bindExpression
  93. ```javascript
  94. t.bindExpression(object, callee)
  95. ```
  96. See also `t.isBindExpression(node, opts)` and `t.assertBindExpression(node, opts)`.
  97. Aliases: `Expression`
  98. - `object` (required)
  99. - `callee` (required)
  100. ---
  101. ### blockStatement
  102. ```javascript
  103. t.blockStatement(body, directives)
  104. ```
  105. See also `t.isBlockStatement(node, opts)` and `t.assertBlockStatement(node, opts)`.
  106. Aliases: `Scopable`, `BlockParent`, `Block`, `Statement`
  107. - `body`: `Array<Statement>` (required)
  108. - `directives`: `Array<Directive>` (default: `[]`)
  109. ---
  110. ### booleanLiteral
  111. ```javascript
  112. t.booleanLiteral(value)
  113. ```
  114. See also `t.isBooleanLiteral(node, opts)` and `t.assertBooleanLiteral(node, opts)`.
  115. Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
  116. - `value`: `boolean` (required)
  117. ---
  118. ### booleanLiteralTypeAnnotation
  119. ```javascript
  120. t.booleanLiteralTypeAnnotation()
  121. ```
  122. See also `t.isBooleanLiteralTypeAnnotation(node, opts)` and `t.assertBooleanLiteralTypeAnnotation(node, opts)`.
  123. Aliases: `Flow`
  124. ---
  125. ### booleanTypeAnnotation
  126. ```javascript
  127. t.booleanTypeAnnotation()
  128. ```
  129. See also `t.isBooleanTypeAnnotation(node, opts)` and `t.assertBooleanTypeAnnotation(node, opts)`.
  130. Aliases: `Flow`, `FlowBaseAnnotation`
  131. ---
  132. ### breakStatement
  133. ```javascript
  134. t.breakStatement(label)
  135. ```
  136. See also `t.isBreakStatement(node, opts)` and `t.assertBreakStatement(node, opts)`.
  137. Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
  138. - `label`: `Identifier` (default: `null`)
  139. ---
  140. ### callExpression
  141. ```javascript
  142. t.callExpression(callee, arguments)
  143. ```
  144. See also `t.isCallExpression(node, opts)` and `t.assertCallExpression(node, opts)`.
  145. Aliases: `Expression`
  146. - `callee`: `Expression` (required)
  147. - `arguments`: `Array<Expression | SpreadElement>` (required)
  148. ---
  149. ### catchClause
  150. ```javascript
  151. t.catchClause(param, body)
  152. ```
  153. See also `t.isCatchClause(node, opts)` and `t.assertCatchClause(node, opts)`.
  154. Aliases: `Scopable`
  155. - `param`: `Identifier` (required)
  156. - `body`: `BlockStatement` (required)
  157. ---
  158. ### classBody
  159. ```javascript
  160. t.classBody(body)
  161. ```
  162. See also `t.isClassBody(node, opts)` and `t.assertClassBody(node, opts)`.
  163. - `body`: `Array<ClassMethod | ClassProperty>` (required)
  164. ---
  165. ### classDeclaration
  166. ```javascript
  167. t.classDeclaration(id, superClass, body, decorators)
  168. ```
  169. See also `t.isClassDeclaration(node, opts)` and `t.assertClassDeclaration(node, opts)`.
  170. Aliases: `Scopable`, `Class`, `Statement`, `Declaration`, `Pureish`
  171. - `id`: `Identifier` (required)
  172. - `superClass`: `Expression` (default: `null`)
  173. - `body`: `ClassBody` (required)
  174. - `decorators`: `Array<Decorator>` (required)
  175. - `implements` (default: `null`)
  176. - `mixins` (default: `null`)
  177. - `superTypeParameters` (default: `null`)
  178. - `typeParameters` (default: `null`)
  179. ---
  180. ### classExpression
  181. ```javascript
  182. t.classExpression(id, superClass, body, decorators)
  183. ```
  184. See also `t.isClassExpression(node, opts)` and `t.assertClassExpression(node, opts)`.
  185. Aliases: `Scopable`, `Class`, `Expression`, `Pureish`
  186. - `id`: `Identifier` (default: `null`)
  187. - `superClass`: `Expression` (default: `null`)
  188. - `body`: `ClassBody` (required)
  189. - `decorators`: `Array<Decorator>` (required)
  190. - `implements` (default: `null`)
  191. - `mixins` (default: `null`)
  192. - `superTypeParameters` (default: `null`)
  193. - `typeParameters` (default: `null`)
  194. ---
  195. ### classImplements
  196. ```javascript
  197. t.classImplements(id, typeParameters)
  198. ```
  199. See also `t.isClassImplements(node, opts)` and `t.assertClassImplements(node, opts)`.
  200. Aliases: `Flow`
  201. - `id` (required)
  202. - `typeParameters` (required)
  203. ---
  204. ### classMethod
  205. ```javascript
  206. t.classMethod(kind, key, params, body, computed, static)
  207. ```
  208. See also `t.isClassMethod(node, opts)` and `t.assertClassMethod(node, opts)`.
  209. Aliases: `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`
  210. - `kind`: `"get" | "set" | "method" | "constructor"` (default: `'method'`)
  211. - `key`if computed then `Expression` else `Identifier | Literal` (required)
  212. - `params`: `Array<LVal>` (required)
  213. - `body`: `BlockStatement` (required)
  214. - `computed`: `boolean` (default: `false`)
  215. - `static`: `boolean` (default: `false`)
  216. - `async`: `boolean` (default: `false`)
  217. - `decorators` (default: `null`)
  218. - `generator`: `boolean` (default: `false`)
  219. - `returnType` (default: `null`)
  220. - `typeParameters` (default: `null`)
  221. ---
  222. ### classProperty
  223. ```javascript
  224. t.classProperty(key, value, typeAnnotation, decorators, computed)
  225. ```
  226. See also `t.isClassProperty(node, opts)` and `t.assertClassProperty(node, opts)`.
  227. Aliases: `Property`
  228. - `key` (required)
  229. - `value` (required)
  230. - `typeAnnotation` (required)
  231. - `decorators` (required)
  232. - `computed`: `boolean` (default: `false`)
  233. ---
  234. ### conditionalExpression
  235. ```javascript
  236. t.conditionalExpression(test, consequent, alternate)
  237. ```
  238. See also `t.isConditionalExpression(node, opts)` and `t.assertConditionalExpression(node, opts)`.
  239. Aliases: `Expression`, `Conditional`
  240. - `test`: `Expression` (required)
  241. - `consequent`: `Expression` (required)
  242. - `alternate`: `Expression` (required)
  243. ---
  244. ### continueStatement
  245. ```javascript
  246. t.continueStatement(label)
  247. ```
  248. See also `t.isContinueStatement(node, opts)` and `t.assertContinueStatement(node, opts)`.
  249. Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
  250. - `label`: `Identifier` (default: `null`)
  251. ---
  252. ### debuggerStatement
  253. ```javascript
  254. t.debuggerStatement()
  255. ```
  256. See also `t.isDebuggerStatement(node, opts)` and `t.assertDebuggerStatement(node, opts)`.
  257. Aliases: `Statement`
  258. ---
  259. ### declareClass
  260. ```javascript
  261. t.declareClass(id, typeParameters, extends, body)
  262. ```
  263. See also `t.isDeclareClass(node, opts)` and `t.assertDeclareClass(node, opts)`.
  264. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  265. - `id` (required)
  266. - `typeParameters` (required)
  267. - `extends` (required)
  268. - `body` (required)
  269. ---
  270. ### declareExportDeclaration
  271. ```javascript
  272. t.declareExportDeclaration(declaration, specifiers, source)
  273. ```
  274. See also `t.isDeclareExportDeclaration(node, opts)` and `t.assertDeclareExportDeclaration(node, opts)`.
  275. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  276. - `declaration` (required)
  277. - `specifiers` (required)
  278. - `source` (required)
  279. ---
  280. ### declareFunction
  281. ```javascript
  282. t.declareFunction(id)
  283. ```
  284. See also `t.isDeclareFunction(node, opts)` and `t.assertDeclareFunction(node, opts)`.
  285. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  286. - `id` (required)
  287. ---
  288. ### declareInterface
  289. ```javascript
  290. t.declareInterface(id, typeParameters, extends, body)
  291. ```
  292. See also `t.isDeclareInterface(node, opts)` and `t.assertDeclareInterface(node, opts)`.
  293. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  294. - `id` (required)
  295. - `typeParameters` (required)
  296. - `extends` (required)
  297. - `body` (required)
  298. ---
  299. ### declareModule
  300. ```javascript
  301. t.declareModule(id, body)
  302. ```
  303. See also `t.isDeclareModule(node, opts)` and `t.assertDeclareModule(node, opts)`.
  304. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  305. - `id` (required)
  306. - `body` (required)
  307. ---
  308. ### declareModuleExports
  309. ```javascript
  310. t.declareModuleExports(typeAnnotation)
  311. ```
  312. See also `t.isDeclareModuleExports(node, opts)` and `t.assertDeclareModuleExports(node, opts)`.
  313. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  314. - `typeAnnotation` (required)
  315. ---
  316. ### declareOpaqueType
  317. ```javascript
  318. t.declareOpaqueType(id, typeParameters, supertype)
  319. ```
  320. See also `t.isDeclareOpaqueType(node, opts)` and `t.assertDeclareOpaqueType(node, opts)`.
  321. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  322. - `id` (required)
  323. - `typeParameters` (required)
  324. - `supertype` (required)
  325. ---
  326. ### declareTypeAlias
  327. ```javascript
  328. t.declareTypeAlias(id, typeParameters, right)
  329. ```
  330. See also `t.isDeclareTypeAlias(node, opts)` and `t.assertDeclareTypeAlias(node, opts)`.
  331. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  332. - `id` (required)
  333. - `typeParameters` (required)
  334. - `right` (required)
  335. ---
  336. ### declareVariable
  337. ```javascript
  338. t.declareVariable(id)
  339. ```
  340. See also `t.isDeclareVariable(node, opts)` and `t.assertDeclareVariable(node, opts)`.
  341. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  342. - `id` (required)
  343. ---
  344. ### decorator
  345. ```javascript
  346. t.decorator(expression)
  347. ```
  348. See also `t.isDecorator(node, opts)` and `t.assertDecorator(node, opts)`.
  349. - `expression`: `Expression` (required)
  350. ---
  351. ### directive
  352. ```javascript
  353. t.directive(value)
  354. ```
  355. See also `t.isDirective(node, opts)` and `t.assertDirective(node, opts)`.
  356. - `value`: `DirectiveLiteral` (required)
  357. ---
  358. ### directiveLiteral
  359. ```javascript
  360. t.directiveLiteral(value)
  361. ```
  362. See also `t.isDirectiveLiteral(node, opts)` and `t.assertDirectiveLiteral(node, opts)`.
  363. - `value`: `string` (required)
  364. ---
  365. ### doExpression
  366. ```javascript
  367. t.doExpression(body)
  368. ```
  369. See also `t.isDoExpression(node, opts)` and `t.assertDoExpression(node, opts)`.
  370. Aliases: `Expression`
  371. - `body`: `BlockStatement` (required)
  372. ---
  373. ### doWhileStatement
  374. ```javascript
  375. t.doWhileStatement(test, body)
  376. ```
  377. See also `t.isDoWhileStatement(node, opts)` and `t.assertDoWhileStatement(node, opts)`.
  378. Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable`
  379. - `test`: `Expression` (required)
  380. - `body`: `Statement` (required)
  381. ---
  382. ### emptyStatement
  383. ```javascript
  384. t.emptyStatement()
  385. ```
  386. See also `t.isEmptyStatement(node, opts)` and `t.assertEmptyStatement(node, opts)`.
  387. Aliases: `Statement`
  388. ---
  389. ### emptyTypeAnnotation
  390. ```javascript
  391. t.emptyTypeAnnotation()
  392. ```
  393. See also `t.isEmptyTypeAnnotation(node, opts)` and `t.assertEmptyTypeAnnotation(node, opts)`.
  394. Aliases: `Flow`, `FlowBaseAnnotation`
  395. ---
  396. ### existentialTypeParam
  397. ```javascript
  398. t.existentialTypeParam()
  399. ```
  400. See also `t.isExistentialTypeParam(node, opts)` and `t.assertExistentialTypeParam(node, opts)`.
  401. Aliases: `Flow`
  402. ---
  403. ### exportAllDeclaration
  404. ```javascript
  405. t.exportAllDeclaration(source)
  406. ```
  407. See also `t.isExportAllDeclaration(node, opts)` and `t.assertExportAllDeclaration(node, opts)`.
  408. Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
  409. - `source`: `StringLiteral` (required)
  410. ---
  411. ### exportDefaultDeclaration
  412. ```javascript
  413. t.exportDefaultDeclaration(declaration)
  414. ```
  415. See also `t.isExportDefaultDeclaration(node, opts)` and `t.assertExportDefaultDeclaration(node, opts)`.
  416. Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
  417. - `declaration`: `FunctionDeclaration | ClassDeclaration | Expression` (required)
  418. ---
  419. ### exportDefaultSpecifier
  420. ```javascript
  421. t.exportDefaultSpecifier(exported)
  422. ```
  423. See also `t.isExportDefaultSpecifier(node, opts)` and `t.assertExportDefaultSpecifier(node, opts)`.
  424. Aliases: `ModuleSpecifier`
  425. - `exported`: `Identifier` (required)
  426. ---
  427. ### exportNamedDeclaration
  428. ```javascript
  429. t.exportNamedDeclaration(declaration, specifiers, source)
  430. ```
  431. See also `t.isExportNamedDeclaration(node, opts)` and `t.assertExportNamedDeclaration(node, opts)`.
  432. Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
  433. - `declaration`: `Declaration` (default: `null`)
  434. - `specifiers`: `Array<ExportSpecifier>` (required)
  435. - `source`: `StringLiteral` (default: `null`)
  436. ---
  437. ### exportNamespaceSpecifier
  438. ```javascript
  439. t.exportNamespaceSpecifier(exported)
  440. ```
  441. See also `t.isExportNamespaceSpecifier(node, opts)` and `t.assertExportNamespaceSpecifier(node, opts)`.
  442. Aliases: `ModuleSpecifier`
  443. - `exported`: `Identifier` (required)
  444. ---
  445. ### exportSpecifier
  446. ```javascript
  447. t.exportSpecifier(local, exported)
  448. ```
  449. See also `t.isExportSpecifier(node, opts)` and `t.assertExportSpecifier(node, opts)`.
  450. Aliases: `ModuleSpecifier`
  451. - `local`: `Identifier` (required)
  452. - `exported`: `Identifier` (required)
  453. ---
  454. ### expressionStatement
  455. ```javascript
  456. t.expressionStatement(expression)
  457. ```
  458. See also `t.isExpressionStatement(node, opts)` and `t.assertExpressionStatement(node, opts)`.
  459. Aliases: `Statement`, `ExpressionWrapper`
  460. - `expression`: `Expression` (required)
  461. ---
  462. ### file
  463. ```javascript
  464. t.file(program, comments, tokens)
  465. ```
  466. See also `t.isFile(node, opts)` and `t.assertFile(node, opts)`.
  467. - `program`: `Program` (required)
  468. - `comments` (required)
  469. - `tokens` (required)
  470. ---
  471. ### forAwaitStatement
  472. ```javascript
  473. t.forAwaitStatement(left, right, body)
  474. ```
  475. See also `t.isForAwaitStatement(node, opts)` and `t.assertForAwaitStatement(node, opts)`.
  476. Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
  477. - `left`: `VariableDeclaration | LVal` (required)
  478. - `right`: `Expression` (required)
  479. - `body`: `Statement` (required)
  480. ---
  481. ### forInStatement
  482. ```javascript
  483. t.forInStatement(left, right, body)
  484. ```
  485. See also `t.isForInStatement(node, opts)` and `t.assertForInStatement(node, opts)`.
  486. Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
  487. - `left`: `VariableDeclaration | LVal` (required)
  488. - `right`: `Expression` (required)
  489. - `body`: `Statement` (required)
  490. ---
  491. ### forOfStatement
  492. ```javascript
  493. t.forOfStatement(left, right, body)
  494. ```
  495. See also `t.isForOfStatement(node, opts)` and `t.assertForOfStatement(node, opts)`.
  496. Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
  497. - `left`: `VariableDeclaration | LVal` (required)
  498. - `right`: `Expression` (required)
  499. - `body`: `Statement` (required)
  500. ---
  501. ### forStatement
  502. ```javascript
  503. t.forStatement(init, test, update, body)
  504. ```
  505. See also `t.isForStatement(node, opts)` and `t.assertForStatement(node, opts)`.
  506. Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`
  507. - `init`: `VariableDeclaration | Expression` (default: `null`)
  508. - `test`: `Expression` (default: `null`)
  509. - `update`: `Expression` (default: `null`)
  510. - `body`: `Statement` (required)
  511. ---
  512. ### functionDeclaration
  513. ```javascript
  514. t.functionDeclaration(id, params, body, generator, async)
  515. ```
  516. See also `t.isFunctionDeclaration(node, opts)` and `t.assertFunctionDeclaration(node, opts)`.
  517. Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Statement`, `Pureish`, `Declaration`
  518. - `id`: `Identifier` (required)
  519. - `params`: `Array<LVal>` (required)
  520. - `body`: `BlockStatement` (required)
  521. - `generator`: `boolean` (default: `false`)
  522. - `async`: `boolean` (default: `false`)
  523. - `returnType` (default: `null`)
  524. - `typeParameters` (default: `null`)
  525. ---
  526. ### functionExpression
  527. ```javascript
  528. t.functionExpression(id, params, body, generator, async)
  529. ```
  530. See also `t.isFunctionExpression(node, opts)` and `t.assertFunctionExpression(node, opts)`.
  531. Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish`
  532. - `id`: `Identifier` (default: `null`)
  533. - `params`: `Array<LVal>` (required)
  534. - `body`: `BlockStatement` (required)
  535. - `generator`: `boolean` (default: `false`)
  536. - `async`: `boolean` (default: `false`)
  537. - `returnType` (default: `null`)
  538. - `typeParameters` (default: `null`)
  539. ---
  540. ### functionTypeAnnotation
  541. ```javascript
  542. t.functionTypeAnnotation(typeParameters, params, rest, returnType)
  543. ```
  544. See also `t.isFunctionTypeAnnotation(node, opts)` and `t.assertFunctionTypeAnnotation(node, opts)`.
  545. Aliases: `Flow`
  546. - `typeParameters` (required)
  547. - `params` (required)
  548. - `rest` (required)
  549. - `returnType` (required)
  550. ---
  551. ### functionTypeParam
  552. ```javascript
  553. t.functionTypeParam(name, typeAnnotation)
  554. ```
  555. See also `t.isFunctionTypeParam(node, opts)` and `t.assertFunctionTypeParam(node, opts)`.
  556. Aliases: `Flow`
  557. - `name` (required)
  558. - `typeAnnotation` (required)
  559. ---
  560. ### genericTypeAnnotation
  561. ```javascript
  562. t.genericTypeAnnotation(id, typeParameters)
  563. ```
  564. See also `t.isGenericTypeAnnotation(node, opts)` and `t.assertGenericTypeAnnotation(node, opts)`.
  565. Aliases: `Flow`
  566. - `id` (required)
  567. - `typeParameters` (required)
  568. ---
  569. ### identifier
  570. ```javascript
  571. t.identifier(name)
  572. ```
  573. See also `t.isIdentifier(node, opts)` and `t.assertIdentifier(node, opts)`.
  574. Aliases: `Expression`, `LVal`
  575. - `name``string` (required)
  576. - `decorators`: `Array<Decorator>` (default: `null`)
  577. - `typeAnnotation` (default: `null`)
  578. ---
  579. ### ifStatement
  580. ```javascript
  581. t.ifStatement(test, consequent, alternate)
  582. ```
  583. See also `t.isIfStatement(node, opts)` and `t.assertIfStatement(node, opts)`.
  584. Aliases: `Statement`, `Conditional`
  585. - `test`: `Expression` (required)
  586. - `consequent`: `Statement` (required)
  587. - `alternate`: `Statement` (default: `null`)
  588. ---
  589. ### import
  590. ```javascript
  591. t.import()
  592. ```
  593. See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.
  594. Aliases: `Expression`
  595. ---
  596. ### importDeclaration
  597. ```javascript
  598. t.importDeclaration(specifiers, source)
  599. ```
  600. See also `t.isImportDeclaration(node, opts)` and `t.assertImportDeclaration(node, opts)`.
  601. Aliases: `Statement`, `Declaration`, `ModuleDeclaration`
  602. - `specifiers`: `Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>` (required)
  603. - `source`: `StringLiteral` (required)
  604. ---
  605. ### importDefaultSpecifier
  606. ```javascript
  607. t.importDefaultSpecifier(local)
  608. ```
  609. See also `t.isImportDefaultSpecifier(node, opts)` and `t.assertImportDefaultSpecifier(node, opts)`.
  610. Aliases: `ModuleSpecifier`
  611. - `local`: `Identifier` (required)
  612. ---
  613. ### importNamespaceSpecifier
  614. ```javascript
  615. t.importNamespaceSpecifier(local)
  616. ```
  617. See also `t.isImportNamespaceSpecifier(node, opts)` and `t.assertImportNamespaceSpecifier(node, opts)`.
  618. Aliases: `ModuleSpecifier`
  619. - `local`: `Identifier` (required)
  620. ---
  621. ### importSpecifier
  622. ```javascript
  623. t.importSpecifier(local, imported)
  624. ```
  625. See also `t.isImportSpecifier(node, opts)` and `t.assertImportSpecifier(node, opts)`.
  626. Aliases: `ModuleSpecifier`
  627. - `local`: `Identifier` (required)
  628. - `imported`: `Identifier` (required)
  629. - `importKind`: `null | 'type' | 'typeof'` (default: `null`)
  630. ---
  631. ### interfaceDeclaration
  632. ```javascript
  633. t.interfaceDeclaration(id, typeParameters, extends, body)
  634. ```
  635. See also `t.isInterfaceDeclaration(node, opts)` and `t.assertInterfaceDeclaration(node, opts)`.
  636. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  637. - `id` (required)
  638. - `typeParameters` (required)
  639. - `extends` (required)
  640. - `body` (required)
  641. ---
  642. ### interfaceExtends
  643. ```javascript
  644. t.interfaceExtends(id, typeParameters)
  645. ```
  646. See also `t.isInterfaceExtends(node, opts)` and `t.assertInterfaceExtends(node, opts)`.
  647. Aliases: `Flow`
  648. - `id` (required)
  649. - `typeParameters` (required)
  650. ---
  651. ### intersectionTypeAnnotation
  652. ```javascript
  653. t.intersectionTypeAnnotation(types)
  654. ```
  655. See also `t.isIntersectionTypeAnnotation(node, opts)` and `t.assertIntersectionTypeAnnotation(node, opts)`.
  656. Aliases: `Flow`
  657. - `types` (required)
  658. ---
  659. ### jSXAttribute
  660. ```javascript
  661. t.jSXAttribute(name, value)
  662. ```
  663. See also `t.isJSXAttribute(node, opts)` and `t.assertJSXAttribute(node, opts)`.
  664. Aliases: `JSX`, `Immutable`
  665. - `name`: `JSXIdentifier | JSXNamespacedName` (required)
  666. - `value`: `JSXElement | StringLiteral | JSXExpressionContainer` (default: `null`)
  667. ---
  668. ### jSXClosingElement
  669. ```javascript
  670. t.jSXClosingElement(name)
  671. ```
  672. See also `t.isJSXClosingElement(node, opts)` and `t.assertJSXClosingElement(node, opts)`.
  673. Aliases: `JSX`, `Immutable`
  674. - `name`: `JSXIdentifier | JSXMemberExpression` (required)
  675. ---
  676. ### jSXElement
  677. ```javascript
  678. t.jSXElement(openingElement, closingElement, children, selfClosing)
  679. ```
  680. See also `t.isJSXElement(node, opts)` and `t.assertJSXElement(node, opts)`.
  681. Aliases: `JSX`, `Immutable`, `Expression`
  682. - `openingElement`: `JSXOpeningElement` (required)
  683. - `closingElement`: `JSXClosingElement` (default: `null`)
  684. - `children`: `Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement>` (required)
  685. - `selfClosing` (required)
  686. ---
  687. ### jSXEmptyExpression
  688. ```javascript
  689. t.jSXEmptyExpression()
  690. ```
  691. See also `t.isJSXEmptyExpression(node, opts)` and `t.assertJSXEmptyExpression(node, opts)`.
  692. Aliases: `JSX`, `Expression`
  693. ---
  694. ### jSXExpressionContainer
  695. ```javascript
  696. t.jSXExpressionContainer(expression)
  697. ```
  698. See also `t.isJSXExpressionContainer(node, opts)` and `t.assertJSXExpressionContainer(node, opts)`.
  699. Aliases: `JSX`, `Immutable`
  700. - `expression`: `Expression` (required)
  701. ---
  702. ### jSXIdentifier
  703. ```javascript
  704. t.jSXIdentifier(name)
  705. ```
  706. See also `t.isJSXIdentifier(node, opts)` and `t.assertJSXIdentifier(node, opts)`.
  707. Aliases: `JSX`, `Expression`
  708. - `name`: `string` (required)
  709. ---
  710. ### jSXMemberExpression
  711. ```javascript
  712. t.jSXMemberExpression(object, property)
  713. ```
  714. See also `t.isJSXMemberExpression(node, opts)` and `t.assertJSXMemberExpression(node, opts)`.
  715. Aliases: `JSX`, `Expression`
  716. - `object`: `JSXMemberExpression | JSXIdentifier` (required)
  717. - `property`: `JSXIdentifier` (required)
  718. ---
  719. ### jSXNamespacedName
  720. ```javascript
  721. t.jSXNamespacedName(namespace, name)
  722. ```
  723. See also `t.isJSXNamespacedName(node, opts)` and `t.assertJSXNamespacedName(node, opts)`.
  724. Aliases: `JSX`
  725. - `namespace`: `JSXIdentifier` (required)
  726. - `name`: `JSXIdentifier` (required)
  727. ---
  728. ### jSXOpeningElement
  729. ```javascript
  730. t.jSXOpeningElement(name, attributes, selfClosing)
  731. ```
  732. See also `t.isJSXOpeningElement(node, opts)` and `t.assertJSXOpeningElement(node, opts)`.
  733. Aliases: `JSX`, `Immutable`
  734. - `name`: `JSXIdentifier | JSXMemberExpression` (required)
  735. - `attributes`: `Array<JSXAttribute | JSXSpreadAttribute>` (required)
  736. - `selfClosing`: `boolean` (default: `false`)
  737. ---
  738. ### jSXSpreadAttribute
  739. ```javascript
  740. t.jSXSpreadAttribute(argument)
  741. ```
  742. See also `t.isJSXSpreadAttribute(node, opts)` and `t.assertJSXSpreadAttribute(node, opts)`.
  743. Aliases: `JSX`
  744. - `argument`: `Expression` (required)
  745. ---
  746. ### jSXSpreadChild
  747. ```javascript
  748. t.jSXSpreadChild(expression)
  749. ```
  750. See also `t.isJSXSpreadChild(node, opts)` and `t.assertJSXSpreadChild(node, opts)`.
  751. Aliases: `JSX`, `Immutable`
  752. - `expression`: `Expression` (required)
  753. ---
  754. ### jSXText
  755. ```javascript
  756. t.jSXText(value)
  757. ```
  758. See also `t.isJSXText(node, opts)` and `t.assertJSXText(node, opts)`.
  759. Aliases: `JSX`, `Immutable`
  760. - `value`: `string` (required)
  761. ---
  762. ### labeledStatement
  763. ```javascript
  764. t.labeledStatement(label, body)
  765. ```
  766. See also `t.isLabeledStatement(node, opts)` and `t.assertLabeledStatement(node, opts)`.
  767. Aliases: `Statement`
  768. - `label`: `Identifier` (required)
  769. - `body`: `Statement` (required)
  770. ---
  771. ### logicalExpression
  772. ```javascript
  773. t.logicalExpression(operator, left, right)
  774. ```
  775. See also `t.isLogicalExpression(node, opts)` and `t.assertLogicalExpression(node, opts)`.
  776. Aliases: `Binary`, `Expression`
  777. - `operator`: `'||' | '&&'` (required)
  778. - `left`: `Expression` (required)
  779. - `right`: `Expression` (required)
  780. ---
  781. ### memberExpression
  782. ```javascript
  783. t.memberExpression(object, property, computed)
  784. ```
  785. See also `t.isMemberExpression(node, opts)` and `t.assertMemberExpression(node, opts)`.
  786. Aliases: `Expression`, `LVal`
  787. - `object`: `Expression` (required)
  788. - `property`if computed then `Expression` else `Identifier` (required)
  789. - `computed`: `boolean` (default: `false`)
  790. ---
  791. ### metaProperty
  792. ```javascript
  793. t.metaProperty(meta, property)
  794. ```
  795. See also `t.isMetaProperty(node, opts)` and `t.assertMetaProperty(node, opts)`.
  796. Aliases: `Expression`
  797. - `meta`: `string` (required)
  798. - `property`: `string` (required)
  799. ---
  800. ### mixedTypeAnnotation
  801. ```javascript
  802. t.mixedTypeAnnotation()
  803. ```
  804. See also `t.isMixedTypeAnnotation(node, opts)` and `t.assertMixedTypeAnnotation(node, opts)`.
  805. Aliases: `Flow`, `FlowBaseAnnotation`
  806. ---
  807. ### newExpression
  808. ```javascript
  809. t.newExpression(callee, arguments)
  810. ```
  811. See also `t.isNewExpression(node, opts)` and `t.assertNewExpression(node, opts)`.
  812. Aliases: `Expression`
  813. - `callee`: `Expression` (required)
  814. - `arguments`: `Array<Expression | SpreadElement>` (required)
  815. ---
  816. ### noop
  817. ```javascript
  818. t.noop()
  819. ```
  820. See also `t.isNoop(node, opts)` and `t.assertNoop(node, opts)`.
  821. ---
  822. ### nullLiteral
  823. ```javascript
  824. t.nullLiteral()
  825. ```
  826. See also `t.isNullLiteral(node, opts)` and `t.assertNullLiteral(node, opts)`.
  827. Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
  828. ---
  829. ### nullLiteralTypeAnnotation
  830. ```javascript
  831. t.nullLiteralTypeAnnotation()
  832. ```
  833. See also `t.isNullLiteralTypeAnnotation(node, opts)` and `t.assertNullLiteralTypeAnnotation(node, opts)`.
  834. Aliases: `Flow`, `FlowBaseAnnotation`
  835. ---
  836. ### nullableTypeAnnotation
  837. ```javascript
  838. t.nullableTypeAnnotation(typeAnnotation)
  839. ```
  840. See also `t.isNullableTypeAnnotation(node, opts)` and `t.assertNullableTypeAnnotation(node, opts)`.
  841. Aliases: `Flow`
  842. - `typeAnnotation` (required)
  843. ---
  844. ### numberTypeAnnotation
  845. ```javascript
  846. t.numberTypeAnnotation()
  847. ```
  848. See also `t.isNumberTypeAnnotation(node, opts)` and `t.assertNumberTypeAnnotation(node, opts)`.
  849. Aliases: `Flow`, `FlowBaseAnnotation`
  850. ---
  851. ### numericLiteral
  852. ```javascript
  853. t.numericLiteral(value)
  854. ```
  855. See also `t.isNumericLiteral(node, opts)` and `t.assertNumericLiteral(node, opts)`.
  856. Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
  857. - `value`: `number` (required)
  858. ---
  859. ### numericLiteralTypeAnnotation
  860. ```javascript
  861. t.numericLiteralTypeAnnotation()
  862. ```
  863. See also `t.isNumericLiteralTypeAnnotation(node, opts)` and `t.assertNumericLiteralTypeAnnotation(node, opts)`.
  864. Aliases: `Flow`
  865. ---
  866. ### objectExpression
  867. ```javascript
  868. t.objectExpression(properties)
  869. ```
  870. See also `t.isObjectExpression(node, opts)` and `t.assertObjectExpression(node, opts)`.
  871. Aliases: `Expression`
  872. - `properties`: `Array<ObjectMethod | ObjectProperty | SpreadProperty>` (required)
  873. ---
  874. ### objectMethod
  875. ```javascript
  876. t.objectMethod(kind, key, params, body, computed)
  877. ```
  878. See also `t.isObjectMethod(node, opts)` and `t.assertObjectMethod(node, opts)`.
  879. Aliases: `UserWhitespacable`, `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`, `ObjectMember`
  880. - `kind`: `"method" | "get" | "set"` (default: `'method'`)
  881. - `key`if computed then `Expression` else `Identifier | Literal` (required)
  882. - `params` (required)
  883. - `body`: `BlockStatement` (required)
  884. - `computed`: `boolean` (default: `false`)
  885. - `async`: `boolean` (default: `false`)
  886. - `decorators`: `Array<Decorator>` (default: `null`)
  887. - `generator`: `boolean` (default: `false`)
  888. - `returnType` (default: `null`)
  889. - `typeParameters` (default: `null`)
  890. ---
  891. ### objectPattern
  892. ```javascript
  893. t.objectPattern(properties, typeAnnotation)
  894. ```
  895. See also `t.isObjectPattern(node, opts)` and `t.assertObjectPattern(node, opts)`.
  896. Aliases: `Pattern`, `LVal`
  897. - `properties`: `Array<RestProperty | Property>` (required)
  898. - `typeAnnotation` (required)
  899. - `decorators`: `Array<Decorator>` (default: `null`)
  900. ---
  901. ### objectProperty
  902. ```javascript
  903. t.objectProperty(key, value, computed, shorthand, decorators)
  904. ```
  905. See also `t.isObjectProperty(node, opts)` and `t.assertObjectProperty(node, opts)`.
  906. Aliases: `UserWhitespacable`, `Property`, `ObjectMember`
  907. - `key`if computed then `Expression` else `Identifier | Literal` (required)
  908. - `value`: `Expression | Pattern | RestElement` (required)
  909. - `computed`: `boolean` (default: `false`)
  910. - `shorthand`: `boolean` (default: `false`)
  911. - `decorators`: `Array<Decorator>` (default: `null`)
  912. ---
  913. ### objectTypeAnnotation
  914. ```javascript
  915. t.objectTypeAnnotation(properties, indexers, callProperties)
  916. ```
  917. See also `t.isObjectTypeAnnotation(node, opts)` and `t.assertObjectTypeAnnotation(node, opts)`.
  918. Aliases: `Flow`
  919. - `properties` (required)
  920. - `indexers` (required)
  921. - `callProperties` (required)
  922. ---
  923. ### objectTypeCallProperty
  924. ```javascript
  925. t.objectTypeCallProperty(value)
  926. ```
  927. See also `t.isObjectTypeCallProperty(node, opts)` and `t.assertObjectTypeCallProperty(node, opts)`.
  928. Aliases: `Flow`, `UserWhitespacable`
  929. - `value` (required)
  930. ---
  931. ### objectTypeIndexer
  932. ```javascript
  933. t.objectTypeIndexer(id, key, value)
  934. ```
  935. See also `t.isObjectTypeIndexer(node, opts)` and `t.assertObjectTypeIndexer(node, opts)`.
  936. Aliases: `Flow`, `UserWhitespacable`
  937. - `id` (required)
  938. - `key` (required)
  939. - `value` (required)
  940. ---
  941. ### objectTypeProperty
  942. ```javascript
  943. t.objectTypeProperty(key, value)
  944. ```
  945. See also `t.isObjectTypeProperty(node, opts)` and `t.assertObjectTypeProperty(node, opts)`.
  946. Aliases: `Flow`, `UserWhitespacable`
  947. - `key` (required)
  948. - `value` (required)
  949. ---
  950. ### objectTypeSpreadProperty
  951. ```javascript
  952. t.objectTypeSpreadProperty(argument)
  953. ```
  954. See also `t.isObjectTypeSpreadProperty(node, opts)` and `t.assertObjectTypeSpreadProperty(node, opts)`.
  955. Aliases: `Flow`, `UserWhitespacable`
  956. - `argument` (required)
  957. ---
  958. ### opaqueType
  959. ```javascript
  960. t.opaqueType(id, typeParameters, impltype, supertype)
  961. ```
  962. See also `t.isOpaqueType(node, opts)` and `t.assertOpaqueType(node, opts)`.
  963. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  964. - `id` (required)
  965. - `typeParameters` (required)
  966. - `impltype` (required)
  967. - `supertype` (required)
  968. ---
  969. ### parenthesizedExpression
  970. ```javascript
  971. t.parenthesizedExpression(expression)
  972. ```
  973. See also `t.isParenthesizedExpression(node, opts)` and `t.assertParenthesizedExpression(node, opts)`.
  974. Aliases: `Expression`, `ExpressionWrapper`
  975. - `expression`: `Expression` (required)
  976. ---
  977. ### program
  978. ```javascript
  979. t.program(body, directives)
  980. ```
  981. See also `t.isProgram(node, opts)` and `t.assertProgram(node, opts)`.
  982. Aliases: `Scopable`, `BlockParent`, `Block`, `FunctionParent`
  983. - `body`: `Array<Statement>` (required)
  984. - `directives`: `Array<Directive>` (default: `[]`)
  985. ---
  986. ### qualifiedTypeIdentifier
  987. ```javascript
  988. t.qualifiedTypeIdentifier(id, qualification)
  989. ```
  990. See also `t.isQualifiedTypeIdentifier(node, opts)` and `t.assertQualifiedTypeIdentifier(node, opts)`.
  991. Aliases: `Flow`
  992. - `id` (required)
  993. - `qualification` (required)
  994. ---
  995. ### regExpLiteral
  996. ```javascript
  997. t.regExpLiteral(pattern, flags)
  998. ```
  999. See also `t.isRegExpLiteral(node, opts)` and `t.assertRegExpLiteral(node, opts)`.
  1000. Aliases: `Expression`, `Literal`
  1001. - `pattern`: `string` (required)
  1002. - `flags`: `string` (default: `''`)
  1003. ---
  1004. ### restElement
  1005. ```javascript
  1006. t.restElement(argument, typeAnnotation)
  1007. ```
  1008. See also `t.isRestElement(node, opts)` and `t.assertRestElement(node, opts)`.
  1009. Aliases: `LVal`
  1010. - `argument`: `LVal` (required)
  1011. - `typeAnnotation` (required)
  1012. - `decorators`: `Array<Decorator>` (default: `null`)
  1013. ---
  1014. ### restProperty
  1015. ```javascript
  1016. t.restProperty(argument)
  1017. ```
  1018. See also `t.isRestProperty(node, opts)` and `t.assertRestProperty(node, opts)`.
  1019. Aliases: `UnaryLike`
  1020. - `argument`: `LVal` (required)
  1021. ---
  1022. ### returnStatement
  1023. ```javascript
  1024. t.returnStatement(argument)
  1025. ```
  1026. See also `t.isReturnStatement(node, opts)` and `t.assertReturnStatement(node, opts)`.
  1027. Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
  1028. - `argument`: `Expression` (default: `null`)
  1029. ---
  1030. ### sequenceExpression
  1031. ```javascript
  1032. t.sequenceExpression(expressions)
  1033. ```
  1034. See also `t.isSequenceExpression(node, opts)` and `t.assertSequenceExpression(node, opts)`.
  1035. Aliases: `Expression`
  1036. - `expressions`: `Array<Expression>` (required)
  1037. ---
  1038. ### spreadElement
  1039. ```javascript
  1040. t.spreadElement(argument)
  1041. ```
  1042. See also `t.isSpreadElement(node, opts)` and `t.assertSpreadElement(node, opts)`.
  1043. Aliases: `UnaryLike`
  1044. - `argument`: `Expression` (required)
  1045. ---
  1046. ### spreadProperty
  1047. ```javascript
  1048. t.spreadProperty(argument)
  1049. ```
  1050. See also `t.isSpreadProperty(node, opts)` and `t.assertSpreadProperty(node, opts)`.
  1051. Aliases: `UnaryLike`
  1052. - `argument`: `Expression` (required)
  1053. ---
  1054. ### stringLiteral
  1055. ```javascript
  1056. t.stringLiteral(value)
  1057. ```
  1058. See also `t.isStringLiteral(node, opts)` and `t.assertStringLiteral(node, opts)`.
  1059. Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
  1060. - `value`: `string` (required)
  1061. ---
  1062. ### stringLiteralTypeAnnotation
  1063. ```javascript
  1064. t.stringLiteralTypeAnnotation()
  1065. ```
  1066. See also `t.isStringLiteralTypeAnnotation(node, opts)` and `t.assertStringLiteralTypeAnnotation(node, opts)`.
  1067. Aliases: `Flow`
  1068. ---
  1069. ### stringTypeAnnotation
  1070. ```javascript
  1071. t.stringTypeAnnotation()
  1072. ```
  1073. See also `t.isStringTypeAnnotation(node, opts)` and `t.assertStringTypeAnnotation(node, opts)`.
  1074. Aliases: `Flow`, `FlowBaseAnnotation`
  1075. ---
  1076. ### super
  1077. ```javascript
  1078. t.super()
  1079. ```
  1080. See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.
  1081. Aliases: `Expression`
  1082. ---
  1083. ### switchCase
  1084. ```javascript
  1085. t.switchCase(test, consequent)
  1086. ```
  1087. See also `t.isSwitchCase(node, opts)` and `t.assertSwitchCase(node, opts)`.
  1088. - `test`: `Expression` (default: `null`)
  1089. - `consequent`: `Array<Statement>` (required)
  1090. ---
  1091. ### switchStatement
  1092. ```javascript
  1093. t.switchStatement(discriminant, cases)
  1094. ```
  1095. See also `t.isSwitchStatement(node, opts)` and `t.assertSwitchStatement(node, opts)`.
  1096. Aliases: `Statement`, `BlockParent`, `Scopable`
  1097. - `discriminant`: `Expression` (required)
  1098. - `cases`: `Array<SwitchCase>` (required)
  1099. ---
  1100. ### taggedTemplateExpression
  1101. ```javascript
  1102. t.taggedTemplateExpression(tag, quasi)
  1103. ```
  1104. See also `t.isTaggedTemplateExpression(node, opts)` and `t.assertTaggedTemplateExpression(node, opts)`.
  1105. Aliases: `Expression`
  1106. - `tag`: `Expression` (required)
  1107. - `quasi`: `TemplateLiteral` (required)
  1108. ---
  1109. ### templateElement
  1110. ```javascript
  1111. t.templateElement(value, tail)
  1112. ```
  1113. See also `t.isTemplateElement(node, opts)` and `t.assertTemplateElement(node, opts)`.
  1114. - `value` (required)
  1115. - `tail`: `boolean` (default: `false`)
  1116. ---
  1117. ### templateLiteral
  1118. ```javascript
  1119. t.templateLiteral(quasis, expressions)
  1120. ```
  1121. See also `t.isTemplateLiteral(node, opts)` and `t.assertTemplateLiteral(node, opts)`.
  1122. Aliases: `Expression`, `Literal`
  1123. - `quasis`: `Array<TemplateElement>` (required)
  1124. - `expressions`: `Array<Expression>` (required)
  1125. ---
  1126. ### thisExpression
  1127. ```javascript
  1128. t.thisExpression()
  1129. ```
  1130. See also `t.isThisExpression(node, opts)` and `t.assertThisExpression(node, opts)`.
  1131. Aliases: `Expression`
  1132. ---
  1133. ### thisTypeAnnotation
  1134. ```javascript
  1135. t.thisTypeAnnotation()
  1136. ```
  1137. See also `t.isThisTypeAnnotation(node, opts)` and `t.assertThisTypeAnnotation(node, opts)`.
  1138. Aliases: `Flow`, `FlowBaseAnnotation`
  1139. ---
  1140. ### throwStatement
  1141. ```javascript
  1142. t.throwStatement(argument)
  1143. ```
  1144. See also `t.isThrowStatement(node, opts)` and `t.assertThrowStatement(node, opts)`.
  1145. Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
  1146. - `argument`: `Expression` (required)
  1147. ---
  1148. ### tryStatement
  1149. ```javascript
  1150. t.tryStatement(block, handler, finalizer)
  1151. ```
  1152. See also `t.isTryStatement(node, opts)` and `t.assertTryStatement(node, opts)`.
  1153. Aliases: `Statement`
  1154. - `block` (required)
  1155. - `handler` (default: `null`)
  1156. - `finalizer`: `BlockStatement` (default: `null`)
  1157. - `body`: `BlockStatement` (default: `null`)
  1158. ---
  1159. ### tupleTypeAnnotation
  1160. ```javascript
  1161. t.tupleTypeAnnotation(types)
  1162. ```
  1163. See also `t.isTupleTypeAnnotation(node, opts)` and `t.assertTupleTypeAnnotation(node, opts)`.
  1164. Aliases: `Flow`
  1165. - `types` (required)
  1166. ---
  1167. ### typeAlias
  1168. ```javascript
  1169. t.typeAlias(id, typeParameters, right)
  1170. ```
  1171. See also `t.isTypeAlias(node, opts)` and `t.assertTypeAlias(node, opts)`.
  1172. Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
  1173. - `id` (required)
  1174. - `typeParameters` (required)
  1175. - `right` (required)
  1176. ---
  1177. ### typeAnnotation
  1178. ```javascript
  1179. t.typeAnnotation(typeAnnotation)
  1180. ```
  1181. See also `t.isTypeAnnotation(node, opts)` and `t.assertTypeAnnotation(node, opts)`.
  1182. Aliases: `Flow`
  1183. - `typeAnnotation` (required)
  1184. ---
  1185. ### typeCastExpression
  1186. ```javascript
  1187. t.typeCastExpression(expression, typeAnnotation)
  1188. ```
  1189. See also `t.isTypeCastExpression(node, opts)` and `t.assertTypeCastExpression(node, opts)`.
  1190. Aliases: `Flow`, `ExpressionWrapper`, `Expression`
  1191. - `expression` (required)
  1192. - `typeAnnotation` (required)
  1193. ---
  1194. ### typeParameter
  1195. ```javascript
  1196. t.typeParameter(bound)
  1197. ```
  1198. See also `t.isTypeParameter(node, opts)` and `t.assertTypeParameter(node, opts)`.
  1199. Aliases: `Flow`
  1200. - `bound` (required)
  1201. ---
  1202. ### typeParameterDeclaration
  1203. ```javascript
  1204. t.typeParameterDeclaration(params)
  1205. ```
  1206. See also `t.isTypeParameterDeclaration(node, opts)` and `t.assertTypeParameterDeclaration(node, opts)`.
  1207. Aliases: `Flow`
  1208. - `params` (required)
  1209. ---
  1210. ### typeParameterInstantiation
  1211. ```javascript
  1212. t.typeParameterInstantiation(params)
  1213. ```
  1214. See also `t.isTypeParameterInstantiation(node, opts)` and `t.assertTypeParameterInstantiation(node, opts)`.
  1215. Aliases: `Flow`
  1216. - `params` (required)
  1217. ---
  1218. ### typeofTypeAnnotation
  1219. ```javascript
  1220. t.typeofTypeAnnotation(argument)
  1221. ```
  1222. See also `t.isTypeofTypeAnnotation(node, opts)` and `t.assertTypeofTypeAnnotation(node, opts)`.
  1223. Aliases: `Flow`
  1224. - `argument` (required)
  1225. ---
  1226. ### unaryExpression
  1227. ```javascript
  1228. t.unaryExpression(operator, argument, prefix)
  1229. ```
  1230. See also `t.isUnaryExpression(node, opts)` and `t.assertUnaryExpression(node, opts)`.
  1231. Aliases: `UnaryLike`, `Expression`
  1232. - `operator`: `'void' | 'delete' | '!' | '+' | '-' | '++' | '--' | '~' | 'typeof'` (required)
  1233. - `argument`: `Expression` (required)
  1234. - `prefix`: `boolean` (default: `true`)
  1235. ---
  1236. ### unionTypeAnnotation
  1237. ```javascript
  1238. t.unionTypeAnnotation(types)
  1239. ```
  1240. See also `t.isUnionTypeAnnotation(node, opts)` and `t.assertUnionTypeAnnotation(node, opts)`.
  1241. Aliases: `Flow`
  1242. - `types` (required)
  1243. ---
  1244. ### updateExpression
  1245. ```javascript
  1246. t.updateExpression(operator, argument, prefix)
  1247. ```
  1248. See also `t.isUpdateExpression(node, opts)` and `t.assertUpdateExpression(node, opts)`.
  1249. Aliases: `Expression`
  1250. - `operator`: `'++' | '--'` (required)
  1251. - `argument`: `Expression` (required)
  1252. - `prefix`: `boolean` (default: `false`)
  1253. ---
  1254. ### variableDeclaration
  1255. ```javascript
  1256. t.variableDeclaration(kind, declarations)
  1257. ```
  1258. See also `t.isVariableDeclaration(node, opts)` and `t.assertVariableDeclaration(node, opts)`.
  1259. Aliases: `Statement`, `Declaration`
  1260. - `kind`: `"var" | "let" | "const"` (required)
  1261. - `declarations`: `Array<VariableDeclarator>` (required)
  1262. ---
  1263. ### variableDeclarator
  1264. ```javascript
  1265. t.variableDeclarator(id, init)
  1266. ```
  1267. See also `t.isVariableDeclarator(node, opts)` and `t.assertVariableDeclarator(node, opts)`.
  1268. - `id`: `LVal` (required)
  1269. - `init`: `Expression` (default: `null`)
  1270. ---
  1271. ### voidTypeAnnotation
  1272. ```javascript
  1273. t.voidTypeAnnotation()
  1274. ```
  1275. See also `t.isVoidTypeAnnotation(node, opts)` and `t.assertVoidTypeAnnotation(node, opts)`.
  1276. Aliases: `Flow`, `FlowBaseAnnotation`
  1277. ---
  1278. ### whileStatement
  1279. ```javascript
  1280. t.whileStatement(test, body)
  1281. ```
  1282. See also `t.isWhileStatement(node, opts)` and `t.assertWhileStatement(node, opts)`.
  1283. Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable`
  1284. - `test`: `Expression` (required)
  1285. - `body`: `BlockStatement | Statement` (required)
  1286. ---
  1287. ### withStatement
  1288. ```javascript
  1289. t.withStatement(object, body)
  1290. ```
  1291. See also `t.isWithStatement(node, opts)` and `t.assertWithStatement(node, opts)`.
  1292. Aliases: `Statement`
  1293. - `object` (required)
  1294. - `body`: `BlockStatement | Statement` (required)
  1295. ---
  1296. ### yieldExpression
  1297. ```javascript
  1298. t.yieldExpression(argument, delegate)
  1299. ```
  1300. See also `t.isYieldExpression(node, opts)` and `t.assertYieldExpression(node, opts)`.
  1301. Aliases: `Expression`, `Terminatorless`
  1302. - `argument`: `Expression` (default: `null`)
  1303. - `delegate`: `boolean` (default: `false`)
  1304. ---
  1305. <!-- end generated section -->