i want to generate interface to string. example
interface cat {
id : number
name : string
}
const output = convertInterfaceToString(cat)
my expect output should be a string exactly like this " interface cat { id : number name : string } "
My purpose is to generate an interface as a string in my project and then save it to a file (e.g., somefile.ts). This way, I can use it in another project without the need for manual copying and parsing.
is it possible in typescript? thankyou.