@@ -17,13 +17,14 @@ import type {
1717 Double ,
1818 Float ,
1919 Int32 ,
20+ WithDefault ,
2021} from 'react-native/Libraries/Types/CodegenTypes' ;
2122import type { NativeComponent } from '../../Renderer/shims/ReactNative' ;
2223import type { TextStyleProp , ViewStyleProp } from '../../StyleSheet/StyleSheet' ;
2324import type { ColorValue } from '../../StyleSheet/StyleSheetTypes' ;
2425import { requireNativeComponent } from 'react-native' ;
2526
26- /* export type KeyboardType =
27+ export type KeyboardType =
2728 // Cross Platform
2829 | 'default'
2930 | 'email-address'
@@ -39,9 +40,9 @@ import {requireNativeComponent} from 'react-native';
3940 | 'twitter'
4041 | 'web-search'
4142 // Android-only
42- | 'visible-password';*/
43+ | 'visible-password' ;
4344
44- /* export type ReturnKeyType =
45+ export type ReturnKeyType =
4546 // Cross Platform
4647 | 'done'
4748 | 'go'
@@ -57,7 +58,7 @@ import {requireNativeComponent} from 'react-native';
5758 | 'google'
5859 | 'join'
5960 | 'route'
60- | 'yahoo';*/
61+ | 'yahoo' ;
6162
6263export type NativeProps = $ReadOnly < { |
6364 // This allows us to inherit everything from ViewProps except for style (see below)
@@ -91,25 +92,22 @@ export type NativeProps = $ReadOnly<{|
9192 *
9293 * @platform android
9394 */
94- // TODO T53321474: define as flow enum
95- autoCompleteType ?: ?string /*WithDefault<
96- ?(
97- | 'cc-csc'
98- | 'cc-exp'
99- | 'cc-exp-month'
100- | 'cc-exp-year'
101- | 'cc-number'
102- | 'email'
103- | 'name'
104- | 'password'
105- | 'postal-code'
106- | 'street-address'
107- | 'tel'
108- | 'username'
109- | 'off'
110- ),
95+ autoCompleteType ?: WithDefault <
96+ | 'cc-csc'
97+ | 'cc-exp'
98+ | 'cc-exp-month'
99+ | 'cc-exp-year'
100+ | 'cc-number'
101+ | 'email'
102+ | 'name'
103+ | 'password'
104+ | 'postal-code'
105+ | 'street-address'
106+ | 'tel'
107+ | 'username'
108+ | 'off' ,
111109 'off' ,
112- >*/ ,
110+ > ,
113111
114112 /**
115113 * Sets the return key to the label. Use it instead of `returnKeyType`.
@@ -139,8 +137,10 @@ export type NativeProps = $ReadOnly<{|
139137 * The default value is `simple`.
140138 * @platform android
141139 */
142- // TODO T53321474: enable enum types in codegen
143- textBreakStrategy ? : string , // ?('simple' | 'highQuality' | 'balanced'),
140+ textBreakStrategy ?: WithDefault <
141+ 'simple' | 'highQuality' | 'balanced' ,
142+ 'simple' ,
143+ > ,
144144
145145 /**
146146 * The color of the `TextInput` underline.
@@ -193,7 +193,10 @@ export type NativeProps = $ReadOnly<{|
193193 * - `sentences`: first letter of each sentence (*default*).
194194 * - `none`: don't auto capitalize anything.
195195 */
196- autoCapitalize ?: ?string , // TODO T53321474: define as enum: AutoCapitalize 'none' | 'sentences' | 'words' | 'characters' ,
196+ autoCapitalize ?: WithDefault <
197+ 'none' | 'sentences' | 'words' | 'characters' ,
198+ 'none' ,
199+ > ,
197200
198201 /**
199202 * If `false`, disables auto-correct. The default value is `true`.
@@ -238,25 +241,13 @@ export type NativeProps = $ReadOnly<{|
238241 * - `email-address`
239242 * - `phone-pad`
240243 *
241- * *iOS Only*
242- *
243- * The following values work on iOS only:
244- *
245- * - `ascii-capable`
246- * - `numbers-and-punctuation`
247- * - `url`
248- * - `name-phone-pad`
249- * - `twitter`
250- * - `web-search`
251- *
252244 * *Android Only*
253245 *
254246 * The following values work on Android only:
255247 *
256248 * - `visible-password`
257249 */
258- // TODO T53321474: enable enum codegen
259- keyboardType ?: ?string , // ?KeyboardType,
250+ keyboardType ?: WithDefault < KeyboardType , 'default' > ,
260251
261252 /**
262253 * Determines how the return key should look. On Android you can also use
@@ -278,20 +269,8 @@ export type NativeProps = $ReadOnly<{|
278269 *
279270 * - `none`
280271 * - `previous`
281- *
282- * *iOS Only*
283- *
284- * The following values work on iOS only:
285- *
286- * - `default`
287- * - `emergency-call`
288- * - `google`
289- * - `join`
290- * - `route`
291- * - `yahoo`
292- */
293- // TODO T53321474: enable enum codegen
294- returnKeyType ?: ?string , // ?ReturnKeyType,
272+ */
273+ returnKeyType ?: WithDefault < ReturnKeyType , 'done' > ,
295274
296275 /**
297276 * Limits the maximum number of characters that can be entered. Use this
0 commit comments