From 51e8fd18683afbd0eddc99f60087036fe39901c5 Mon Sep 17 00:00:00 2001 From: Sven SAULEAU Date: Tue, 29 Nov 2016 02:22:59 +0100 Subject: [PATCH] Update babel-types README (#4905) [skip ci] --- packages/babel-types/README.md | 973 +++++++++++++++++++++++---- scripts/generate-babel-types-docs.js | 8 +- 2 files changed, 841 insertions(+), 140 deletions(-) diff --git a/packages/babel-types/README.md b/packages/babel-types/README.md index 869d70fb43..5e92c361b1 100644 --- a/packages/babel-types/README.md +++ b/packages/babel-types/README.md @@ -12,14 +12,22 @@ $ npm install --save-dev babel-types -### t.anyTypeAnnotation() +### anyTypeAnnotation +```javascript +t.anyTypeAnnotation() +``` See also `t.isAnyTypeAnnotation(node, opts)` and `t.assertAnyTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.arrayExpression(elements) +--- + +### arrayExpression +```javascript +t.arrayExpression(elements) +``` See also `t.isArrayExpression(node, opts)` and `t.assertArrayExpression(node, opts)`. @@ -27,7 +35,12 @@ Aliases: `Expression` - `elements`: `Array` (default: `[]`) -### t.arrayPattern(elements, typeAnnotation) +--- + +### arrayPattern +```javascript +t.arrayPattern(elements, typeAnnotation) +``` See also `t.isArrayPattern(node, opts)` and `t.assertArrayPattern(node, opts)`. @@ -37,7 +50,12 @@ Aliases: `Pattern`, `LVal` - `typeAnnotation` (required) - `decorators`: `Array` (default: `null`) -### t.arrayTypeAnnotation(elementType) +--- + +### arrayTypeAnnotation +```javascript +t.arrayTypeAnnotation(elementType) +``` See also `t.isArrayTypeAnnotation(node, opts)` and `t.assertArrayTypeAnnotation(node, opts)`. @@ -45,7 +63,12 @@ Aliases: `Flow` - `elementType` (required) -### t.arrowFunctionExpression(params, body, async) +--- + +### arrowFunctionExpression +```javascript +t.arrowFunctionExpression(params, body, async) +``` See also `t.isArrowFunctionExpression(node, opts)` and `t.assertArrowFunctionExpression(node, opts)`. @@ -57,7 +80,12 @@ Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, - `returnType` (default: `null`) - `typeParameters` (default: `null`) -### t.assignmentExpression(operator, left, right) +--- + +### assignmentExpression +```javascript +t.assignmentExpression(operator, left, right) +``` See also `t.isAssignmentExpression(node, opts)` and `t.assertAssignmentExpression(node, opts)`. @@ -67,7 +95,12 @@ Aliases: `Expression` - `left`: `LVal` (required) - `right`: `Expression` (required) -### t.assignmentPattern(left, right) +--- + +### assignmentPattern +```javascript +t.assignmentPattern(left, right) +``` See also `t.isAssignmentPattern(node, opts)` and `t.assertAssignmentPattern(node, opts)`. @@ -77,7 +110,12 @@ Aliases: `Pattern`, `LVal` - `right`: `Expression` (required) - `decorators`: `Array` (default: `null`) -### t.awaitExpression(argument) +--- + +### awaitExpression +```javascript +t.awaitExpression(argument) +``` See also `t.isAwaitExpression(node, opts)` and `t.assertAwaitExpression(node, opts)`. @@ -85,7 +123,12 @@ Aliases: `Expression`, `Terminatorless` - `argument`: `Expression` (required) -### t.binaryExpression(operator, left, right) +--- + +### binaryExpression +```javascript +t.binaryExpression(operator, left, right) +``` See also `t.isBinaryExpression(node, opts)` and `t.assertBinaryExpression(node, opts)`. @@ -95,7 +138,12 @@ Aliases: `Binary`, `Expression` - `left`: `Expression` (required) - `right`: `Expression` (required) -### t.bindExpression(object, callee) +--- + +### bindExpression +```javascript +t.bindExpression(object, callee) +``` See also `t.isBindExpression(node, opts)` and `t.assertBindExpression(node, opts)`. @@ -104,7 +152,12 @@ Aliases: `Expression` - `object` (required) - `callee` (required) -### t.blockStatement(body, directives) +--- + +### blockStatement +```javascript +t.blockStatement(body, directives) +``` See also `t.isBlockStatement(node, opts)` and `t.assertBlockStatement(node, opts)`. @@ -113,7 +166,12 @@ Aliases: `Scopable`, `BlockParent`, `Block`, `Statement` - `body`: `Array` (required) - `directives`: `Array` (default: `[]`) -### t.booleanLiteral(value) +--- + +### booleanLiteral +```javascript +t.booleanLiteral(value) +``` See also `t.isBooleanLiteral(node, opts)` and `t.assertBooleanLiteral(node, opts)`. @@ -121,21 +179,36 @@ Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` - `value`: `boolean` (required) -### t.booleanLiteralTypeAnnotation() +--- + +### booleanLiteralTypeAnnotation +```javascript +t.booleanLiteralTypeAnnotation() +``` See also `t.isBooleanLiteralTypeAnnotation(node, opts)` and `t.assertBooleanLiteralTypeAnnotation(node, opts)`. Aliases: `Flow` -### t.booleanTypeAnnotation() +--- + +### booleanTypeAnnotation +```javascript +t.booleanTypeAnnotation() +``` See also `t.isBooleanTypeAnnotation(node, opts)` and `t.assertBooleanTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.breakStatement(label) +--- + +### breakStatement +```javascript +t.breakStatement(label) +``` See also `t.isBreakStatement(node, opts)` and `t.assertBreakStatement(node, opts)`. @@ -143,7 +216,12 @@ Aliases: `Statement`, `Terminatorless`, `CompletionStatement` - `label`: `Identifier` (default: `null`) -### t.callExpression(callee, arguments) +--- + +### callExpression +```javascript +t.callExpression(callee, arguments) +``` See also `t.isCallExpression(node, opts)` and `t.assertCallExpression(node, opts)`. @@ -152,7 +230,12 @@ Aliases: `Expression` - `callee`: `Expression` (required) - `arguments`: `Array` (required) -### t.catchClause(param, body) +--- + +### catchClause +```javascript +t.catchClause(param, body) +``` See also `t.isCatchClause(node, opts)` and `t.assertCatchClause(node, opts)`. @@ -161,13 +244,23 @@ Aliases: `Scopable` - `param`: `Identifier` (required) - `body`: `BlockStatement` (required) -### t.classBody(body) +--- + +### classBody +```javascript +t.classBody(body) +``` See also `t.isClassBody(node, opts)` and `t.assertClassBody(node, opts)`. - `body`: `Array` (required) -### t.classDeclaration(id, superClass, body, decorators) +--- + +### classDeclaration +```javascript +t.classDeclaration(id, superClass, body, decorators) +``` See also `t.isClassDeclaration(node, opts)` and `t.assertClassDeclaration(node, opts)`. @@ -182,7 +275,12 @@ Aliases: `Scopable`, `Class`, `Statement`, `Declaration`, `Pureish` - `superTypeParameters` (default: `null`) - `typeParameters` (default: `null`) -### t.classExpression(id, superClass, body, decorators) +--- + +### classExpression +```javascript +t.classExpression(id, superClass, body, decorators) +``` See also `t.isClassExpression(node, opts)` and `t.assertClassExpression(node, opts)`. @@ -197,7 +295,12 @@ Aliases: `Scopable`, `Class`, `Expression`, `Pureish` - `superTypeParameters` (default: `null`) - `typeParameters` (default: `null`) -### t.classImplements(id, typeParameters) +--- + +### classImplements +```javascript +t.classImplements(id, typeParameters) +``` See also `t.isClassImplements(node, opts)` and `t.assertClassImplements(node, opts)`. @@ -206,7 +309,12 @@ Aliases: `Flow` - `id` (required) - `typeParameters` (required) -### t.classMethod(kind, key, params, body, computed, static) +--- + +### classMethod +```javascript +t.classMethod(kind, key, params, body, computed, static) +``` See also `t.isClassMethod(node, opts)` and `t.assertClassMethod(node, opts)`. @@ -224,7 +332,12 @@ Aliases: `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method` - `returnType` (default: `null`) - `typeParameters` (default: `null`) -### t.classProperty(key, value, typeAnnotation, decorators, computed) +--- + +### classProperty +```javascript +t.classProperty(key, value, typeAnnotation, decorators, computed) +``` See also `t.isClassProperty(node, opts)` and `t.assertClassProperty(node, opts)`. @@ -236,7 +349,12 @@ Aliases: `Property` - `decorators` (required) - `computed`: `boolean` (default: `false`) -### t.conditionalExpression(test, consequent, alternate) +--- + +### conditionalExpression +```javascript +t.conditionalExpression(test, consequent, alternate) +``` See also `t.isConditionalExpression(node, opts)` and `t.assertConditionalExpression(node, opts)`. @@ -246,7 +364,12 @@ Aliases: `Expression`, `Conditional` - `consequent`: `Expression` (required) - `alternate`: `Expression` (required) -### t.continueStatement(label) +--- + +### continueStatement +```javascript +t.continueStatement(label) +``` See also `t.isContinueStatement(node, opts)` and `t.assertContinueStatement(node, opts)`. @@ -254,14 +377,24 @@ Aliases: `Statement`, `Terminatorless`, `CompletionStatement` - `label`: `Identifier` (default: `null`) -### t.debuggerStatement() +--- + +### debuggerStatement +```javascript +t.debuggerStatement() +``` See also `t.isDebuggerStatement(node, opts)` and `t.assertDebuggerStatement(node, opts)`. Aliases: `Statement` -### t.declareClass(id, typeParameters, extends, body) +--- + +### declareClass +```javascript +t.declareClass(id, typeParameters, extends, body) +``` See also `t.isDeclareClass(node, opts)` and `t.assertDeclareClass(node, opts)`. @@ -272,7 +405,12 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `extends` (required) - `body` (required) -### t.declareFunction(id) +--- + +### declareFunction +```javascript +t.declareFunction(id) +``` See also `t.isDeclareFunction(node, opts)` and `t.assertDeclareFunction(node, opts)`. @@ -280,7 +418,12 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `id` (required) -### t.declareInterface(id, typeParameters, extends, body) +--- + +### declareInterface +```javascript +t.declareInterface(id, typeParameters, extends, body) +``` See also `t.isDeclareInterface(node, opts)` and `t.assertDeclareInterface(node, opts)`. @@ -291,7 +434,12 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `extends` (required) - `body` (required) -### t.declareModule(id, body) +--- + +### declareModule +```javascript +t.declareModule(id, body) +``` See also `t.isDeclareModule(node, opts)` and `t.assertDeclareModule(node, opts)`. @@ -300,7 +448,12 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `id` (required) - `body` (required) -### t.declareModuleExports(typeAnnotation) +--- + +### declareModuleExports +```javascript +t.declareModuleExports(typeAnnotation) +``` See also `t.isDeclareModuleExports(node, opts)` and `t.assertDeclareModuleExports(node, opts)`. @@ -308,7 +461,12 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `typeAnnotation` (required) -### t.declareTypeAlias(id, typeParameters, right) +--- + +### declareTypeAlias +```javascript +t.declareTypeAlias(id, typeParameters, right) +``` See also `t.isDeclareTypeAlias(node, opts)` and `t.assertDeclareTypeAlias(node, opts)`. @@ -318,7 +476,12 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `typeParameters` (required) - `right` (required) -### t.declareVariable(id) +--- + +### declareVariable +```javascript +t.declareVariable(id) +``` See also `t.isDeclareVariable(node, opts)` and `t.assertDeclareVariable(node, opts)`. @@ -326,25 +489,45 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `id` (required) -### t.decorator(expression) +--- + +### decorator +```javascript +t.decorator(expression) +``` See also `t.isDecorator(node, opts)` and `t.assertDecorator(node, opts)`. - `expression`: `Expression` (required) -### t.directive(value) +--- + +### directive +```javascript +t.directive(value) +``` See also `t.isDirective(node, opts)` and `t.assertDirective(node, opts)`. - `value`: `DirectiveLiteral` (required) -### t.directiveLiteral(value) +--- + +### directiveLiteral +```javascript +t.directiveLiteral(value) +``` See also `t.isDirectiveLiteral(node, opts)` and `t.assertDirectiveLiteral(node, opts)`. - `value`: `string` (required) -### t.doExpression(body) +--- + +### doExpression +```javascript +t.doExpression(body) +``` See also `t.isDoExpression(node, opts)` and `t.assertDoExpression(node, opts)`. @@ -352,7 +535,12 @@ Aliases: `Expression` - `body`: `BlockStatement` (required) -### t.doWhileStatement(test, body) +--- + +### doWhileStatement +```javascript +t.doWhileStatement(test, body) +``` See also `t.isDoWhileStatement(node, opts)` and `t.assertDoWhileStatement(node, opts)`. @@ -361,28 +549,48 @@ Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable` - `test`: `Expression` (required) - `body`: `Statement` (required) -### t.emptyStatement() +--- + +### emptyStatement +```javascript +t.emptyStatement() +``` See also `t.isEmptyStatement(node, opts)` and `t.assertEmptyStatement(node, opts)`. Aliases: `Statement` -### t.emptyTypeAnnotation() +--- + +### emptyTypeAnnotation +```javascript +t.emptyTypeAnnotation() +``` See also `t.isEmptyTypeAnnotation(node, opts)` and `t.assertEmptyTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.existentialTypeParam() +--- + +### existentialTypeParam +```javascript +t.existentialTypeParam() +``` See also `t.isExistentialTypeParam(node, opts)` and `t.assertExistentialTypeParam(node, opts)`. Aliases: `Flow` -### t.exportAllDeclaration(source) +--- + +### exportAllDeclaration +```javascript +t.exportAllDeclaration(source) +``` See also `t.isExportAllDeclaration(node, opts)` and `t.assertExportAllDeclaration(node, opts)`. @@ -390,7 +598,12 @@ Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` - `source`: `StringLiteral` (required) -### t.exportDefaultDeclaration(declaration) +--- + +### exportDefaultDeclaration +```javascript +t.exportDefaultDeclaration(declaration) +``` See also `t.isExportDefaultDeclaration(node, opts)` and `t.assertExportDefaultDeclaration(node, opts)`. @@ -398,7 +611,12 @@ Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` - `declaration`: `FunctionDeclaration | ClassDeclaration | Expression` (required) -### t.exportDefaultSpecifier(exported) +--- + +### exportDefaultSpecifier +```javascript +t.exportDefaultSpecifier(exported) +``` See also `t.isExportDefaultSpecifier(node, opts)` and `t.assertExportDefaultSpecifier(node, opts)`. @@ -406,7 +624,12 @@ Aliases: `ModuleSpecifier` - `exported`: `Identifier` (required) -### t.exportNamedDeclaration(declaration, specifiers, source) +--- + +### exportNamedDeclaration +```javascript +t.exportNamedDeclaration(declaration, specifiers, source) +``` See also `t.isExportNamedDeclaration(node, opts)` and `t.assertExportNamedDeclaration(node, opts)`. @@ -416,7 +639,12 @@ Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` - `specifiers`: `Array` (required) - `source`: `StringLiteral` (default: `null`) -### t.exportNamespaceSpecifier(exported) +--- + +### exportNamespaceSpecifier +```javascript +t.exportNamespaceSpecifier(exported) +``` See also `t.isExportNamespaceSpecifier(node, opts)` and `t.assertExportNamespaceSpecifier(node, opts)`. @@ -424,7 +652,12 @@ Aliases: `ModuleSpecifier` - `exported`: `Identifier` (required) -### t.exportSpecifier(local, exported) +--- + +### exportSpecifier +```javascript +t.exportSpecifier(local, exported) +``` See also `t.isExportSpecifier(node, opts)` and `t.assertExportSpecifier(node, opts)`. @@ -433,7 +666,12 @@ Aliases: `ModuleSpecifier` - `local`: `Identifier` (required) - `exported`: `Identifier` (required) -### t.expressionStatement(expression) +--- + +### expressionStatement +```javascript +t.expressionStatement(expression) +``` See also `t.isExpressionStatement(node, opts)` and `t.assertExpressionStatement(node, opts)`. @@ -441,7 +679,12 @@ Aliases: `Statement`, `ExpressionWrapper` - `expression`: `Expression` (required) -### t.file(program, comments, tokens) +--- + +### file +```javascript +t.file(program, comments, tokens) +``` See also `t.isFile(node, opts)` and `t.assertFile(node, opts)`. @@ -449,7 +692,12 @@ See also `t.isFile(node, opts)` and `t.assertFile(node, opts)`. - `comments` (required) - `tokens` (required) -### t.forAwaitStatement(left, right, body) +--- + +### forAwaitStatement +```javascript +t.forAwaitStatement(left, right, body) +``` See also `t.isForAwaitStatement(node, opts)` and `t.assertForAwaitStatement(node, opts)`. @@ -459,7 +707,12 @@ Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement` - `right`: `Expression` (required) - `body`: `Statement` (required) -### t.forInStatement(left, right, body) +--- + +### forInStatement +```javascript +t.forInStatement(left, right, body) +``` See also `t.isForInStatement(node, opts)` and `t.assertForInStatement(node, opts)`. @@ -469,7 +722,12 @@ Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement` - `right`: `Expression` (required) - `body`: `Statement` (required) -### t.forOfStatement(left, right, body) +--- + +### forOfStatement +```javascript +t.forOfStatement(left, right, body) +``` See also `t.isForOfStatement(node, opts)` and `t.assertForOfStatement(node, opts)`. @@ -479,7 +737,12 @@ Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement` - `right`: `Expression` (required) - `body`: `Statement` (required) -### t.forStatement(init, test, update, body) +--- + +### forStatement +```javascript +t.forStatement(init, test, update, body) +``` See also `t.isForStatement(node, opts)` and `t.assertForStatement(node, opts)`. @@ -490,7 +753,12 @@ Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop` - `update`: `Expression` (default: `null`) - `body`: `Statement` (required) -### t.functionDeclaration(id, params, body, generator, async) +--- + +### functionDeclaration +```javascript +t.functionDeclaration(id, params, body, generator, async) +``` See also `t.isFunctionDeclaration(node, opts)` and `t.assertFunctionDeclaration(node, opts)`. @@ -504,7 +772,12 @@ Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Statement`, ` - `returnType` (default: `null`) - `typeParameters` (default: `null`) -### t.functionExpression(id, params, body, generator, async) +--- + +### functionExpression +```javascript +t.functionExpression(id, params, body, generator, async) +``` See also `t.isFunctionExpression(node, opts)` and `t.assertFunctionExpression(node, opts)`. @@ -518,7 +791,12 @@ Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, - `returnType` (default: `null`) - `typeParameters` (default: `null`) -### t.functionTypeAnnotation(typeParameters, params, rest, returnType) +--- + +### functionTypeAnnotation +```javascript +t.functionTypeAnnotation(typeParameters, params, rest, returnType) +``` See also `t.isFunctionTypeAnnotation(node, opts)` and `t.assertFunctionTypeAnnotation(node, opts)`. @@ -529,7 +807,12 @@ Aliases: `Flow` - `rest` (required) - `returnType` (required) -### t.functionTypeParam(name, typeAnnotation) +--- + +### functionTypeParam +```javascript +t.functionTypeParam(name, typeAnnotation) +``` See also `t.isFunctionTypeParam(node, opts)` and `t.assertFunctionTypeParam(node, opts)`. @@ -538,7 +821,12 @@ Aliases: `Flow` - `name` (required) - `typeAnnotation` (required) -### t.genericTypeAnnotation(id, typeParameters) +--- + +### genericTypeAnnotation +```javascript +t.genericTypeAnnotation(id, typeParameters) +``` See also `t.isGenericTypeAnnotation(node, opts)` and `t.assertGenericTypeAnnotation(node, opts)`. @@ -547,7 +835,12 @@ Aliases: `Flow` - `id` (required) - `typeParameters` (required) -### t.identifier(name) +--- + +### identifier +```javascript +t.identifier(name) +``` See also `t.isIdentifier(node, opts)` and `t.assertIdentifier(node, opts)`. @@ -557,7 +850,12 @@ Aliases: `Expression`, `LVal` - `decorators`: `Array` (default: `null`) - `typeAnnotation` (default: `null`) -### t.ifStatement(test, consequent, alternate) +--- + +### ifStatement +```javascript +t.ifStatement(test, consequent, alternate) +``` See also `t.isIfStatement(node, opts)` and `t.assertIfStatement(node, opts)`. @@ -567,7 +865,12 @@ Aliases: `Statement`, `Conditional` - `consequent`: `Statement` (required) - `alternate`: `Statement` (default: `null`) -### t.importDeclaration(specifiers, source) +--- + +### importDeclaration +```javascript +t.importDeclaration(specifiers, source) +``` See also `t.isImportDeclaration(node, opts)` and `t.assertImportDeclaration(node, opts)`. @@ -576,7 +879,12 @@ Aliases: `Statement`, `Declaration`, `ModuleDeclaration` - `specifiers`: `Array` (required) - `source`: `StringLiteral` (required) -### t.importDefaultSpecifier(local) +--- + +### importDefaultSpecifier +```javascript +t.importDefaultSpecifier(local) +``` See also `t.isImportDefaultSpecifier(node, opts)` and `t.assertImportDefaultSpecifier(node, opts)`. @@ -584,7 +892,12 @@ Aliases: `ModuleSpecifier` - `local`: `Identifier` (required) -### t.importNamespaceSpecifier(local) +--- + +### importNamespaceSpecifier +```javascript +t.importNamespaceSpecifier(local) +``` See also `t.isImportNamespaceSpecifier(node, opts)` and `t.assertImportNamespaceSpecifier(node, opts)`. @@ -592,7 +905,12 @@ Aliases: `ModuleSpecifier` - `local`: `Identifier` (required) -### t.importSpecifier(local, imported) +--- + +### importSpecifier +```javascript +t.importSpecifier(local, imported) +``` See also `t.isImportSpecifier(node, opts)` and `t.assertImportSpecifier(node, opts)`. @@ -601,7 +919,12 @@ Aliases: `ModuleSpecifier` - `local`: `Identifier` (required) - `imported`: `Identifier` (required) -### t.interfaceDeclaration(id, typeParameters, extends, body) +--- + +### interfaceDeclaration +```javascript +t.interfaceDeclaration(id, typeParameters, extends, body) +``` See also `t.isInterfaceDeclaration(node, opts)` and `t.assertInterfaceDeclaration(node, opts)`. @@ -612,7 +935,12 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `extends` (required) - `body` (required) -### t.interfaceExtends(id, typeParameters) +--- + +### interfaceExtends +```javascript +t.interfaceExtends(id, typeParameters) +``` See also `t.isInterfaceExtends(node, opts)` and `t.assertInterfaceExtends(node, opts)`. @@ -621,7 +949,12 @@ Aliases: `Flow` - `id` (required) - `typeParameters` (required) -### t.intersectionTypeAnnotation(types) +--- + +### intersectionTypeAnnotation +```javascript +t.intersectionTypeAnnotation(types) +``` See also `t.isIntersectionTypeAnnotation(node, opts)` and `t.assertIntersectionTypeAnnotation(node, opts)`. @@ -629,7 +962,12 @@ Aliases: `Flow` - `types` (required) -### t.jSXAttribute(name, value) +--- + +### jSXAttribute +```javascript +t.jSXAttribute(name, value) +``` See also `t.isJSXAttribute(node, opts)` and `t.assertJSXAttribute(node, opts)`. @@ -638,7 +976,12 @@ Aliases: `JSX`, `Immutable` - `name`: `JSXIdentifier | JSXNamespacedName` (required) - `value`: `JSXElement | StringLiteral | JSXExpressionContainer` (default: `null`) -### t.jSXClosingElement(name) +--- + +### jSXClosingElement +```javascript +t.jSXClosingElement(name) +``` See also `t.isJSXClosingElement(node, opts)` and `t.assertJSXClosingElement(node, opts)`. @@ -646,7 +989,12 @@ Aliases: `JSX`, `Immutable` - `name`: `JSXIdentifier | JSXMemberExpression` (required) -### t.jSXElement(openingElement, closingElement, children, selfClosing) +--- + +### jSXElement +```javascript +t.jSXElement(openingElement, closingElement, children, selfClosing) +``` See also `t.isJSXElement(node, opts)` and `t.assertJSXElement(node, opts)`. @@ -657,14 +1005,24 @@ Aliases: `JSX`, `Immutable`, `Expression` - `children`: `Array` (required) - `selfClosing` (required) -### t.jSXEmptyExpression() +--- + +### jSXEmptyExpression +```javascript +t.jSXEmptyExpression() +``` See also `t.isJSXEmptyExpression(node, opts)` and `t.assertJSXEmptyExpression(node, opts)`. Aliases: `JSX`, `Expression` -### t.jSXExpressionContainer(expression) +--- + +### jSXExpressionContainer +```javascript +t.jSXExpressionContainer(expression) +``` See also `t.isJSXExpressionContainer(node, opts)` and `t.assertJSXExpressionContainer(node, opts)`. @@ -672,7 +1030,12 @@ Aliases: `JSX`, `Immutable` - `expression`: `Expression` (required) -### t.jSXIdentifier(name) +--- + +### jSXIdentifier +```javascript +t.jSXIdentifier(name) +``` See also `t.isJSXIdentifier(node, opts)` and `t.assertJSXIdentifier(node, opts)`. @@ -680,7 +1043,12 @@ Aliases: `JSX`, `Expression` - `name`: `string` (required) -### t.jSXMemberExpression(object, property) +--- + +### jSXMemberExpression +```javascript +t.jSXMemberExpression(object, property) +``` See also `t.isJSXMemberExpression(node, opts)` and `t.assertJSXMemberExpression(node, opts)`. @@ -689,7 +1057,12 @@ Aliases: `JSX`, `Expression` - `object`: `JSXMemberExpression | JSXIdentifier` (required) - `property`: `JSXIdentifier` (required) -### t.jSXNamespacedName(namespace, name) +--- + +### jSXNamespacedName +```javascript +t.jSXNamespacedName(namespace, name) +``` See also `t.isJSXNamespacedName(node, opts)` and `t.assertJSXNamespacedName(node, opts)`. @@ -698,7 +1071,12 @@ Aliases: `JSX` - `namespace`: `JSXIdentifier` (required) - `name`: `JSXIdentifier` (required) -### t.jSXOpeningElement(name, attributes, selfClosing) +--- + +### jSXOpeningElement +```javascript +t.jSXOpeningElement(name, attributes, selfClosing) +``` See also `t.isJSXOpeningElement(node, opts)` and `t.assertJSXOpeningElement(node, opts)`. @@ -708,7 +1086,12 @@ Aliases: `JSX`, `Immutable` - `attributes`: `Array` (required) - `selfClosing`: `boolean` (default: `false`) -### t.jSXSpreadAttribute(argument) +--- + +### jSXSpreadAttribute +```javascript +t.jSXSpreadAttribute(argument) +``` See also `t.isJSXSpreadAttribute(node, opts)` and `t.assertJSXSpreadAttribute(node, opts)`. @@ -716,7 +1099,12 @@ Aliases: `JSX` - `argument`: `Expression` (required) -### t.jSXText(value) +--- + +### jSXText +```javascript +t.jSXText(value) +``` See also `t.isJSXText(node, opts)` and `t.assertJSXText(node, opts)`. @@ -724,7 +1112,12 @@ Aliases: `JSX`, `Immutable` - `value`: `string` (required) -### t.labeledStatement(label, body) +--- + +### labeledStatement +```javascript +t.labeledStatement(label, body) +``` See also `t.isLabeledStatement(node, opts)` and `t.assertLabeledStatement(node, opts)`. @@ -733,7 +1126,12 @@ Aliases: `Statement` - `label`: `Identifier` (required) - `body`: `Statement` (required) -### t.logicalExpression(operator, left, right) +--- + +### logicalExpression +```javascript +t.logicalExpression(operator, left, right) +``` See also `t.isLogicalExpression(node, opts)` and `t.assertLogicalExpression(node, opts)`. @@ -743,7 +1141,12 @@ Aliases: `Binary`, `Expression` - `left`: `Expression` (required) - `right`: `Expression` (required) -### t.memberExpression(object, property, computed) +--- + +### memberExpression +```javascript +t.memberExpression(object, property, computed) +``` See also `t.isMemberExpression(node, opts)` and `t.assertMemberExpression(node, opts)`. @@ -753,7 +1156,12 @@ Aliases: `Expression`, `LVal` - `property`if computed then `Expression` else `Identifier` (required) - `computed`: `boolean` (default: `false`) -### t.metaProperty(meta, property) +--- + +### metaProperty +```javascript +t.metaProperty(meta, property) +``` See also `t.isMetaProperty(node, opts)` and `t.assertMetaProperty(node, opts)`. @@ -762,14 +1170,24 @@ Aliases: `Expression` - `meta`: `string` (required) - `property`: `string` (required) -### t.mixedTypeAnnotation() +--- + +### mixedTypeAnnotation +```javascript +t.mixedTypeAnnotation() +``` See also `t.isMixedTypeAnnotation(node, opts)` and `t.assertMixedTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.newExpression(callee, arguments) +--- + +### newExpression +```javascript +t.newExpression(callee, arguments) +``` See also `t.isNewExpression(node, opts)` and `t.assertNewExpression(node, opts)`. @@ -778,26 +1196,46 @@ Aliases: `Expression` - `callee`: `Expression` (required) - `arguments`: `Array` (required) -### t.noop() +--- + +### noop +```javascript +t.noop() +``` See also `t.isNoop(node, opts)` and `t.assertNoop(node, opts)`. -### t.nullLiteral() +--- + +### nullLiteral +```javascript +t.nullLiteral() +``` See also `t.isNullLiteral(node, opts)` and `t.assertNullLiteral(node, opts)`. Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` -### t.nullLiteralTypeAnnotation() +--- + +### nullLiteralTypeAnnotation +```javascript +t.nullLiteralTypeAnnotation() +``` See also `t.isNullLiteralTypeAnnotation(node, opts)` and `t.assertNullLiteralTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.nullableTypeAnnotation(typeAnnotation) +--- + +### nullableTypeAnnotation +```javascript +t.nullableTypeAnnotation(typeAnnotation) +``` See also `t.isNullableTypeAnnotation(node, opts)` and `t.assertNullableTypeAnnotation(node, opts)`. @@ -805,14 +1243,24 @@ Aliases: `Flow` - `typeAnnotation` (required) -### t.numberTypeAnnotation() +--- + +### numberTypeAnnotation +```javascript +t.numberTypeAnnotation() +``` See also `t.isNumberTypeAnnotation(node, opts)` and `t.assertNumberTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.numericLiteral(value) +--- + +### numericLiteral +```javascript +t.numericLiteral(value) +``` See also `t.isNumericLiteral(node, opts)` and `t.assertNumericLiteral(node, opts)`. @@ -820,14 +1268,24 @@ Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` - `value`: `number` (required) -### t.numericLiteralTypeAnnotation() +--- + +### numericLiteralTypeAnnotation +```javascript +t.numericLiteralTypeAnnotation() +``` See also `t.isNumericLiteralTypeAnnotation(node, opts)` and `t.assertNumericLiteralTypeAnnotation(node, opts)`. Aliases: `Flow` -### t.objectExpression(properties) +--- + +### objectExpression +```javascript +t.objectExpression(properties) +``` See also `t.isObjectExpression(node, opts)` and `t.assertObjectExpression(node, opts)`. @@ -835,7 +1293,12 @@ Aliases: `Expression` - `properties`: `Array` (required) -### t.objectMethod(kind, key, params, body, computed) +--- + +### objectMethod +```javascript +t.objectMethod(kind, key, params, body, computed) +``` See also `t.isObjectMethod(node, opts)` and `t.assertObjectMethod(node, opts)`. @@ -852,7 +1315,12 @@ Aliases: `UserWhitespacable`, `Function`, `Scopable`, `BlockParent`, `FunctionPa - `returnType` (default: `null`) - `typeParameters` (default: `null`) -### t.objectPattern(properties, typeAnnotation) +--- + +### objectPattern +```javascript +t.objectPattern(properties, typeAnnotation) +``` See also `t.isObjectPattern(node, opts)` and `t.assertObjectPattern(node, opts)`. @@ -862,7 +1330,12 @@ Aliases: `Pattern`, `LVal` - `typeAnnotation` (required) - `decorators`: `Array` (default: `null`) -### t.objectProperty(key, value, computed, shorthand, decorators) +--- + +### objectProperty +```javascript +t.objectProperty(key, value, computed, shorthand, decorators) +``` See also `t.isObjectProperty(node, opts)` and `t.assertObjectProperty(node, opts)`. @@ -874,7 +1347,12 @@ Aliases: `UserWhitespacable`, `Property`, `ObjectMember` - `shorthand`: `boolean` (default: `false`) - `decorators`: `Array` (default: `null`) -### t.objectTypeAnnotation(properties, indexers, callProperties) +--- + +### objectTypeAnnotation +```javascript +t.objectTypeAnnotation(properties, indexers, callProperties) +``` See also `t.isObjectTypeAnnotation(node, opts)` and `t.assertObjectTypeAnnotation(node, opts)`. @@ -884,7 +1362,12 @@ Aliases: `Flow` - `indexers` (required) - `callProperties` (required) -### t.objectTypeCallProperty(value) +--- + +### objectTypeCallProperty +```javascript +t.objectTypeCallProperty(value) +``` See also `t.isObjectTypeCallProperty(node, opts)` and `t.assertObjectTypeCallProperty(node, opts)`. @@ -892,7 +1375,12 @@ Aliases: `Flow`, `UserWhitespacable` - `value` (required) -### t.objectTypeIndexer(id, key, value) +--- + +### objectTypeIndexer +```javascript +t.objectTypeIndexer(id, key, value) +``` See also `t.isObjectTypeIndexer(node, opts)` and `t.assertObjectTypeIndexer(node, opts)`. @@ -902,7 +1390,12 @@ Aliases: `Flow`, `UserWhitespacable` - `key` (required) - `value` (required) -### t.objectTypeProperty(key, value) +--- + +### objectTypeProperty +```javascript +t.objectTypeProperty(key, value) +``` See also `t.isObjectTypeProperty(node, opts)` and `t.assertObjectTypeProperty(node, opts)`. @@ -911,7 +1404,12 @@ Aliases: `Flow`, `UserWhitespacable` - `key` (required) - `value` (required) -### t.parenthesizedExpression(expression) +--- + +### parenthesizedExpression +```javascript +t.parenthesizedExpression(expression) +``` See also `t.isParenthesizedExpression(node, opts)` and `t.assertParenthesizedExpression(node, opts)`. @@ -919,7 +1417,12 @@ Aliases: `Expression`, `ExpressionWrapper` - `expression`: `Expression` (required) -### t.program(body, directives) +--- + +### program +```javascript +t.program(body, directives) +``` See also `t.isProgram(node, opts)` and `t.assertProgram(node, opts)`. @@ -928,7 +1431,12 @@ Aliases: `Scopable`, `BlockParent`, `Block`, `FunctionParent` - `body`: `Array` (required) - `directives`: `Array` (default: `[]`) -### t.qualifiedTypeIdentifier(id, qualification) +--- + +### qualifiedTypeIdentifier +```javascript +t.qualifiedTypeIdentifier(id, qualification) +``` See also `t.isQualifiedTypeIdentifier(node, opts)` and `t.assertQualifiedTypeIdentifier(node, opts)`. @@ -937,7 +1445,12 @@ Aliases: `Flow` - `id` (required) - `qualification` (required) -### t.regExpLiteral(pattern, flags) +--- + +### regExpLiteral +```javascript +t.regExpLiteral(pattern, flags) +``` See also `t.isRegExpLiteral(node, opts)` and `t.assertRegExpLiteral(node, opts)`. @@ -946,7 +1459,12 @@ Aliases: `Expression`, `Literal` - `pattern`: `string` (required) - `flags`: `string` (default: `''`) -### t.restElement(argument, typeAnnotation) +--- + +### restElement +```javascript +t.restElement(argument, typeAnnotation) +``` See also `t.isRestElement(node, opts)` and `t.assertRestElement(node, opts)`. @@ -956,7 +1474,12 @@ Aliases: `LVal` - `typeAnnotation` (required) - `decorators`: `Array` (default: `null`) -### t.restProperty(argument) +--- + +### restProperty +```javascript +t.restProperty(argument) +``` See also `t.isRestProperty(node, opts)` and `t.assertRestProperty(node, opts)`. @@ -964,7 +1487,12 @@ Aliases: `UnaryLike` - `argument`: `LVal` (required) -### t.returnStatement(argument) +--- + +### returnStatement +```javascript +t.returnStatement(argument) +``` See also `t.isReturnStatement(node, opts)` and `t.assertReturnStatement(node, opts)`. @@ -972,7 +1500,12 @@ Aliases: `Statement`, `Terminatorless`, `CompletionStatement` - `argument`: `Expression` (default: `null`) -### t.sequenceExpression(expressions) +--- + +### sequenceExpression +```javascript +t.sequenceExpression(expressions) +``` See also `t.isSequenceExpression(node, opts)` and `t.assertSequenceExpression(node, opts)`. @@ -980,7 +1513,12 @@ Aliases: `Expression` - `expressions`: `Array` (required) -### t.spreadElement(argument) +--- + +### spreadElement +```javascript +t.spreadElement(argument) +``` See also `t.isSpreadElement(node, opts)` and `t.assertSpreadElement(node, opts)`. @@ -988,7 +1526,12 @@ Aliases: `UnaryLike` - `argument`: `Expression` (required) -### t.spreadProperty(argument) +--- + +### spreadProperty +```javascript +t.spreadProperty(argument) +``` See also `t.isSpreadProperty(node, opts)` and `t.assertSpreadProperty(node, opts)`. @@ -996,7 +1539,12 @@ Aliases: `UnaryLike` - `argument`: `Expression` (required) -### t.stringLiteral(value) +--- + +### stringLiteral +```javascript +t.stringLiteral(value) +``` See also `t.isStringLiteral(node, opts)` and `t.assertStringLiteral(node, opts)`. @@ -1004,35 +1552,60 @@ Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` - `value`: `string` (required) -### t.stringLiteralTypeAnnotation() +--- + +### stringLiteralTypeAnnotation +```javascript +t.stringLiteralTypeAnnotation() +``` See also `t.isStringLiteralTypeAnnotation(node, opts)` and `t.assertStringLiteralTypeAnnotation(node, opts)`. Aliases: `Flow` -### t.stringTypeAnnotation() +--- + +### stringTypeAnnotation +```javascript +t.stringTypeAnnotation() +``` See also `t.isStringTypeAnnotation(node, opts)` and `t.assertStringTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.super() +--- + +### super +```javascript +t.super() +``` See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`. Aliases: `Expression` -### t.switchCase(test, consequent) +--- + +### switchCase +```javascript +t.switchCase(test, consequent) +``` See also `t.isSwitchCase(node, opts)` and `t.assertSwitchCase(node, opts)`. - `test`: `Expression` (default: `null`) - `consequent`: `Array` (required) -### t.switchStatement(discriminant, cases) +--- + +### switchStatement +```javascript +t.switchStatement(discriminant, cases) +``` See also `t.isSwitchStatement(node, opts)` and `t.assertSwitchStatement(node, opts)`. @@ -1041,7 +1614,12 @@ Aliases: `Statement`, `BlockParent`, `Scopable` - `discriminant`: `Expression` (required) - `cases`: `Array` (required) -### t.taggedTemplateExpression(tag, quasi) +--- + +### taggedTemplateExpression +```javascript +t.taggedTemplateExpression(tag, quasi) +``` See also `t.isTaggedTemplateExpression(node, opts)` and `t.assertTaggedTemplateExpression(node, opts)`. @@ -1050,14 +1628,24 @@ Aliases: `Expression` - `tag`: `Expression` (required) - `quasi`: `TemplateLiteral` (required) -### t.templateElement(value, tail) +--- + +### templateElement +```javascript +t.templateElement(value, tail) +``` See also `t.isTemplateElement(node, opts)` and `t.assertTemplateElement(node, opts)`. - `value` (required) - `tail`: `boolean` (default: `false`) -### t.templateLiteral(quasis, expressions) +--- + +### templateLiteral +```javascript +t.templateLiteral(quasis, expressions) +``` See also `t.isTemplateLiteral(node, opts)` and `t.assertTemplateLiteral(node, opts)`. @@ -1066,21 +1654,36 @@ Aliases: `Expression`, `Literal` - `quasis`: `Array` (required) - `expressions`: `Array` (required) -### t.thisExpression() +--- + +### thisExpression +```javascript +t.thisExpression() +``` See also `t.isThisExpression(node, opts)` and `t.assertThisExpression(node, opts)`. Aliases: `Expression` -### t.thisTypeAnnotation() +--- + +### thisTypeAnnotation +```javascript +t.thisTypeAnnotation() +``` See also `t.isThisTypeAnnotation(node, opts)` and `t.assertThisTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.throwStatement(argument) +--- + +### throwStatement +```javascript +t.throwStatement(argument) +``` See also `t.isThrowStatement(node, opts)` and `t.assertThrowStatement(node, opts)`. @@ -1088,7 +1691,12 @@ Aliases: `Statement`, `Terminatorless`, `CompletionStatement` - `argument`: `Expression` (required) -### t.tryStatement(block, handler, finalizer) +--- + +### tryStatement +```javascript +t.tryStatement(block, handler, finalizer) +``` See also `t.isTryStatement(node, opts)` and `t.assertTryStatement(node, opts)`. @@ -1099,7 +1707,12 @@ Aliases: `Statement` - `finalizer`: `BlockStatement` (default: `null`) - `body`: `BlockStatement` (default: `null`) -### t.tupleTypeAnnotation(types) +--- + +### tupleTypeAnnotation +```javascript +t.tupleTypeAnnotation(types) +``` See also `t.isTupleTypeAnnotation(node, opts)` and `t.assertTupleTypeAnnotation(node, opts)`. @@ -1107,7 +1720,12 @@ Aliases: `Flow` - `types` (required) -### t.typeAlias(id, typeParameters, right) +--- + +### typeAlias +```javascript +t.typeAlias(id, typeParameters, right) +``` See also `t.isTypeAlias(node, opts)` and `t.assertTypeAlias(node, opts)`. @@ -1117,7 +1735,12 @@ Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` - `typeParameters` (required) - `right` (required) -### t.typeAnnotation(typeAnnotation) +--- + +### typeAnnotation +```javascript +t.typeAnnotation(typeAnnotation) +``` See also `t.isTypeAnnotation(node, opts)` and `t.assertTypeAnnotation(node, opts)`. @@ -1125,7 +1748,12 @@ Aliases: `Flow` - `typeAnnotation` (required) -### t.typeCastExpression(expression, typeAnnotation) +--- + +### typeCastExpression +```javascript +t.typeCastExpression(expression, typeAnnotation) +``` See also `t.isTypeCastExpression(node, opts)` and `t.assertTypeCastExpression(node, opts)`. @@ -1134,7 +1762,12 @@ Aliases: `Flow`, `ExpressionWrapper`, `Expression` - `expression` (required) - `typeAnnotation` (required) -### t.typeParameter(bound) +--- + +### typeParameter +```javascript +t.typeParameter(bound) +``` See also `t.isTypeParameter(node, opts)` and `t.assertTypeParameter(node, opts)`. @@ -1142,7 +1775,12 @@ Aliases: `Flow` - `bound` (required) -### t.typeParameterDeclaration(params) +--- + +### typeParameterDeclaration +```javascript +t.typeParameterDeclaration(params) +``` See also `t.isTypeParameterDeclaration(node, opts)` and `t.assertTypeParameterDeclaration(node, opts)`. @@ -1150,7 +1788,12 @@ Aliases: `Flow` - `params` (required) -### t.typeParameterInstantiation(params) +--- + +### typeParameterInstantiation +```javascript +t.typeParameterInstantiation(params) +``` See also `t.isTypeParameterInstantiation(node, opts)` and `t.assertTypeParameterInstantiation(node, opts)`. @@ -1158,7 +1801,12 @@ Aliases: `Flow` - `params` (required) -### t.typeofTypeAnnotation(argument) +--- + +### typeofTypeAnnotation +```javascript +t.typeofTypeAnnotation(argument) +``` See also `t.isTypeofTypeAnnotation(node, opts)` and `t.assertTypeofTypeAnnotation(node, opts)`. @@ -1166,7 +1814,12 @@ Aliases: `Flow` - `argument` (required) -### t.unaryExpression(operator, argument, prefix) +--- + +### unaryExpression +```javascript +t.unaryExpression(operator, argument, prefix) +``` See also `t.isUnaryExpression(node, opts)` and `t.assertUnaryExpression(node, opts)`. @@ -1176,7 +1829,12 @@ Aliases: `UnaryLike`, `Expression` - `argument`: `Expression` (required) - `prefix`: `boolean` (default: `true`) -### t.unionTypeAnnotation(types) +--- + +### unionTypeAnnotation +```javascript +t.unionTypeAnnotation(types) +``` See also `t.isUnionTypeAnnotation(node, opts)` and `t.assertUnionTypeAnnotation(node, opts)`. @@ -1184,7 +1842,12 @@ Aliases: `Flow` - `types` (required) -### t.updateExpression(operator, argument, prefix) +--- + +### updateExpression +```javascript +t.updateExpression(operator, argument, prefix) +``` See also `t.isUpdateExpression(node, opts)` and `t.assertUpdateExpression(node, opts)`. @@ -1194,7 +1857,12 @@ Aliases: `Expression` - `argument`: `Expression` (required) - `prefix`: `boolean` (default: `false`) -### t.variableDeclaration(kind, declarations) +--- + +### variableDeclaration +```javascript +t.variableDeclaration(kind, declarations) +``` See also `t.isVariableDeclaration(node, opts)` and `t.assertVariableDeclaration(node, opts)`. @@ -1203,21 +1871,36 @@ Aliases: `Statement`, `Declaration` - `kind`: `"var" | "let" | "const"` (required) - `declarations`: `Array` (required) -### t.variableDeclarator(id, init) +--- + +### variableDeclarator +```javascript +t.variableDeclarator(id, init) +``` See also `t.isVariableDeclarator(node, opts)` and `t.assertVariableDeclarator(node, opts)`. - `id`: `LVal` (required) - `init`: `Expression` (default: `null`) -### t.voidTypeAnnotation() +--- + +### voidTypeAnnotation +```javascript +t.voidTypeAnnotation() +``` See also `t.isVoidTypeAnnotation(node, opts)` and `t.assertVoidTypeAnnotation(node, opts)`. Aliases: `Flow`, `FlowBaseAnnotation` -### t.whileStatement(test, body) +--- + +### whileStatement +```javascript +t.whileStatement(test, body) +``` See also `t.isWhileStatement(node, opts)` and `t.assertWhileStatement(node, opts)`. @@ -1226,7 +1909,12 @@ Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable` - `test`: `Expression` (required) - `body`: `BlockStatement | Statement` (required) -### t.withStatement(object, body) +--- + +### withStatement +```javascript +t.withStatement(object, body) +``` See also `t.isWithStatement(node, opts)` and `t.assertWithStatement(node, opts)`. @@ -1235,7 +1923,12 @@ Aliases: `Statement` - `object` (required) - `body`: `BlockStatement | Statement` (required) -### t.yieldExpression(argument, delegate) +--- + +### yieldExpression +```javascript +t.yieldExpression(argument, delegate) +``` See also `t.isYieldExpression(node, opts)` and `t.assertYieldExpression(node, opts)`. @@ -1244,6 +1937,8 @@ Aliases: `Expression`, `Terminatorless` - `argument`: `Expression` (default: `null`) - `delegate`: `boolean` (default: `false`) +--- + diff --git a/scripts/generate-babel-types-docs.js b/scripts/generate-babel-types-docs.js index 2a486d55cf..c0336b1618 100644 --- a/scripts/generate-babel-types-docs.js +++ b/scripts/generate-babel-types-docs.js @@ -65,7 +65,10 @@ function getType(validator) { throw err; } Object.keys(types.BUILDER_KEYS).sort().forEach(function (key) { - readme.push('### t.' + key[0].toLowerCase() + key.substr(1) + '(' + types.BUILDER_KEYS[key].join(', ') + ')'); + readme.push('### ' + key[0].toLowerCase() + key.substr(1)); + readme.push('```javascript'); + readme.push('t.' + key[0].toLowerCase() + key.substr(1) + '(' + types.BUILDER_KEYS[key].join(', ') + ')'); + readme.push('```'); readme.push(''); readme.push('See also `t.is' + key + '(node, opts)` and `t.assert' + key + '(node, opts)`.'); readme.push(''); @@ -108,6 +111,9 @@ Object.keys(types.BUILDER_KEYS).sort().forEach(function (key) { } readme.push(' - ' + fieldDescription.join('')); }); + + readme.push(''); + readme.push('---'); readme.push(''); });