update Event documentation by sgny · Pull Request #672 · rescript-react-native/rescript-react-native

Expand Up @@ -86,17 +86,18 @@ type responderSyntheticEvent('a) = { ### `layoutEvent`
```reason type layoutEvent = syntheticEvent({ . "layout": { . "x": float, "y": float, "width": float, "height": float, }, }); type layoutEvent = syntheticEvent(layout) ```
where `layout` is defined as
```reason type layout = { x: float, y: float, width: float, height: float, }; ```
### `pressEvent` Expand All @@ -109,77 +110,98 @@ where `pressEventPayload` is defined as
```reason 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), 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), }; ```
### `scrollEvent`
```reason type scrollEvent = syntheticEvent({ . "contentInset": { . "bottom": float, "left": float, "right": float, "top": float, }, "contentOffset": contentOffset, "contentSize": dimensions, "layoutMeasurement": dimensions, }); type scrollEvent = syntheticEvent(scrollEventPayload) ```
where `contentOffset` and `dimensions` are defined as where `scrollEventPayload` is defined as
```reason type scrollEventPayload = { contentInset, contentOffset, contentSize: dimensions, layoutMeasurement: dimensions, } ```
and `contentInset`, `contentOffset` and `dimensions` are defined as
```reason type contentInset = { bottom: float, left: float, right: float, top: float, }; ```
```reason type contentOffset = { . "x": float, "y": float, x: float, y: float, }; ```
```reason type dimensions = { . "height": float, "width": float, height: float, width: float, }; ```
### `switchChangeEvent`
```reason type switchChangeEvent = syntheticEvent({value: bool}); type switchChangeEvent = syntheticEvent(switchChangePayload) ```
where `switchChangePayload` is defined as
```reason type switchChangePayload = {value: bool}; ```
### `targetEvent`
```reason type targetEvent = syntheticEvent({target: int}); type targetEvent = syntheticEvent(targetPayload) ```
where `targetPayload` is defined as
```reason type targetPayload = {target: int}; ```
### `textLayoutEvent`
```reason type textLayoutEvent = syntheticEvent({lines: array(textLayout)}); type textLayoutEvent = syntheticEvent(textLayouts); ```
where `textLayouts` and `textLayout` are defined as
```reason type textLayouts = {lines: array(textLayout)}; ```
where `textLayout` is defined as and
```reason type textLayout = { Expand Down