RN: Add Missing Events to ViewPropTypes

Reviewed By: TheSavior

Differential Revision: D7984937

fbshipit-source-id: fc2703e3382a7515b71f8a634aca5b6d7a5b25b4
This commit is contained in:
Tim Yung 2018-05-13 00:48:47 -07:00 committed by Facebook Github Bot
parent 3d3edfc3da
commit 41a940392c
1 changed files with 36 additions and 14 deletions

View File

@ -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,
@ -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,