sdeleuze
10/23/2019, 1:35 AMimplementation(npm("rsocket-websocket-client", "0.0.16"))
dependency to my project and I would like to consume RSocketWebSocketClient
class defined like that in JS:
class RSocketWebSocketClient {
constructor(options, encoders) {
// ...
}
close() {
// ...
}
connect() {
// ...
}
}
exports.default = RSocketWebSocketClient;
On Kotlin side, I have defined:
@JsModule("rsocket-websocket-client")
external class RSocketWebSocketClient(options: dynamic, encoders: dynamic)
fun main() {
println("Hello JavaScript!")
RSocketWebSocketClient(js("{}"), js("{}"))
}
And I get this error TypeError: RSocketWebSocketClient is not a constructor
. What did I miss?sdeleuze
10/23/2019, 7:34 AM@file:JsModule("rsocket-websocket-client")
@JsName("default")
external class RSocketWebSocketClient()
sdeleuze
10/23/2019, 7:35 AMtarek
10/23/2019, 8:25 AMdukat
to convert TypeScript types to kotlin external, it helped me with a lot of js modulestarek
10/23/2019, 8:25 AMsdeleuze
10/23/2019, 8:26 AMdukat
but RSocket JS client is using Facebook Flow so I have to convert things manuallysdeleuze
10/23/2019, 8:27 AM