Hi!
I added an npm package to my KMP project, which contains an extension for the Window.
external class Window {
fun init(url: String): Promise<MyResponse>
}
class MyResponse{
val message: String? = null
val status: String? = null
}
In the following code, the function call and even the .await() is working, but I think the conversion from json object to MyResponse is not.
val response = window.init("url").await()
console.log("init",response). //logs out as json object instead of MyResponse, and all fields have values.
console.log("message: ", response.message). // will be undefined
Can someone explain me what am I doing wrong?
window.init("url").await().asDynamic().message
works fine, but I want the use the response as a class. Is it possible?