class
Webview::Webview
- Webview::Webview
- Reference
- Object
Included Modules
Defined in:
lib/webview/src/webview.crlune/webview.cr
Instance Method Summary
-
#bind_deferred(name : String, &block : String, Array(JSON::Any) -> Nil)
Registers a JS-callable function but does NOT auto-call webview_return.
-
#resolve(seq : String, status : Int32, result : String)
Send a response to a pending JS promise from bind_deferred.
Instance methods inherited from module Lune::WebviewLike
bind_deferred(name : String, &block : String, Array(JSON::Any) -> Nil)
bind_deferred,
dispatch(&)
dispatch,
eval(js : String)
eval,
resolve(seq : String, status : Int32, result : String)
resolve
Instance Method Detail
def bind_deferred(name : String, &block : String, Array(JSON::Any) -> Nil)
#
Registers a JS-callable function but does NOT auto-call webview_return. The block receives (seq, args). Call resolve(seq, ...) whenever ready.
def resolve(seq : String, status : Int32, result : String)
#
Send a response to a pending JS promise from bind_deferred. status: 0 = success, non-zero = error. result must be valid JSON.