diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index 0665d6f2c5e63a..574bd577cc9997 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -9,6 +9,7 @@ */ 'use strict'; +const React = require('React'); const EdgeInsetsPropType = require('EdgeInsetsPropType'); const PlatformViewPropTypes = require('PlatformViewPropTypes'); const PropTypes = require('prop-types'); @@ -26,21 +27,12 @@ import type { } from 'ViewAccessibility'; import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; import type {TVViewProps} from 'TVViewPropTypes'; +import type {Layout, LayoutEvent} from 'CoreEventTypes'; const stylePropType = StyleSheetPropType(ViewStylePropTypes); -export type ViewLayout = { - x: number, - y: number, - width: number, - height: number, -} - -export type ViewLayoutEvent = { - nativeEvent: { - layout: ViewLayout, - } -} +export type ViewLayout = Layout; +export type ViewLayoutEvent = LayoutEvent; // There's no easy way to create a different type if (Platform.isTVOS): // so we must include TVViewProps @@ -54,23 +46,24 @@ export type ViewProps = { accessibilityTraits?: AccessibilityTrait | Array, accessibilityViewIsModal?: bool, accessibilityElementsHidden?: bool, + children?: ?React.Node, onAccessibilityAction?: Function, onAccessibilityTap?: Function, onMagicTap?: Function, - testID?: string, + testID?: ?string, nativeID?: string, - onLayout?: (event: ViewLayoutEvent) => void, - onResponderGrant?: Function, - onResponderMove?: Function, - onResponderReject?: Function, - onResponderRelease?: Function, - onResponderTerminate?: Function, - onResponderTerminationRequest?: Function, - onStartShouldSetResponder?: Function, - onStartShouldSetResponderCapture?: Function, - onMoveShouldSetResponder?: Function, - onMoveShouldSetResponderCapture?: Function, - hitSlop?: EdgeInsetsProp, + 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, removeClippedSubviews?: bool,