How to use the typeAlias function from babel-types
Find comprehensive JavaScript babel-types.typeAlias code examples handpicked from public code repositorys.
106 107 108 109 110 111 112 113 114 115
for (let key in cssData.properties) { let prop = parseSyntax(cssData.properties[key]); key = toCamelCase(key); statementList.push( t.exportNamedDeclaration( t.typeAlias( t.identifier(propertyName(key)), null, normalizeType(buildType(prop, key)), ),
10
148
8
+ 17 other calls in file
29 30 31 32 33 34 35 36 37 38
/** * export type NAME = TYPE */ function exportType(name: string, type: BabelAST) { return t.exportNamedDeclaration( t.typeAlias(t.identifier(name), null, type), [], null, ); }
0
1
3
+ 5 other calls in file
223 224 225 226 227 228 229 230 231 232
Fragment(node) { const baseType = selectionsToBabel(node.selections); const type = isPlural(node) ? arrayOfType(baseType) : baseType; return t.exportNamedDeclaration( t.typeAlias(t.identifier(node.name), null, type), [], null, ); },
0
1
2
+ 3 other calls in file
GitHub: pranaygp/relay
113 114 115 116 117 118 119 120 121 122
path.traverse(findObjectTypeProperty, {prevName: this.name}); // Add the node of that transformed path to the array normalizedRoots.push( t.exportNamedDeclaration( t.typeAlias(t.identifier(this.name), null, path.node), [], null, ), );
0
1
2
+ 19 other calls in file
17 18 19 20 21 22 23 24 25 26
/** * type NAME = any; */ function anyTypeAlias(name: string): BabelAST { return t.typeAlias(t.identifier(name), null, t.anyTypeAnnotation()); } /** * {|
0
0
2
+ 7 other calls in file
babel-types.identifier is the most popular function in babel-types (4076 examples)