How to use the tsTypeReference function from @babel/types
Find comprehensive JavaScript @babel/types.tsTypeReference code examples handpicked from public code repositorys.
77 78 79 80 81 82 83 84 85 86
if (!path.parent.typeParameters) { path.parent.typeParameters = t.tsTypeParameterInstantiation([]); } let param = path.parent.typeParameters.params.find(p => p.typeName.name === name[0]); if (!param) { path.parentPath.get('typeParameters').pushContainer('params', t.tsTypeReference(t.identifier(name[0]))); } } // Keep going to all references of this reference.
+ 13 other calls in file
69 70 71 72 73 74 75 76 77 78
} function anyOf(variants) { return t.tsIntersectionType( variants.map((variant) => t.tsTypeReference( t.identifier('Partial'), t.tsTypeParameterInstantiation([createInterface(variant)]), ), ),
+ 23 other calls in file
GitHub: openapi/preset-effector
![openapi profile picture](/openapi.png?size=40)
20 21 22 23 24 25 26 27 28 29
}`, { allowAwaitOutsideFunction: true }, ); function contractGet({ contractName }) { return t.tsTypeReference( t.tsQualifiedName(t.identifier('typed'), t.identifier('Get')), t.tsTypeParameterInstantiation([ t.tsTypeQuery(t.identifier(changeCase.camelCase(contractName))), ]),
+ 11 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)