Copyright | (C) 2016-2025 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.Lynx.Element.View.Method
Contents
Description
Synopsis
- boundingClientRect :: MisoString -> BoundingClientRect -> (Rect -> action) -> (MisoString -> action) -> Effect parent model action
- takeScreenshot :: MisoString -> TakeScreenshot -> (JSVal -> action) -> (MisoString -> action) -> Effect parent model action
- requestAccessibilityFocus :: MisoString -> (JSVal -> action) -> (MisoString -> action) -> Effect parent model action
- data Rect = Rect {}
- data BoundingClientRect = BoundingClientRect {}
- data TakeScreenshot = TakeScreenshot {
- format :: MisoString
- scale :: Double
- defaultBoundingClientRect :: BoundingClientRect
- defaultTakeScreenshot :: TakeScreenshot
Methods
boundingClientRect :: MisoString -> BoundingClientRect -> (Rect -> action) -> (MisoString -> action) -> Effect parent model action Source #
https://lynxjs.org/api/elements/built-in/view.html#boundingclientrect
The front end can execute boundingClientRect
through the SelectorQuery API.
data Action = Success Rect | Failure MisoString | GetRect update :: Action -> Effect model Action update GetRect = boundingClientRect defaultBoundingClientRect "#box" Success Failure update (Succes Rect {..}) = consoleLog "Successfuly got Rect" update (Failure errorMsg) = consoleLog ("Failed to call getClientBoundingRect: " <> errorMsg)
takeScreenshot :: MisoString -> TakeScreenshot -> (JSVal -> action) -> (MisoString -> action) -> Effect parent model action Source #
https://lynxjs.org/api/elements/built-in/view.html#takescreenshot
The front end can execute takeScreenshot
through the SelectorQuery API.
data Action = Success Image | Failure MisoString | GetScreenshot update :: Action -> Effect model Action update GetScreenshot = takeScreenshot defaultTakeScreenshot "#my-view" Success Failure update (Succes image) = consoleLog "Successfuly got image" consoleLog' image update (Failure errorMsg) = consoleLog ("Failed to call takeScreenshot: " <> errorMsg)
requestAccessibilityFocus :: MisoString -> (JSVal -> action) -> (MisoString -> action) -> Effect parent model action Source #
https://lynxjs.org/api/elements/built-in/view.html#requestaccessibilityfocus
The front end can execute requestAccessiblityFocus
through the SelectorQuery API.
data Action = Success | Failure MisoString | GetFocus update :: Action -> Effect model Action update GetFocus = requestAccessibilityFocus "#my-view" Success Failure update Success = consoleLog "Successfuly got focus" update (Failure errorMsg) = consoleLog ("Failed to call requestAccessibilityFocus: " <> errorMsg)
Types
Result of calling getClientBoundingRect
Constructors
Rect | |
data BoundingClientRect Source #
Constructors
BoundingClientRect | |
Fields
|
Instances
ToJSVal BoundingClientRect Source # | |
Defined in Miso.Lynx.Element.View.Method Methods toJSVal :: BoundingClientRect -> JSM JSVal Source # toJSValListOf :: [BoundingClientRect] -> JSM JSVal Source # |
data TakeScreenshot Source #
Constructors
TakeScreenshot | |
Fields
|
Instances
ToJSVal TakeScreenshot Source # | |
Defined in Miso.Lynx.Element.View.Method Methods toJSVal :: TakeScreenshot -> JSM JSVal Source # toJSValListOf :: [TakeScreenshot] -> JSM JSVal Source # |
Smart constructors
defaultBoundingClientRect :: BoundingClientRect Source #
Smart constructor for constructing boundingClientRect
defaultTakeScreenshot :: TakeScreenshot Source #
Smart constructor for calling TakeScreenshot