1 | # babel-types
|
2 |
|
3 | > This module contains methods for building ASTs manually and for checking the types of AST nodes.
|
4 |
|
5 | ## Install
|
6 |
|
7 | ```sh
|
8 | npm install --save-dev babel-types
|
9 | ```
|
10 |
|
11 | ## API
|
12 |
|
13 |
|
14 |
|
15 | ### anyTypeAnnotation
|
16 | ```javascript
|
17 | t.anyTypeAnnotation()
|
18 | ```
|
19 |
|
20 | See also `t.isAnyTypeAnnotation(node, opts)` and `t.assertAnyTypeAnnotation(node, opts)`.
|
21 |
|
22 | Aliases: `Flow`, `FlowBaseAnnotation`
|
23 |
|
24 |
|
25 | ---
|
26 |
|
27 | ### arrayExpression
|
28 | ```javascript
|
29 | t.arrayExpression(elements)
|
30 | ```
|
31 |
|
32 | See also `t.isArrayExpression(node, opts)` and `t.assertArrayExpression(node, opts)`.
|
33 |
|
34 | Aliases: `Expression`
|
35 |
|
36 | - `elements`: `Array<null | Expression | SpreadElement>` (default: `[]`)
|
37 |
|
38 | ---
|
39 |
|
40 | ### arrayPattern
|
41 | ```javascript
|
42 | t.arrayPattern(elements, typeAnnotation)
|
43 | ```
|
44 |
|
45 | See also `t.isArrayPattern(node, opts)` and `t.assertArrayPattern(node, opts)`.
|
46 |
|
47 | Aliases: `Pattern`, `LVal`
|
48 |
|
49 | - `elements`: `Array<Identifier | Pattern | RestElement>` (required)
|
50 | - `typeAnnotation` (required)
|
51 | - `decorators`: `Array<Decorator>` (default: `null`)
|
52 |
|
53 | ---
|
54 |
|
55 | ### arrayTypeAnnotation
|
56 | ```javascript
|
57 | t.arrayTypeAnnotation(elementType)
|
58 | ```
|
59 |
|
60 | See also `t.isArrayTypeAnnotation(node, opts)` and `t.assertArrayTypeAnnotation(node, opts)`.
|
61 |
|
62 | Aliases: `Flow`
|
63 |
|
64 | - `elementType` (required)
|
65 |
|
66 | ---
|
67 |
|
68 | ### arrowFunctionExpression
|
69 | ```javascript
|
70 | t.arrowFunctionExpression(params, body, async)
|
71 | ```
|
72 |
|
73 | See also `t.isArrowFunctionExpression(node, opts)` and `t.assertArrowFunctionExpression(node, opts)`.
|
74 |
|
75 | Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish`
|
76 |
|
77 | - `params`: `Array<LVal>` (required)
|
78 | - `body`: `BlockStatement | Expression` (required)
|
79 | - `async`: `boolean` (default: `false`)
|
80 | - `returnType` (default: `null`)
|
81 | - `typeParameters` (default: `null`)
|
82 |
|
83 | ---
|
84 |
|
85 | ### assignmentExpression
|
86 | ```javascript
|
87 | t.assignmentExpression(operator, left, right)
|
88 | ```
|
89 |
|
90 | See also `t.isAssignmentExpression(node, opts)` and `t.assertAssignmentExpression(node, opts)`.
|
91 |
|
92 | Aliases: `Expression`
|
93 |
|
94 | - `operator`: `string` (required)
|
95 | - `left`: `LVal` (required)
|
96 | - `right`: `Expression` (required)
|
97 |
|
98 | ---
|
99 |
|
100 | ### assignmentPattern
|
101 | ```javascript
|
102 | t.assignmentPattern(left, right)
|
103 | ```
|
104 |
|
105 | See also `t.isAssignmentPattern(node, opts)` and `t.assertAssignmentPattern(node, opts)`.
|
106 |
|
107 | Aliases: `Pattern`, `LVal`
|
108 |
|
109 | - `left`: `Identifier` (required)
|
110 | - `right`: `Expression` (required)
|
111 | - `decorators`: `Array<Decorator>` (default: `null`)
|
112 |
|
113 | ---
|
114 |
|
115 | ### awaitExpression
|
116 | ```javascript
|
117 | t.awaitExpression(argument)
|
118 | ```
|
119 |
|
120 | See also `t.isAwaitExpression(node, opts)` and `t.assertAwaitExpression(node, opts)`.
|
121 |
|
122 | Aliases: `Expression`, `Terminatorless`
|
123 |
|
124 | - `argument`: `Expression` (required)
|
125 |
|
126 | ---
|
127 |
|
128 | ### binaryExpression
|
129 | ```javascript
|
130 | t.binaryExpression(operator, left, right)
|
131 | ```
|
132 |
|
133 | See also `t.isBinaryExpression(node, opts)` and `t.assertBinaryExpression(node, opts)`.
|
134 |
|
135 | Aliases: `Binary`, `Expression`
|
136 |
|
137 | - `operator`: `'+' | '-' | '/' | '%' | '*' | '**' | '&' | '|' | '>>' | '>>>' | '<<' | '^' | '==' | '===' | '!=' | '!==' | 'in' | 'instanceof' | '>' | '<' | '>=' | '<='` (required)
|
138 | - `left`: `Expression` (required)
|
139 | - `right`: `Expression` (required)
|
140 |
|
141 | ---
|
142 |
|
143 | ### bindExpression
|
144 | ```javascript
|
145 | t.bindExpression(object, callee)
|
146 | ```
|
147 |
|
148 | See also `t.isBindExpression(node, opts)` and `t.assertBindExpression(node, opts)`.
|
149 |
|
150 | Aliases: `Expression`
|
151 |
|
152 | - `object` (required)
|
153 | - `callee` (required)
|
154 |
|
155 | ---
|
156 |
|
157 | ### blockStatement
|
158 | ```javascript
|
159 | t.blockStatement(body, directives)
|
160 | ```
|
161 |
|
162 | See also `t.isBlockStatement(node, opts)` and `t.assertBlockStatement(node, opts)`.
|
163 |
|
164 | Aliases: `Scopable`, `BlockParent`, `Block`, `Statement`
|
165 |
|
166 | - `body`: `Array<Statement>` (required)
|
167 | - `directives`: `Array<Directive>` (default: `[]`)
|
168 |
|
169 | ---
|
170 |
|
171 | ### booleanLiteral
|
172 | ```javascript
|
173 | t.booleanLiteral(value)
|
174 | ```
|
175 |
|
176 | See also `t.isBooleanLiteral(node, opts)` and `t.assertBooleanLiteral(node, opts)`.
|
177 |
|
178 | Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
|
179 |
|
180 | - `value`: `boolean` (required)
|
181 |
|
182 | ---
|
183 |
|
184 | ### booleanLiteralTypeAnnotation
|
185 | ```javascript
|
186 | t.booleanLiteralTypeAnnotation()
|
187 | ```
|
188 |
|
189 | See also `t.isBooleanLiteralTypeAnnotation(node, opts)` and `t.assertBooleanLiteralTypeAnnotation(node, opts)`.
|
190 |
|
191 | Aliases: `Flow`
|
192 |
|
193 |
|
194 | ---
|
195 |
|
196 | ### booleanTypeAnnotation
|
197 | ```javascript
|
198 | t.booleanTypeAnnotation()
|
199 | ```
|
200 |
|
201 | See also `t.isBooleanTypeAnnotation(node, opts)` and `t.assertBooleanTypeAnnotation(node, opts)`.
|
202 |
|
203 | Aliases: `Flow`, `FlowBaseAnnotation`
|
204 |
|
205 |
|
206 | ---
|
207 |
|
208 | ### breakStatement
|
209 | ```javascript
|
210 | t.breakStatement(label)
|
211 | ```
|
212 |
|
213 | See also `t.isBreakStatement(node, opts)` and `t.assertBreakStatement(node, opts)`.
|
214 |
|
215 | Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
|
216 |
|
217 | - `label`: `Identifier` (default: `null`)
|
218 |
|
219 | ---
|
220 |
|
221 | ### callExpression
|
222 | ```javascript
|
223 | t.callExpression(callee, arguments)
|
224 | ```
|
225 |
|
226 | See also `t.isCallExpression(node, opts)` and `t.assertCallExpression(node, opts)`.
|
227 |
|
228 | Aliases: `Expression`
|
229 |
|
230 | - `callee`: `Expression` (required)
|
231 | - `arguments`: `Array<Expression | SpreadElement>` (required)
|
232 |
|
233 | ---
|
234 |
|
235 | ### catchClause
|
236 | ```javascript
|
237 | t.catchClause(param, body)
|
238 | ```
|
239 |
|
240 | See also `t.isCatchClause(node, opts)` and `t.assertCatchClause(node, opts)`.
|
241 |
|
242 | Aliases: `Scopable`
|
243 |
|
244 | - `param`: `Identifier` (required)
|
245 | - `body`: `BlockStatement` (required)
|
246 |
|
247 | ---
|
248 |
|
249 | ### classBody
|
250 | ```javascript
|
251 | t.classBody(body)
|
252 | ```
|
253 |
|
254 | See also `t.isClassBody(node, opts)` and `t.assertClassBody(node, opts)`.
|
255 |
|
256 | - `body`: `Array<ClassMethod | ClassProperty>` (required)
|
257 |
|
258 | ---
|
259 |
|
260 | ### classDeclaration
|
261 | ```javascript
|
262 | t.classDeclaration(id, superClass, body, decorators)
|
263 | ```
|
264 |
|
265 | See also `t.isClassDeclaration(node, opts)` and `t.assertClassDeclaration(node, opts)`.
|
266 |
|
267 | Aliases: `Scopable`, `Class`, `Statement`, `Declaration`, `Pureish`
|
268 |
|
269 | - `id`: `Identifier` (required)
|
270 | - `superClass`: `Expression` (default: `null`)
|
271 | - `body`: `ClassBody` (required)
|
272 | - `decorators`: `Array<Decorator>` (required)
|
273 | - `implements` (default: `null`)
|
274 | - `mixins` (default: `null`)
|
275 | - `superTypeParameters` (default: `null`)
|
276 | - `typeParameters` (default: `null`)
|
277 |
|
278 | ---
|
279 |
|
280 | ### classExpression
|
281 | ```javascript
|
282 | t.classExpression(id, superClass, body, decorators)
|
283 | ```
|
284 |
|
285 | See also `t.isClassExpression(node, opts)` and `t.assertClassExpression(node, opts)`.
|
286 |
|
287 | Aliases: `Scopable`, `Class`, `Expression`, `Pureish`
|
288 |
|
289 | - `id`: `Identifier` (default: `null`)
|
290 | - `superClass`: `Expression` (default: `null`)
|
291 | - `body`: `ClassBody` (required)
|
292 | - `decorators`: `Array<Decorator>` (required)
|
293 | - `implements` (default: `null`)
|
294 | - `mixins` (default: `null`)
|
295 | - `superTypeParameters` (default: `null`)
|
296 | - `typeParameters` (default: `null`)
|
297 |
|
298 | ---
|
299 |
|
300 | ### classImplements
|
301 | ```javascript
|
302 | t.classImplements(id, typeParameters)
|
303 | ```
|
304 |
|
305 | See also `t.isClassImplements(node, opts)` and `t.assertClassImplements(node, opts)`.
|
306 |
|
307 | Aliases: `Flow`
|
308 |
|
309 | - `id` (required)
|
310 | - `typeParameters` (required)
|
311 |
|
312 | ---
|
313 |
|
314 | ### classMethod
|
315 | ```javascript
|
316 | t.classMethod(kind, key, params, body, computed, static)
|
317 | ```
|
318 |
|
319 | See also `t.isClassMethod(node, opts)` and `t.assertClassMethod(node, opts)`.
|
320 |
|
321 | Aliases: `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`
|
322 |
|
323 | - `kind`: `"get" | "set" | "method" | "constructor"` (default: `'method'`)
|
324 | - `key`if computed then `Expression` else `Identifier | Literal` (required)
|
325 | - `params`: `Array<LVal>` (required)
|
326 | - `body`: `BlockStatement` (required)
|
327 | - `computed`: `boolean` (default: `false`)
|
328 | - `static`: `boolean` (default: `false`)
|
329 | - `async`: `boolean` (default: `false`)
|
330 | - `decorators` (default: `null`)
|
331 | - `generator`: `boolean` (default: `false`)
|
332 | - `returnType` (default: `null`)
|
333 | - `typeParameters` (default: `null`)
|
334 |
|
335 | ---
|
336 |
|
337 | ### classProperty
|
338 | ```javascript
|
339 | t.classProperty(key, value, typeAnnotation, decorators, computed)
|
340 | ```
|
341 |
|
342 | See also `t.isClassProperty(node, opts)` and `t.assertClassProperty(node, opts)`.
|
343 |
|
344 | Aliases: `Property`
|
345 |
|
346 | - `key` (required)
|
347 | - `value` (required)
|
348 | - `typeAnnotation` (required)
|
349 | - `decorators` (required)
|
350 | - `computed`: `boolean` (default: `false`)
|
351 |
|
352 | ---
|
353 |
|
354 | ### conditionalExpression
|
355 | ```javascript
|
356 | t.conditionalExpression(test, consequent, alternate)
|
357 | ```
|
358 |
|
359 | See also `t.isConditionalExpression(node, opts)` and `t.assertConditionalExpression(node, opts)`.
|
360 |
|
361 | Aliases: `Expression`, `Conditional`
|
362 |
|
363 | - `test`: `Expression` (required)
|
364 | - `consequent`: `Expression` (required)
|
365 | - `alternate`: `Expression` (required)
|
366 |
|
367 | ---
|
368 |
|
369 | ### continueStatement
|
370 | ```javascript
|
371 | t.continueStatement(label)
|
372 | ```
|
373 |
|
374 | See also `t.isContinueStatement(node, opts)` and `t.assertContinueStatement(node, opts)`.
|
375 |
|
376 | Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
|
377 |
|
378 | - `label`: `Identifier` (default: `null`)
|
379 |
|
380 | ---
|
381 |
|
382 | ### debuggerStatement
|
383 | ```javascript
|
384 | t.debuggerStatement()
|
385 | ```
|
386 |
|
387 | See also `t.isDebuggerStatement(node, opts)` and `t.assertDebuggerStatement(node, opts)`.
|
388 |
|
389 | Aliases: `Statement`
|
390 |
|
391 |
|
392 | ---
|
393 |
|
394 | ### declareClass
|
395 | ```javascript
|
396 | t.declareClass(id, typeParameters, extends, body)
|
397 | ```
|
398 |
|
399 | See also `t.isDeclareClass(node, opts)` and `t.assertDeclareClass(node, opts)`.
|
400 |
|
401 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
402 |
|
403 | - `id` (required)
|
404 | - `typeParameters` (required)
|
405 | - `extends` (required)
|
406 | - `body` (required)
|
407 |
|
408 | ---
|
409 |
|
410 | ### declareExportDeclaration
|
411 | ```javascript
|
412 | t.declareExportDeclaration(declaration, specifiers, source)
|
413 | ```
|
414 |
|
415 | See also `t.isDeclareExportDeclaration(node, opts)` and `t.assertDeclareExportDeclaration(node, opts)`.
|
416 |
|
417 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
418 |
|
419 | - `declaration` (required)
|
420 | - `specifiers` (required)
|
421 | - `source` (required)
|
422 |
|
423 | ---
|
424 |
|
425 | ### declareFunction
|
426 | ```javascript
|
427 | t.declareFunction(id)
|
428 | ```
|
429 |
|
430 | See also `t.isDeclareFunction(node, opts)` and `t.assertDeclareFunction(node, opts)`.
|
431 |
|
432 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
433 |
|
434 | - `id` (required)
|
435 |
|
436 | ---
|
437 |
|
438 | ### declareInterface
|
439 | ```javascript
|
440 | t.declareInterface(id, typeParameters, extends, body)
|
441 | ```
|
442 |
|
443 | See also `t.isDeclareInterface(node, opts)` and `t.assertDeclareInterface(node, opts)`.
|
444 |
|
445 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
446 |
|
447 | - `id` (required)
|
448 | - `typeParameters` (required)
|
449 | - `extends` (required)
|
450 | - `body` (required)
|
451 |
|
452 | ---
|
453 |
|
454 | ### declareModule
|
455 | ```javascript
|
456 | t.declareModule(id, body)
|
457 | ```
|
458 |
|
459 | See also `t.isDeclareModule(node, opts)` and `t.assertDeclareModule(node, opts)`.
|
460 |
|
461 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
462 |
|
463 | - `id` (required)
|
464 | - `body` (required)
|
465 |
|
466 | ---
|
467 |
|
468 | ### declareModuleExports
|
469 | ```javascript
|
470 | t.declareModuleExports(typeAnnotation)
|
471 | ```
|
472 |
|
473 | See also `t.isDeclareModuleExports(node, opts)` and `t.assertDeclareModuleExports(node, opts)`.
|
474 |
|
475 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
476 |
|
477 | - `typeAnnotation` (required)
|
478 |
|
479 | ---
|
480 |
|
481 | ### declareOpaqueType
|
482 | ```javascript
|
483 | t.declareOpaqueType(id, typeParameters, supertype)
|
484 | ```
|
485 |
|
486 | See also `t.isDeclareOpaqueType(node, opts)` and `t.assertDeclareOpaqueType(node, opts)`.
|
487 |
|
488 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
489 |
|
490 | - `id` (required)
|
491 | - `typeParameters` (required)
|
492 | - `supertype` (required)
|
493 |
|
494 | ---
|
495 |
|
496 | ### declareTypeAlias
|
497 | ```javascript
|
498 | t.declareTypeAlias(id, typeParameters, right)
|
499 | ```
|
500 |
|
501 | See also `t.isDeclareTypeAlias(node, opts)` and `t.assertDeclareTypeAlias(node, opts)`.
|
502 |
|
503 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
504 |
|
505 | - `id` (required)
|
506 | - `typeParameters` (required)
|
507 | - `right` (required)
|
508 |
|
509 | ---
|
510 |
|
511 | ### declareVariable
|
512 | ```javascript
|
513 | t.declareVariable(id)
|
514 | ```
|
515 |
|
516 | See also `t.isDeclareVariable(node, opts)` and `t.assertDeclareVariable(node, opts)`.
|
517 |
|
518 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
519 |
|
520 | - `id` (required)
|
521 |
|
522 | ---
|
523 |
|
524 | ### decorator
|
525 | ```javascript
|
526 | t.decorator(expression)
|
527 | ```
|
528 |
|
529 | See also `t.isDecorator(node, opts)` and `t.assertDecorator(node, opts)`.
|
530 |
|
531 | - `expression`: `Expression` (required)
|
532 |
|
533 | ---
|
534 |
|
535 | ### directive
|
536 | ```javascript
|
537 | t.directive(value)
|
538 | ```
|
539 |
|
540 | See also `t.isDirective(node, opts)` and `t.assertDirective(node, opts)`.
|
541 |
|
542 | - `value`: `DirectiveLiteral` (required)
|
543 |
|
544 | ---
|
545 |
|
546 | ### directiveLiteral
|
547 | ```javascript
|
548 | t.directiveLiteral(value)
|
549 | ```
|
550 |
|
551 | See also `t.isDirectiveLiteral(node, opts)` and `t.assertDirectiveLiteral(node, opts)`.
|
552 |
|
553 | - `value`: `string` (required)
|
554 |
|
555 | ---
|
556 |
|
557 | ### doExpression
|
558 | ```javascript
|
559 | t.doExpression(body)
|
560 | ```
|
561 |
|
562 | See also `t.isDoExpression(node, opts)` and `t.assertDoExpression(node, opts)`.
|
563 |
|
564 | Aliases: `Expression`
|
565 |
|
566 | - `body`: `BlockStatement` (required)
|
567 |
|
568 | ---
|
569 |
|
570 | ### doWhileStatement
|
571 | ```javascript
|
572 | t.doWhileStatement(test, body)
|
573 | ```
|
574 |
|
575 | See also `t.isDoWhileStatement(node, opts)` and `t.assertDoWhileStatement(node, opts)`.
|
576 |
|
577 | Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable`
|
578 |
|
579 | - `test`: `Expression` (required)
|
580 | - `body`: `Statement` (required)
|
581 |
|
582 | ---
|
583 |
|
584 | ### emptyStatement
|
585 | ```javascript
|
586 | t.emptyStatement()
|
587 | ```
|
588 |
|
589 | See also `t.isEmptyStatement(node, opts)` and `t.assertEmptyStatement(node, opts)`.
|
590 |
|
591 | Aliases: `Statement`
|
592 |
|
593 |
|
594 | ---
|
595 |
|
596 | ### emptyTypeAnnotation
|
597 | ```javascript
|
598 | t.emptyTypeAnnotation()
|
599 | ```
|
600 |
|
601 | See also `t.isEmptyTypeAnnotation(node, opts)` and `t.assertEmptyTypeAnnotation(node, opts)`.
|
602 |
|
603 | Aliases: `Flow`, `FlowBaseAnnotation`
|
604 |
|
605 |
|
606 | ---
|
607 |
|
608 | ### existentialTypeParam
|
609 | ```javascript
|
610 | t.existentialTypeParam()
|
611 | ```
|
612 |
|
613 | See also `t.isExistentialTypeParam(node, opts)` and `t.assertExistentialTypeParam(node, opts)`.
|
614 |
|
615 | Aliases: `Flow`
|
616 |
|
617 |
|
618 | ---
|
619 |
|
620 | ### exportAllDeclaration
|
621 | ```javascript
|
622 | t.exportAllDeclaration(source)
|
623 | ```
|
624 |
|
625 | See also `t.isExportAllDeclaration(node, opts)` and `t.assertExportAllDeclaration(node, opts)`.
|
626 |
|
627 | Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
|
628 |
|
629 | - `source`: `StringLiteral` (required)
|
630 |
|
631 | ---
|
632 |
|
633 | ### exportDefaultDeclaration
|
634 | ```javascript
|
635 | t.exportDefaultDeclaration(declaration)
|
636 | ```
|
637 |
|
638 | See also `t.isExportDefaultDeclaration(node, opts)` and `t.assertExportDefaultDeclaration(node, opts)`.
|
639 |
|
640 | Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
|
641 |
|
642 | - `declaration`: `FunctionDeclaration | ClassDeclaration | Expression` (required)
|
643 |
|
644 | ---
|
645 |
|
646 | ### exportDefaultSpecifier
|
647 | ```javascript
|
648 | t.exportDefaultSpecifier(exported)
|
649 | ```
|
650 |
|
651 | See also `t.isExportDefaultSpecifier(node, opts)` and `t.assertExportDefaultSpecifier(node, opts)`.
|
652 |
|
653 | Aliases: `ModuleSpecifier`
|
654 |
|
655 | - `exported`: `Identifier` (required)
|
656 |
|
657 | ---
|
658 |
|
659 | ### exportNamedDeclaration
|
660 | ```javascript
|
661 | t.exportNamedDeclaration(declaration, specifiers, source)
|
662 | ```
|
663 |
|
664 | See also `t.isExportNamedDeclaration(node, opts)` and `t.assertExportNamedDeclaration(node, opts)`.
|
665 |
|
666 | Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration`
|
667 |
|
668 | - `declaration`: `Declaration` (default: `null`)
|
669 | - `specifiers`: `Array<ExportSpecifier>` (required)
|
670 | - `source`: `StringLiteral` (default: `null`)
|
671 |
|
672 | ---
|
673 |
|
674 | ### exportNamespaceSpecifier
|
675 | ```javascript
|
676 | t.exportNamespaceSpecifier(exported)
|
677 | ```
|
678 |
|
679 | See also `t.isExportNamespaceSpecifier(node, opts)` and `t.assertExportNamespaceSpecifier(node, opts)`.
|
680 |
|
681 | Aliases: `ModuleSpecifier`
|
682 |
|
683 | - `exported`: `Identifier` (required)
|
684 |
|
685 | ---
|
686 |
|
687 | ### exportSpecifier
|
688 | ```javascript
|
689 | t.exportSpecifier(local, exported)
|
690 | ```
|
691 |
|
692 | See also `t.isExportSpecifier(node, opts)` and `t.assertExportSpecifier(node, opts)`.
|
693 |
|
694 | Aliases: `ModuleSpecifier`
|
695 |
|
696 | - `local`: `Identifier` (required)
|
697 | - `exported`: `Identifier` (required)
|
698 |
|
699 | ---
|
700 |
|
701 | ### expressionStatement
|
702 | ```javascript
|
703 | t.expressionStatement(expression)
|
704 | ```
|
705 |
|
706 | See also `t.isExpressionStatement(node, opts)` and `t.assertExpressionStatement(node, opts)`.
|
707 |
|
708 | Aliases: `Statement`, `ExpressionWrapper`
|
709 |
|
710 | - `expression`: `Expression` (required)
|
711 |
|
712 | ---
|
713 |
|
714 | ### file
|
715 | ```javascript
|
716 | t.file(program, comments, tokens)
|
717 | ```
|
718 |
|
719 | See also `t.isFile(node, opts)` and `t.assertFile(node, opts)`.
|
720 |
|
721 | - `program`: `Program` (required)
|
722 | - `comments` (required)
|
723 | - `tokens` (required)
|
724 |
|
725 | ---
|
726 |
|
727 | ### forAwaitStatement
|
728 | ```javascript
|
729 | t.forAwaitStatement(left, right, body)
|
730 | ```
|
731 |
|
732 | See also `t.isForAwaitStatement(node, opts)` and `t.assertForAwaitStatement(node, opts)`.
|
733 |
|
734 | Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
|
735 |
|
736 | - `left`: `VariableDeclaration | LVal` (required)
|
737 | - `right`: `Expression` (required)
|
738 | - `body`: `Statement` (required)
|
739 |
|
740 | ---
|
741 |
|
742 | ### forInStatement
|
743 | ```javascript
|
744 | t.forInStatement(left, right, body)
|
745 | ```
|
746 |
|
747 | See also `t.isForInStatement(node, opts)` and `t.assertForInStatement(node, opts)`.
|
748 |
|
749 | Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
|
750 |
|
751 | - `left`: `VariableDeclaration | LVal` (required)
|
752 | - `right`: `Expression` (required)
|
753 | - `body`: `Statement` (required)
|
754 |
|
755 | ---
|
756 |
|
757 | ### forOfStatement
|
758 | ```javascript
|
759 | t.forOfStatement(left, right, body)
|
760 | ```
|
761 |
|
762 | See also `t.isForOfStatement(node, opts)` and `t.assertForOfStatement(node, opts)`.
|
763 |
|
764 | Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement`
|
765 |
|
766 | - `left`: `VariableDeclaration | LVal` (required)
|
767 | - `right`: `Expression` (required)
|
768 | - `body`: `Statement` (required)
|
769 |
|
770 | ---
|
771 |
|
772 | ### forStatement
|
773 | ```javascript
|
774 | t.forStatement(init, test, update, body)
|
775 | ```
|
776 |
|
777 | See also `t.isForStatement(node, opts)` and `t.assertForStatement(node, opts)`.
|
778 |
|
779 | Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`
|
780 |
|
781 | - `init`: `VariableDeclaration | Expression` (default: `null`)
|
782 | - `test`: `Expression` (default: `null`)
|
783 | - `update`: `Expression` (default: `null`)
|
784 | - `body`: `Statement` (required)
|
785 |
|
786 | ---
|
787 |
|
788 | ### functionDeclaration
|
789 | ```javascript
|
790 | t.functionDeclaration(id, params, body, generator, async)
|
791 | ```
|
792 |
|
793 | See also `t.isFunctionDeclaration(node, opts)` and `t.assertFunctionDeclaration(node, opts)`.
|
794 |
|
795 | Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Statement`, `Pureish`, `Declaration`
|
796 |
|
797 | - `id`: `Identifier` (required)
|
798 | - `params`: `Array<LVal>` (required)
|
799 | - `body`: `BlockStatement` (required)
|
800 | - `generator`: `boolean` (default: `false`)
|
801 | - `async`: `boolean` (default: `false`)
|
802 | - `returnType` (default: `null`)
|
803 | - `typeParameters` (default: `null`)
|
804 |
|
805 | ---
|
806 |
|
807 | ### functionExpression
|
808 | ```javascript
|
809 | t.functionExpression(id, params, body, generator, async)
|
810 | ```
|
811 |
|
812 | See also `t.isFunctionExpression(node, opts)` and `t.assertFunctionExpression(node, opts)`.
|
813 |
|
814 | Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish`
|
815 |
|
816 | - `id`: `Identifier` (default: `null`)
|
817 | - `params`: `Array<LVal>` (required)
|
818 | - `body`: `BlockStatement` (required)
|
819 | - `generator`: `boolean` (default: `false`)
|
820 | - `async`: `boolean` (default: `false`)
|
821 | - `returnType` (default: `null`)
|
822 | - `typeParameters` (default: `null`)
|
823 |
|
824 | ---
|
825 |
|
826 | ### functionTypeAnnotation
|
827 | ```javascript
|
828 | t.functionTypeAnnotation(typeParameters, params, rest, returnType)
|
829 | ```
|
830 |
|
831 | See also `t.isFunctionTypeAnnotation(node, opts)` and `t.assertFunctionTypeAnnotation(node, opts)`.
|
832 |
|
833 | Aliases: `Flow`
|
834 |
|
835 | - `typeParameters` (required)
|
836 | - `params` (required)
|
837 | - `rest` (required)
|
838 | - `returnType` (required)
|
839 |
|
840 | ---
|
841 |
|
842 | ### functionTypeParam
|
843 | ```javascript
|
844 | t.functionTypeParam(name, typeAnnotation)
|
845 | ```
|
846 |
|
847 | See also `t.isFunctionTypeParam(node, opts)` and `t.assertFunctionTypeParam(node, opts)`.
|
848 |
|
849 | Aliases: `Flow`
|
850 |
|
851 | - `name` (required)
|
852 | - `typeAnnotation` (required)
|
853 |
|
854 | ---
|
855 |
|
856 | ### genericTypeAnnotation
|
857 | ```javascript
|
858 | t.genericTypeAnnotation(id, typeParameters)
|
859 | ```
|
860 |
|
861 | See also `t.isGenericTypeAnnotation(node, opts)` and `t.assertGenericTypeAnnotation(node, opts)`.
|
862 |
|
863 | Aliases: `Flow`
|
864 |
|
865 | - `id` (required)
|
866 | - `typeParameters` (required)
|
867 |
|
868 | ---
|
869 |
|
870 | ### identifier
|
871 | ```javascript
|
872 | t.identifier(name)
|
873 | ```
|
874 |
|
875 | See also `t.isIdentifier(node, opts)` and `t.assertIdentifier(node, opts)`.
|
876 |
|
877 | Aliases: `Expression`, `LVal`
|
878 |
|
879 | - `name``string` (required)
|
880 | - `decorators`: `Array<Decorator>` (default: `null`)
|
881 | - `typeAnnotation` (default: `null`)
|
882 |
|
883 | ---
|
884 |
|
885 | ### ifStatement
|
886 | ```javascript
|
887 | t.ifStatement(test, consequent, alternate)
|
888 | ```
|
889 |
|
890 | See also `t.isIfStatement(node, opts)` and `t.assertIfStatement(node, opts)`.
|
891 |
|
892 | Aliases: `Statement`, `Conditional`
|
893 |
|
894 | - `test`: `Expression` (required)
|
895 | - `consequent`: `Statement` (required)
|
896 | - `alternate`: `Statement` (default: `null`)
|
897 |
|
898 | ---
|
899 |
|
900 | ### import
|
901 | ```javascript
|
902 | t.import()
|
903 | ```
|
904 |
|
905 | See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`.
|
906 |
|
907 | Aliases: `Expression`
|
908 |
|
909 |
|
910 | ---
|
911 |
|
912 | ### importDeclaration
|
913 | ```javascript
|
914 | t.importDeclaration(specifiers, source)
|
915 | ```
|
916 |
|
917 | See also `t.isImportDeclaration(node, opts)` and `t.assertImportDeclaration(node, opts)`.
|
918 |
|
919 | Aliases: `Statement`, `Declaration`, `ModuleDeclaration`
|
920 |
|
921 | - `specifiers`: `Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>` (required)
|
922 | - `source`: `StringLiteral` (required)
|
923 |
|
924 | ---
|
925 |
|
926 | ### importDefaultSpecifier
|
927 | ```javascript
|
928 | t.importDefaultSpecifier(local)
|
929 | ```
|
930 |
|
931 | See also `t.isImportDefaultSpecifier(node, opts)` and `t.assertImportDefaultSpecifier(node, opts)`.
|
932 |
|
933 | Aliases: `ModuleSpecifier`
|
934 |
|
935 | - `local`: `Identifier` (required)
|
936 |
|
937 | ---
|
938 |
|
939 | ### importNamespaceSpecifier
|
940 | ```javascript
|
941 | t.importNamespaceSpecifier(local)
|
942 | ```
|
943 |
|
944 | See also `t.isImportNamespaceSpecifier(node, opts)` and `t.assertImportNamespaceSpecifier(node, opts)`.
|
945 |
|
946 | Aliases: `ModuleSpecifier`
|
947 |
|
948 | - `local`: `Identifier` (required)
|
949 |
|
950 | ---
|
951 |
|
952 | ### importSpecifier
|
953 | ```javascript
|
954 | t.importSpecifier(local, imported)
|
955 | ```
|
956 |
|
957 | See also `t.isImportSpecifier(node, opts)` and `t.assertImportSpecifier(node, opts)`.
|
958 |
|
959 | Aliases: `ModuleSpecifier`
|
960 |
|
961 | - `local`: `Identifier` (required)
|
962 | - `imported`: `Identifier` (required)
|
963 | - `importKind`: `null | 'type' | 'typeof'` (default: `null`)
|
964 |
|
965 | ---
|
966 |
|
967 | ### interfaceDeclaration
|
968 | ```javascript
|
969 | t.interfaceDeclaration(id, typeParameters, extends, body)
|
970 | ```
|
971 |
|
972 | See also `t.isInterfaceDeclaration(node, opts)` and `t.assertInterfaceDeclaration(node, opts)`.
|
973 |
|
974 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
975 |
|
976 | - `id` (required)
|
977 | - `typeParameters` (required)
|
978 | - `extends` (required)
|
979 | - `body` (required)
|
980 |
|
981 | ---
|
982 |
|
983 | ### interfaceExtends
|
984 | ```javascript
|
985 | t.interfaceExtends(id, typeParameters)
|
986 | ```
|
987 |
|
988 | See also `t.isInterfaceExtends(node, opts)` and `t.assertInterfaceExtends(node, opts)`.
|
989 |
|
990 | Aliases: `Flow`
|
991 |
|
992 | - `id` (required)
|
993 | - `typeParameters` (required)
|
994 |
|
995 | ---
|
996 |
|
997 | ### intersectionTypeAnnotation
|
998 | ```javascript
|
999 | t.intersectionTypeAnnotation(types)
|
1000 | ```
|
1001 |
|
1002 | See also `t.isIntersectionTypeAnnotation(node, opts)` and `t.assertIntersectionTypeAnnotation(node, opts)`.
|
1003 |
|
1004 | Aliases: `Flow`
|
1005 |
|
1006 | - `types` (required)
|
1007 |
|
1008 | ---
|
1009 |
|
1010 | ### jSXAttribute
|
1011 | ```javascript
|
1012 | t.jSXAttribute(name, value)
|
1013 | ```
|
1014 |
|
1015 | See also `t.isJSXAttribute(node, opts)` and `t.assertJSXAttribute(node, opts)`.
|
1016 |
|
1017 | Aliases: `JSX`, `Immutable`
|
1018 |
|
1019 | - `name`: `JSXIdentifier | JSXNamespacedName` (required)
|
1020 | - `value`: `JSXElement | StringLiteral | JSXExpressionContainer` (default: `null`)
|
1021 |
|
1022 | ---
|
1023 |
|
1024 | ### jSXClosingElement
|
1025 | ```javascript
|
1026 | t.jSXClosingElement(name)
|
1027 | ```
|
1028 |
|
1029 | See also `t.isJSXClosingElement(node, opts)` and `t.assertJSXClosingElement(node, opts)`.
|
1030 |
|
1031 | Aliases: `JSX`, `Immutable`
|
1032 |
|
1033 | - `name`: `JSXIdentifier | JSXMemberExpression` (required)
|
1034 |
|
1035 | ---
|
1036 |
|
1037 | ### jSXElement
|
1038 | ```javascript
|
1039 | t.jSXElement(openingElement, closingElement, children, selfClosing)
|
1040 | ```
|
1041 |
|
1042 | See also `t.isJSXElement(node, opts)` and `t.assertJSXElement(node, opts)`.
|
1043 |
|
1044 | Aliases: `JSX`, `Immutable`, `Expression`
|
1045 |
|
1046 | - `openingElement`: `JSXOpeningElement` (required)
|
1047 | - `closingElement`: `JSXClosingElement` (default: `null`)
|
1048 | - `children`: `Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement>` (required)
|
1049 | - `selfClosing` (required)
|
1050 |
|
1051 | ---
|
1052 |
|
1053 | ### jSXEmptyExpression
|
1054 | ```javascript
|
1055 | t.jSXEmptyExpression()
|
1056 | ```
|
1057 |
|
1058 | See also `t.isJSXEmptyExpression(node, opts)` and `t.assertJSXEmptyExpression(node, opts)`.
|
1059 |
|
1060 | Aliases: `JSX`, `Expression`
|
1061 |
|
1062 |
|
1063 | ---
|
1064 |
|
1065 | ### jSXExpressionContainer
|
1066 | ```javascript
|
1067 | t.jSXExpressionContainer(expression)
|
1068 | ```
|
1069 |
|
1070 | See also `t.isJSXExpressionContainer(node, opts)` and `t.assertJSXExpressionContainer(node, opts)`.
|
1071 |
|
1072 | Aliases: `JSX`, `Immutable`
|
1073 |
|
1074 | - `expression`: `Expression` (required)
|
1075 |
|
1076 | ---
|
1077 |
|
1078 | ### jSXIdentifier
|
1079 | ```javascript
|
1080 | t.jSXIdentifier(name)
|
1081 | ```
|
1082 |
|
1083 | See also `t.isJSXIdentifier(node, opts)` and `t.assertJSXIdentifier(node, opts)`.
|
1084 |
|
1085 | Aliases: `JSX`, `Expression`
|
1086 |
|
1087 | - `name`: `string` (required)
|
1088 |
|
1089 | ---
|
1090 |
|
1091 | ### jSXMemberExpression
|
1092 | ```javascript
|
1093 | t.jSXMemberExpression(object, property)
|
1094 | ```
|
1095 |
|
1096 | See also `t.isJSXMemberExpression(node, opts)` and `t.assertJSXMemberExpression(node, opts)`.
|
1097 |
|
1098 | Aliases: `JSX`, `Expression`
|
1099 |
|
1100 | - `object`: `JSXMemberExpression | JSXIdentifier` (required)
|
1101 | - `property`: `JSXIdentifier` (required)
|
1102 |
|
1103 | ---
|
1104 |
|
1105 | ### jSXNamespacedName
|
1106 | ```javascript
|
1107 | t.jSXNamespacedName(namespace, name)
|
1108 | ```
|
1109 |
|
1110 | See also `t.isJSXNamespacedName(node, opts)` and `t.assertJSXNamespacedName(node, opts)`.
|
1111 |
|
1112 | Aliases: `JSX`
|
1113 |
|
1114 | - `namespace`: `JSXIdentifier` (required)
|
1115 | - `name`: `JSXIdentifier` (required)
|
1116 |
|
1117 | ---
|
1118 |
|
1119 | ### jSXOpeningElement
|
1120 | ```javascript
|
1121 | t.jSXOpeningElement(name, attributes, selfClosing)
|
1122 | ```
|
1123 |
|
1124 | See also `t.isJSXOpeningElement(node, opts)` and `t.assertJSXOpeningElement(node, opts)`.
|
1125 |
|
1126 | Aliases: `JSX`, `Immutable`
|
1127 |
|
1128 | - `name`: `JSXIdentifier | JSXMemberExpression` (required)
|
1129 | - `attributes`: `Array<JSXAttribute | JSXSpreadAttribute>` (required)
|
1130 | - `selfClosing`: `boolean` (default: `false`)
|
1131 |
|
1132 | ---
|
1133 |
|
1134 | ### jSXSpreadAttribute
|
1135 | ```javascript
|
1136 | t.jSXSpreadAttribute(argument)
|
1137 | ```
|
1138 |
|
1139 | See also `t.isJSXSpreadAttribute(node, opts)` and `t.assertJSXSpreadAttribute(node, opts)`.
|
1140 |
|
1141 | Aliases: `JSX`
|
1142 |
|
1143 | - `argument`: `Expression` (required)
|
1144 |
|
1145 | ---
|
1146 |
|
1147 | ### jSXSpreadChild
|
1148 | ```javascript
|
1149 | t.jSXSpreadChild(expression)
|
1150 | ```
|
1151 |
|
1152 | See also `t.isJSXSpreadChild(node, opts)` and `t.assertJSXSpreadChild(node, opts)`.
|
1153 |
|
1154 | Aliases: `JSX`, `Immutable`
|
1155 |
|
1156 | - `expression`: `Expression` (required)
|
1157 |
|
1158 | ---
|
1159 |
|
1160 | ### jSXText
|
1161 | ```javascript
|
1162 | t.jSXText(value)
|
1163 | ```
|
1164 |
|
1165 | See also `t.isJSXText(node, opts)` and `t.assertJSXText(node, opts)`.
|
1166 |
|
1167 | Aliases: `JSX`, `Immutable`
|
1168 |
|
1169 | - `value`: `string` (required)
|
1170 |
|
1171 | ---
|
1172 |
|
1173 | ### labeledStatement
|
1174 | ```javascript
|
1175 | t.labeledStatement(label, body)
|
1176 | ```
|
1177 |
|
1178 | See also `t.isLabeledStatement(node, opts)` and `t.assertLabeledStatement(node, opts)`.
|
1179 |
|
1180 | Aliases: `Statement`
|
1181 |
|
1182 | - `label`: `Identifier` (required)
|
1183 | - `body`: `Statement` (required)
|
1184 |
|
1185 | ---
|
1186 |
|
1187 | ### logicalExpression
|
1188 | ```javascript
|
1189 | t.logicalExpression(operator, left, right)
|
1190 | ```
|
1191 |
|
1192 | See also `t.isLogicalExpression(node, opts)` and `t.assertLogicalExpression(node, opts)`.
|
1193 |
|
1194 | Aliases: `Binary`, `Expression`
|
1195 |
|
1196 | - `operator`: `'||' | '&&'` (required)
|
1197 | - `left`: `Expression` (required)
|
1198 | - `right`: `Expression` (required)
|
1199 |
|
1200 | ---
|
1201 |
|
1202 | ### memberExpression
|
1203 | ```javascript
|
1204 | t.memberExpression(object, property, computed)
|
1205 | ```
|
1206 |
|
1207 | See also `t.isMemberExpression(node, opts)` and `t.assertMemberExpression(node, opts)`.
|
1208 |
|
1209 | Aliases: `Expression`, `LVal`
|
1210 |
|
1211 | - `object`: `Expression` (required)
|
1212 | - `property`if computed then `Expression` else `Identifier` (required)
|
1213 | - `computed`: `boolean` (default: `false`)
|
1214 |
|
1215 | ---
|
1216 |
|
1217 | ### metaProperty
|
1218 | ```javascript
|
1219 | t.metaProperty(meta, property)
|
1220 | ```
|
1221 |
|
1222 | See also `t.isMetaProperty(node, opts)` and `t.assertMetaProperty(node, opts)`.
|
1223 |
|
1224 | Aliases: `Expression`
|
1225 |
|
1226 | - `meta`: `string` (required)
|
1227 | - `property`: `string` (required)
|
1228 |
|
1229 | ---
|
1230 |
|
1231 | ### mixedTypeAnnotation
|
1232 | ```javascript
|
1233 | t.mixedTypeAnnotation()
|
1234 | ```
|
1235 |
|
1236 | See also `t.isMixedTypeAnnotation(node, opts)` and `t.assertMixedTypeAnnotation(node, opts)`.
|
1237 |
|
1238 | Aliases: `Flow`, `FlowBaseAnnotation`
|
1239 |
|
1240 |
|
1241 | ---
|
1242 |
|
1243 | ### newExpression
|
1244 | ```javascript
|
1245 | t.newExpression(callee, arguments)
|
1246 | ```
|
1247 |
|
1248 | See also `t.isNewExpression(node, opts)` and `t.assertNewExpression(node, opts)`.
|
1249 |
|
1250 | Aliases: `Expression`
|
1251 |
|
1252 | - `callee`: `Expression` (required)
|
1253 | - `arguments`: `Array<Expression | SpreadElement>` (required)
|
1254 |
|
1255 | ---
|
1256 |
|
1257 | ### noop
|
1258 | ```javascript
|
1259 | t.noop()
|
1260 | ```
|
1261 |
|
1262 | See also `t.isNoop(node, opts)` and `t.assertNoop(node, opts)`.
|
1263 |
|
1264 |
|
1265 | ---
|
1266 |
|
1267 | ### nullLiteral
|
1268 | ```javascript
|
1269 | t.nullLiteral()
|
1270 | ```
|
1271 |
|
1272 | See also `t.isNullLiteral(node, opts)` and `t.assertNullLiteral(node, opts)`.
|
1273 |
|
1274 | Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
|
1275 |
|
1276 |
|
1277 | ---
|
1278 |
|
1279 | ### nullLiteralTypeAnnotation
|
1280 | ```javascript
|
1281 | t.nullLiteralTypeAnnotation()
|
1282 | ```
|
1283 |
|
1284 | See also `t.isNullLiteralTypeAnnotation(node, opts)` and `t.assertNullLiteralTypeAnnotation(node, opts)`.
|
1285 |
|
1286 | Aliases: `Flow`, `FlowBaseAnnotation`
|
1287 |
|
1288 |
|
1289 | ---
|
1290 |
|
1291 | ### nullableTypeAnnotation
|
1292 | ```javascript
|
1293 | t.nullableTypeAnnotation(typeAnnotation)
|
1294 | ```
|
1295 |
|
1296 | See also `t.isNullableTypeAnnotation(node, opts)` and `t.assertNullableTypeAnnotation(node, opts)`.
|
1297 |
|
1298 | Aliases: `Flow`
|
1299 |
|
1300 | - `typeAnnotation` (required)
|
1301 |
|
1302 | ---
|
1303 |
|
1304 | ### numberTypeAnnotation
|
1305 | ```javascript
|
1306 | t.numberTypeAnnotation()
|
1307 | ```
|
1308 |
|
1309 | See also `t.isNumberTypeAnnotation(node, opts)` and `t.assertNumberTypeAnnotation(node, opts)`.
|
1310 |
|
1311 | Aliases: `Flow`, `FlowBaseAnnotation`
|
1312 |
|
1313 |
|
1314 | ---
|
1315 |
|
1316 | ### numericLiteral
|
1317 | ```javascript
|
1318 | t.numericLiteral(value)
|
1319 | ```
|
1320 |
|
1321 | See also `t.isNumericLiteral(node, opts)` and `t.assertNumericLiteral(node, opts)`.
|
1322 |
|
1323 | Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
|
1324 |
|
1325 | - `value`: `number` (required)
|
1326 |
|
1327 | ---
|
1328 |
|
1329 | ### numericLiteralTypeAnnotation
|
1330 | ```javascript
|
1331 | t.numericLiteralTypeAnnotation()
|
1332 | ```
|
1333 |
|
1334 | See also `t.isNumericLiteralTypeAnnotation(node, opts)` and `t.assertNumericLiteralTypeAnnotation(node, opts)`.
|
1335 |
|
1336 | Aliases: `Flow`
|
1337 |
|
1338 |
|
1339 | ---
|
1340 |
|
1341 | ### objectExpression
|
1342 | ```javascript
|
1343 | t.objectExpression(properties)
|
1344 | ```
|
1345 |
|
1346 | See also `t.isObjectExpression(node, opts)` and `t.assertObjectExpression(node, opts)`.
|
1347 |
|
1348 | Aliases: `Expression`
|
1349 |
|
1350 | - `properties`: `Array<ObjectMethod | ObjectProperty | SpreadProperty>` (required)
|
1351 |
|
1352 | ---
|
1353 |
|
1354 | ### objectMethod
|
1355 | ```javascript
|
1356 | t.objectMethod(kind, key, params, body, computed)
|
1357 | ```
|
1358 |
|
1359 | See also `t.isObjectMethod(node, opts)` and `t.assertObjectMethod(node, opts)`.
|
1360 |
|
1361 | Aliases: `UserWhitespacable`, `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`, `ObjectMember`
|
1362 |
|
1363 | - `kind`: `"method" | "get" | "set"` (default: `'method'`)
|
1364 | - `key`if computed then `Expression` else `Identifier | Literal` (required)
|
1365 | - `params` (required)
|
1366 | - `body`: `BlockStatement` (required)
|
1367 | - `computed`: `boolean` (default: `false`)
|
1368 | - `async`: `boolean` (default: `false`)
|
1369 | - `decorators`: `Array<Decorator>` (default: `null`)
|
1370 | - `generator`: `boolean` (default: `false`)
|
1371 | - `returnType` (default: `null`)
|
1372 | - `typeParameters` (default: `null`)
|
1373 |
|
1374 | ---
|
1375 |
|
1376 | ### objectPattern
|
1377 | ```javascript
|
1378 | t.objectPattern(properties, typeAnnotation)
|
1379 | ```
|
1380 |
|
1381 | See also `t.isObjectPattern(node, opts)` and `t.assertObjectPattern(node, opts)`.
|
1382 |
|
1383 | Aliases: `Pattern`, `LVal`
|
1384 |
|
1385 | - `properties`: `Array<RestProperty | Property>` (required)
|
1386 | - `typeAnnotation` (required)
|
1387 | - `decorators`: `Array<Decorator>` (default: `null`)
|
1388 |
|
1389 | ---
|
1390 |
|
1391 | ### objectProperty
|
1392 | ```javascript
|
1393 | t.objectProperty(key, value, computed, shorthand, decorators)
|
1394 | ```
|
1395 |
|
1396 | See also `t.isObjectProperty(node, opts)` and `t.assertObjectProperty(node, opts)`.
|
1397 |
|
1398 | Aliases: `UserWhitespacable`, `Property`, `ObjectMember`
|
1399 |
|
1400 | - `key`if computed then `Expression` else `Identifier | Literal` (required)
|
1401 | - `value`: `Expression | Pattern | RestElement` (required)
|
1402 | - `computed`: `boolean` (default: `false`)
|
1403 | - `shorthand`: `boolean` (default: `false`)
|
1404 | - `decorators`: `Array<Decorator>` (default: `null`)
|
1405 |
|
1406 | ---
|
1407 |
|
1408 | ### objectTypeAnnotation
|
1409 | ```javascript
|
1410 | t.objectTypeAnnotation(properties, indexers, callProperties)
|
1411 | ```
|
1412 |
|
1413 | See also `t.isObjectTypeAnnotation(node, opts)` and `t.assertObjectTypeAnnotation(node, opts)`.
|
1414 |
|
1415 | Aliases: `Flow`
|
1416 |
|
1417 | - `properties` (required)
|
1418 | - `indexers` (required)
|
1419 | - `callProperties` (required)
|
1420 |
|
1421 | ---
|
1422 |
|
1423 | ### objectTypeCallProperty
|
1424 | ```javascript
|
1425 | t.objectTypeCallProperty(value)
|
1426 | ```
|
1427 |
|
1428 | See also `t.isObjectTypeCallProperty(node, opts)` and `t.assertObjectTypeCallProperty(node, opts)`.
|
1429 |
|
1430 | Aliases: `Flow`, `UserWhitespacable`
|
1431 |
|
1432 | - `value` (required)
|
1433 |
|
1434 | ---
|
1435 |
|
1436 | ### objectTypeIndexer
|
1437 | ```javascript
|
1438 | t.objectTypeIndexer(id, key, value)
|
1439 | ```
|
1440 |
|
1441 | See also `t.isObjectTypeIndexer(node, opts)` and `t.assertObjectTypeIndexer(node, opts)`.
|
1442 |
|
1443 | Aliases: `Flow`, `UserWhitespacable`
|
1444 |
|
1445 | - `id` (required)
|
1446 | - `key` (required)
|
1447 | - `value` (required)
|
1448 |
|
1449 | ---
|
1450 |
|
1451 | ### objectTypeProperty
|
1452 | ```javascript
|
1453 | t.objectTypeProperty(key, value)
|
1454 | ```
|
1455 |
|
1456 | See also `t.isObjectTypeProperty(node, opts)` and `t.assertObjectTypeProperty(node, opts)`.
|
1457 |
|
1458 | Aliases: `Flow`, `UserWhitespacable`
|
1459 |
|
1460 | - `key` (required)
|
1461 | - `value` (required)
|
1462 |
|
1463 | ---
|
1464 |
|
1465 | ### objectTypeSpreadProperty
|
1466 | ```javascript
|
1467 | t.objectTypeSpreadProperty(argument)
|
1468 | ```
|
1469 |
|
1470 | See also `t.isObjectTypeSpreadProperty(node, opts)` and `t.assertObjectTypeSpreadProperty(node, opts)`.
|
1471 |
|
1472 | Aliases: `Flow`, `UserWhitespacable`
|
1473 |
|
1474 | - `argument` (required)
|
1475 |
|
1476 | ---
|
1477 |
|
1478 | ### opaqueType
|
1479 | ```javascript
|
1480 | t.opaqueType(id, typeParameters, impltype, supertype)
|
1481 | ```
|
1482 |
|
1483 | See also `t.isOpaqueType(node, opts)` and `t.assertOpaqueType(node, opts)`.
|
1484 |
|
1485 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
1486 |
|
1487 | - `id` (required)
|
1488 | - `typeParameters` (required)
|
1489 | - `impltype` (required)
|
1490 | - `supertype` (required)
|
1491 |
|
1492 | ---
|
1493 |
|
1494 | ### parenthesizedExpression
|
1495 | ```javascript
|
1496 | t.parenthesizedExpression(expression)
|
1497 | ```
|
1498 |
|
1499 | See also `t.isParenthesizedExpression(node, opts)` and `t.assertParenthesizedExpression(node, opts)`.
|
1500 |
|
1501 | Aliases: `Expression`, `ExpressionWrapper`
|
1502 |
|
1503 | - `expression`: `Expression` (required)
|
1504 |
|
1505 | ---
|
1506 |
|
1507 | ### program
|
1508 | ```javascript
|
1509 | t.program(body, directives)
|
1510 | ```
|
1511 |
|
1512 | See also `t.isProgram(node, opts)` and `t.assertProgram(node, opts)`.
|
1513 |
|
1514 | Aliases: `Scopable`, `BlockParent`, `Block`, `FunctionParent`
|
1515 |
|
1516 | - `body`: `Array<Statement>` (required)
|
1517 | - `directives`: `Array<Directive>` (default: `[]`)
|
1518 |
|
1519 | ---
|
1520 |
|
1521 | ### qualifiedTypeIdentifier
|
1522 | ```javascript
|
1523 | t.qualifiedTypeIdentifier(id, qualification)
|
1524 | ```
|
1525 |
|
1526 | See also `t.isQualifiedTypeIdentifier(node, opts)` and `t.assertQualifiedTypeIdentifier(node, opts)`.
|
1527 |
|
1528 | Aliases: `Flow`
|
1529 |
|
1530 | - `id` (required)
|
1531 | - `qualification` (required)
|
1532 |
|
1533 | ---
|
1534 |
|
1535 | ### regExpLiteral
|
1536 | ```javascript
|
1537 | t.regExpLiteral(pattern, flags)
|
1538 | ```
|
1539 |
|
1540 | See also `t.isRegExpLiteral(node, opts)` and `t.assertRegExpLiteral(node, opts)`.
|
1541 |
|
1542 | Aliases: `Expression`, `Literal`
|
1543 |
|
1544 | - `pattern`: `string` (required)
|
1545 | - `flags`: `string` (default: `''`)
|
1546 |
|
1547 | ---
|
1548 |
|
1549 | ### restElement
|
1550 | ```javascript
|
1551 | t.restElement(argument, typeAnnotation)
|
1552 | ```
|
1553 |
|
1554 | See also `t.isRestElement(node, opts)` and `t.assertRestElement(node, opts)`.
|
1555 |
|
1556 | Aliases: `LVal`
|
1557 |
|
1558 | - `argument`: `LVal` (required)
|
1559 | - `typeAnnotation` (required)
|
1560 | - `decorators`: `Array<Decorator>` (default: `null`)
|
1561 |
|
1562 | ---
|
1563 |
|
1564 | ### restProperty
|
1565 | ```javascript
|
1566 | t.restProperty(argument)
|
1567 | ```
|
1568 |
|
1569 | See also `t.isRestProperty(node, opts)` and `t.assertRestProperty(node, opts)`.
|
1570 |
|
1571 | Aliases: `UnaryLike`
|
1572 |
|
1573 | - `argument`: `LVal` (required)
|
1574 |
|
1575 | ---
|
1576 |
|
1577 | ### returnStatement
|
1578 | ```javascript
|
1579 | t.returnStatement(argument)
|
1580 | ```
|
1581 |
|
1582 | See also `t.isReturnStatement(node, opts)` and `t.assertReturnStatement(node, opts)`.
|
1583 |
|
1584 | Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
|
1585 |
|
1586 | - `argument`: `Expression` (default: `null`)
|
1587 |
|
1588 | ---
|
1589 |
|
1590 | ### sequenceExpression
|
1591 | ```javascript
|
1592 | t.sequenceExpression(expressions)
|
1593 | ```
|
1594 |
|
1595 | See also `t.isSequenceExpression(node, opts)` and `t.assertSequenceExpression(node, opts)`.
|
1596 |
|
1597 | Aliases: `Expression`
|
1598 |
|
1599 | - `expressions`: `Array<Expression>` (required)
|
1600 |
|
1601 | ---
|
1602 |
|
1603 | ### spreadElement
|
1604 | ```javascript
|
1605 | t.spreadElement(argument)
|
1606 | ```
|
1607 |
|
1608 | See also `t.isSpreadElement(node, opts)` and `t.assertSpreadElement(node, opts)`.
|
1609 |
|
1610 | Aliases: `UnaryLike`
|
1611 |
|
1612 | - `argument`: `Expression` (required)
|
1613 |
|
1614 | ---
|
1615 |
|
1616 | ### spreadProperty
|
1617 | ```javascript
|
1618 | t.spreadProperty(argument)
|
1619 | ```
|
1620 |
|
1621 | See also `t.isSpreadProperty(node, opts)` and `t.assertSpreadProperty(node, opts)`.
|
1622 |
|
1623 | Aliases: `UnaryLike`
|
1624 |
|
1625 | - `argument`: `Expression` (required)
|
1626 |
|
1627 | ---
|
1628 |
|
1629 | ### stringLiteral
|
1630 | ```javascript
|
1631 | t.stringLiteral(value)
|
1632 | ```
|
1633 |
|
1634 | See also `t.isStringLiteral(node, opts)` and `t.assertStringLiteral(node, opts)`.
|
1635 |
|
1636 | Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
|
1637 |
|
1638 | - `value`: `string` (required)
|
1639 |
|
1640 | ---
|
1641 |
|
1642 | ### stringLiteralTypeAnnotation
|
1643 | ```javascript
|
1644 | t.stringLiteralTypeAnnotation()
|
1645 | ```
|
1646 |
|
1647 | See also `t.isStringLiteralTypeAnnotation(node, opts)` and `t.assertStringLiteralTypeAnnotation(node, opts)`.
|
1648 |
|
1649 | Aliases: `Flow`
|
1650 |
|
1651 |
|
1652 | ---
|
1653 |
|
1654 | ### stringTypeAnnotation
|
1655 | ```javascript
|
1656 | t.stringTypeAnnotation()
|
1657 | ```
|
1658 |
|
1659 | See also `t.isStringTypeAnnotation(node, opts)` and `t.assertStringTypeAnnotation(node, opts)`.
|
1660 |
|
1661 | Aliases: `Flow`, `FlowBaseAnnotation`
|
1662 |
|
1663 |
|
1664 | ---
|
1665 |
|
1666 | ### super
|
1667 | ```javascript
|
1668 | t.super()
|
1669 | ```
|
1670 |
|
1671 | See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`.
|
1672 |
|
1673 | Aliases: `Expression`
|
1674 |
|
1675 |
|
1676 | ---
|
1677 |
|
1678 | ### switchCase
|
1679 | ```javascript
|
1680 | t.switchCase(test, consequent)
|
1681 | ```
|
1682 |
|
1683 | See also `t.isSwitchCase(node, opts)` and `t.assertSwitchCase(node, opts)`.
|
1684 |
|
1685 | - `test`: `Expression` (default: `null`)
|
1686 | - `consequent`: `Array<Statement>` (required)
|
1687 |
|
1688 | ---
|
1689 |
|
1690 | ### switchStatement
|
1691 | ```javascript
|
1692 | t.switchStatement(discriminant, cases)
|
1693 | ```
|
1694 |
|
1695 | See also `t.isSwitchStatement(node, opts)` and `t.assertSwitchStatement(node, opts)`.
|
1696 |
|
1697 | Aliases: `Statement`, `BlockParent`, `Scopable`
|
1698 |
|
1699 | - `discriminant`: `Expression` (required)
|
1700 | - `cases`: `Array<SwitchCase>` (required)
|
1701 |
|
1702 | ---
|
1703 |
|
1704 | ### taggedTemplateExpression
|
1705 | ```javascript
|
1706 | t.taggedTemplateExpression(tag, quasi)
|
1707 | ```
|
1708 |
|
1709 | See also `t.isTaggedTemplateExpression(node, opts)` and `t.assertTaggedTemplateExpression(node, opts)`.
|
1710 |
|
1711 | Aliases: `Expression`
|
1712 |
|
1713 | - `tag`: `Expression` (required)
|
1714 | - `quasi`: `TemplateLiteral` (required)
|
1715 |
|
1716 | ---
|
1717 |
|
1718 | ### templateElement
|
1719 | ```javascript
|
1720 | t.templateElement(value, tail)
|
1721 | ```
|
1722 |
|
1723 | See also `t.isTemplateElement(node, opts)` and `t.assertTemplateElement(node, opts)`.
|
1724 |
|
1725 | - `value` (required)
|
1726 | - `tail`: `boolean` (default: `false`)
|
1727 |
|
1728 | ---
|
1729 |
|
1730 | ### templateLiteral
|
1731 | ```javascript
|
1732 | t.templateLiteral(quasis, expressions)
|
1733 | ```
|
1734 |
|
1735 | See also `t.isTemplateLiteral(node, opts)` and `t.assertTemplateLiteral(node, opts)`.
|
1736 |
|
1737 | Aliases: `Expression`, `Literal`
|
1738 |
|
1739 | - `quasis`: `Array<TemplateElement>` (required)
|
1740 | - `expressions`: `Array<Expression>` (required)
|
1741 |
|
1742 | ---
|
1743 |
|
1744 | ### thisExpression
|
1745 | ```javascript
|
1746 | t.thisExpression()
|
1747 | ```
|
1748 |
|
1749 | See also `t.isThisExpression(node, opts)` and `t.assertThisExpression(node, opts)`.
|
1750 |
|
1751 | Aliases: `Expression`
|
1752 |
|
1753 |
|
1754 | ---
|
1755 |
|
1756 | ### thisTypeAnnotation
|
1757 | ```javascript
|
1758 | t.thisTypeAnnotation()
|
1759 | ```
|
1760 |
|
1761 | See also `t.isThisTypeAnnotation(node, opts)` and `t.assertThisTypeAnnotation(node, opts)`.
|
1762 |
|
1763 | Aliases: `Flow`, `FlowBaseAnnotation`
|
1764 |
|
1765 |
|
1766 | ---
|
1767 |
|
1768 | ### throwStatement
|
1769 | ```javascript
|
1770 | t.throwStatement(argument)
|
1771 | ```
|
1772 |
|
1773 | See also `t.isThrowStatement(node, opts)` and `t.assertThrowStatement(node, opts)`.
|
1774 |
|
1775 | Aliases: `Statement`, `Terminatorless`, `CompletionStatement`
|
1776 |
|
1777 | - `argument`: `Expression` (required)
|
1778 |
|
1779 | ---
|
1780 |
|
1781 | ### tryStatement
|
1782 | ```javascript
|
1783 | t.tryStatement(block, handler, finalizer)
|
1784 | ```
|
1785 |
|
1786 | See also `t.isTryStatement(node, opts)` and `t.assertTryStatement(node, opts)`.
|
1787 |
|
1788 | Aliases: `Statement`
|
1789 |
|
1790 | - `block` (required)
|
1791 | - `handler` (default: `null`)
|
1792 | - `finalizer`: `BlockStatement` (default: `null`)
|
1793 | - `body`: `BlockStatement` (default: `null`)
|
1794 |
|
1795 | ---
|
1796 |
|
1797 | ### tupleTypeAnnotation
|
1798 | ```javascript
|
1799 | t.tupleTypeAnnotation(types)
|
1800 | ```
|
1801 |
|
1802 | See also `t.isTupleTypeAnnotation(node, opts)` and `t.assertTupleTypeAnnotation(node, opts)`.
|
1803 |
|
1804 | Aliases: `Flow`
|
1805 |
|
1806 | - `types` (required)
|
1807 |
|
1808 | ---
|
1809 |
|
1810 | ### typeAlias
|
1811 | ```javascript
|
1812 | t.typeAlias(id, typeParameters, right)
|
1813 | ```
|
1814 |
|
1815 | See also `t.isTypeAlias(node, opts)` and `t.assertTypeAlias(node, opts)`.
|
1816 |
|
1817 | Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration`
|
1818 |
|
1819 | - `id` (required)
|
1820 | - `typeParameters` (required)
|
1821 | - `right` (required)
|
1822 |
|
1823 | ---
|
1824 |
|
1825 | ### typeAnnotation
|
1826 | ```javascript
|
1827 | t.typeAnnotation(typeAnnotation)
|
1828 | ```
|
1829 |
|
1830 | See also `t.isTypeAnnotation(node, opts)` and `t.assertTypeAnnotation(node, opts)`.
|
1831 |
|
1832 | Aliases: `Flow`
|
1833 |
|
1834 | - `typeAnnotation` (required)
|
1835 |
|
1836 | ---
|
1837 |
|
1838 | ### typeCastExpression
|
1839 | ```javascript
|
1840 | t.typeCastExpression(expression, typeAnnotation)
|
1841 | ```
|
1842 |
|
1843 | See also `t.isTypeCastExpression(node, opts)` and `t.assertTypeCastExpression(node, opts)`.
|
1844 |
|
1845 | Aliases: `Flow`, `ExpressionWrapper`, `Expression`
|
1846 |
|
1847 | - `expression` (required)
|
1848 | - `typeAnnotation` (required)
|
1849 |
|
1850 | ---
|
1851 |
|
1852 | ### typeParameter
|
1853 | ```javascript
|
1854 | t.typeParameter(bound)
|
1855 | ```
|
1856 |
|
1857 | See also `t.isTypeParameter(node, opts)` and `t.assertTypeParameter(node, opts)`.
|
1858 |
|
1859 | Aliases: `Flow`
|
1860 |
|
1861 | - `bound` (required)
|
1862 |
|
1863 | ---
|
1864 |
|
1865 | ### typeParameterDeclaration
|
1866 | ```javascript
|
1867 | t.typeParameterDeclaration(params)
|
1868 | ```
|
1869 |
|
1870 | See also `t.isTypeParameterDeclaration(node, opts)` and `t.assertTypeParameterDeclaration(node, opts)`.
|
1871 |
|
1872 | Aliases: `Flow`
|
1873 |
|
1874 | - `params` (required)
|
1875 |
|
1876 | ---
|
1877 |
|
1878 | ### typeParameterInstantiation
|
1879 | ```javascript
|
1880 | t.typeParameterInstantiation(params)
|
1881 | ```
|
1882 |
|
1883 | See also `t.isTypeParameterInstantiation(node, opts)` and `t.assertTypeParameterInstantiation(node, opts)`.
|
1884 |
|
1885 | Aliases: `Flow`
|
1886 |
|
1887 | - `params` (required)
|
1888 |
|
1889 | ---
|
1890 |
|
1891 | ### typeofTypeAnnotation
|
1892 | ```javascript
|
1893 | t.typeofTypeAnnotation(argument)
|
1894 | ```
|
1895 |
|
1896 | See also `t.isTypeofTypeAnnotation(node, opts)` and `t.assertTypeofTypeAnnotation(node, opts)`.
|
1897 |
|
1898 | Aliases: `Flow`
|
1899 |
|
1900 | - `argument` (required)
|
1901 |
|
1902 | ---
|
1903 |
|
1904 | ### unaryExpression
|
1905 | ```javascript
|
1906 | t.unaryExpression(operator, argument, prefix)
|
1907 | ```
|
1908 |
|
1909 | See also `t.isUnaryExpression(node, opts)` and `t.assertUnaryExpression(node, opts)`.
|
1910 |
|
1911 | Aliases: `UnaryLike`, `Expression`
|
1912 |
|
1913 | - `operator`: `'void' | 'delete' | '!' | '+' | '-' | '++' | '--' | '~' | 'typeof'` (required)
|
1914 | - `argument`: `Expression` (required)
|
1915 | - `prefix`: `boolean` (default: `true`)
|
1916 |
|
1917 | ---
|
1918 |
|
1919 | ### unionTypeAnnotation
|
1920 | ```javascript
|
1921 | t.unionTypeAnnotation(types)
|
1922 | ```
|
1923 |
|
1924 | See also `t.isUnionTypeAnnotation(node, opts)` and `t.assertUnionTypeAnnotation(node, opts)`.
|
1925 |
|
1926 | Aliases: `Flow`
|
1927 |
|
1928 | - `types` (required)
|
1929 |
|
1930 | ---
|
1931 |
|
1932 | ### updateExpression
|
1933 | ```javascript
|
1934 | t.updateExpression(operator, argument, prefix)
|
1935 | ```
|
1936 |
|
1937 | See also `t.isUpdateExpression(node, opts)` and `t.assertUpdateExpression(node, opts)`.
|
1938 |
|
1939 | Aliases: `Expression`
|
1940 |
|
1941 | - `operator`: `'++' | '--'` (required)
|
1942 | - `argument`: `Expression` (required)
|
1943 | - `prefix`: `boolean` (default: `false`)
|
1944 |
|
1945 | ---
|
1946 |
|
1947 | ### variableDeclaration
|
1948 | ```javascript
|
1949 | t.variableDeclaration(kind, declarations)
|
1950 | ```
|
1951 |
|
1952 | See also `t.isVariableDeclaration(node, opts)` and `t.assertVariableDeclaration(node, opts)`.
|
1953 |
|
1954 | Aliases: `Statement`, `Declaration`
|
1955 |
|
1956 | - `kind`: `"var" | "let" | "const"` (required)
|
1957 | - `declarations`: `Array<VariableDeclarator>` (required)
|
1958 |
|
1959 | ---
|
1960 |
|
1961 | ### variableDeclarator
|
1962 | ```javascript
|
1963 | t.variableDeclarator(id, init)
|
1964 | ```
|
1965 |
|
1966 | See also `t.isVariableDeclarator(node, opts)` and `t.assertVariableDeclarator(node, opts)`.
|
1967 |
|
1968 | - `id`: `LVal` (required)
|
1969 | - `init`: `Expression` (default: `null`)
|
1970 |
|
1971 | ---
|
1972 |
|
1973 | ### voidTypeAnnotation
|
1974 | ```javascript
|
1975 | t.voidTypeAnnotation()
|
1976 | ```
|
1977 |
|
1978 | See also `t.isVoidTypeAnnotation(node, opts)` and `t.assertVoidTypeAnnotation(node, opts)`.
|
1979 |
|
1980 | Aliases: `Flow`, `FlowBaseAnnotation`
|
1981 |
|
1982 |
|
1983 | ---
|
1984 |
|
1985 | ### whileStatement
|
1986 | ```javascript
|
1987 | t.whileStatement(test, body)
|
1988 | ```
|
1989 |
|
1990 | See also `t.isWhileStatement(node, opts)` and `t.assertWhileStatement(node, opts)`.
|
1991 |
|
1992 | Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable`
|
1993 |
|
1994 | - `test`: `Expression` (required)
|
1995 | - `body`: `BlockStatement | Statement` (required)
|
1996 |
|
1997 | ---
|
1998 |
|
1999 | ### withStatement
|
2000 | ```javascript
|
2001 | t.withStatement(object, body)
|
2002 | ```
|
2003 |
|
2004 | See also `t.isWithStatement(node, opts)` and `t.assertWithStatement(node, opts)`.
|
2005 |
|
2006 | Aliases: `Statement`
|
2007 |
|
2008 | - `object` (required)
|
2009 | - `body`: `BlockStatement | Statement` (required)
|
2010 |
|
2011 | ---
|
2012 |
|
2013 | ### yieldExpression
|
2014 | ```javascript
|
2015 | t.yieldExpression(argument, delegate)
|
2016 | ```
|
2017 |
|
2018 | See also `t.isYieldExpression(node, opts)` and `t.assertYieldExpression(node, opts)`.
|
2019 |
|
2020 | Aliases: `Expression`, `Terminatorless`
|
2021 |
|
2022 | - `argument`: `Expression` (default: `null`)
|
2023 | - `delegate`: `boolean` (default: `false`)
|
2024 |
|
2025 | ---
|
2026 |
|
2027 |
|
2028 |
|
2029 |
|