0 | module Text.HTML.Event
2 | import Web.Internal.FileTypes
11 | record WheelInfo where
12 | constructor MkWheelInfo
19 | record MouseInfo where
20 | constructor MkMouseInfo
42 | record InputInfo where
43 | constructor MkInputInfo
49 | record KeyInfo where
50 | constructor MkKeyInfo
63 | record ScrollInfo where
64 | constructor MkScrollInfo
66 | scrollHeight : Int32
67 | clientHeight : Int32
86 | data DOMEvent : Type -> Type where
88 | Click : (MouseInfo -> Maybe a) -> DOMEvent a
89 | DblClick : (MouseInfo -> Maybe a) -> DOMEvent a
90 | MouseDown : (MouseInfo -> Maybe a) -> DOMEvent a
91 | MouseUp : (MouseInfo -> Maybe a) -> DOMEvent a
94 | MouseEnter : (MouseInfo -> Maybe a) -> DOMEvent a
95 | MouseLeave : (MouseInfo -> Maybe a) -> DOMEvent a
96 | MouseOver : (MouseInfo -> Maybe a) -> DOMEvent a
97 | MouseOut : (MouseInfo -> Maybe a) -> DOMEvent a
98 | MouseMove : (MouseInfo -> Maybe a) -> DOMEvent a
101 | Blur : a -> DOMEvent a
102 | Focus : a -> DOMEvent a
105 | KeyDown : (KeyInfo -> Maybe a) -> DOMEvent a
106 | KeyUp : (KeyInfo -> Maybe a) -> DOMEvent a
109 | Change : (InputInfo -> Maybe a) -> DOMEvent a
110 | Input : (InputInfo -> Maybe a) -> DOMEvent a
113 | HashChange : a -> DOMEvent a
116 | Scroll : (ScrollInfo -> Maybe a) -> DOMEvent a
119 | Wheel : (WheelInfo -> Maybe a) -> DOMEvent a
122 | Resize : (Rect -> Maybe a) -> DOMEvent a
125 | Remove : a -> DOMEvent a
126 | Close : a -> DOMEvent a
129 | Functor DOMEvent where
130 | map f (Click g) = Click (map f . g)
131 | map f (DblClick g) = DblClick (map f . g)
132 | map f (MouseDown g) = MouseDown (map f . g)
133 | map f (MouseUp g) = MouseUp (map f . g)
134 | map f (MouseEnter g) = MouseEnter (map f . g)
135 | map f (MouseLeave g) = MouseLeave (map f . g)
136 | map f (MouseOver g) = MouseOver (map f . g)
137 | map f (MouseOut g) = MouseOut (map f . g)
138 | map f (MouseMove g) = MouseMove (map f . g)
139 | map f (Blur x) = Blur (f x)
140 | map f (Focus x) = Focus (f x)
141 | map f (KeyDown g) = KeyDown (map f . g)
142 | map f (KeyUp g) = KeyUp (map f . g)
143 | map f (Change g) = Change (map f . g)
144 | map f (Input g) = Input (map f . g)
145 | map f (HashChange x) = HashChange (f x)
146 | map f (Scroll g) = Scroll (map f . g)
147 | map f (Wheel g) = Wheel (map f . g)
148 | map f (Resize g) = Resize (map f . g)
149 | map f (Remove x) = Remove (f x)
150 | map f (Close x) = Close (f x)