external object Paho {
object MQTT {
class Client(hostname: String, port: Int, clientId: String) {
val hostname: String
val port: Int
val clientId: String
}
}
}
fun main(args: Array<String>) {
val c = Paho.MQTT.Client("localhost", 8080, "me")
println("${c.clientId}@${c.hostname}:${c.port}")
}
roughly translates to
var Paho$MQTT$Client = Paho.MQTT.Client;
var println = Kotlin.kotlin.io.println_s8jyv4$;
function main(args) {
var c = new Paho$MQTT$Client('localhost', 8080, 'me');
println(c.clientId + '@' + c.hostname + ':' + c.port);
}
Is that what you need?
Please note, that at the moment properties in the external class constructors are prohibited.
By the way we’ve just set up an external declaration repository.
It is more of an EAP at the moment, but those declarations are available in NPM, Maven and Gradle.
Would you be interested in checking it out and potentially adding your declarations via a pull request?
You feedback would be valuable =)
We’d like to receive some early adopters feedback first. And maybe add some more declarations before advertising it as well. This way we make sure it works and is actually useful. =)