jsMain.kotlinext.js.Function.kt Maven / Gradle / Ivy
package kotlinext.js
external interface JsFunction {
fun call(ctx: C, vararg args: Any?): O
fun apply(ctx: C, args: Array): O
fun bind(ctx: C, vararg args: Any?): JsFunction
val length: Int
}
external interface JsFunction0 : JsFunction
operator fun JsFunction0.invoke() = asDynamic()()
external interface JsFunction1 : JsFunction
operator fun JsFunction1.invoke(arg: I) =
asDynamic()(arg)
external interface JsFunction2 : JsFunction
operator fun JsFunction2.invoke(arg1: I1, arg2: I2) =
asDynamic()(arg1, arg2)
external interface JsFunction3 : JsFunction
operator fun JsFunction3.invoke(arg1: I1, arg2: I2, arg3: I3) =
asDynamic()(arg1, arg2, arg3)