I think I am having a very similar issue like this. The problem is that the generated type is final.
Here is a part of the TypeScript header:
interface ChartEvents {
selection?(event: ChartSelectionEvent): void;
}
Here is the generated Kotlin external interface
external interface ChartEvents {
val selection: ((event: ChartSelectionEvent) -> Unit)? get() = definedExternally
}
Here is how I can create a JS interface (calling JS from Kotlin)
js("{ selection: function(event) { console.log("Called") } }")
How can I pass in a Kotlin lambda to selection
?
I cannot use function variables, because their names are changed when the final .js file is created.
I have been stuck way too long on this issue. Thank you for your help.