That's better, for sure. It was in fact the experience that got me started on TSD.
fun toTsd(output: TsdOutput)
The TsdOutput is seen by your class like a kind of print stream or console that, basically, expects key-value pairs with indentation.
github.com/GeePawHill/tsd
it doesn't do anything yet. First I had to learn how to do multi-project gradle builds. But I'll be working on it, here and there now and then, and sharing notes. If you want to help, ping me!