| 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.Element.View.Event
Description
Synopsis
- onTouchStart :: (TouchEvent -> action) -> Attribute model action
- onTouchStartWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action
- onTouchStartMain :: (TouchEvent -> action) -> EventHandler model action
- onTouchStartMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action
- onTouchMove :: (TouchEvent -> action) -> Attribute model action
- onTouchMoveWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action
- onTouchMoveMain :: (TouchEvent -> action) -> EventHandler model action
- onTouchMoveMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action
- onTouchEnd :: (TouchEvent -> action) -> Attribute model action
- onTouchEndWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action
- onTouchEndMain :: (TouchEvent -> action) -> EventHandler model action
- onTouchEndMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action
- onTouchCancel :: (TouchEvent -> action) -> Attribute model action
- onTouchCancelWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action
- onTouchCancelMain :: (TouchEvent -> action) -> EventHandler model action
- onTouchCancelMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action
- onTap :: action -> Attribute model action
- onTapMain :: action -> EventHandler model action
- onTapWith :: (DOMRef -> action) -> Attribute model action
- onTapMainWith :: (DOMRef -> action) -> EventHandler model action
- onTapMainModel :: (model -> action) -> EventHandler model action
- onLongPress :: (TouchEvent -> action) -> Attribute model action
- onLongPressWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action
- onLongPressMain :: (TouchEvent -> action) -> EventHandler model action
- onLongPressMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action
- onLayoutChange :: (LayoutChangeDetailEvent -> action) -> Attribute model action
- onLayoutChangeWith :: (LayoutChangeDetailEvent -> DOMRef -> action) -> Attribute model action
- onLayoutChangeMain :: (LayoutChangeDetailEvent -> action) -> EventHandler model action
- onLayoutChangeMainWith :: (LayoutChangeDetailEvent -> model -> DOMRef -> action) -> EventHandler model action
- onAppear :: (UIAppearanceDetailEvent -> action) -> Attribute model action
- onAppearWith :: (UIAppearanceDetailEvent -> DOMRef -> action) -> Attribute model action
- onAppearMain :: (UIAppearanceDetailEvent -> action) -> EventHandler model action
- onAppearMainWith :: (UIAppearanceDetailEvent -> model -> DOMRef -> action) -> EventHandler model action
- onDisappear :: (UIAppearanceDetailEvent -> action) -> Attribute model action
- onDisappearWith :: (UIAppearanceDetailEvent -> DOMRef -> action) -> Attribute model action
- onDisappearMain :: (UIAppearanceDetailEvent -> action) -> EventHandler model action
- onDisappearMainWith :: (UIAppearanceDetailEvent -> model -> DOMRef -> action) -> EventHandler model action
- onAnimationStart :: (AnimationEvent -> action) -> Attribute model action
- onAnimationStartWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action
- onAnimationStartMain :: (AnimationEvent -> action) -> EventHandler model action
- onAnimationStartMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action
- onAnimationEnd :: (AnimationEvent -> action) -> Attribute model action
- onAnimationEndWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action
- onAnimationEndMain :: (AnimationEvent -> action) -> EventHandler model action
- onAnimationEndMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action
- onAnimationCancel :: (AnimationEvent -> action) -> Attribute model action
- onAnimationCancelWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action
- onAnimationCancelMain :: (AnimationEvent -> action) -> EventHandler model action
- onAnimationCancelMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action
- onAnimationIteration :: (AnimationEvent -> action) -> Attribute model action
- onAnimationIterationWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action
- onAnimationIterationMain :: (AnimationEvent -> action) -> EventHandler model action
- onAnimationIterationMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action
- onTransitionStart :: (AnimationEvent -> action) -> Attribute model action
- onTransitionStartWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action
- onTransitionStartMain :: (AnimationEvent -> action) -> EventHandler model action
- onTransitionStartMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action
- onTransitionEnd :: (AnimationEvent -> action) -> Attribute model action
- onTransitionEndWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action
- onTransitionEndMain :: (AnimationEvent -> action) -> EventHandler model action
- onTransitionEndMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action
- onTransitionCancel :: (AnimationEvent -> action) -> Attribute model action
- onTransitionCancelWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action
- onTransitionCancelMain :: (AnimationEvent -> action) -> EventHandler model action
- onTransitionCancelMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action
- data TouchEvent = TouchEvent {}
- data AnimationEvent = AnimationEvent {
- animationType :: AnimationType
- animationName :: MisoString
- newAnimator :: Bool
- data LayoutChangeDetailEvent = LayoutChangeDetailEvent {
- layoutChangeDetailEventId :: MisoString
- layoutChangeDetailEventWidth :: Double
- layoutChangeDetailEventHeight :: Double
- layoutChangeDetailEventTop :: Double
- layoutChangeDetailEventRight :: Double
- layoutChangeDetailEventBottom :: Double
- layoutChangeDetailEventLeft :: Double
- layoutChangeDetailEventDataset :: Object
- data UIAppearanceDetailEvent = UIAppearanceDetailEvent {}
- touchDecoder :: Decoder TouchEvent
- animationDecoder :: Decoder AnimationEvent
- layoutChangeDetailDecoder :: Decoder LayoutChangeDetailEvent
- uiAppearanceDetailDecoder :: Decoder UIAppearanceDetailEvent
- viewEvents :: Events
Events
onTouchStart :: (TouchEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#touchstart
It belongs to touch event, which is triggered when the finger starts to touch the touch surface.
@ data Action = HandleTouch TouchEvent
view model = view_ [ onTouchStart HandleTouch ]
update :: Action -> Effect props Model Action update (HandleTouch TouchEvent {..}) = do io_ (consoleLog "touch event received")
onTouchStartWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action Source #
Like onTouchStart, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onTouchStartMain :: (TouchEvent -> action) -> EventHandler model action Source #
Like onTouchStart, but dispatched on the Lynx main thread (MTS).
data Action = HandleTouch TouchEvent view_ [ event (static (onTouchStartMain HandleTouch)) ] [ "some view" ]
onTouchStartMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onTouchStartMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleTouch TouchEvent Model DOMRef view_ [ event (static (onTouchStartMainWith HandleTouch)) ] [ "some view" ]
onTouchMove :: (TouchEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#touchmove
It belongs to touch event, which is triggered when the finger moves on the touch surface.
data Action = HandleTouch TouchEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onTouchMove HandleTouch ]
update :: Action -> Effect context props Model Action
update (HandleTouch TouchEvent {..}) = do
io_ (consoleLog "touch event received")
onTouchMoveWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action Source #
Like onTouchMove, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onTouchMoveMain :: (TouchEvent -> action) -> EventHandler model action Source #
Like onTouchMove, but dispatched on the Lynx main thread (MTS).
data Action = HandleTouch TouchEvent view_ [ event (static (onTouchMoveMain HandleTouch)) ] [ "some view" ]
onTouchMoveMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onTouchMoveMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleTouch TouchEvent Model DOMRef view_ [ event (static (onTouchMoveMainWith HandleTouch)) ] [ "some view" ]
onTouchEnd :: (TouchEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#touchend
It belongs to touch event, which is triggered when the finger leaves the touch surface.
data Action = HandleTouch TouchEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onTouchEnd HandleTouch ]
update :: Action -> Effect context props Model Action
update (HandleTouch TouchEvent {..}) = do
io_ (consoleLog "touch event received")
onTouchEndWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action Source #
Like onTouchEnd, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onTouchEndMain :: (TouchEvent -> action) -> EventHandler model action Source #
Like onTouchEnd, but dispatched on the Lynx main thread (MTS).
data Action = HandleTouch TouchEvent view_ [ event (static (onTouchEndMain HandleTouch)) ] [ "some view" ]
onTouchEndMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onTouchEndMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleTouch TouchEvent Model DOMRef view_ [ event (static (onTouchEndMainWith HandleTouch)) ] [ "some view" ]
onTouchCancel :: (TouchEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#touchcancel
It belongs to touch event, which is triggered when the touch event, is interrupted by the system or Lynx external gesture.
data Action = HandleTouch TouchEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onTouchCancel HandleTouch ]
update :: Action -> Effect context props Model Action
update (HandleTouch TouchEvent {..}) =
io_ (consoleLog "touch event received")
onTouchCancelWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action Source #
Like onTouchCancel, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onTouchCancelMain :: (TouchEvent -> action) -> EventHandler model action Source #
Like onTouchCancel, but dispatched on the Lynx main thread (MTS).
data Action = HandleTouch TouchEvent view_ [ event (static (onTouchCancelMain HandleTouch)) ] [ "some view" ]
onTouchCancelMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onTouchCancelMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleTouch TouchEvent Model DOMRef view_ [ event (static (onTouchCancelMainWith HandleTouch)) ] [ "some view" ]
onTap :: action -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#tap
It belongs to touch event, which is triggered when the finger clicks on the touch surface.
data Action = HandleTap view :: context -> props -> Model -> View context Action view model = view_ [ onTap HandleTap ] update :: Action -> Effect context props Model Action update HandleTap = io_ (consoleLog "touch event received")
onTapMain :: action -> EventHandler model action Source #
https://lynxjs.org/api/elements/built-in/view.html#tap
It belongs to touch event, which is triggered when the finger clicks on the touch surface.
Unlike onTap, onTapMain is necessary for handling tap events on the main thread (MTS).
data Action = HandleTap view :: context -> props -> Model -> View context Action view model = view_ [ event $ static (onTapMain HandleTap) ] update :: Action -> Effect context props Model Action update HandleTap = io_ (consoleLog "touch event received")
onTapMainWith :: (DOMRef -> action) -> EventHandler model action Source #
https://lynxjs.org/api/elements/built-in/view.html#tap
It belongs to touch event, which is triggered when the finger clicks on the touch surface.
Unlike onTap, onTapMain is necessary for handling tap events on the main thread (MTS).
data Action = HandleTap view :: context -> props -> Model -> View context Action view model = view_ [ event $ static (onTapMain HandleTap) ] update :: Action -> Effect context props Model Action update HandleTap = io_ (consoleLog "touch event received")
onTapMainModel :: (model -> action) -> EventHandler model action Source #
https://lynxjs.org/api/elements/built-in/view.html#tap
It belongs to touch event, which is triggered when the finger clicks on the touch surface.
Unlike onTap, onTapMain is necessary for handling tap events on the main thread (MTS).
data Action = HandleTap view :: context -> props -> Model -> View context Action view model = view_ [ event $ static (onTapMain HandleTap) ] update :: Action -> Effect context props Model Action update HandleTap = io_ (consoleLog "touch event received")
onLongPress :: (TouchEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#longpress
It belongs to the touch event, which is triggered when the finger is long pressed on the touch surface, and the interval between long press triggers is `500 ms`.
data Action = HandleTouch TouchEvent
view :: context -> props -> Model -> View context Action
view model = view_ [ onLongPress HandleTouch ]
update :: Action -> Effect context props Model Action
update (HandleTouch TouchEvent {..}) = io_ (consoleLog "touch event received")
onLongPressWith :: (TouchEvent -> DOMRef -> action) -> Attribute model action Source #
Like onLongPress, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onLongPressMain :: (TouchEvent -> action) -> EventHandler model action Source #
Like onLongPress, but dispatched on the Lynx main thread (MTS).
data Action = HandleTouch TouchEvent view_ [ event (static (onLongPressMain HandleTouch)) ] [ "some view" ]
onLongPressMainWith :: (TouchEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onLongPressMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleTouch TouchEvent Model DOMRef view_ [ event (static (onLongPressMainWith HandleTouch)) ] [ "some view" ]
onLayoutChange :: (LayoutChangeDetailEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#layoutchange
It belongs to a custom event, which is triggered when the target node layout is completed, and returns the position information of the target node relative to the LynxView viewport coordinate system.
data Action = HandleLayout LayoutChangeDetailEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onLayoutChange HandleLayout ]
update :: Action -> Effect context props Model Action
update (HandleLayout LayoutChangeDetailEvent {..}) =
io_ (consoleLog "layout changed")
onLayoutChangeWith :: (LayoutChangeDetailEvent -> DOMRef -> action) -> Attribute model action Source #
Like onLayoutChange, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onLayoutChangeMain :: (LayoutChangeDetailEvent -> action) -> EventHandler model action Source #
Like onLayoutChange, but dispatched on the Lynx main thread (MTS).
data Action = HandleLayout LayoutChangeDetailEvent view_ [ event (static (onLayoutChangeMain HandleLayout)) ] [ "some view" ]
onLayoutChangeMainWith :: (LayoutChangeDetailEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onLayoutChangeMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleLayout LayoutChangeDetailEvent Model DOMRef view_ [ event (static (onLayoutChangeMainWith HandleLayout)) ] [ "some view" ]
onAppear :: (UIAppearanceDetailEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#uiappear
It belongs to custom event, which is triggered when the target node appears on the screen.
data Action = HandleUI UIAppearanceDetailEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onAppear HandleUI ]
update :: Action -> Effect context props Model Action
update (HandleUI UIAppearanceDetailEvent {..}) = do
io_ (consoleLog "appearance detail event received")
onAppearWith :: (UIAppearanceDetailEvent -> DOMRef -> action) -> Attribute model action Source #
onAppearMain :: (UIAppearanceDetailEvent -> action) -> EventHandler model action Source #
Like onAppear, but dispatched on the Lynx main thread (MTS).
data Action = HandleAppear UIAppearanceDetailEvent view_ [ event (static (onAppearMain HandleAppear)) ] [ "some view" ]
onAppearMainWith :: (UIAppearanceDetailEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onAppearMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleAppear UIAppearanceDetailEvent Model DOMRef view_ [ event (static (onAppearMainWith HandleAppear)) ] [ "some view" ]
onDisappear :: (UIAppearanceDetailEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#uidisappear
It belongs to custom event, which is triggered when the target node appears on the screen.
data Action = HandleUI UIAppearanceDetailEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onDisappear HandleUI ]
update :: Action -> Effect props Model Action
update (HandleUI UIAppearanceDetailEvent {..}) = do
io_ (consoleLog "appearance detail event received")
onDisappearWith :: (UIAppearanceDetailEvent -> DOMRef -> action) -> Attribute model action Source #
Like onDisappear, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onDisappearMain :: (UIAppearanceDetailEvent -> action) -> EventHandler model action Source #
Like onDisappear, but dispatched on the Lynx main thread (MTS).
data Action = HandleDisappear UIAppearanceDetailEvent view_ [ event (static (onDisappearMain HandleDisappear)) ] [ "some view" ]
onDisappearMainWith :: (UIAppearanceDetailEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onDisappearMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleDisappear UIAppearanceDetailEvent Model DOMRef view_ [ event (static (onDisappearMainWith HandleDisappear)) ] [ "some view" ]
onAnimationStart :: (AnimationEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#animationstart
It belongs to animation event, which is triggered when the Animation animation starts.
data Action = HandleAnimation AnimationEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onAnimationStart HandleAnimation ]
update :: Action -> Effect context props Model Action
update (HandleAnimation AnimationEvent {..}) =
io_ (consoleLog "animation event received")
onAnimationStartWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action Source #
Like onAnimationStart, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onAnimationStartMain :: (AnimationEvent -> action) -> EventHandler model action Source #
Like onAnimationStart, but dispatched on the Lynx main thread (MTS).
data Action = HandleAnimation AnimationEvent view_ [ event (static (onAnimationStartMain HandleAnimation)) ] [ "some view" ]
onAnimationStartMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onAnimationStartMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleAnimation AnimationEvent Model DOMRef view_ [ event (static (onAnimationStartMainWith HandleAnimation)) ] [ "some view" ]
onAnimationEnd :: (AnimationEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#animationend
It belongs to animation event, which is triggered when the Animation animation ends.
data Action = HandleAnimation AnimationEvent
view :: context -> props -> Model -> View context Action
view model = view_ [ onAnimationEnd HandleAnimation ]
update :: Action -> Effect context props Model Action
update (HandleAnimation AnimationEvent {..}) =
io_ (consoleLog "animation event received")
onAnimationEndWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action Source #
Like onAnimationEnd, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onAnimationEndMain :: (AnimationEvent -> action) -> EventHandler model action Source #
Like onAnimationEnd, but dispatched on the Lynx main thread (MTS).
data Action = HandleAnimation AnimationEvent view_ [ event (static (onAnimationEndMain HandleAnimation)) ] [ "some view" ]
onAnimationEndMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onAnimationEndMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleAnimation AnimationEvent Model DOMRef view_ [ event (static (onAnimationEndMainWith HandleAnimation)) ] [ "some view" ]
onAnimationCancel :: (AnimationEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#animationcancel
It belongs to animation event, which is triggered when the Animation animation cancels.
data Action = HandleAnimation AnimationEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onAnimationCancel HandleAnimation ]
update :: Action -> Effect context props Model Action
update (HandleAnimation AnimationEvent {..}) =
io_ (consoleLog "animation event received")
onAnimationCancelWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action Source #
Like onAnimationCancel, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onAnimationCancelMain :: (AnimationEvent -> action) -> EventHandler model action Source #
Like onAnimationCancel, but dispatched on the Lynx main thread (MTS).
data Action = HandleAnimation AnimationEvent view_ [ event (static (onAnimationCancelMain HandleAnimation)) ] [ "some view" ]
onAnimationCancelMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onAnimationCancelMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleAnimation AnimationEvent Model DOMRef view_ [ event (static (onAnimationCancelMainWith HandleAnimation)) ] [ "some view" ]
onAnimationIteration :: (AnimationEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#animationiteration
It belongs to animation event, which is triggered when the Animation animation iterates.
data Action = HandleAnimation AnimationEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onAnimationIteration HandleAnimation ]
update :: Action -> Effect context props Model Action
update (HandleAnimation AnimationEvent {..}) =
io_ (consoleLog "animation event received")
onAnimationIterationWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action Source #
Like onAnimationIteration, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onAnimationIterationMain :: (AnimationEvent -> action) -> EventHandler model action Source #
Like onAnimationIteration, but dispatched on the Lynx main thread (MTS).
data Action = HandleAnimation AnimationEvent view_ [ event (static (onAnimationIterationMain HandleAnimation)) ] [ "some view" ]
onAnimationIterationMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onAnimationIterationMain, but also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleAnimation AnimationEvent Model DOMRef view_ [ event (static (onAnimationIterationMainWith HandleAnimation)) ] [ "some view" ]
onTransitionStart :: (AnimationEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#transitionstart
It belongs to animation event, which is triggered when the Transition animation starts.
data Action = HandleTransition AnimationEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onTransitionStart HandleTransition ]
update :: Action -> Effect context props Model Action
update (HandleTransition TransitionEvent {..}) =
io_ (consoleLog "transition event received")
onTransitionStartWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action Source #
Like onTransitionStart, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onTransitionStartMain :: (AnimationEvent -> action) -> EventHandler model action Source #
Like onTransitionStart, but dispatched on the Lynx main thread (MTS).
data Action = HandleTransition AnimationEvent view_ [ event (static (onTransitionStartMain HandleTransition)) ] [ "some view" ]
onTransitionStartMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onTransitionStartMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleTransition AnimationEvent Model DOMRef view_ [ event (static (onTransitionStartMainWith HandleTransition)) ] [ "some view" ]
onTransitionEnd :: (AnimationEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#transitionend
It belongs to animation event, which is triggered when the Transition animation ends.
data Action = HandleTransition AnimationEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onTransitionEnd HandleTransition ]
update :: Action -> Effect context props Model Action
update (HandleTransition TransitionEvent {..}) =
io_ (consoleLog "transition event received")
onTransitionEndWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action Source #
Like onTransitionEnd, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onTransitionEndMain :: (AnimationEvent -> action) -> EventHandler model action Source #
Like onTransitionEnd, but dispatched on the Lynx main thread (MTS).
data Action = HandleTransition AnimationEvent view_ [ event (static (onTransitionEndMain HandleTransition)) ] [ "some view" ]
onTransitionEndMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onTransitionEndMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleTransition AnimationEvent Model DOMRef view_ [ event (static (onTransitionEndMainWith HandleTransition)) ] [ "some view" ]
onTransitionCancel :: (AnimationEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/view.html#transitioncancel
It belongs to animation event, which is triggered when the Transition animation cancels.
data Action = HandleTransition AnimationEvent
view :: context -> props -> Model -> View context Action
view _ _ model = view_ [ onTransitionCancel HandleTransition ]
update :: Action -> Effect context props Model Action
update (HandleTransition TransitionEvent {..}) =
io_ (consoleLog "transition event received")
onTransitionCancelWith :: (AnimationEvent -> DOMRef -> action) -> Attribute model action Source #
Like onTransitionCancel, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onTransitionCancelMain :: (AnimationEvent -> action) -> EventHandler model action Source #
Like onTransitionCancel, but dispatched on the Lynx main thread (MTS).
data Action = HandleTransition AnimationEvent view_ [ event (static (onTransitionCancelMain HandleTransition)) ] [ "some view" ]
onTransitionCancelMainWith :: (AnimationEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onTransitionCancelMain, but also receives read-only access to the model
and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleTransition AnimationEvent Model DOMRef view_ [ event (static (onTransitionCancelMainWith HandleTransition)) ] [ "some view" ]
Types
data TouchEvent Source #
Constructors
| TouchEvent | |
Fields
| |
Instances
| Show TouchEvent Source # | |
Defined in Miso.Native.Element.View.Event Methods showsPrec :: Int -> TouchEvent -> ShowS # show :: TouchEvent -> String # showList :: [TouchEvent] -> ShowS # | |
| Eq TouchEvent Source # | |
Defined in Miso.Native.Element.View.Event | |
data AnimationEvent Source #
Constructors
| AnimationEvent | |
Fields
| |
Instances
| Show AnimationEvent Source # | |
Defined in Miso.Native.Element.View.Event Methods showsPrec :: Int -> AnimationEvent -> ShowS # show :: AnimationEvent -> String # showList :: [AnimationEvent] -> ShowS # | |
| Eq AnimationEvent Source # | |
Defined in Miso.Native.Element.View.Event Methods (==) :: AnimationEvent -> AnimationEvent -> Bool # (/=) :: AnimationEvent -> AnimationEvent -> Bool # | |
data LayoutChangeDetailEvent Source #
Constructors
| LayoutChangeDetailEvent | |
Fields
| |
Instances
| Show LayoutChangeDetailEvent Source # | |
Defined in Miso.Native.Element.View.Event Methods showsPrec :: Int -> LayoutChangeDetailEvent -> ShowS # show :: LayoutChangeDetailEvent -> String # showList :: [LayoutChangeDetailEvent] -> ShowS # | |
| Eq LayoutChangeDetailEvent Source # | |
Defined in Miso.Native.Element.View.Event Methods (==) :: LayoutChangeDetailEvent -> LayoutChangeDetailEvent -> Bool # (/=) :: LayoutChangeDetailEvent -> LayoutChangeDetailEvent -> Bool # | |
data UIAppearanceDetailEvent Source #
Constructors
| UIAppearanceDetailEvent | |
Fields
| |
Instances
| Show UIAppearanceDetailEvent Source # | |
Defined in Miso.Native.Element.View.Event Methods showsPrec :: Int -> UIAppearanceDetailEvent -> ShowS # show :: UIAppearanceDetailEvent -> String # showList :: [UIAppearanceDetailEvent] -> ShowS # | |
| Eq UIAppearanceDetailEvent Source # | |
Defined in Miso.Native.Element.View.Event Methods (==) :: UIAppearanceDetailEvent -> UIAppearanceDetailEvent -> Bool # (/=) :: UIAppearanceDetailEvent -> UIAppearanceDetailEvent -> Bool # | |
Decoders
touchDecoder :: Decoder TouchEvent Source #
Touch decoder for use with events like onTap
animationDecoder :: Decoder AnimationEvent Source #
Animation decoder for use with events like onAnimationStart
Event Map
viewEvents :: Events Source #