Skip to content

Commit

Permalink
RN: Create SyntheticEvent and ScrollEvent Types
Browse files Browse the repository at this point in the history
Reviewed By: sahrens

Differential Revision: D6720478

fbshipit-source-id: b542bd50db7cd7085aecce8b986c6922bfb24a43
  • Loading branch information
yungsters authored and facebook-github-bot committed Jan 14, 2018
1 parent c355a34 commit 83ed9d1
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion Libraries/Types/CoreEventTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
|}>;

0 comments on commit 83ed9d1

Please sign in to comment.