Looks slick!
The open issues you have in there also cover the main things I could think of
🙏 1
ankushg
04/05/2022, 6:35 PM
The magic end-result here would be if — in addition to a
@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 classes
a
Adam S
04/05/2022, 8:29 PM
Thanks!
I'm not sure I understand your magic end result. What do you mean by a wrapped original class? I'm finding it difficult to think of a situation where creating that sort of automation would be less work than just creating a TypeScript class manually!
a
ankushg
04/26/2022, 11:32 PM
Ah I think I misread things — at first, I thought this library was generating Kotlin/JS `external interface`s, rather than directly generating TS definitions!