@@ -24,20 +24,34 @@ const ViewPropTypes = require('ViewPropTypes');
24
24
const createReactClass = require ( 'create-react-class' ) ;
25
25
const requireNativeComponent = require ( 'requireNativeComponent' ) ;
26
26
27
+ import type { ViewProps } from 'ViewPropTypes' ;
27
28
type DefaultProps = {
28
29
mode : 'date' | 'time' | 'datetime' ,
29
30
} ;
30
31
31
32
type Event = Object ;
32
33
34
+ type Props = $ReadOnly < { |
35
+ ...ViewProps ,
36
+ date ?: ?Date ,
37
+ initialDate ?: ?Date ,
38
+ locale ?: ?string ,
39
+ maximumDate ?: ?Date ,
40
+ minimumDate ?: ?Date ,
41
+ minuteInterval ?: ?( 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30 ) ,
42
+ mode ?: ?( 'date' | 'time' | 'datetime' ) ,
43
+ onDateChange : ( date : Date ) => void ,
44
+ timeZoneOffsetInMinutes ?: ?number ,
45
+ | } > ;
46
+
33
47
/**
34
48
* Use `DatePickerIOS` to render a date/time picker (selector) on iOS. This is
35
49
* a controlled component, so you must hook in to the `onDateChange` callback
36
50
* and update the `date` prop in order for the component to update, otherwise
37
51
* the user's change will be reverted immediately to reflect `props.date` as the
38
52
* source of truth.
39
53
*/
40
- const DatePickerIOS = createReactClass ( {
54
+ const DatePickerIOS = ( ( createReactClass ( {
41
55
displayName : 'DatePickerIOS' ,
42
56
// TOOD: Put a better type for _picker
43
57
_picker : ( undefined : ?$FlowFixMe ) ,
@@ -171,7 +185,7 @@ const DatePickerIOS = createReactClass({
171
185
</ View >
172
186
) ;
173
187
} ,
174
- } ) ;
188
+ } ) : any ) : React . ComponentType < Props > ) ;
175
189
176
190
const styles = StyleSheet . create ( {
177
191
datePickerIOS : {
0 commit comments