@@ -14,14 +14,43 @@ const ElementProperties = require('ElementProperties');
1414const NetworkOverlay = require ( 'NetworkOverlay' ) ;
1515const PerformanceOverlay = require ( 'PerformanceOverlay' ) ;
1616const React = require ( 'React' ) ;
17- const PropTypes = require ( 'prop-types' ) ;
1817const ScrollView = require ( 'ScrollView' ) ;
1918const StyleSheet = require ( 'StyleSheet' ) ;
2019const Text = require ( 'Text' ) ;
2120const TouchableHighlight = require ( 'TouchableHighlight' ) ;
2221const View = require ( 'View' ) ;
2322
24- class InspectorPanel extends React . Component < $FlowFixMeProps > {
23+ import type { ViewStyleProp } from 'StyleSheet' ;
24+
25+ type Props = $ReadOnly < { |
26+ devtoolsIsOpen ?: ?boolean ,
27+ inspecting : boolean ,
28+ setInspecting : ( val : boolean ) = > void ,
29+ perfing : boolean ,
30+ setPerfing : ( val : boolean ) = > void ,
31+ touchTargeting ?: ?boolean ,
32+ setTouchTargeting ?: ?( val : boolean ) => void ,
33+ networking ?: ?boolean ,
34+ setNetworking ?: ?( val : boolean ) => void ,
35+ hierarchy ?: any ,
36+ selection : number ,
37+ setSelection : number => mixed ,
38+ inspected ?: ?{ |
39+ style ?: ?ViewStyleProp ,
40+ frame ?: ?{ |
41+ top ?: ?number ,
42+ left ?: ?number ,
43+ width ?: ?number ,
44+ height : ?number ,
45+ | } ,
46+ source ?: ?{ |
47+ fileName ?: string ,
48+ lineNumber ?: number ,
49+ | } ,
50+ | } ,
51+ | } > ;
52+
53+ class InspectorPanel extends React . Component < Props > {
2554 renderWaiting ( ) {
2655 if ( this . props . inspecting ) {
2756 return (
@@ -57,22 +86,22 @@ class InspectorPanel extends React.Component<$FlowFixMeProps> {
5786 < View style = { styles . container } >
5887 { ! this . props . devtoolsIsOpen && contents }
5988 < View style = { styles . buttonRow } >
60- < Button
89+ < InspectorPanelButton
6190 title = { 'Inspect' }
6291 pressed = { this . props . inspecting }
6392 onClick = { this . props . setInspecting }
6493 />
65- < Button
94+ < InspectorPanelButton
6695 title = { 'Perf' }
6796 pressed = { this . props . perfing }
6897 onClick = { this . props . setPerfing }
6998 />
70- < Button
99+ < InspectorPanelButton
71100 title = { 'Network' }
72101 pressed = { this . props . networking }
73102 onClick = { this . props . setNetworking }
74103 />
75- < Button
104+ < InspectorPanelButton
76105 title = { 'Touchables' }
77106 pressed = { this . props . touchTargeting }
78107 onClick = { this . props . setTouchTargeting }
@@ -83,20 +112,13 @@ class InspectorPanel extends React.Component<$FlowFixMeProps> {
83112 }
84113}
85114
86- InspectorPanel . propTypes = {
87- devtoolsIsOpen : PropTypes . bool ,
88- inspecting : PropTypes . bool ,
89- setInspecting : PropTypes . func ,
90- inspected : PropTypes . object ,
91- perfing : PropTypes . bool ,
92- setPerfing : PropTypes . func ,
93- touchTargeting : PropTypes . bool ,
94- setTouchTargeting : PropTypes . func ,
95- networking : PropTypes . bool ,
96- setNetworking : PropTypes . func ,
97- } ;
115+ type InspectorPanelButtonProps = $ReadOnly < { |
116+ onClick : ( val : boolean ) => void ,
117+ pressed ?: ?boolean ,
118+ title ?: ?string ,
119+ | } > ;
98120
99- class Button extends React . Component < $FlowFixMeProps > {
121+ class InspectorPanelButton extends React . Component < InspectorPanelButtonProps > {
100122 render ( ) {
101123 return (
102124 < TouchableHighlight
0 commit comments