ForteScarlet / kotlin-suspend-transform-compiler-plugin

A Kotlin compiler plugin for transforming suspend functions to platform-compatible non-suspend functions, such as the JVM Blocking API and CompletableFuture 🐱
MIT License
33 stars 3 forks source link

Converting Types for JS API? #30

Open ScottPierce opened 1 year ago

ScottPierce commented 1 year ago

There are certain types that JS doesn't work well with Kotlin i.e. if you have a function that returns a List<String>. It'd be nice if there was a way to automatically convert Kotlin collections to their correct JS counterparts.

List to Array Map to JS Object I'm sure there are others.

ForteScarlet commented 1 year ago

🤔️ This does seem to be a problem. Perhaps some way of providing support for type conversion of returned results (and which could be user-defined and not limited to JS) would be considered. I haven't thought about it yet though, and the JS target is not available at the moment, so maybe I'll come back to it after KT-53993 is fixed or #29 is implemented 😉 .