How to use the typeAlias function from @babel/types
Find comprehensive JavaScript @babel/types.typeAlias code examples handpicked from public code repositorys.
53 54 55 56 57 58 59 60 61 62
/** * export type NAME = TYPE */ function exportType(name: string, type: BabelAST): $FlowFixMe { return t.exportNamedDeclaration( t.typeAlias(t.identifier(name), null, type), [], null, ); }
0
1
3
+ 7 other calls in file
18 19 20 21 22 23 24 25 26 27
/** * type NAME = any; */ function anyTypeAlias(name: string): BabelAST { return t.typeAlias(t.identifier(name), undefined, t.anyTypeAnnotation()); } /** * {|
0
1
1
+ 3 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)