@@ -4,29 +4,29 @@ import { TextStyle, StyleProp, ViewProps } from 'react-native'
4
4
export type ItemValue = number | string
5
5
6
6
export interface PickerItemProps < T = ItemValue > {
7
- label ?: string ;
7
+ label ?: string ;
8
8
value ?: T ;
9
9
color ?: string ;
10
10
fontFamily ?: string ,
11
- testID ?: string ;
12
- /**
13
- * Style to apply to individual item labels.
14
- * Only following values take effect:
15
- * - 'color'
16
- * - 'backgroundColor'
17
- * - 'fontSize'
18
- * - 'fontFamily'
19
- *
20
- * @platform android
21
- */
22
- style ?: StyleProp < TextStyle >
23
- /**
24
- * If set to false, the specific item will be disabled, i.e. the user will not be able to make a
25
- * selection.
26
- * @default true
27
- * @platform android
28
- */
29
- enabled ?:boolean
11
+ testID ?: string ;
12
+ /**
13
+ * Style to apply to individual item labels.
14
+ * Only following values take effect:
15
+ * - 'color'
16
+ * - 'backgroundColor'
17
+ * - 'fontSize'
18
+ * - 'fontFamily'
19
+ *
20
+ * @platform android
21
+ */
22
+ style ?: StyleProp < TextStyle >
23
+ /**
24
+ * If set to false, the specific item will be disabled, i.e. the user will not be able to make a
25
+ * selection.
26
+ * @default true
27
+ * @platform android
28
+ */
29
+ enabled ?:boolean
30
30
}
31
31
32
32
export interface PickerProps < T = ItemValue > extends ViewProps {
@@ -69,38 +69,54 @@ export interface PickerProps<T = ItemValue> extends ViewProps {
69
69
/**
70
70
* Used to locate this view in end-to-end tests.
71
71
*/
72
- testID ?: string ;
72
+ testID ?: string ;
73
+ /**
74
+ * Color of arrow for spinner dropdown in hexadecimal format
75
+ * @platform android
76
+ */
77
+ dropdownIconColor ?: string ;
78
+ /**
79
+ * On Android, used to truncate the text with an ellipsis after computing the text layout, including line wrapping,
80
+ * such that the total number of lines does not exceed this number. Default is '1'
81
+ * @platform android
82
+ */
83
+ numberOfLines ?: number ;
84
+ /**
85
+ * The string used for the accessibility label. Will be read once focused on the picker but not on change.
86
+ */
87
+ accessibilityLabel ?: string ;
73
88
/**
74
- * Color of arrow for spinner dropdown in hexadecimal format
89
+ * Called when picker is focused
75
90
* @platform android
76
91
*/
77
- dropdownIconColor ?: string ;
78
-
79
- /**
80
- * On Android, used to truncate the text with an ellipsis after computing the text layout, including line wrapping,
81
- * such that the total number of lines does not exceed this number. Default is '1'
82
- * @platform android
83
- */
84
- numberOfLines ?: number ;
85
-
86
- /**
87
- * The string used for the accessibility label. Will be read once focused on the picker but not on change.
88
- */
89
- accessibilityLabel ?: string ;
90
-
92
+ onFocus ?: ( e : NativeSyntheticEvent < TargetedEvent > ) => void
93
+ /**
94
+ * Called when picker is blurred
95
+ * @platform android
96
+ */
97
+ onBlur ?: ( e : NativeSyntheticEvent < TargetedEvent > ) => void
91
98
}
92
99
93
100
declare class Picker < T > extends React . Component < PickerProps < T > , { } > {
94
101
/**
95
102
* On Android, display the options in a dialog (this is the default).
96
103
*/
97
- static readonly MODE_DIALOG : 'dialog' ;
98
- /**
99
- * On Android, display the options in a dropdown.
100
- */
101
- static readonly MODE_DROPDOWN : 'dropdown' ;
104
+ static readonly MODE_DIALOG : 'dialog' ;
105
+ /**
106
+ * On Android, display the options in a dropdown.
107
+ */
108
+ static readonly MODE_DROPDOWN : 'dropdown' ;
109
+
110
+ static Item : React . ComponentType < PickerItemProps < ItemValue > > ;
102
111
103
- static Item : React . ComponentType < PickerItemProps < ItemValue > > ;
112
+ /**
113
+ * @platform android
114
+ */
115
+ focus : ( ) => void
116
+ /**
117
+ * @platform android
118
+ */
119
+ blur : ( ) => void
104
120
}
105
121
106
- export { Picker } ;
122
+ export { Picker } ;
0 commit comments