@babel/types APIs
- ObjectExpression
- Expression
- Identifier
- CallExpression
- Node
- ImportDeclaration
- ArrayExpression
- VariableDeclarator
- JSXElement
- File
- JSXAttribute
- ImportSpecifier
- Statement
- ObjectProperty
- JSXExpressionContainer
- JSXMemberExpression
- BlockStatement
- JSXIdentifier
- ObjectPattern
- isIdentifier
- identifier
- stringLiteral
- booleanLiteral
- isObjectProperty
- isMemberExpression
- StringLiteral
- ArrowFunctionExpression
- VariableDeclaration
- ImportDefaultSpecifier
- FunctionExpression
- jsxAttribute
- jsxIdentifier
- JSXFragment
- JSXSpreadChild
- JSXText
- expressionStatement
- Program
- BooleanLiteral
- JSXOpeningElement
- MemberExpression
- FunctionDeclaration
- PatternLike
- RestElement
- LVal
- SourceLocation
- SpreadElement
- file
- Comment
- isCallExpression
- isVariableDeclarator
- isLogicalExpression
- isReturnStatement
- conditionalExpression
- isAssignmentExpression
- isNumericLiteral
- arrayPattern
- jsxElement
- isStringLiteral
- isBooleanLiteral
- jsxExpressionContainer
- isExpression
- jsxOpeningElement
- jsxMemberExpression
- isObjectExpression
- jsxClosingElement
- jsxText
- isArrayPattern
- isExpressionStatement
- isFunctionExpression
- ExpressionStatement
- ImportNamespaceSpecifier
- ReturnStatement
- JSXNamespacedName
- JSX
- LogicalExpression
- AssignmentPattern
- objectProperty
- objectExpression
- arrayExpression
- objectPattern
- nullLiteral
- numericLiteral
- isAssignmentPattern
- isRestElement
- importDeclaration
- importSpecifier
- isTemplateLiteral
- callExpression
- isImportSpecifier
- isArrowFunctionExpression
- isTSTypeReference
- isTypeAnnotation
- isObjectPattern
- BinaryExpression
- UnaryExpression
- ArrayPattern
- CatchClause
- DoWhileStatement
- ForInStatement
- ForOfStatement
- ForStatement
- NewExpression
- SwitchCase
- TemplateLiteral
- WhileStatement
- program
- isJSXIdentifier
- isJSXMemberExpression
- ClassDeclaration
- DebuggerStatement
- Declaration
- ExportDefaultDeclaration
- ExportNamedDeclaration
- ExportSpecifier
- NumericLiteral
- ObjectMethod
- Pattern
- TSDeclareFunction
- ExportDeclaration
- AssignmentExpression
- JSXEmptyExpression
- JSXSpreadAttribute
- isTSModuleDeclaration
- CommentBlock
- CommentLine
- InterpreterDirective
- addComments
- removeComments
Other Related APIs
- @babel/types#Expression
- @babel/types#Node
- @babel/types#ImportDeclaration
- @babel/types#ImportSpecifier
- @babel/types#ArrayExpression
- @babel/types#Identifier
- @babel/types#BooleanLiteral
- @babel/types#CallExpression
- @babel/types#ArrowFunctionExpression
- @babel/types#ImportDefaultSpecifier
- @babel/types#MemberExpression
- @babel/types#FunctionDeclaration
- @babel/types#BlockStatement
- @babel/types#LVal
- @babel/types#ClassDeclaration
- @babel/types#DebuggerStatement
- @babel/types#ExportDefaultDeclaration
- @babel/types#ExportNamedDeclaration
- @babel/types#ExportSpecifier
- @babel/types#ExpressionStatement
- @babel/types#ImportNamespaceSpecifier
@babel/types#Declaration TypeScript Examples
The following examples show how to use
@babel/types#Declaration.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: babel-polyfill.ts From nota with MIT License | 6 votes |
exportNamedDeclaration = (
declaration?: Declaration,
source: StringLiteral | null = null,
specifiers: ExportSpecifier[] = []
): ExportNamedDeclaration => ({
type: "ExportNamedDeclaration",
declaration,
specifiers,
source,
...baseNode,
})