bind

expect fun bind(name: String, fn: WebviewKo.(String) -> String)

Binds a Kotlin callback so that it will appear under the given name as a global JS function.

Parameters

name

the name of the global JS function

fn

the callback function which receives the request parameter in JSON as input and return the response JSON. If you want to reject the Promise, throw JSRejectException in fn

actual fun bind(name: String, fn: WebviewKo.(String) -> String)

Binds a Kotlin callback so that it will appear under the given name as a global JS function.

Parameters

name

the name of the global JS function

fn

the callback function which receives the request parameter in JSON as input and return the response JSON. If you want to reject the Promise, throw JSRejectException in fn

actual fun bind(name: String, fn: WebviewKo.(String) -> String)

Binds a Kotlin callback so that it will appear under the given name as a global JS function.

Parameters

name

the name of the global JS function

fn

the callback function which receives the request parameter in JSON as input and return the response JSON. If you want to reject the Promise, throw JSRejectException in fn

actual fun bind(name: String, fn: WebviewKo.(String) -> String)

Binds a Kotlin callback so that it will appear under the given name as a global JS function.

Parameters

name

the name of the global JS function

fn

the callback function which receives the request parameter in JSON as input and return the response JSON. If you want to reject the Promise, throw JSRejectException in fn