| 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.FFI
Contents
Description
Synopsis
- setInterval :: Double -> IO () -> IO Double
- clearInterval :: Double -> IO Double
- invokeExec :: (ToJSVal params, FromJSVal argument) => MisoString -> MisoString -> params -> (argument -> action) -> (MisoString -> action) -> Effect context props model action
- enableDebugging :: IO ()
Lynx specific FFI
Arguments
| :: (ToJSVal params, FromJSVal argument) | |
| => MisoString | method |
| -> MisoString | selector |
| -> params | params |
| -> (argument -> action) | successful |
| -> (MisoString -> action) | errorful |
| -> Effect context props model action |
https://lynxjs.org/api/lynx-api/nodes-ref/nodes-ref-invoke.html
Used to call methods on elements in view_, image_, etc.
We use this internally to implement the various Method sections
per the lynx docs.
invokeExec "gifs" "startAnimate" :: IO ()
lynx.createSelectorQuery()
.select('#gifs')
.invoke({
method: startAnimate,
}).exec();
invoke
enableDebugging :: IO () Source #
Turn on the native console→syslog bridge for on-device debugging.
On a physical device, background-thread console.* output is not printed to
the platform log (iOS syslog / Android logcat) without a LynxDevTool
connection. After calling this, every consoleError (and any other
console.error) is mirrored — prefixed [miso] — through
lynx.reportError, which the host does surface in the device log. Grep for
[miso] in idevicesyslog (iOS) or adb logcat (Android).
Sets globalThis.debug = true; the bridge checks that flag per line, so this
takes effect immediately even though it runs after startup. Enable it early
(e.g. at the top of main) to capture diagnostics from the whole session.