Skip to content

Commit

Permalink
RN: Add Missing Events to ViewPropTypes
Browse files Browse the repository at this point in the history
Reviewed By: TheSavior

Differential Revision: D7984937

fbshipit-source-id: fc2703e3382a7515b71f8a634aca5b6d7a5b25b4
  • Loading branch information
yungsters authored and facebook-github-bot committed May 13, 2018
1 parent 3d3edfc commit 41a9403
Showing 1 changed file with 36 additions and 14 deletions.
50 changes: 36 additions & 14 deletions Libraries/Components/View/ViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,43 @@ const stylePropType = StyleSheetPropType(ViewStylePropTypes);
export type ViewLayout = Layout;
export type ViewLayoutEvent = LayoutEvent;

type DirectEventProps = $ReadOnly<{|
onAccessibilityAction?: Function,
onAccessibilityTap?: Function,
onLayout?: ?(event: LayoutEvent) => void,
onMagicTap?: Function,
|}>;

type TouchEventProps = $ReadOnly<{|
onTouchCancel?: ?Function,
onTouchCancelCapture?: ?Function,
onTouchEnd?: ?Function,
onTouchEndCapture?: ?Function,
onTouchMove?: ?Function,
onTouchMoveCapture?: ?Function,
onTouchStart?: ?Function,
onTouchStartCapture?: ?Function,
|}>;

type GestureResponderEventProps = $ReadOnly<{|
onMoveShouldSetResponder?: ?Function,
onMoveShouldSetResponderCapture?: ?Function,
onResponderGrant?: ?Function,
onResponderMove?: ?Function,
onResponderReject?: ?Function,
onResponderRelease?: ?Function,
onResponderStart?: ?Function,
onResponderTerminate?: ?Function,
onResponderTerminationRequest?: ?Function,
onStartShouldSetResponder?: ?Function,
onStartShouldSetResponderCapture?: ?Function,
|}>;

export type ViewProps = $ReadOnly<{|
...DirectEventProps,
...GestureResponderEventProps,
...TouchEventProps,

// There's no easy way to create a different type if (Platform.isTVOS):
// so we must include TVViewProps
...TVViewProps,
Expand All @@ -55,22 +91,8 @@ export type ViewProps = $ReadOnly<{|
accessibilityViewIsModal?: boolean,
accessibilityElementsHidden?: boolean,
children?: ?React.Node,
onAccessibilityAction?: Function,
onAccessibilityTap?: Function,
onMagicTap?: Function,
testID?: ?string,
nativeID?: string,
onLayout?: ?(event: LayoutEvent) => void,
onResponderGrant?: ?Function,
onResponderMove?: ?Function,
onResponderReject?: ?Function,
onResponderRelease?: ?Function,
onResponderTerminate?: ?Function,
onResponderTerminationRequest?: ?Function,
onStartShouldSetResponder?: ?Function,
onStartShouldSetResponderCapture?: ?Function,
onMoveShouldSetResponder?: ?Function,
onMoveShouldSetResponderCapture?: ?Function,
hitSlop?: ?EdgeInsetsProp,
pointerEvents?: null | 'box-none' | 'none' | 'box-only' | 'auto',
style?: stylePropType,
Expand Down

0 comments on commit 41a9403

Please sign in to comment.