From cbe045a95f1ca53d99ae521742a93299a53d6136 Mon Sep 17 00:00:00 2001 From: Eli White Date: Mon, 14 May 2018 00:09:16 -0700 Subject: [PATCH] Flowtype Slider Reviewed By: yungsters Differential Revision: D7985857 fbshipit-source-id: 8b6b9f58aa89b898fa38d1cfc0564df5f64741a2 --- Libraries/Components/Slider/Slider.js | 36 ++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 8e9eabd4361894..4c4c0b9790286a 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -13,6 +13,7 @@ const Image = require('Image'); const ColorPropType = require('ColorPropType'); const NativeMethodsMixin = require('NativeMethodsMixin'); +const ReactNative = require('ReactNative'); const ReactNativeViewAttributes = require('ReactNativeViewAttributes'); const Platform = require('Platform'); const React = require('React'); @@ -23,8 +24,41 @@ const ViewPropTypes = require('ViewPropTypes'); const createReactClass = require('create-react-class'); const requireNativeComponent = require('requireNativeComponent'); +import type {ImageSource} from 'ImageSource'; +import type {ViewStyleProp} from 'StyleSheet'; +import type {ColorValue} from 'StyleSheetTypes'; +import type {ViewProps} from 'ViewPropTypes'; + type Event = Object; +type IOSProps = $ReadOnly<{| + trackImage?: ?ImageSource, + minimumTrackImage?: ?ImageSource, + maximumTrackImage?: ?ImageSource, + thumbImage?: ?ImageSource, +|}>; + +type AndroidProps = $ReadOnly<{| + thumbTintColor?: ?ColorValue, +|}>; + +type Props = $ReadOnly<{| + ...ViewProps, + ...IOSProps, + ...AndroidProps, + style?: ?ViewStyleProp, + value?: ?number, + step?: ?number, + minimumValue?: ?number, + maximumValue?: ?number, + minimumTrackTintColor?: ?ColorValue, + maximumTrackTintColor?: ?ColorValue, + disabled?: ?boolean, + onValueChange?: ?Function, + onSlidingComplete?: ?Function, + testID?: ?string, +|}>; + /** * A component used to select a single value from a range of values. * @@ -282,4 +316,4 @@ if (Platform.OS === 'android') { } const RCTSlider = requireNativeComponent('RCTSlider', Slider, options); -module.exports = Slider; +module.exports = ((Slider: any): Class>);