@office-iss/react-native-win32 0.0.0-canary.291 → 0.0.0-canary.292

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +16 -1
  3. package/CHANGELOG.md +12 -4
  4. package/Libraries/Alert/RCTAlertManager.js +17 -0
  5. package/Libraries/Animated/AnimatedEvent.js +4 -3
  6. package/Libraries/Animated/AnimatedExports.js.flow +2 -0
  7. package/Libraries/Animated/AnimatedImplementation.js +2 -2
  8. package/Libraries/Animated/components/AnimatedScrollView.js +48 -43
  9. package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
  10. package/Libraries/BatchedBridge/MessageQueue.js +2 -2
  11. package/Libraries/Blob/FileReader.js +219 -8
  12. package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js +17 -0
  13. package/Libraries/Components/Button.js +1 -1
  14. package/Libraries/Components/Button.win32.js +1 -1
  15. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -3
  16. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +15 -0
  17. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +6 -66
  18. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js.flow +18 -0
  19. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.js +71 -0
  20. package/Libraries/Components/Keyboard/Keyboard.js +4 -2
  21. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +6 -3
  22. package/Libraries/Components/Pressable/Pressable.js +2 -0
  23. package/Libraries/Components/Pressable/Pressable.win32.js +2 -0
  24. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +12 -2
  25. package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
  26. package/Libraries/Components/ScrollView/ScrollView.js +128 -116
  27. package/Libraries/Components/StaticRenderer.js +1 -1
  28. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -1
  29. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -4
  30. package/Libraries/Components/TextInput/TextInput.flow.js +35 -43
  31. package/Libraries/Components/TextInput/TextInput.flow.win32.js +1184 -0
  32. package/Libraries/Components/TextInput/TextInput.js +65 -1005
  33. package/Libraries/Components/TextInput/TextInput.win32.js +67 -1037
  34. package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +13 -0
  35. package/Libraries/Components/ToastAndroid/ToastAndroid.js +4 -32
  36. package/Libraries/Components/ToastAndroid/ToastAndroid.js.flow +109 -0
  37. package/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +4 -32
  38. package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +45 -0
  39. package/Libraries/Components/Touchable/Touchable.js +5 -5
  40. package/Libraries/Components/Touchable/Touchable.win32.js +5 -5
  41. package/Libraries/Components/Touchable/TouchableBounce.js +12 -6
  42. package/Libraries/Components/Touchable/TouchableHighlight.js +9 -6
  43. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +4 -4
  44. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +4 -4
  45. package/Libraries/Components/Touchable/TouchableOpacity.js +11 -5
  46. package/Libraries/Components/View/ViewAccessibility.js +7 -0
  47. package/Libraries/Components/View/ViewAccessibility.win32.js +7 -0
  48. package/Libraries/Components/View/ViewPropTypes.js +1 -1
  49. package/Libraries/Components/View/ViewPropTypes.win32.js +1 -1
  50. package/Libraries/Core/ReactNativeVersion.js +1 -1
  51. package/Libraries/EventEmitter/NativeEventEmitter.js +4 -1
  52. package/Libraries/Image/Image.js +17 -0
  53. package/Libraries/Image/Image.js.flow +2 -2
  54. package/Libraries/Image/ImageInjection.js +1 -1
  55. package/Libraries/Image/ImageProps.js +5 -4
  56. package/Libraries/Image/ImageTypes.flow.js +1 -1
  57. package/Libraries/Lists/FlatList.js +1 -1
  58. package/Libraries/Lists/SectionList.js +1 -1
  59. package/Libraries/Lists/SectionListModern.js +2 -1
  60. package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
  61. package/Libraries/Modal/Modal.js +3 -3
  62. package/Libraries/NativeComponent/BaseViewConfig.js +17 -0
  63. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +2 -2
  64. package/Libraries/Network/RCTNetworking.js +17 -0
  65. package/Libraries/Network/XMLHttpRequest.js +781 -10
  66. package/Libraries/NewAppScreen/components/DebugInstructions.js +1 -1
  67. package/Libraries/NewAppScreen/components/Header.js +1 -1
  68. package/Libraries/NewAppScreen/components/HermesBadge.js +1 -1
  69. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +3 -3
  70. package/Libraries/NewAppScreen/components/ReloadInstructions.js +1 -1
  71. package/Libraries/Performance/Systrace.js +7 -7
  72. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +2 -2
  73. package/Libraries/Settings/Settings.js +13 -19
  74. package/Libraries/Settings/Settings.win32.js +19 -20
  75. package/Libraries/Settings/SettingsFallback.js +33 -0
  76. package/Libraries/StyleSheet/PlatformColorValueTypes.js +15 -0
  77. package/Libraries/StyleSheet/Rect.js +1 -0
  78. package/Libraries/StyleSheet/StyleSheet.js.flow +3 -3
  79. package/Libraries/StyleSheet/StyleSheetTypes.js +28 -30
  80. package/Libraries/StyleSheet/flattenStyle.js +7 -1
  81. package/Libraries/Text/Text.js +3 -3
  82. package/Libraries/Text/Text.win32.js +3 -3
  83. package/Libraries/Text/TextProps.js +1 -1
  84. package/Libraries/Text/TextProps.win32.js +1 -1
  85. package/Libraries/Utilities/Appearance.js +2 -0
  86. package/Libraries/Utilities/BackHandler.js +17 -0
  87. package/Libraries/Utilities/Platform.js +17 -0
  88. package/Libraries/Utilities/PlatformTypes.js +2 -0
  89. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  90. package/Libraries/WebSocket/WebSocket.js +313 -8
  91. package/flow/global.js +0 -2
  92. package/index.win32.js +5 -5
  93. package/overrides.json +23 -17
  94. package/package.json +12 -12
  95. package/src/private/animated/NativeAnimatedHelper.js +1 -1
  96. package/src/private/animated/NativeAnimatedHelper.win32.js +1 -1
  97. package/src/private/animated/createAnimatedPropsHook.js +2 -27
  98. package/src/private/components/{SafeAreaView_INTERNAL_DO_NOT_USE.js → safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js} +6 -6
  99. package/src/private/components/{HScrollViewNativeComponents.js → scrollview/HScrollViewNativeComponents.js} +8 -8
  100. package/src/private/components/scrollview/VScrollViewNativeComponents.js +25 -0
  101. package/src/private/featureflags/ReactNativeFeatureFlags.js +21 -32
  102. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -6
  103. package/src/private/inspector/BorderBox.js +1 -1
  104. package/src/private/inspector/BoxInspector.js +1 -1
  105. package/src/private/inspector/ElementBox.js +1 -1
  106. package/src/private/inspector/ElementProperties.js +1 -1
  107. package/src/private/inspector/Inspector.js +2 -2
  108. package/src/private/inspector/InspectorOverlay.js +1 -1
  109. package/src/private/inspector/InspectorPanel.js +1 -1
  110. package/src/private/inspector/NetworkOverlay.js +1 -1
  111. package/src/private/inspector/PerformanceOverlay.js +1 -1
  112. package/src/private/inspector/StyleInspector.js +1 -1
  113. package/src/private/types/HostComponent.js +1 -1
  114. package/src/private/types/HostInstance.js +10 -2
  115. package/src/private/webapis/performance/Performance.js +1 -3
  116. package/Libraries/Blob/FileReader_new.js +0 -231
  117. package/Libraries/Blob/FileReader_old.js +0 -186
  118. package/Libraries/Events/CustomEvent.js +0 -32
  119. package/Libraries/Events/EventPolyfill.js +0 -239
  120. package/Libraries/Network/XMLHttpRequest_new.js +0 -794
  121. package/Libraries/Network/XMLHttpRequest_old.js +0 -701
  122. package/Libraries/WebSocket/WebSocketEvent.js +0 -30
  123. package/Libraries/WebSocket/WebSocket_new.js +0 -325
  124. package/Libraries/WebSocket/WebSocket_old.js +0 -297
  125. package/Libraries/WebSocket/__mocks__/event-target-shim.js +0 -27
  126. package/src/private/components/VScrollViewNativeComponents.js +0 -25
  127. package/src/types/third_party/event-target-shim.d.ts +0 -392
@@ -0,0 +1,1184 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and 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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import type {HostInstance} from '../../../src/private/types/HostInstance';
12
+ import type {
13
+ GestureResponderEvent,
14
+ NativeSyntheticEvent,
15
+ ScrollEvent,
16
+ } from '../../Types/CoreEventTypes';
17
+ import type {ViewProps} from '../View/ViewPropTypes';
18
+
19
+ import {
20
+ type ColorValue,
21
+ type TextStyleProp,
22
+ type ViewStyleProp,
23
+ } from '../../StyleSheet/StyleSheet';
24
+ import * as React from 'react';
25
+
26
+ /**
27
+ * @see TextInputProps.onChange
28
+ */
29
+ type TextInputChangeEventData = $ReadOnly<{
30
+ eventCount: number,
31
+ target: number,
32
+ text: string,
33
+ }>;
34
+
35
+ export type TextInputChangeEvent =
36
+ NativeSyntheticEvent<TextInputChangeEventData>;
37
+
38
+ export type TextInputEvent = NativeSyntheticEvent<
39
+ $ReadOnly<{
40
+ eventCount: number,
41
+ previousText: string,
42
+ range: $ReadOnly<{
43
+ start: number,
44
+ end: number,
45
+ }>,
46
+ target: number,
47
+ text: string,
48
+ }>,
49
+ >;
50
+
51
+ type TextInputContentSizeChangeEventData = $ReadOnly<{
52
+ target: number,
53
+ contentSize: $ReadOnly<{
54
+ width: number,
55
+ height: number,
56
+ }>,
57
+ }>;
58
+
59
+ /**
60
+ * @see TextInputProps.onContentSizeChange
61
+ */
62
+ export type TextInputContentSizeChangeEvent =
63
+ NativeSyntheticEvent<TextInputContentSizeChangeEventData>;
64
+
65
+ type TargetEvent = $ReadOnly<{
66
+ target: number,
67
+ ...
68
+ }>;
69
+
70
+ type TextInputFocusEventData = TargetEvent;
71
+
72
+ /**
73
+ * @see TextInputProps.onBlur
74
+ */
75
+ export type TextInputBlurEvent = NativeSyntheticEvent<TextInputFocusEventData>;
76
+
77
+ /**
78
+ * @see TextInputProps.onFocus
79
+ */
80
+ export type TextInputFocusEvent = NativeSyntheticEvent<TextInputFocusEventData>;
81
+
82
+ export type Selection = $ReadOnly<{
83
+ start: number,
84
+ end: number,
85
+ }>;
86
+
87
+ type TextInputSelectionChangeEventData = $ReadOnly<{
88
+ ...TargetEvent,
89
+ selection: Selection,
90
+ ...
91
+ }>;
92
+
93
+ /**
94
+ * @see TextInputProps.onSelectionChange
95
+ */
96
+ export type TextInputSelectionChangeEvent =
97
+ NativeSyntheticEvent<TextInputSelectionChangeEventData>;
98
+
99
+ type TextInputKeyPressEventData = $ReadOnly<{
100
+ ...TargetEvent,
101
+ key: string,
102
+ target?: ?number,
103
+ eventCount: number,
104
+ ...
105
+ }>;
106
+
107
+ /**
108
+ * @see TextInputProps.onKeyPress
109
+ */
110
+ export type TextInputKeyPressEvent =
111
+ NativeSyntheticEvent<TextInputKeyPressEventData>;
112
+
113
+ type TextInputEndEditingEventData = $ReadOnly<{
114
+ ...TargetEvent,
115
+ eventCount: number,
116
+ text: string,
117
+ ...
118
+ }>;
119
+
120
+ /**
121
+ * @see TextInputProps.onEndEditing
122
+ */
123
+ export type TextInputEndEditingEvent =
124
+ NativeSyntheticEvent<TextInputEndEditingEventData>;
125
+
126
+ type TextInputSubmitEditingEventData = $ReadOnly<{
127
+ ...TargetEvent,
128
+ eventCount: number,
129
+ text: string,
130
+ ...
131
+ }>;
132
+
133
+ /**
134
+ * @see TextInputProps.onSubmitEditing
135
+ */
136
+ export type TextInputSubmitEditingEvent =
137
+ NativeSyntheticEvent<TextInputSubmitEditingEventData>;
138
+
139
+ export type TextInputEditingEvent =
140
+ NativeSyntheticEvent<TextInputEndEditingEventData>;
141
+
142
+ type DataDetectorTypesType =
143
+ | 'phoneNumber'
144
+ | 'link'
145
+ | 'address'
146
+ | 'calendarEvent'
147
+ | 'trackingNumber'
148
+ | 'flightNumber'
149
+ | 'lookupSuggestion'
150
+ | 'none'
151
+ | 'all';
152
+
153
+ export type KeyboardType =
154
+ | 'default'
155
+ | 'email-address'
156
+ | 'numeric'
157
+ | 'phone-pad'
158
+ | 'number-pad'
159
+ | 'decimal-pad'
160
+ | 'url';
161
+
162
+ export type KeyboardTypeIOS =
163
+ | 'ascii-capable'
164
+ | 'numbers-and-punctuation'
165
+ | 'name-phone-pad'
166
+ | 'twitter'
167
+ | 'web-search'
168
+ // iOS 10+ only
169
+ | 'ascii-capable-number-pad';
170
+
171
+ export type KeyboardTypeAndroid = 'visible-password';
172
+
173
+ export type KeyboardTypeOptions =
174
+ | KeyboardType
175
+ | KeyboardTypeIOS
176
+ | KeyboardTypeAndroid;
177
+
178
+ export type InputModeOptions =
179
+ | 'none'
180
+ | 'text'
181
+ | 'decimal'
182
+ | 'numeric'
183
+ | 'tel'
184
+ | 'search'
185
+ | 'email'
186
+ | 'url';
187
+
188
+ export type ReturnKeyType = 'done' | 'go' | 'next' | 'search' | 'send';
189
+
190
+ export type ReturnKeyTypeIOS =
191
+ | 'default'
192
+ | 'emergency-call'
193
+ | 'google'
194
+ | 'join'
195
+ | 'route'
196
+ | 'yahoo';
197
+
198
+ export type ReturnKeyTypeAndroid = 'none' | 'previous';
199
+
200
+ export type ReturnKeyTypeOptions =
201
+ | ReturnKeyType
202
+ | ReturnKeyTypeIOS
203
+ | ReturnKeyTypeAndroid;
204
+
205
+ export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
206
+
207
+ export type AutoCapitalize = 'none' | 'sentences' | 'words' | 'characters';
208
+
209
+ export type TextContentType =
210
+ | 'none'
211
+ | 'URL'
212
+ | 'addressCity'
213
+ | 'addressCityAndState'
214
+ | 'addressState'
215
+ | 'countryName'
216
+ | 'creditCardNumber'
217
+ | 'creditCardExpiration'
218
+ | 'creditCardExpirationMonth'
219
+ | 'creditCardExpirationYear'
220
+ | 'creditCardSecurityCode'
221
+ | 'creditCardType'
222
+ | 'creditCardName'
223
+ | 'creditCardGivenName'
224
+ | 'creditCardMiddleName'
225
+ | 'creditCardFamilyName'
226
+ | 'emailAddress'
227
+ | 'familyName'
228
+ | 'fullStreetAddress'
229
+ | 'givenName'
230
+ | 'jobTitle'
231
+ | 'location'
232
+ | 'middleName'
233
+ | 'name'
234
+ | 'namePrefix'
235
+ | 'nameSuffix'
236
+ | 'nickname'
237
+ | 'organizationName'
238
+ | 'postalCode'
239
+ | 'streetAddressLine1'
240
+ | 'streetAddressLine2'
241
+ | 'sublocality'
242
+ | 'telephoneNumber'
243
+ | 'username'
244
+ | 'password'
245
+ | 'newPassword'
246
+ | 'oneTimeCode'
247
+ | 'birthdate'
248
+ | 'birthdateDay'
249
+ | 'birthdateMonth'
250
+ | 'birthdateYear'
251
+ | 'cellularEID'
252
+ | 'cellularIMEI'
253
+ | 'dateTime'
254
+ | 'flightNumber'
255
+ | 'shipmentTrackingNumber';
256
+
257
+ export type EnterKeyHintTypeAndroid = 'previous';
258
+
259
+ export type EnterKeyHintTypeIOS = 'enter';
260
+
261
+ export type EnterKeyHintType = 'done' | 'go' | 'next' | 'search' | 'send';
262
+
263
+ export type EnterKeyHintTypeOptions =
264
+ | EnterKeyHintType
265
+ | EnterKeyHintTypeAndroid
266
+ | EnterKeyHintTypeIOS;
267
+
268
+ type PasswordRules = string;
269
+
270
+ export type TextInputIOSProps = $ReadOnly<{
271
+ /**
272
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
273
+ * @platform ios
274
+ */
275
+ disableKeyboardShortcuts?: ?boolean,
276
+
277
+ /**
278
+ * When the clear button should appear on the right side of the text view.
279
+ * This property is supported only for single-line TextInput component.
280
+ * @platform ios
281
+ */
282
+ clearButtonMode?: ?('never' | 'while-editing' | 'unless-editing' | 'always'),
283
+
284
+ /**
285
+ * If `true`, clears the text field automatically when editing begins.
286
+ * @platform ios
287
+ */
288
+ clearTextOnFocus?: ?boolean,
289
+
290
+ /**
291
+ * Determines the types of data converted to clickable URLs in the text input.
292
+ * Only valid if `multiline={true}` and `editable={false}`.
293
+ * By default no data types are detected.
294
+ *
295
+ * You can provide one type or an array of many types.
296
+ *
297
+ * Possible values for `dataDetectorTypes` are:
298
+ *
299
+ * - `'phoneNumber'`
300
+ * - `'link'`
301
+ * - `'address'`
302
+ * - `'calendarEvent'`
303
+ * - `'none'`
304
+ * - `'all'`
305
+ *
306
+ * @platform ios
307
+ */
308
+ dataDetectorTypes?:
309
+ | ?DataDetectorTypesType
310
+ | $ReadOnlyArray<DataDetectorTypesType>,
311
+
312
+ /**
313
+ * If `true`, the keyboard disables the return key when there is no text and
314
+ * automatically enables it when there is text. The default value is `false`.
315
+ * @platform ios
316
+ */
317
+ enablesReturnKeyAutomatically?: ?boolean,
318
+
319
+ /**
320
+ * An optional identifier which links a custom InputAccessoryView to
321
+ * this text input. The InputAccessoryView is rendered above the
322
+ * keyboard when this text input is focused.
323
+ * @platform ios
324
+ */
325
+ inputAccessoryViewID?: ?string,
326
+
327
+ /**
328
+ * An optional label that overrides the default input accessory view button label.
329
+ * @platform ios
330
+ */
331
+ inputAccessoryViewButtonLabel?: ?string,
332
+
333
+ /**
334
+ * Determines the color of the keyboard.
335
+ * @platform ios
336
+ */
337
+ keyboardAppearance?: ?('default' | 'light' | 'dark'),
338
+
339
+ /**
340
+ * Provide rules for your password.
341
+ * For example, say you want to require a password with at least eight characters consisting of a mix of uppercase and lowercase letters, at least one number, and at most two consecutive characters.
342
+ * "required: upper; required: lower; required: digit; max-consecutive: 2; minlength: 8;"
343
+ * @platform ios
344
+ */
345
+ passwordRules?: ?PasswordRules,
346
+
347
+ /*
348
+ * If `true`, allows TextInput to pass touch events to the parent component.
349
+ * This allows components to be swipeable from the TextInput on iOS,
350
+ * as is the case on Android by default.
351
+ * If `false`, TextInput always asks to handle the input (except when disabled).
352
+ * @platform ios
353
+ */
354
+ rejectResponderTermination?: ?boolean,
355
+
356
+ /**
357
+ * If `false`, scrolling of the text view will be disabled.
358
+ * The default value is `true`. Does only work with 'multiline={true}'.
359
+ * @platform ios
360
+ */
361
+ scrollEnabled?: ?boolean,
362
+
363
+ /**
364
+ * If `false`, disables spell-check style (i.e. red underlines).
365
+ * The default value is inherited from `autoCorrect`.
366
+ * @platform ios
367
+ */
368
+ spellCheck?: ?boolean,
369
+
370
+ /**
371
+ * Give the keyboard and the system information about the
372
+ * expected semantic meaning for the content that users enter.
373
+ * @platform ios
374
+ */
375
+ textContentType?: ?TextContentType,
376
+
377
+ /**
378
+ * Set line break strategy on iOS.
379
+ * @platform ios
380
+ */
381
+ lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'),
382
+
383
+ /**
384
+ * Set line break mode on iOS.
385
+ * @platform ios
386
+ */
387
+ lineBreakModeIOS?: ?(
388
+ | 'wordWrapping'
389
+ | 'char'
390
+ | 'clip'
391
+ | 'head'
392
+ | 'middle'
393
+ | 'tail'
394
+ ),
395
+
396
+ /**
397
+ * If `false`, the iOS system will not insert an extra space after a paste operation
398
+ * neither delete one or two spaces after a cut or delete operation.
399
+ *
400
+ * The default value is `true`.
401
+ *
402
+ * @platform ios
403
+ */
404
+ smartInsertDelete?: ?boolean,
405
+ }>;
406
+
407
+ export type TextInputAndroidProps = $ReadOnly<{
408
+ /**
409
+ * When provided it will set the color of the cursor (or "caret") in the component.
410
+ * Unlike the behavior of `selectionColor` the cursor color will be set independently
411
+ * from the color of the text selection box.
412
+ * @platform android
413
+ */
414
+ cursorColor?: ?ColorValue,
415
+
416
+ /**
417
+ * When provided it will set the color of the selection handles when highlighting text.
418
+ * Unlike the behavior of `selectionColor` the handle color will be set independently
419
+ * from the color of the text selection box.
420
+ * @platform android
421
+ */
422
+ selectionHandleColor?: ?ColorValue,
423
+
424
+ /**
425
+ * When `false`, if there is a small amount of space available around a text input
426
+ * (e.g. landscape orientation on a phone), the OS may choose to have the user edit
427
+ * the text inside of a full screen text input mode. When `true`, this feature is
428
+ * disabled and users will always edit the text directly inside of the text input.
429
+ * Defaults to `false`.
430
+ * @platform android
431
+ */
432
+ disableFullscreenUI?: ?boolean,
433
+
434
+ /**
435
+ * Determines whether the individual fields in your app should be included in a
436
+ * view structure for autofill purposes on Android API Level 26+. Defaults to auto.
437
+ * To disable auto complete, use `off`.
438
+ *
439
+ * *Android Only*
440
+ *
441
+ * The following values work on Android only:
442
+ *
443
+ * - `auto` - let Android decide
444
+ * - `no` - not important for autofill
445
+ * - `noExcludeDescendants` - this view and its children aren't important for autofill
446
+ * - `yes` - is important for autofill
447
+ * - `yesExcludeDescendants` - this view is important for autofill but its children aren't
448
+ */
449
+ importantForAutofill?: ?(
450
+ | 'auto'
451
+ | 'no'
452
+ | 'noExcludeDescendants'
453
+ | 'yes'
454
+ | 'yesExcludeDescendants'
455
+ ),
456
+
457
+ /**
458
+ * If defined, the provided image resource will be rendered on the left.
459
+ * The image resource must be inside `/android/app/src/main/res/drawable` and referenced
460
+ * like
461
+ * ```
462
+ * <TextInput
463
+ * inlineImageLeft='search_icon'
464
+ * />
465
+ * ```
466
+ * @platform android
467
+ */
468
+ inlineImageLeft?: ?string,
469
+
470
+ /**
471
+ * Padding between the inline image, if any, and the text input itself.
472
+ * @platform android
473
+ */
474
+ inlineImagePadding?: ?number,
475
+
476
+ /**
477
+ * Sets the number of lines for a `TextInput`. Use it with multiline set to
478
+ * `true` to be able to fill the lines.
479
+ * @platform android
480
+ */
481
+ numberOfLines?: ?number,
482
+
483
+ /**
484
+ * Sets the return key to the label. Use it instead of `returnKeyType`.
485
+ * @platform android
486
+ */
487
+ returnKeyLabel?: ?string,
488
+
489
+ /**
490
+ * Sets the number of rows for a `TextInput`. Use it with multiline set to
491
+ * `true` to be able to fill the lines.
492
+ * @platform android
493
+ */
494
+ rows?: ?number,
495
+
496
+ /**
497
+ * When `false`, it will prevent the soft keyboard from showing when the field is focused.
498
+ * Defaults to `true`.
499
+ */
500
+ showSoftInputOnFocus?: ?boolean,
501
+
502
+ /**
503
+ * Set text break strategy on Android API Level 23+, possible values are `simple`, `highQuality`, `balanced`
504
+ * The default value is `simple`.
505
+ * @platform android
506
+ */
507
+ textBreakStrategy?: ?('simple' | 'highQuality' | 'balanced'),
508
+
509
+ /**
510
+ * The color of the `TextInput` underline.
511
+ * @platform android
512
+ */
513
+ underlineColorAndroid?: ?ColorValue,
514
+ }>;
515
+
516
+ // [Windows
517
+
518
+ type SubmitKeyEvent = $ReadOnly<{|
519
+ altKey?: ?boolean,
520
+ ctrlKey?: ?boolean,
521
+ metaKey?: ?boolean,
522
+ shiftKey?: ?boolean,
523
+ code: string,
524
+ |}>;
525
+
526
+ export type TextInputWindowsProps = $ReadOnly<{|
527
+ /**
528
+ * If `true`, clears the text field synchronously before `onSubmitEditing` is emitted.
529
+ * @platform windows
530
+ */
531
+ clearTextOnSubmit?: ?boolean,
532
+
533
+ /**
534
+ * Configures keys that can be used to submit editing for the TextInput.
535
+ * @platform windows
536
+ */
537
+ submitKeyEvents?: ?$ReadOnlyArray<SubmitKeyEvent>,
538
+ |}>;
539
+
540
+ // Windows]
541
+
542
+ type TextInputBaseProps = $ReadOnly<{
543
+ /**
544
+ * String to be read by screenreaders to indicate an error state. The acceptable parameters
545
+ * of accessibilityErrorMessage is a string. Setting accessibilityInvalid to true activates
546
+ * the error message. Setting accessibilityInvalid to false removes the error message.
547
+ */
548
+ accessibilityErrorMessage?: ?Stringish,
549
+ accessibilityInvalid?: ?boolean,
550
+
551
+ /**
552
+ * Can tell `TextInput` to automatically capitalize certain characters.
553
+ *
554
+ * - `characters`: all characters.
555
+ * - `words`: first letter of each word.
556
+ * - `sentences`: first letter of each sentence (*default*).
557
+ * - `none`: don't auto capitalize anything.
558
+ */
559
+ autoCapitalize?: ?AutoCapitalize,
560
+
561
+ /**
562
+ * Specifies autocomplete hints for the system, so it can provide autofill.
563
+ * On Android, the system will always attempt to offer autofill by using heuristics to identify the type of content.
564
+ * To disable autocomplete, set autoComplete to off.
565
+ *
566
+ * The following values work across platforms:
567
+ *
568
+ * - `additional-name`
569
+ * - `address-line1`
570
+ * - `address-line2`
571
+ * - `birthdate-day` (iOS 17+)
572
+ * - `birthdate-full` (iOS 17+)
573
+ * - `birthdate-month` (iOS 17+)
574
+ * - `birthdate-year` (iOS 17+)
575
+ * - `cc-number`
576
+ * - `cc-csc` (iOS 17+)
577
+ * - `cc-exp` (iOS 17+)
578
+ * - `cc-exp-day` (iOS 17+)
579
+ * - `cc-exp-month` (iOS 17+)
580
+ * - `cc-exp-year` (iOS 17+)
581
+ * - `country`
582
+ * - `current-password`
583
+ * - `email`
584
+ * - `family-name`
585
+ * - `given-name`
586
+ * - `honorific-prefix`
587
+ * - `honorific-suffix`
588
+ * - `name`
589
+ * - `new-password`
590
+ * - `off`
591
+ * - `one-time-code`
592
+ * - `postal-code`
593
+ * - `street-address`
594
+ * - `tel`
595
+ * - `username`
596
+ *
597
+ * The following values work on iOS only:
598
+ *
599
+ * - `cc-name` (iOS 17+)
600
+ * - `cc-given-name` (iOS 17+)
601
+ * - `cc-middle-name` (iOS 17+)
602
+ * - `cc-family-name` (iOS 17+)
603
+ * - `cc-type` (iOS 17+)
604
+ * - `nickname`
605
+ * - `organization`
606
+ * - `organization-title`
607
+ * - `url`
608
+ *
609
+ * The following values work on Android only:
610
+ *
611
+ * - `gender`
612
+ * - `name-family`
613
+ * - `name-given`
614
+ * - `name-middle`
615
+ * - `name-middle-initial`
616
+ * - `name-prefix`
617
+ * - `name-suffix`
618
+ * - `password`
619
+ * - `password-new`
620
+ * - `postal-address`
621
+ * - `postal-address-country`
622
+ * - `postal-address-extended`
623
+ * - `postal-address-extended-postal-code`
624
+ * - `postal-address-locality`
625
+ * - `postal-address-region`
626
+ * - `sms-otp`
627
+ * - `tel-country-code`
628
+ * - `tel-national`
629
+ * - `tel-device`
630
+ * - `username-new`
631
+ */
632
+ autoComplete?: ?(
633
+ | 'additional-name'
634
+ | 'address-line1'
635
+ | 'address-line2'
636
+ | 'birthdate-day'
637
+ | 'birthdate-full'
638
+ | 'birthdate-month'
639
+ | 'birthdate-year'
640
+ | 'cc-csc'
641
+ | 'cc-exp'
642
+ | 'cc-exp-day'
643
+ | 'cc-exp-month'
644
+ | 'cc-exp-year'
645
+ | 'cc-number'
646
+ | 'cc-name'
647
+ | 'cc-given-name'
648
+ | 'cc-middle-name'
649
+ | 'cc-family-name'
650
+ | 'cc-type'
651
+ | 'country'
652
+ | 'current-password'
653
+ | 'email'
654
+ | 'family-name'
655
+ | 'gender'
656
+ | 'given-name'
657
+ | 'honorific-prefix'
658
+ | 'honorific-suffix'
659
+ | 'name'
660
+ | 'name-family'
661
+ | 'name-given'
662
+ | 'name-middle'
663
+ | 'name-middle-initial'
664
+ | 'name-prefix'
665
+ | 'name-suffix'
666
+ | 'new-password'
667
+ | 'nickname'
668
+ | 'one-time-code'
669
+ | 'organization'
670
+ | 'organization-title'
671
+ | 'password'
672
+ | 'password-new'
673
+ | 'postal-address'
674
+ | 'postal-address-country'
675
+ | 'postal-address-extended'
676
+ | 'postal-address-extended-postal-code'
677
+ | 'postal-address-locality'
678
+ | 'postal-address-region'
679
+ | 'postal-code'
680
+ | 'street-address'
681
+ | 'sms-otp'
682
+ | 'tel'
683
+ | 'tel-country-code'
684
+ | 'tel-national'
685
+ | 'tel-device'
686
+ | 'url'
687
+ | 'username'
688
+ | 'username-new'
689
+ | 'off'
690
+ ),
691
+
692
+ /**
693
+ * If `false`, disables auto-correct. The default value is `true`.
694
+ */
695
+ autoCorrect?: ?boolean,
696
+
697
+ /**
698
+ * If `true`, focuses the input on `componentDidMount`.
699
+ * The default value is `false`.
700
+ */
701
+ autoFocus?: ?boolean,
702
+
703
+ /**
704
+ * Specifies whether fonts should scale to respect Text Size accessibility settings. The
705
+ * default is `true`.
706
+ */
707
+ allowFontScaling?: ?boolean,
708
+
709
+ /**
710
+ * If `true`, caret is hidden. The default value is `false`.
711
+ *
712
+ * On Android devices manufactured by Xiaomi with Android Q,
713
+ * when keyboardType equals 'email-address'this will be set
714
+ * in native to 'true' to prevent a system related crash. This
715
+ * will cause cursor to be disabled as a side-effect.
716
+ *
717
+ */
718
+ caretHidden?: ?boolean,
719
+
720
+ /*
721
+ * If `true`, contextMenuHidden is hidden. The default value is `false`.
722
+ */
723
+ contextMenuHidden?: ?boolean,
724
+
725
+ /**
726
+ * Provides an initial value that will change when the user starts typing.
727
+ * Useful for simple use-cases where you do not want to deal with listening
728
+ * to events and updating the value prop to keep the controlled state in sync.
729
+ */
730
+ defaultValue?: ?Stringish,
731
+
732
+ /**
733
+ * If `false`, text is not editable. The default value is `true`.
734
+ */
735
+ editable?: ?boolean,
736
+
737
+ forwardedRef?: ?React.RefSetter<TextInputInstance>,
738
+
739
+ /**
740
+ * `enterKeyHint` defines what action label (or icon) to present for the enter key on virtual keyboards.
741
+ *
742
+ * The following values is supported:
743
+ *
744
+ * - `enter`
745
+ * - `done`
746
+ * - `go`
747
+ * - `next`
748
+ * - `previous`
749
+ * - `search`
750
+ * - `send`
751
+ */
752
+ enterKeyHint?: ?EnterKeyHintTypeOptions,
753
+
754
+ /**
755
+ * `inputMode` works like the `inputmode` attribute in HTML, it determines which
756
+ * keyboard to open, e.g.`numeric` and has precedence over keyboardType
757
+ *
758
+ * Support the following values:
759
+ *
760
+ * - `none`
761
+ * - `text`
762
+ * - `decimal`
763
+ * - `numeric`
764
+ * - `tel`
765
+ * - `search`
766
+ * - `email`
767
+ * - `url`
768
+ */
769
+ inputMode?: ?InputModeOptions,
770
+
771
+ /**
772
+ * Determines which keyboard to open, e.g.`numeric`.
773
+ *
774
+ * The following values work across platforms:
775
+ *
776
+ * - `default`
777
+ * - `numeric`
778
+ * - `number-pad`
779
+ * - `decimal-pad`
780
+ * - `email-address`
781
+ * - `phone-pad`
782
+ * - `url`
783
+ *
784
+ * *iOS Only*
785
+ *
786
+ * The following values work on iOS only:
787
+ *
788
+ * - `ascii-capable`
789
+ * - `numbers-and-punctuation`
790
+ * - `name-phone-pad`
791
+ * - `twitter`
792
+ * - `web-search`
793
+ *
794
+ * *Android Only*
795
+ *
796
+ * The following values work on Android only:
797
+ *
798
+ * - `visible-password`
799
+ *
800
+ */
801
+ keyboardType?: ?KeyboardTypeOptions,
802
+
803
+ /**
804
+ * Specifies largest possible scale a font can reach when `allowFontScaling` is enabled.
805
+ * Possible values:
806
+ * `null/undefined` (default): inherit from the parent node or the global default (0)
807
+ * `0`: no max, ignore parent/global default
808
+ * `>= 1`: sets the maxFontSizeMultiplier of this node to this value
809
+ */
810
+ maxFontSizeMultiplier?: ?number,
811
+
812
+ /**
813
+ * Limits the maximum number of characters that can be entered. Use this
814
+ * instead of implementing the logic in JS to avoid flicker.
815
+ */
816
+ maxLength?: ?number,
817
+
818
+ /**
819
+ * If `true`, the text input can be multiple lines.
820
+ * The default value is `false`.
821
+ */
822
+ multiline?: ?boolean,
823
+
824
+ /**
825
+ * Callback that is called when the text input is blurred.
826
+ */
827
+ onBlur?: ?(e: TextInputBlurEvent) => mixed,
828
+
829
+ /**
830
+ * Callback that is called when the text input's text changes.
831
+ */
832
+ onChange?: ?(e: TextInputChangeEvent) => mixed,
833
+
834
+ /**
835
+ * Callback that is called when the text input's text changes.
836
+ * Changed text is passed as an argument to the callback handler.
837
+ */
838
+ onChangeText?: ?(text: string) => mixed,
839
+
840
+ /**
841
+ * Callback that is called when the text input's content size changes.
842
+ * This will be called with
843
+ * `{ nativeEvent: { contentSize: { width, height } } }`.
844
+ *
845
+ * Only called for multiline text inputs.
846
+ */
847
+ onContentSizeChange?: ?(e: TextInputContentSizeChangeEvent) => mixed,
848
+
849
+ /**
850
+ * Callback that is called when text input ends.
851
+ */
852
+ onEndEditing?: ?(e: TextInputEndEditingEvent) => mixed,
853
+
854
+ /**
855
+ * Callback that is called when the text input is focused.
856
+ */
857
+ onFocus?: ?(e: TextInputFocusEvent) => mixed,
858
+
859
+ /**
860
+ * Callback that is called when a key is pressed.
861
+ * This will be called with `{ nativeEvent: { key: keyValue } }`
862
+ * where `keyValue` is `'Enter'` or `'Backspace'` for respective keys and
863
+ * the typed-in character otherwise including `' '` for space.
864
+ * Fires before `onChange` callbacks.
865
+ */
866
+ onKeyPress?: ?(e: TextInputKeyPressEvent) => mixed,
867
+
868
+ /**
869
+ * Called when a single tap gesture is detected.
870
+ */
871
+ onPress?: ?(event: GestureResponderEvent) => mixed,
872
+
873
+ /**
874
+ * Called when a touch is engaged.
875
+ */
876
+ onPressIn?: ?(event: GestureResponderEvent) => mixed,
877
+
878
+ /**
879
+ * Called when a touch is released.
880
+ */
881
+ onPressOut?: ?(event: GestureResponderEvent) => mixed,
882
+
883
+ /**
884
+ * Callback that is called when the text input selection is changed.
885
+ * This will be called with
886
+ * `{ nativeEvent: { selection: { start, end } } }`.
887
+ */
888
+ onSelectionChange?: ?(e: TextInputSelectionChangeEvent) => mixed,
889
+
890
+ /**
891
+ * Callback that is called when the text input's submit button is pressed.
892
+ * Invalid if `multiline={true}` is specified.
893
+ */
894
+ onSubmitEditing?: ?(e: TextInputSubmitEditingEvent) => mixed,
895
+
896
+ /**
897
+ * Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`.
898
+ * May also contain other properties from ScrollEvent but on Android contentSize
899
+ * is not provided for performance reasons.
900
+ */
901
+ onScroll?: ?(e: ScrollEvent) => mixed,
902
+
903
+ /**
904
+ * The string that will be rendered before text input has been entered.
905
+ */
906
+ placeholder?: ?Stringish,
907
+
908
+ /**
909
+ * The text color of the placeholder string.
910
+ */
911
+ placeholderTextColor?: ?ColorValue,
912
+
913
+ /** `readOnly` works like the `readonly` attribute in HTML.
914
+ * If `true`, text is not editable. The default value is `false`.
915
+ * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly
916
+ * for more details.
917
+ */
918
+ readOnly?: ?boolean,
919
+
920
+ /**
921
+ * Determines how the return key should look. On Android you can also use
922
+ * `returnKeyLabel`.
923
+ *
924
+ * *Cross platform*
925
+ *
926
+ * The following values work across platforms:
927
+ *
928
+ * - `done`
929
+ * - `go`
930
+ * - `next`
931
+ * - `search`
932
+ * - `send`
933
+ *
934
+ * *Android Only*
935
+ *
936
+ * The following values work on Android only:
937
+ *
938
+ * - `none`
939
+ * - `previous`
940
+ *
941
+ * *iOS Only*
942
+ *
943
+ * The following values work on iOS only:
944
+ *
945
+ * - `default`
946
+ * - `emergency-call`
947
+ * - `google`
948
+ * - `join`
949
+ * - `route`
950
+ * - `yahoo`
951
+ */
952
+ returnKeyType?: ?ReturnKeyTypeOptions,
953
+
954
+ /**
955
+ * If `true`, the text input obscures the text entered so that sensitive text
956
+ * like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'.
957
+ */
958
+ secureTextEntry?: ?boolean,
959
+
960
+ /**
961
+ * The start and end of the text input's selection. Set start and end to
962
+ * the same value to position the cursor.
963
+ */
964
+ selection?: ?$ReadOnly<{
965
+ start: number,
966
+ end?: ?number,
967
+ }>,
968
+
969
+ /**
970
+ * The highlight and cursor color of the text input.
971
+ */
972
+ selectionColor?: ?ColorValue,
973
+
974
+ /**
975
+ * If `true`, all text will automatically be selected on focus.
976
+ */
977
+ selectTextOnFocus?: ?boolean,
978
+
979
+ /**
980
+ * If `true`, the text field will blur when submitted.
981
+ * The default value is true for single-line fields and false for
982
+ * multiline fields. Note that for multiline fields, setting `blurOnSubmit`
983
+ * to `true` means that pressing return will blur the field and trigger the
984
+ * `onSubmitEditing` event instead of inserting a newline into the field.
985
+ *
986
+ * @deprecated
987
+ * Note that `submitBehavior` now takes the place of `blurOnSubmit` and will
988
+ * override any behavior defined by `blurOnSubmit`.
989
+ * @see submitBehavior
990
+ */
991
+ blurOnSubmit?: ?boolean,
992
+
993
+ /**
994
+ * When the return key is pressed,
995
+ *
996
+ * For single line inputs:
997
+ *
998
+ * - `'newline`' defaults to `'blurAndSubmit'`
999
+ * - `undefined` defaults to `'blurAndSubmit'`
1000
+ *
1001
+ * For multiline inputs:
1002
+ *
1003
+ * - `'newline'` adds a newline
1004
+ * - `undefined` defaults to `'newline'`
1005
+ *
1006
+ * For both single line and multiline inputs:
1007
+ *
1008
+ * - `'submit'` will only send a submit event and not blur the input
1009
+ * - `'blurAndSubmit`' will both blur the input and send a submit event
1010
+ */
1011
+ submitBehavior?: ?SubmitBehavior,
1012
+
1013
+ /**
1014
+ * Note that not all Text styles are supported, an incomplete list of what is not supported includes:
1015
+ *
1016
+ * - `borderLeftWidth`
1017
+ * - `borderTopWidth`
1018
+ * - `borderRightWidth`
1019
+ * - `borderBottomWidth`
1020
+ * - `borderTopLeftRadius`
1021
+ * - `borderTopRightRadius`
1022
+ * - `borderBottomRightRadius`
1023
+ * - `borderBottomLeftRadius`
1024
+ *
1025
+ * see [Issue#7070](https://github.com/facebook/react-native/issues/7070)
1026
+ * for more detail.
1027
+ *
1028
+ * [Styles](docs/style.html)
1029
+ */
1030
+ style?: ?TextStyleProp,
1031
+
1032
+ /**
1033
+ * The value to show for the text input. `TextInput` is a controlled
1034
+ * component, which means the native value will be forced to match this
1035
+ * value prop if provided. For most uses, this works great, but in some
1036
+ * cases this may cause flickering - one common cause is preventing edits
1037
+ * by keeping value the same. In addition to simply setting the same value,
1038
+ * either set `editable={false}`, or set/update `maxLength` to prevent
1039
+ * unwanted edits without flicker.
1040
+ */
1041
+ value?: ?Stringish,
1042
+ }>;
1043
+
1044
+ export type TextInputProps = $ReadOnly<{
1045
+ ...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
1046
+ ...TextInputIOSProps,
1047
+ ...TextInputAndroidProps,
1048
+ ...TextInputBaseProps,
1049
+ ...TextInputWindowsProps, // [Windows]
1050
+ }>;
1051
+
1052
+ export interface TextInputInstance extends HostInstance {
1053
+ +clear: () => void;
1054
+ +isFocused: () => boolean;
1055
+ +getNativeRef: () => ?HostInstance;
1056
+ +setSelection: (start: number, end: number) => void;
1057
+ }
1058
+
1059
+ /**
1060
+ * A foundational component for inputting text into the app via a
1061
+ * keyboard. Props provide configurability for several features, such as
1062
+ * auto-correction, auto-capitalization, placeholder text, and different keyboard
1063
+ * types, such as a numeric keypad.
1064
+ *
1065
+ * The simplest use case is to plop down a `TextInput` and subscribe to the
1066
+ * `onChangeText` events to read the user input. There are also other events,
1067
+ * such as `onSubmitEditing` and `onFocus` that can be subscribed to. A simple
1068
+ * example:
1069
+ *
1070
+ * ```ReactNativeWebPlayer
1071
+ * import React, { Component } from 'react';
1072
+ * import { AppRegistry, TextInput } from 'react-native';
1073
+ *
1074
+ * export default class UselessTextInput extends Component {
1075
+ * constructor(props) {
1076
+ * super(props);
1077
+ * this.state = { text: 'Useless Placeholder' };
1078
+ * }
1079
+ *
1080
+ * render() {
1081
+ * return (
1082
+ * <TextInput
1083
+ * style={{height: 40, borderColor: 'gray', borderWidth: 1}}
1084
+ * onChangeText={(text) => this.setState({text})}
1085
+ * value={this.state.text}
1086
+ * />
1087
+ * );
1088
+ * }
1089
+ * }
1090
+ *
1091
+ * // skip this line if using Create React Native App
1092
+ * AppRegistry.registerComponent('AwesomeProject', () => UselessTextInput);
1093
+ * ```
1094
+ *
1095
+ * Two methods exposed via the native element are .focus() and .blur() that
1096
+ * will focus or blur the TextInput programmatically.
1097
+ *
1098
+ * Note that some props are only available with `multiline={true/false}`.
1099
+ * Additionally, border styles that apply to only one side of the element
1100
+ * (e.g., `borderBottomColor`, `borderLeftWidth`, etc.) will not be applied if
1101
+ * `multiline=false`. To achieve the same effect, you can wrap your `TextInput`
1102
+ * in a `View`:
1103
+ *
1104
+ * ```ReactNativeWebPlayer
1105
+ * import React, { Component } from 'react';
1106
+ * import { AppRegistry, View, TextInput } from 'react-native';
1107
+ *
1108
+ * class UselessTextInput extends Component {
1109
+ * render() {
1110
+ * return (
1111
+ * <TextInput
1112
+ * {...this.props} // Inherit any props passed to it; e.g., multiline, numberOfLines below
1113
+ * editable = {true}
1114
+ * maxLength = {40}
1115
+ * />
1116
+ * );
1117
+ * }
1118
+ * }
1119
+ *
1120
+ * export default class UselessTextInputMultiline extends Component {
1121
+ * constructor(props) {
1122
+ * super(props);
1123
+ * this.state = {
1124
+ * text: 'Useless Multiline Placeholder',
1125
+ * };
1126
+ * }
1127
+ *
1128
+ * // If you type something in the text box that is a color, the background will change to that
1129
+ * // color.
1130
+ * render() {
1131
+ * return (
1132
+ * <View style={{
1133
+ * backgroundColor: this.state.text,
1134
+ * borderBottomColor: '#000000',
1135
+ * borderBottomWidth: 1 }}
1136
+ * >
1137
+ * <UselessTextInput
1138
+ * multiline = {true}
1139
+ * numberOfLines = {4}
1140
+ * onChangeText={(text) => this.setState({text})}
1141
+ * value={this.state.text}
1142
+ * />
1143
+ * </View>
1144
+ * );
1145
+ * }
1146
+ * }
1147
+ *
1148
+ * // skip these lines if using Create React Native App
1149
+ * AppRegistry.registerComponent(
1150
+ * 'AwesomeProject',
1151
+ * () => UselessTextInputMultiline
1152
+ * );
1153
+ * ```
1154
+ *
1155
+ * `TextInput` has by default a border at the bottom of its view. This border
1156
+ * has its padding set by the background image provided by the system, and it
1157
+ * cannot be changed. Solutions to avoid this is to either not set height
1158
+ * explicitly, case in which the system will take care of displaying the border
1159
+ * in the correct position, or to not display the border by setting
1160
+ * `underlineColorAndroid` to transparent.
1161
+ *
1162
+ * Note that on Android performing text selection in input can change
1163
+ * app's activity `windowSoftInputMode` param to `adjustResize`.
1164
+ * This may cause issues with components that have position: 'absolute'
1165
+ * while keyboard is active. To avoid this behavior either specify `windowSoftInputMode`
1166
+ * in AndroidManifest.xml ( https://developer.android.com/guide/topics/manifest/activity-element.html )
1167
+ * or control this param programmatically with native code.
1168
+ *
1169
+ */
1170
+ type InternalTextInput = component(
1171
+ ref?: React.RefSetter<TextInputInstance>,
1172
+ ...TextInputProps
1173
+ );
1174
+
1175
+ export type TextInputComponentStatics = $ReadOnly<{
1176
+ State: $ReadOnly<{
1177
+ currentlyFocusedInput: () => ?HostInstance,
1178
+ currentlyFocusedField: () => ?number,
1179
+ focusTextInput: (textField: ?HostInstance) => void,
1180
+ blurTextInput: (textField: ?HostInstance) => void,
1181
+ }>,
1182
+ }>;
1183
+
1184
+ export type TextInputType = InternalTextInput & TextInputComponentStatics;