How to use the tsInterfaceDeclaration function from @babel/types
Find comprehensive JavaScript @babel/types.tsInterfaceDeclaration code examples handpicked from public code repositorys.
37 38 39 40 41 42 43 44 45 46
buildInterface(object/*: Interface*/) { const fields = Object.keys(object.fields) .map((fieldName) => this.buildField(object.fields[fieldName])) const ast = bt.exportNamedDeclaration( bt.tsInterfaceDeclaration( bt.identifier(object.name), undefined, null, bt.tsInterfaceBody(fields),
9
40
4
+ 7 other calls in file
GitHub: groupon/esfixup
96 97 98 99 100 101 102 103 104 105
* @param {string} propLines */ function handleTypedefObjBlock(stmts, m, objName, propLines) { stmts.push( t.exportNamedDeclaration( t.tsInterfaceDeclaration( t.identifier(objName), null, null, t.tsInterfaceBody(propLines.trim().split('\n').map(propLineToTypeElem))
0
0
7
+ 3 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)