Permalink
Browse files

RN: Use `$ReadOnly` in CoreEventTypes

Reviewed By: sahrens

Differential Revision: D7082715

fbshipit-source-id: d2f7e280d02bbd8e7dcba2d38b719fa4f82ecb8b
  • Loading branch information...
yungsters authored and facebook-github-bot committed Feb 26, 2018
1 parent 16c9e5b commit a817c6404338b7b15aaeac5693ae3635a0a3dde0
Showing with 52 additions and 47 deletions.
  1. +52 −47 Libraries/Types/CoreEventTypes.js
@@ -11,55 +11,60 @@
'use strict';
export type Layout = {|
+x: number,
+y: number,
+width: number,
+height: number,
|};
export type LayoutEvent = SyntheticEvent<{|
+layout: Layout,
export type SyntheticEvent<T> = $ReadOnly<{|
bubbles: ?boolean,
cancelable: ?boolean,
currentTarget: number,
defaultPrevented: ?boolean,
dispatchConfig: $ReadOnly<{|
registrationName: string,
|}>,
eventPhase: ?number,
isDefaultPrevented: () => boolean,
isPropagationStopped: () => boolean,
isTrusted: ?boolean,
nativeEvent: T,
persist: () => void,
target: ?number,
timeStamp: number,
type: ?string,
|}>;
export type SyntheticEvent<T> = {|
+bubbles: ?boolean,
+cancelable: ?boolean,
+currentTarget: number,
+defaultPrevented: ?boolean,
+dispatchConfig: {|
+registrationName: string,
|},
+eventPhase: ?number,
+isDefaultPrevented: () => boolean,
+isPropagationStopped: () => boolean,
+isTrusted: ?boolean,
+nativeEvent: T,
+persist: () => void,
+target: ?number,
+timeStamp: number,
+type: ?string,
|};
export type Layout = $ReadOnly<{|
x: number,
y: number,
width: number,
height: number,
|}>;
export type LayoutEvent = SyntheticEvent<
$ReadOnly<{|
layout: Layout,
|}>,
>;
export type PressEvent = SyntheticEvent<Object>;
export type ScrollEvent = SyntheticEvent<{|
+contentInset: {|
+bottom: number,
+left: number,
+right: number,
+top: number,
|},
+contentOffset: {|
+y: number,
+x: number,
|},
+contentSize: {|
+height: number,
+width: number,
|},
+layoutMeasurement: {|
+height: number,
+width: number,
|},
+zoomScale: number,
|}>;
export type ScrollEvent = SyntheticEvent<
$ReadOnly<{|
contentInset: $ReadOnly<{|
bottom: number,
left: number,
right: number,
top: number,
|}>,
contentOffset: $ReadOnly<{|
y: number,
x: number,
|}>,
contentSize: $ReadOnly<{|
height: number,
width: number,
|}>,
layoutMeasurement: $ReadOnly<{|
height: number,
width: number,
|}>,
zoomScale: number,
|}>,
>;

0 comments on commit a817c64

Please sign in to comment.