Flowtype SegmentedControlIOS

Reviewed By: yungsters

Differential Revision: D7985978

fbshipit-source-id: 6579ad8dd5c5377571fd790149ea5cfc6b33939f
This commit is contained in:
Eli White 2018-05-14 00:09:28 -07:00 committed by Facebook Github Bot
parent c87701ba05
commit 113f009698

View File

@ -12,6 +12,7 @@
const NativeMethodsMixin = require('NativeMethodsMixin'); const NativeMethodsMixin = require('NativeMethodsMixin');
const React = require('React'); const React = require('React');
const ReactNative = require('ReactNative');
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
const StyleSheet = require('StyleSheet'); const StyleSheet = require('StyleSheet');
const ViewPropTypes = require('ViewPropTypes'); const ViewPropTypes = require('ViewPropTypes');
@ -19,11 +20,24 @@ const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class'); const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent'); const requireNativeComponent = require('requireNativeComponent');
import type {ViewProps} from 'ViewPropTypes';
type DefaultProps = { type DefaultProps = {
values: Array<string>, values: $ReadOnlyArray<string>,
enabled: boolean, enabled: boolean,
}; };
type Props = $ReadOnly<{|
...ViewProps,
values?: ?$ReadOnlyArray<string>,
selectedIndex?: ?number,
onValueChange?: ?Function,
onChange?: ?Function,
enabled?: ?boolean,
tintColor?: ?string,
momentary?: ?boolean,
|}>;
const SEGMENTED_CONTROL_REFERENCE = 'segmentedcontrol'; const SEGMENTED_CONTROL_REFERENCE = 'segmentedcontrol';
type Event = Object; type Event = Object;
@ -130,4 +144,6 @@ const RCTSegmentedControl = requireNativeComponent(
SegmentedControlIOS, SegmentedControlIOS,
); );
module.exports = SegmentedControlIOS; module.exports = ((SegmentedControlIOS: any): Class<
ReactNative.NativeComponent<Props>,
>);