Skip to content

Commit

Permalink
Flowtype Slider
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D7985857

fbshipit-source-id: 8b6b9f58aa89b898fa38d1cfc0564df5f64741a2
  • Loading branch information
elicwhite authored and facebook-github-bot committed May 14, 2018
1 parent 891dfc3 commit cbe045a
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion Libraries/Components/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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.
*
Expand Down Expand Up @@ -282,4 +316,4 @@ if (Platform.OS === 'android') {
}
const RCTSlider = requireNativeComponent('RCTSlider', Slider, options);

module.exports = Slider;
module.exports = ((Slider: any): Class<ReactNative.NativeComponent<Props>>);

0 comments on commit cbe045a

Please sign in to comment.