Hello! While exploring the "<What's New in Kotlin ...
# webassembly
a
Hello! While exploring the "What's New in Kotlin 2.2.0" section related to Kotlin/Wasm, I came across this example: kotlin
Copy code
@JsExport
expect class WindowManager {
    fun close()
}

// jsMain

@JsExport
actual class WindowManager {
    fun close() {
        window.close()
    }
}
Up until now, I could only use the @JsExport annotation on functions. When I tried applying it to a class, I got the error: "This annotation is not applicable to target 'class'. Applicable targets: function." Is this a documentation error, or is @JsExport now intended to work with classes as well?
Maybe it works for kotlin/js only but is confusing, i expected to work for kotlin/wasm also
a
@Anuta Vlad Sv, the part with the @JsExport on the actual classes is related to Kotlin/JS, not to Kotlin/Wasm: https://kotlinlang.org/docs/whatsnew22.html#kotlin-js
👍 1