Adam S
04/03/2022, 9:55 PM@Serializer
annotated class and generate some TypeScript interfaces - so they can generate compatible JSON.
The basics are in, and it needs more work to finish up some of the tricky bits. Please take a look!
https://github.com/adamko-dev/kotlinx-serialization-typescript-generator/
It's available from JitPack. There's code examples in the docs directoryankushg
04/05/2022, 6:33 PMankushg
04/05/2022, 6:35 PM@TsExport
annotation — you could somehow annotate a class with @TsWrap
and have KSP also generate a TS-friendly wrapper for that class that
◦ wraps the annotated original class into a `@JsExport`ed one
◦ creates methods on that wrapper with the same names as the original class, but method signatures modified to use your generated `external interface`s instead of the original Kotlin classes
◦ uses kotlinx.serialization
to automatically map between external interface
s and kotlin classesAdam S
04/05/2022, 8:29 PMankushg
04/26/2022, 11:32 PM