https://kotlinlang.org logo
#webassembly
Title
# webassembly
g

Gopi S

03/25/2024, 9:21 AM
Hi, I have scenario, where I need to expose classes for K/JS but it is not needed Kotlin/wasm. is it possible to omit @jsexport annotation for Kotlin/wasm only.
a

Artem Kobzar

03/25/2024, 11:57 AM
Only if you define the class as expect-class and copy the actual "implementations" of the class into all the platform source sets.
b

bashor

03/25/2024, 1:00 PM
You can introduce expect annotation say
JsOnlyExport
And actaulize differently for JS and Wasm JS:
actual typealias JsOnlyExport = JsExport
Wasm:
actual annotation class JsOnlyExport
gratitude thank you 1
K 4
g

Gopi S

03/26/2024, 1:53 PM
Sure, I'll try. thanks for reply 🙂
3 Views