Hi, what's the best way to generate Typescript def...
# announcements
h
Hi, what's the best way to generate Typescript definitions for some Kotlin data classes? (a bit like Dukat in reverse?)
s
This is probably best asked in #C0B8L3U69 🙂 Short answer – new IR compiler. https://kotlinlang.org/docs/reference/js-ir-compiler.html#preview-generation-of-typescript-declaration-files-dts Compiler itself is in Alpha, TS generation is a preview feature, so use at your own risk 😉
h
Thank you!
l
An alternative solution would be to use Thrift IDL and generate both Kotlin & TS from it. https://github.com/microsoft/thrifty generates idiomatic kotlin data classes. You don't necessarily have to use thrift rpc - you can use just the IDL alone.
h
Thank you too!