|
12 | 12 |
|
13 | 13 | const Dimensions = require('Dimensions'); |
14 | 14 | const ElementBox = require('ElementBox'); |
15 | | -const PropTypes = require('prop-types'); |
16 | 15 | const React = require('React'); |
17 | 16 | const StyleSheet = require('StyleSheet'); |
18 | 17 | const UIManager = require('UIManager'); |
19 | 18 | const View = require('View'); |
20 | 19 |
|
| 20 | +import type {ViewStyleProp} from 'StyleSheet'; |
| 21 | + |
21 | 22 | type EventLike = { |
22 | 23 | nativeEvent: Object, |
23 | 24 | }; |
24 | 25 |
|
25 | | -class InspectorOverlay extends React.Component<{ |
26 | | - inspected?: { |
27 | | - frame?: Object, |
28 | | - style?: any, |
29 | | - }, |
30 | | - inspectedViewTag?: number, |
31 | | - onTouchViewTag: (tag: number, frame: Object, pointerY: number) => void, |
32 | | -}> { |
33 | | - static propTypes = { |
34 | | - inspected: PropTypes.shape({ |
35 | | - frame: PropTypes.object, |
36 | | - style: PropTypes.any, |
37 | | - }), |
38 | | - inspectedViewTag: PropTypes.number, |
39 | | - onTouchViewTag: PropTypes.func.isRequired, |
40 | | - }; |
| 26 | +type Inspected = $ReadOnly<{| |
| 27 | + frame?: Object, |
| 28 | + style?: ViewStyleProp, |
| 29 | +|}>; |
| 30 | + |
| 31 | +type Props = $ReadOnly<{| |
| 32 | + inspected?: Inspected, |
| 33 | + inspectedViewTag?: ?number, |
| 34 | + onTouchViewTag: (tag: number, frame: Object, pointerY: number) => mixed, |
| 35 | +|}>; |
41 | 36 |
|
| 37 | +class InspectorOverlay extends React.Component<Props> { |
42 | 38 | findViewForTouchEvent = (e: EventLike) => { |
43 | 39 | const {locationX, locationY} = e.nativeEvent.touches[0]; |
44 | 40 | UIManager.findSubviewIn( |
|
0 commit comments