-
Notifications
You must be signed in to change notification settings - Fork 25
/
Events.purs
50 lines (41 loc) · 850 Bytes
/
Events.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
module ReactNative.Events where
import Control.Monad.Eff.Uncurried (EffFn1, EffFn2)
import Prelude (Unit)
type TouchEvent = {
nativeEvent :: {
identifier :: Int
, locationX :: Number
, locationY :: Number
, pageX :: Number
, pageY :: Number
, timestamp :: Int
}
}
type LayoutEvent = {
nativeEvent :: {
layout :: {
x :: Int
, y :: Int
, width :: Int
, height :: Int
}
}
}
type TextInputEvent = {
nativeEvent :: {
text :: String
}
}
type ContentSizeEvent = {
nativeEvent :: {
contentSize :: { width :: Int, height :: Int }
}
}
type ScrollEvent = {
nativeEvent :: {
contentOffset :: {x::Number, y::Number}
}
}
type EventHandler eff a = EffFn1 eff a Unit
type EventHandler2 eff a b = EffFn2 eff a b Unit
type UnitEventHandler eff = EffFn1 eff Unit Unit