I’m trying to generate something like this:
type Cond<T> = T extends Alias1 ? Alias2 : never
with the library ts-morph
. You can view the AST here.
I’ve tried somthing like:
import { Project } from "ts-morph"
const project = new Project()
const sourceFile = project.addSourceFileAtPath("./try.ts")
sourceFile.addStatements([
{
// ...
}
])
but I cannot figure out the proper structure to generate what I want.
Thanks