File tree 1 file changed +17
-3
lines changed
Libraries/Components/Switch
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,32 @@ const ColorPropType = require('ColorPropType');
14
14
const NativeMethodsMixin = require ( 'NativeMethodsMixin' ) ;
15
15
const Platform = require ( 'Platform' ) ;
16
16
const React = require ( 'React' ) ;
17
+ const ReactNative = require ( 'ReactNative' ) ;
17
18
const PropTypes = require ( 'prop-types' ) ;
18
19
const StyleSheet = require ( 'StyleSheet' ) ;
19
20
const ViewPropTypes = require ( 'ViewPropTypes' ) ;
20
21
21
22
const createReactClass = require ( 'create-react-class' ) ;
22
23
const requireNativeComponent = require ( 'requireNativeComponent' ) ;
23
24
24
- type DefaultProps = {
25
+ import type { ColorValue } from 'StyleSheetTypes' ;
26
+ import type { ViewProps } from 'ViewPropTypes' ;
27
+
28
+ type DefaultProps = $ReadOnly < { |
25
29
value : boolean ,
26
30
disabled : boolean ,
27
- } ;
31
+ | } > ;
28
32
33
+ type Props = $ReadOnly < { |
34
+ ...ViewProps ,
35
+ value ?: ?boolean ,
36
+ disabled ?: ?boolean ,
37
+ onValueChange ?: ?Function ,
38
+ testID ?: ?string ,
39
+ tintColor ?: ?ColorValue ,
40
+ onTintColor ?: ?ColorValue ,
41
+ thumbTintColor ?: ?ColorValue ,
42
+ | } > ;
29
43
/**
30
44
* Renders a boolean input.
31
45
*
@@ -161,4 +175,4 @@ if (Platform.OS === 'android') {
161
175
} ) ;
162
176
}
163
177
164
- module . exports = Switch ;
178
+ module . exports = ( ( Switch : any ) : Class < ReactNative . NativeComponent < Props >> ) ;
You can’t perform that action at this time.
0 commit comments