RN: Create SyntheticEvent and ScrollEvent Types

Reviewed By: sahrens

Differential Revision: D6720478

fbshipit-source-id: b542bd50db7cd7085aecce8b986c6922bfb24a43
This commit is contained in:
Tim Yung 2018-01-14 10:42:04 -08:00 committed by Facebook Github Bot
parent c355a34de1
commit 83ed9d170b
1 changed files with 41 additions and 1 deletions

View File

@ -26,4 +26,44 @@ export type LayoutEvent = {|
+persist: () => void,
|};
export type PressEvent = Object;
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,
+target: ?number,
+timeStamp: number,
+type: ?string,
|};
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,
|}>;