Commit 9e48430 1 parent 25e2887 commit 9e48430 Copy full SHA for 9e48430
File tree 2 files changed +33
-8
lines changed
Libraries/Components/TimePickerAndroid
2 files changed +33
-8
lines changed Original file line number Diff line number Diff line change 5
5
* LICENSE file in the root directory of this source tree.
6
6
*
7
7
* @format
8
- * @flow
8
+ * @flow strict-local
9
9
*/
10
10
11
11
'use strict' ;
12
12
13
13
const TimePickerModule = require ( 'NativeModules' ) . TimePickerAndroid ;
14
14
15
+ import type {
16
+ TimePickerOptions ,
17
+ TimePickerResult ,
18
+ } from './TimePickerAndroidTypes' ;
19
+
15
20
/**
16
21
* Opens the standard Android time picker dialog.
17
22
*
@@ -52,22 +57,18 @@ class TimePickerAndroid {
52
57
* still be resolved with action being `TimePickerAndroid.dismissedAction` and all the other keys
53
58
* being undefined. **Always** check whether the `action` before reading the values.
54
59
*/
55
- static async open ( options : Object ) : Promise < Object > {
60
+ static async open ( options : TimePickerOptions ) : Promise < TimePickerResult > {
56
61
return TimePickerModule . open ( options ) ;
57
62
}
58
63
59
64
/**
60
65
* A time has been selected.
61
66
*/
62
- static get timeSetAction ( ) {
63
- return 'timeSetAction' ;
64
- }
67
+ static + timeSetAction : 'timeSetAction' = 'timeSetAction' ;
65
68
/**
66
69
* The dialog has been dismissed.
67
70
*/
68
- static get dismissedAction ( ) {
69
- return 'dismissedAction' ;
70
- }
71
+ static + dismissedAction : 'dismissedAction' = 'dismissedAction' ;
71
72
}
72
73
73
74
module . exports = TimePickerAndroid ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ * @flow strict-local
9
+ */
10
+
11
+ 'use strict' ;
12
+
13
+ export type TimePickerOptions = { |
14
+ hour ? : number ,
15
+ minute ? : number ,
16
+ is24Hour ? : boolean ,
17
+ mode ? : 'clock' | 'spinner' | 'default' ,
18
+ | } ;
19
+
20
+ export type TimePickerResult = $ReadOnly < { |
21
+ action : string ,
22
+ hour : number ,
23
+ minute : number ,
24
+ | } > ;
You can’t perform that action at this time.
0 commit comments