| id | event |
|---|---|
| title | Event |
| officialDoc | https://github.com/facebook/react-native/blob/main/Libraries/Types/CoreEventTypes.js |
These are the types of objects returned in Event callbacks. Types are
instances of syntheticEvent<'a> and responderSyntheticEvent<'a>.
type syntheticEvent<'a> = {
bubbles: Js.Nullable.t<bool>,
cancelable: Js.Nullable.t<bool>,
currentTarget: float,
defaultPrevented: Js.Nullable.t<bool>,
dispatchConfig: registrationName,
eventPhase: Js.Nullable.t<float>,
isTrusted: Js.Nullable.t<bool>,
nativeEvent: T._payload,
target: Js.Nullable.t<float>,
timeStamp: float,
_type: Js.Nullable.t<string>,
}responderSyntheticEvent<'a> adds the touchHistory key to
syntheticEvent<'a>
type responderSyntheticEvent<'a> = {
bubbles: Js.Nullable.t<bool>,
cancelable: Js.Nullable.t<bool>,
currentTarget: float,
defaultPrevented: Js.Nullable.t<bool>,
dispatchConfig: registrationName,
eventPhase: Js.Nullable.t<float>,
isTrusted: Js.Nullable.t<bool>,
nativeEvent: T._payload,
target: Js.Nullable.t<float>,
timeStamp: float,
_type: Js.Nullable.t<string>,
touchHistory: touchHistory,
}type layoutEvent = syntheticEvent<layout>where layout is defined as
type layout = {
x: float,
y: float,
width: float,
height: float,
}type pressEvent = responderSyntheticEvent<pressEventPayload>where pressEventPayload is defined as
type pressEventPayload = {
changedTouches: array(pressEventPayload),
force: float,
identifier: int,
locationX: float,
locationY: float,
pageX: float,
pageY: float,
target: Js.Nullable.t(float),
timestamp: float,
touches: array(pressEventPayload),
}type scrollEvent = syntheticEvent<scrollEventPayload>where scrollEventPayload is defined as
type scrollEventPayload = {
contentInset,
contentOffset,
contentSize: dimensions,
layoutMeasurement: dimensions,
}and contentInset, contentOffset and dimensions are defined as
type contentInset = {
bottom: float,
left: float,
right: float,
top: float,
}type contentOffset = {
x: float,
y: float,
}type dimensions = {
height: float,
width: float,
}type switchChangeEvent = syntheticEvent<switchChangePayload>where switchChangePayload is defined as
type switchChangePayload = {value: bool}type targetEvent = syntheticEvent<targetPayload>where targetPayload is defined as
type targetPayload = {target: int}type textLayoutEvent = syntheticEvent<textLayouts>where textLayouts and textLayout are defined as
type textLayouts = {lines: array(textLayout)}and
type textLayout = {
x: float,
y: float,
width: float,
height: float,
ascender: float, // verify
capHeight: float, // verify
descender: float, // verify
text: string,
xHeight: float // verify
}