https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Justin

05/23/2020, 5:02 PM
Any suggestions for generating a TypeScript library in a multiplatform project? I realize I could just manually create all the type definitions inside the JS build product, but that would be, well, manual.
d

Derek Ellis

05/23/2020, 5:14 PM
Have you tried the TypeScript type definition generation preview in 1.4?
j

Justin

05/23/2020, 9:35 PM
I have tried updating my Kotlin and JS plugin versions to 1.4-M1 and am able to build my project but I still don’t see any TS defs in my JS build product. I also set the compiler to
ir
in gradle.properties, FWIW. This is for creating a node library to be used in a separate typescript-based React app.
Relatedly, is there a new version of
kotlinx.serialization
that’s compatible with Kotlin 1.4?
d

Derek Ellis

05/24/2020, 2:18 AM
You have to enable the new IR backend
And yeah, there's 1.4 compatible versions of all(?) the official libraries. They're mentioned on the 1.4-M1 blog post
j

Justin

05/24/2020, 3:28 AM
@Derek Ellis where do I find the typescript definitions though? they aren’t in the js build product
d

Derek Ellis

05/24/2020, 4:36 AM
I don't think they include them in distributions, but if you just run the webpack task, they'll be in your build
j

Justin

05/24/2020, 5:11 AM
hmmm where is the webpack task? do i need to add it to my build gradle somehow?
d

Derek Ellis

05/24/2020, 12:38 PM
I think it's under the "other" category. I usually just run
jsBrowserWebpackDevelopment
(or Node if you're using that target)
It should be added automatically with your js target(s)
6 Views