How to use the tSTypeAliasDeclaration function from @babel/types
Find comprehensive JavaScript @babel/types.tSTypeAliasDeclaration code examples handpicked from public code repositorys.
5 6 7 8 9 10 11 12 13 14
class TypeScriptBuilder extends AbstractJsBuilder { buildUnion(object/*: Union */) { const ast = bt.exportNamedDeclaration( bt.tSTypeAliasDeclaration( bt.identifier(object.name), undefined, bt.tSUnionType(object.variants.map((name) => ( bt.tSTypeReference(bt.identifier(name))
9
40
4
+ 3 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)