9
9
*/
10
10
'use strict' ;
11
11
12
+ const React = require ( 'React' ) ;
12
13
const EdgeInsetsPropType = require ( 'EdgeInsetsPropType' ) ;
13
14
const PlatformViewPropTypes = require ( 'PlatformViewPropTypes' ) ;
14
15
const PropTypes = require ( 'prop-types' ) ;
@@ -26,21 +27,12 @@ import type {
26
27
} from 'ViewAccessibility' ;
27
28
import type { EdgeInsetsProp } from 'EdgeInsetsPropType' ;
28
29
import type { TVViewProps } from 'TVViewPropTypes' ;
30
+ import type { Layout , LayoutEvent } from 'CoreEventTypes' ;
29
31
30
32
const stylePropType = StyleSheetPropType ( ViewStylePropTypes ) ;
31
33
32
- export type ViewLayout = {
33
- x : number ,
34
- y : number ,
35
- width : number ,
36
- height : number ,
37
- }
38
-
39
- export type ViewLayoutEvent = {
40
- nativeEvent : {
41
- layout : ViewLayout ,
42
- }
43
- }
34
+ export type ViewLayout = Layout ;
35
+ export type ViewLayoutEvent = LayoutEvent ;
44
36
45
37
// There's no easy way to create a different type if (Platform.isTVOS):
46
38
// so we must include TVViewProps
@@ -54,23 +46,24 @@ export type ViewProps = {
54
46
accessibilityTraits ?: AccessibilityTrait | Array < AccessibilityTrait > ,
55
47
accessibilityViewIsModal ?: bool ,
56
48
accessibilityElementsHidden ?: bool ,
49
+ children ?: ?React . Node ,
57
50
onAccessibilityAction ?: Function ,
58
51
onAccessibilityTap ?: Function ,
59
52
onMagicTap ?: Function ,
60
- testID ?: string ,
53
+ testID ?: ? string ,
61
54
nativeID ?: string ,
62
- onLayout ?: ( event : ViewLayoutEvent ) => void ,
63
- onResponderGrant ? : Function ,
64
- onResponderMove ?: Function ,
65
- onResponderReject ?: Function ,
66
- onResponderRelease ?: Function ,
67
- onResponderTerminate ?: Function ,
68
- onResponderTerminationRequest ?: Function ,
69
- onStartShouldSetResponder ?: Function ,
70
- onStartShouldSetResponderCapture ?: Function ,
71
- onMoveShouldSetResponder ?: Function ,
72
- onMoveShouldSetResponderCapture ?: Function ,
73
- hitSlop ?: EdgeInsetsProp ,
55
+ onLayout ?: ? ( event : LayoutEvent ) => void ,
56
+ onResponderGrant ?: ? Function ,
57
+ onResponderMove ?: ? Function ,
58
+ onResponderReject ?: ? Function ,
59
+ onResponderRelease ?: ? Function ,
60
+ onResponderTerminate ?: ? Function ,
61
+ onResponderTerminationRequest ?: ? Function ,
62
+ onStartShouldSetResponder ?: ? Function ,
63
+ onStartShouldSetResponderCapture ?: ? Function ,
64
+ onMoveShouldSetResponder ?: ? Function ,
65
+ onMoveShouldSetResponderCapture ?: ? Function ,
66
+ hitSlop ?: ? EdgeInsetsProp ,
74
67
pointerEvents ?: null | 'box-none' | 'none' | 'box-only' | 'auto' ,
75
68
style ?: stylePropType ,
76
69
removeClippedSubviews ?: bool ,
0 commit comments