Is there a way to make something like this work? `...
# javascript
k
Is there a way to make something like this work?
Copy code
//js
karel = {
    "name": "Karel Peeters"
};

//kotlin
class Person(val name: String) {
    fun printName() = println(name)
}

external val karel: Person

fun main(args: Array<String>) {
    karel.printName()
}
I have some data defined externally that matches some classes in fields, but it doesn't have the functions the class needs. Is there a way to automatically use the Kotlin-defined ones?