BindScope

class BindScope<T : Any>

What bind gives you: a place to name the members a script should see.

Functions

Link copied to clipboard
fun method(name: String, arity: Int = 0, body: T.(List<JsValue>) -> Any?)

Exposes a Kotlin function under name.

Link copied to clipboard
fun property(name: String, prop: KMutableProperty1<T, Any?>)

Exposes a Kotlin property a script can also write.

fun property(name: String, prop: KProperty1<T, Any?>)

Exposes a read-only Kotlin property under its own name.