[K/JS] Support companion objects in external and exported declarations

This commit is contained in:
Artem Kobzar
2024-02-27 16:30:13 +00:00
committed by Space Team
parent 5cda3fba12
commit 3429cbd321
51 changed files with 551 additions and 56 deletions
@@ -0,0 +1,24 @@
// SKIP_MINIFICATION
// ES_MODULES
// FILE: api.kt
package api
@JsExport
interface A {
companion object {
fun ok() = "OK"
}
}
// FILE: main.kt
external interface JsResult {
val res: String
}
@JsModule("./interfaceWithCompanion.mjs")
external fun jsBox(): JsResult
fun box(): String {
return jsBox().res
}
@@ -0,0 +1,7 @@
import * as api from "./interfaceWithCompanion_v5.mjs";
export default function() {
return {
"res": api.A.getInstance().ok()
};
};