| Copyright | (C) 2016-2026 David M. Johnson |
|---|---|
| License | BSD3-style (see the file LICENSE) |
| Maintainer | David M. Johnson <code@dmj.io> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Miso.Native.X.Element.Webview.Event
Description
Synopsis
- onError :: (WebviewErrorEvent -> action) -> Attribute model action
- onErrorWith :: (WebviewErrorEvent -> DOMRef -> action) -> Attribute model action
- onErrorMain :: (WebviewErrorEvent -> action) -> EventHandler model action
- onErrorMainWith :: (WebviewErrorEvent -> model -> DOMRef -> action) -> EventHandler model action
- onLoad :: action -> Attribute model action
- onLoadWith :: (DOMRef -> action) -> Attribute model action
- onLoadMain :: action -> EventHandler model action
- onLoadMainWith :: (model -> DOMRef -> action) -> EventHandler model action
- onLocationChange :: (MisoString -> action) -> Attribute model action
- onLocationChangeWith :: (MisoString -> DOMRef -> action) -> Attribute model action
- onLocationChangeMain :: (MisoString -> action) -> EventHandler model action
- onLocationChangeMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action
- onMessage :: (MisoString -> action) -> Attribute model action
- onMessageWith :: (MisoString -> DOMRef -> action) -> Attribute model action
- onMessageMain :: (MisoString -> action) -> EventHandler model action
- onMessageMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action
- onOpenWindow :: (MisoString -> action) -> Attribute model action
- onOpenWindowWith :: (MisoString -> DOMRef -> action) -> Attribute model action
- onOpenWindowMain :: (MisoString -> action) -> EventHandler model action
- onOpenWindowMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action
- data WebviewErrorEvent = WebviewErrorEvent {
- errorCode :: Int
- errorMsg :: MisoString
- webviewErrorDecoder :: Decoder WebviewErrorEvent
- urlDecoder :: Decoder MisoString
- messageDecoder :: Decoder MisoString
- webviewEvents :: Events
Events
onError :: (WebviewErrorEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/webview.html#binderror
Triggered on a webview error.
onErrorWith :: (WebviewErrorEvent -> DOMRef -> action) -> Attribute model action Source #
onErrorMain :: (WebviewErrorEvent -> action) -> EventHandler model action Source #
Like onError, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Errored WebviewErrorEvent view_ [ event (static (onErrorMain Errored)) ] [ "some view" ]
onErrorMainWith :: (WebviewErrorEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onErrorMain, but the handler also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = Errored WebviewErrorEvent Model DOMRef view_ [ event (static (onErrorMainWith Errored)) ] [ "some view" ]
onLoad :: action -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/webview.html#bindload
Triggered when the webview loads successfully.
onLoadWith :: (DOMRef -> action) -> Attribute model action Source #
onLoadMain :: action -> EventHandler model action Source #
Like onLoad, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Loaded view_ [ event (static (onLoadMain Loaded)) ] [ "some view" ]
onLoadMainWith :: (model -> DOMRef -> action) -> EventHandler model action Source #
Like onLoadMain, but the handler also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = Loaded Model DOMRef view_ [ event (static (onLoadMainWith Loaded)) ] [ "some view" ]
onLocationChange :: (MisoString -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/webview.html#bindlocationchange
- Desktop, Lynx 3.5+*. Triggered when the location changes.
onLocationChangeWith :: (MisoString -> DOMRef -> action) -> Attribute model action Source #
Like onLocationChange, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onLocationChangeMain :: (MisoString -> action) -> EventHandler model action Source #
Like onLocationChange, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = LocationChanged MisoString view_ [ event (static (onLocationChangeMain LocationChanged)) ] [ "some view" ]
onLocationChangeMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onLocationChangeMain, but the handler also receives read-only access
to the model and the target element's DOMRef (for imperative MTS mutation).
data Action = LocationChanged MisoString Model DOMRef view_ [ event (static (onLocationChangeMainWith LocationChanged)) ] [ "some view" ]
onMessage :: (MisoString -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/webview.html#bindmessage
Triggered when a message is posted from JavaScript.
onMessageWith :: (MisoString -> DOMRef -> action) -> Attribute model action Source #
onMessageMain :: (MisoString -> action) -> EventHandler model action Source #
Like onMessage, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Message MisoString view_ [ event (static (onMessageMain Message)) ] [ "some view" ]
onMessageMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onMessageMain, but the handler also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = Message MisoString Model DOMRef view_ [ event (static (onMessageMainWith Message)) ] [ "some view" ]
onOpenWindow :: (MisoString -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/webview.html#bindopenwindow
- Desktop, Lynx 3.5+*. Triggered on an open-window event.
onOpenWindowWith :: (MisoString -> DOMRef -> action) -> Attribute model action Source #
Like onOpenWindow, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onOpenWindowMain :: (MisoString -> action) -> EventHandler model action Source #
Like onOpenWindow, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = OpenWindow MisoString view_ [ event (static (onOpenWindowMain OpenWindow)) ] [ "some view" ]
onOpenWindowMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onOpenWindowMain, but the handler also receives read-only access to
the model and the target element's DOMRef (for imperative MTS mutation).
data Action = OpenWindow MisoString Model DOMRef view_ [ event (static (onOpenWindowMainWith OpenWindow)) ] [ "some view" ]
Types
data WebviewErrorEvent Source #
Payload of the binderror event.
Constructors
| WebviewErrorEvent | |
Fields
| |
Instances
| Show WebviewErrorEvent Source # | |
Defined in Miso.Native.X.Element.Webview.Event Methods showsPrec :: Int -> WebviewErrorEvent -> ShowS # show :: WebviewErrorEvent -> String # showList :: [WebviewErrorEvent] -> ShowS # | |
| Eq WebviewErrorEvent Source # | |
Defined in Miso.Native.X.Element.Webview.Event Methods (==) :: WebviewErrorEvent -> WebviewErrorEvent -> Bool # (/=) :: WebviewErrorEvent -> WebviewErrorEvent -> Bool # | |
Decoders
urlDecoder :: Decoder MisoString Source #
Decodes the url field of bindlocationchange and bindopenwindow.
messageDecoder :: Decoder MisoString Source #
Decodes the msg field of bindmessage.