Flowtype Switch

Reviewed By: yungsters

Differential Revision: D7985880

fbshipit-source-id: eaaff2188b8257d09e1bf628d19dae6dfb4c2fc6
This commit is contained in:
Eli White 2018-05-14 00:09:18 -07:00 committed by Facebook Github Bot
parent cbe045a95f
commit 06052a2330

View File

@ -14,6 +14,7 @@ const ColorPropType = require('ColorPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const ReactNative = require('ReactNative');
const PropTypes = require('prop-types');
const StyleSheet = require('StyleSheet');
const ViewPropTypes = require('ViewPropTypes');
@ -21,11 +22,24 @@ const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');
type DefaultProps = {
import type {ColorValue} from 'StyleSheetTypes';
import type {ViewProps} from 'ViewPropTypes';
type DefaultProps = $ReadOnly<{|
value: boolean,
disabled: boolean,
};
|}>;
type Props = $ReadOnly<{|
...ViewProps,
value?: ?boolean,
disabled?: ?boolean,
onValueChange?: ?Function,
testID?: ?string,
tintColor?: ?ColorValue,
onTintColor?: ?ColorValue,
thumbTintColor?: ?ColorValue,
|}>;
/**
* Renders a boolean input.
*
@ -161,4 +175,4 @@ if (Platform.OS === 'android') {
});
}
module.exports = Switch;
module.exports = ((Switch: any): Class<ReactNative.NativeComponent<Props>>);