@tamagui/react-native-types 0.0.0-bootstrap.0 → 3.0.0-beta.1097.1

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.
@@ -0,0 +1,3798 @@
1
+ /**
2
+ * GENERATED by `bun run generate` from react-native 0.86.2. Do not edit.
3
+ *
4
+ * 170 declarations reached from 23 roots, plus
5
+ * 3 written by hand (see SUBSTITUTIONS in the generator).
6
+ * Everything Tamagui uses from react-native's types on web lives here, so no
7
+ * non-`.native` file needs react-native installed. To refresh, bump the repo
8
+ * root's react-native override and re-run `bun run generate` in this package.
9
+ */
10
+
11
+ // react-native declares mixin bases as `interface X { new (): Y }`, which is
12
+ // the shape this rule objects to. Copied verbatim on purpose.
13
+ /* oxlint-disable typescript/no-misused-new */
14
+
15
+ import type * as React from 'react'
16
+
17
+ /**
18
+ * `Animated.AnimatedNode`, the handle `new Animated.Value()` returns, lifted
19
+ * out of the `Animated` namespace it is declared in.
20
+ *
21
+ * Copied member for member rather than replaced with an opaque brand, because
22
+ * a brand is only assignable to itself: a `.native` file that builds a style
23
+ * with these types and hands it to a real react-native component has to
24
+ * typecheck, and classes with no private members are structural, so this one
25
+ * and react-native's are interchangeable. `parity.test-d.ts` is what keeps
26
+ * the copy honest.
27
+ */
28
+ export declare class AnimatedNode {
29
+ addListener(callback: (value: any) => any): string
30
+ removeListener(id: string): void
31
+ removeAllListeners(): void
32
+ hasListeners(): boolean
33
+ }
34
+
35
+ export type AnimatableNumericValue = number | AnimatedNode
36
+
37
+ export type AnimatableStringValue = string | AnimatedNode
38
+
39
+ export type DimensionValue = number | 'auto' | `${number}%` | AnimatedNode | null
40
+
41
+ export type AccessibilityActionEvent = NativeSyntheticEvent<
42
+ Readonly<{
43
+ actionName: string
44
+ }>
45
+ >
46
+
47
+ export type AccessibilityActionInfo = Readonly<{
48
+ name: AccessibilityActionName | string
49
+ label?: string | undefined
50
+ }>
51
+
52
+ export type AccessibilityActionName =
53
+ /**
54
+ * Generated when a screen reader user double taps the component.
55
+ */
56
+ | 'activate'
57
+ /**
58
+ * Generated when a screen reader user increments an adjustable component.
59
+ */
60
+ | 'increment'
61
+ /**
62
+ * Generated when a screen reader user decrements an adjustable component.
63
+ */
64
+ | 'decrement'
65
+ /**
66
+ * Generated when a TalkBack user places accessibility focus on the component and double taps and holds one finger on the screen.
67
+ * @platform android
68
+ */
69
+ | 'longpress'
70
+ /**
71
+ * Generated when a VoiceOver user places focus on or inside the component and double taps with two fingers.
72
+ * @platform ios
73
+ * */
74
+ | 'magicTap'
75
+ /**
76
+ * Generated when a VoiceOver user places focus on or inside the component and performs a two finger scrub gesture (left, right, left).
77
+ * @platform ios
78
+ * */
79
+ | 'escape'
80
+
81
+ export interface AccessibilityProps
82
+ extends AccessibilityPropsAndroid, AccessibilityPropsIOS {
83
+ /**
84
+ * When true, indicates that the view is an accessibility element.
85
+ * By default, all the touchable elements are accessible.
86
+ */
87
+ accessible?: boolean | undefined
88
+
89
+ /**
90
+ * Provides an array of custom actions available for accessibility.
91
+ */
92
+ accessibilityActions?: ReadonlyArray<AccessibilityActionInfo> | undefined
93
+
94
+ /**
95
+ * Overrides the text that's read by the screen reader when the user interacts with the element. By default, the
96
+ * label is constructed by traversing all the children and accumulating all the Text nodes separated by space.
97
+ */
98
+ accessibilityLabel?: string | undefined
99
+
100
+ /**
101
+ * Alias for accessibilityLabel https://reactnative.dev/docs/view#accessibilitylabel
102
+ * https://github.com/react/react-native/issues/34424
103
+ */
104
+ 'aria-label'?: string | undefined
105
+
106
+ /**
107
+ * Accessibility Role tells a person using either VoiceOver on iOS or TalkBack on Android the type of element that is focused on.
108
+ */
109
+ accessibilityRole?: AccessibilityRole | undefined
110
+ /**
111
+ * Accessibility State tells a person using either VoiceOver on iOS or TalkBack on Android the state of the element currently focused on.
112
+ */
113
+ accessibilityState?: AccessibilityState | undefined
114
+
115
+ /**
116
+ * alias for accessibilityState
117
+ *
118
+ * see https://reactnative.dev/docs/accessibility#accessibilitystate
119
+ */
120
+ 'aria-busy'?: boolean | undefined
121
+ 'aria-checked'?: boolean | 'mixed' | undefined
122
+ 'aria-disabled'?: boolean | undefined
123
+ 'aria-expanded'?: boolean | undefined
124
+ 'aria-selected'?: boolean | undefined
125
+
126
+ /**
127
+ * An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label.
128
+ */
129
+ accessibilityHint?: string | undefined
130
+ /**
131
+ * Represents the current value of a component. It can be a textual description of a component's value, or for range-based components, such as sliders and progress bars,
132
+ * it contains range information (minimum, current, and maximum).
133
+ */
134
+ accessibilityValue?: AccessibilityValue | undefined
135
+
136
+ 'aria-valuemax'?: AccessibilityValue['max'] | undefined
137
+ 'aria-valuemin'?: AccessibilityValue['min'] | undefined
138
+ 'aria-valuenow'?: AccessibilityValue['now'] | undefined
139
+ 'aria-valuetext'?: AccessibilityValue['text'] | undefined
140
+ /**
141
+ * When `accessible` is true, the system will try to invoke this function when the user performs an accessibility custom action.
142
+ */
143
+ onAccessibilityAction?: ((event: AccessibilityActionEvent) => void) | undefined
144
+
145
+ /**
146
+ * [Android] Controlling if a view fires accessibility events and if it is reported to accessibility services.
147
+ */
148
+ importantForAccessibility?: ('auto' | 'yes' | 'no' | 'no-hide-descendants') | undefined
149
+
150
+ /**
151
+ * A value indicating whether the accessibility elements contained within
152
+ * this accessibility element are hidden.
153
+ */
154
+ 'aria-hidden'?: boolean | undefined
155
+
156
+ 'aria-modal'?: boolean | undefined
157
+
158
+ /**
159
+ * Indicates to accessibility services to treat UI component like a specific role.
160
+ */
161
+ role?: Role | undefined
162
+ }
163
+
164
+ export interface AccessibilityPropsAndroid {
165
+ /**
166
+ * Identifies the element that labels the element it is applied to. When the assistive technology focuses on the component with this props,
167
+ * the text is read aloud. The value should should match the nativeID of the related element.
168
+ *
169
+ * @platform android
170
+ */
171
+ accessibilityLabelledBy?: string | string[] | undefined
172
+
173
+ /**
174
+ * Identifies the element that labels the element it is applied to. When the assistive technology focuses on the component with this props,
175
+ * the text is read aloud. The value should should match the nativeID of the related element.
176
+ *
177
+ * @platform android
178
+ */
179
+ 'aria-labelledby'?: string | undefined
180
+
181
+ /**
182
+ * Indicates to accessibility services whether the user should be notified
183
+ * when this view changes. Works for Android API >= 19 only.
184
+ *
185
+ * @platform android
186
+ *
187
+ * See https://reactnative.dev/docs/view#accessibilityliveregion
188
+ */
189
+ accessibilityLiveRegion?: 'none' | 'polite' | 'assertive' | undefined
190
+
191
+ /**
192
+ * Indicates to accessibility services whether the user should be notified
193
+ * when this view changes. Works for Android API >= 19 only.
194
+ *
195
+ * @platform android
196
+ *
197
+ * See https://reactnative.dev/docs/view#accessibilityliveregion
198
+ */
199
+ 'aria-live'?: ('polite' | 'assertive' | 'off') | undefined
200
+
201
+ /**
202
+ * Controls how view is important for accessibility which is if it fires accessibility events
203
+ * and if it is reported to accessibility services that query the screen.
204
+ * Works for Android only. See http://developer.android.com/reference/android/R.attr.html#importantForAccessibility for references.
205
+ *
206
+ * Possible values:
207
+ * 'auto' - The system determines whether the view is important for accessibility - default (recommended).
208
+ * 'yes' - The view is important for accessibility.
209
+ * 'no' - The view is not important for accessibility.
210
+ * 'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views.
211
+ *
212
+ * @platform android
213
+ */
214
+ importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants' | undefined
215
+
216
+ /**
217
+ * Enables the view to be screen reader focusable, not keyboard focusable.
218
+ *
219
+ * @platform android
220
+ */
221
+ screenReaderFocusable?: boolean | undefined
222
+ }
223
+
224
+ export interface AccessibilityPropsIOS {
225
+ /**
226
+ * A Boolean value indicating whether the accessibility elements contained within this accessibility element
227
+ * are hidden to the screen reader.
228
+ * @platform ios
229
+ */
230
+ accessibilityElementsHidden?: boolean | undefined
231
+
232
+ /**
233
+ * A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver.
234
+ * @platform ios
235
+ */
236
+ accessibilityViewIsModal?: boolean | undefined
237
+
238
+ /**
239
+ * When accessible is true, the system will invoke this function when the user performs the escape gesture (scrub with two fingers).
240
+ * @platform ios
241
+ */
242
+ onAccessibilityEscape?: (() => void) | undefined
243
+
244
+ /**
245
+ * When `accessible` is true, the system will try to invoke this function when the user performs accessibility tap gesture.
246
+ * @platform ios
247
+ */
248
+ onAccessibilityTap?: (() => void) | undefined
249
+
250
+ /**
251
+ * When accessible is true, the system will invoke this function when the user performs the magic tap gesture.
252
+ * @platform ios
253
+ */
254
+ onMagicTap?: (() => void) | undefined
255
+
256
+ /**
257
+ * https://reactnative.dev/docs/accessibility#accessibilityignoresinvertcolorsios
258
+ * @platform ios
259
+ */
260
+ accessibilityIgnoresInvertColors?: boolean | undefined
261
+
262
+ /**
263
+ * By using the accessibilityLanguage property, the screen reader will understand which language to use while reading the element's label, value and hint. The provided string value must follow the BCP 47 specification (https://www.rfc-editor.org/info/bcp47).
264
+ * https://reactnative.dev/docs/accessibility#accessibilitylanguage-ios
265
+ * @platform ios
266
+ */
267
+ accessibilityLanguage?: string | undefined
268
+
269
+ /**
270
+ * A Boolean value that indicates whether or not to show the item in the large content viewer.
271
+ * Available on iOS 13.0+
272
+ * https://reactnative.dev/docs/accessibility#accessibilityshowslargecontentviewer
273
+ * @platform ios
274
+ */
275
+ accessibilityShowsLargeContentViewer?: boolean | undefined
276
+
277
+ /**
278
+ * When `accessibilityShowsLargeContentViewer` is set, this string will be used as title for the large content viewer.
279
+ * https://reactnative.dev/docs/accessibility#accessibilitylargecontenttitle
280
+ * @platform ios
281
+ */
282
+ accessibilityLargeContentTitle?: string | undefined
283
+
284
+ /**
285
+ * Blocks the user from interacting with the component through keyboard while still allowing
286
+ * screen reader to interact with it if this View is still accessible.
287
+ *
288
+ * @platform ios
289
+ */
290
+ accessibilityRespondsToUserInteraction?: boolean | undefined
291
+ }
292
+
293
+ export type AccessibilityRole =
294
+ | 'none'
295
+ | 'button'
296
+ | 'togglebutton'
297
+ | 'link'
298
+ | 'search'
299
+ | 'image'
300
+ | 'keyboardkey'
301
+ | 'text'
302
+ | 'adjustable'
303
+ | 'imagebutton'
304
+ | 'header'
305
+ | 'summary'
306
+ | 'alert'
307
+ | 'checkbox'
308
+ | 'combobox'
309
+ | 'menu'
310
+ | 'menubar'
311
+ | 'menuitem'
312
+ | 'progressbar'
313
+ | 'radio'
314
+ | 'radiogroup'
315
+ | 'scrollbar'
316
+ | 'spinbutton'
317
+ | 'switch'
318
+ | 'tab'
319
+ | 'tabbar'
320
+ | 'tablist'
321
+ | 'timer'
322
+ | 'list'
323
+ | 'toolbar'
324
+
325
+ export interface AccessibilityState {
326
+ /**
327
+ * When true, informs accessible tools if the element is disabled
328
+ */
329
+ disabled?: boolean | undefined
330
+ /**
331
+ * When true, informs accessible tools if the element is selected
332
+ */
333
+ selected?: boolean | undefined
334
+ /**
335
+ * For items like Checkboxes and Toggle switches, reports their state to accessible tools
336
+ */
337
+ checked?: boolean | 'mixed' | undefined
338
+ /**
339
+ * When present, informs accessible tools if the element is busy
340
+ */
341
+ busy?: boolean | undefined
342
+ /**
343
+ * When present, informs accessible tools the element is expanded or collapsed
344
+ */
345
+ expanded?: boolean | undefined
346
+ }
347
+
348
+ export interface AccessibilityValue {
349
+ /**
350
+ * The minimum value of this component's range. (should be an integer)
351
+ */
352
+ min?: number | undefined
353
+
354
+ /**
355
+ * The maximum value of this component's range. (should be an integer)
356
+ */
357
+ max?: number | undefined
358
+
359
+ /**
360
+ * The current value of this component's range. (should be an integer)
361
+ */
362
+ now?: number | undefined
363
+
364
+ /**
365
+ * A textual description of this component's value. (will override minimum, current, and maximum if set)
366
+ */
367
+ text?: string | undefined
368
+ }
369
+
370
+ export type BackgroundImageValue = LinearGradientValue | RadialGradientValue
371
+
372
+ export type BackgroundPositionValue =
373
+ | {
374
+ top: number | string
375
+ left: number | string
376
+ }
377
+ | {
378
+ top: number | string
379
+ right: number | string
380
+ }
381
+ | {
382
+ bottom: number | string
383
+ left: number | string
384
+ }
385
+ | {
386
+ bottom: number | string
387
+ right: number | string
388
+ }
389
+
390
+ export type BackgroundRepeatKeyword = 'repeat' | 'space' | 'round' | 'no-repeat'
391
+
392
+ export type BackgroundRepeatValue = {
393
+ x: BackgroundRepeatKeyword
394
+ y: BackgroundRepeatKeyword
395
+ }
396
+
397
+ export type BackgroundSizeValue = {
398
+ x: string | number
399
+ y: string | number
400
+ }
401
+
402
+ export type BlendMode =
403
+ | 'normal'
404
+ | 'multiply'
405
+ | 'screen'
406
+ | 'overlay'
407
+ | 'darken'
408
+ | 'lighten'
409
+ | 'color-dodge'
410
+ | 'color-burn'
411
+ | 'hard-light'
412
+ | 'soft-light'
413
+ | 'difference'
414
+ | 'exclusion'
415
+ | 'hue'
416
+ | 'saturation'
417
+ | 'color'
418
+ | 'luminosity'
419
+ | 'plus-lighter'
420
+
421
+ export type BlurEvent = NativeSyntheticEvent<TargetedEvent>
422
+
423
+ export type BoxShadowValue = {
424
+ offsetX: number | string
425
+ offsetY: number | string
426
+ color?: ColorValue | undefined
427
+ blurRadius?: string | number | undefined
428
+ spreadDistance?: number | string | undefined
429
+ inset?: boolean | undefined
430
+ }
431
+
432
+ export type ColorValue = string | OpaqueColorValue
433
+
434
+ export type Constructor<T> = new (...args: any[]) => T
435
+
436
+ export type CursorValue = 'auto' | 'pointer'
437
+
438
+ export type DataDetectorTypes =
439
+ | 'phoneNumber'
440
+ | 'link'
441
+ | 'address'
442
+ | 'calendarEvent'
443
+ | 'trackingNumber'
444
+ | 'flightNumber'
445
+ | 'lookupSuggestion'
446
+ | 'none'
447
+ | 'all'
448
+
449
+ export interface DocumentSelectionState extends EventEmitter {
450
+ new (anchor: number, focus: number): DocumentSelectionState
451
+
452
+ /**
453
+ * Apply an update to the state. If either offset value has changed,
454
+ * set the values and emit the `change` event. Otherwise no-op.
455
+ *
456
+ */
457
+ update(anchor: number, focus: number): void
458
+
459
+ /**
460
+ * Given a max text length, constrain our selection offsets to ensure
461
+ * that the selection remains strictly within the text range.
462
+ *
463
+ */
464
+ constrainLength(maxLength: number): void
465
+
466
+ focus(): void
467
+ blur(): void
468
+ hasFocus(): boolean
469
+ isCollapsed(): boolean
470
+ isBackward(): boolean
471
+
472
+ getAnchorOffset(): number
473
+ getFocusOffset(): number
474
+ getStartOffset(): number
475
+ getEndOffset(): number
476
+ overlaps(start: number, end: number): boolean
477
+ }
478
+
479
+ export type DropShadowValue = {
480
+ offsetX: number | string
481
+ offsetY: number | string
482
+ standardDeviation?: number | string | undefined
483
+ color?: ColorValue | number | undefined
484
+ }
485
+
486
+ export interface EmitterSubscription extends EventSubscription {
487
+ emitter: EventEmitter
488
+ listener: () => any
489
+ context: any
490
+
491
+ /**
492
+ * @param emitter - The event emitter that registered this
493
+ * subscription
494
+ * @param subscriber - The subscriber that controls
495
+ * this subscription
496
+ * @param listener - Function to invoke when the specified event is
497
+ * emitted
498
+ * @param context - Optional context object to use when invoking the
499
+ * listener
500
+ */
501
+ new (
502
+ emitter: EventEmitter,
503
+ subscriber: EventSubscriptionVendor,
504
+ listener: () => any,
505
+ context: any
506
+ ): EmitterSubscription
507
+
508
+ /**
509
+ * Removes this subscription from the emitter that registered it.
510
+ * Note: we're overriding the `remove()` method of EventSubscription here
511
+ * but deliberately not calling `super.remove()` as the responsibility
512
+ * for removing the subscription lies with the EventEmitter.
513
+ */
514
+ remove(): void
515
+ }
516
+
517
+ export type EnterKeyHintType = 'done' | 'go' | 'next' | 'search' | 'send'
518
+
519
+ export type EnterKeyHintTypeAndroid = 'previous'
520
+
521
+ export type EnterKeyHintTypeIOS = 'enter'
522
+
523
+ export type EnterKeyHintTypeOptions =
524
+ | EnterKeyHintType
525
+ | EnterKeyHintTypeAndroid
526
+ | EnterKeyHintTypeIOS
527
+
528
+ export declare class EventEmitter {
529
+ /**
530
+ *
531
+ * @param subscriber - Optional subscriber instance
532
+ * to use. If omitted, a new subscriber will be created for the emitter.
533
+ */
534
+ constructor(subscriber?: EventSubscriptionVendor | null)
535
+
536
+ /**
537
+ * Adds a listener to be invoked when events of the specified type are
538
+ * emitted. An optional calling context may be provided. The data arguments
539
+ * emitted will be passed to the listener function.
540
+ *
541
+ * @param eventType - Name of the event to listen to
542
+ * @param listener - Function to invoke when the specified event is
543
+ * emitted
544
+ * @param context - Optional context object to use when invoking the
545
+ * listener
546
+ */
547
+ addListener(
548
+ eventType: string,
549
+ listener: (...args: any[]) => any,
550
+ context?: any
551
+ ): EmitterSubscription
552
+
553
+ /**
554
+ * Removes all of the registered listeners, including those registered as
555
+ * listener maps.
556
+ *
557
+ * @param eventType - Optional name of the event whose registered
558
+ * listeners to remove
559
+ */
560
+ removeAllListeners(eventType?: string): void
561
+
562
+ /**
563
+ * Returns the number of listeners that are currently registered for the given
564
+ * event.
565
+ *
566
+ * @param eventType - Name of the event to query
567
+ */
568
+ listenerCount(eventType: string): number
569
+
570
+ /**
571
+ * Emits an event of the given type with the given data. All handlers of that
572
+ * particular type will be notified.
573
+ *
574
+ * @param eventType - Name of the event to emit
575
+ * @param Arbitrary arguments to be passed to each registered listener
576
+ *
577
+ * @example
578
+ * emitter.addListener('someEvent', function(message) {
579
+ * console.log(message);
580
+ * });
581
+ *
582
+ * emitter.emit('someEvent', 'abc'); // logs 'abc'
583
+ */
584
+ emit(eventType: string, ...params: any[]): void
585
+ }
586
+
587
+ export interface EventSubscription {
588
+ eventType: string
589
+ key: number
590
+ subscriber: EventSubscriptionVendor
591
+
592
+ /**
593
+ * @param subscriber the subscriber that controls
594
+ * this subscription.
595
+ */
596
+ new (subscriber: EventSubscriptionVendor): EventSubscription
597
+
598
+ /**
599
+ * Removes this subscription from the subscriber that controls it.
600
+ */
601
+ remove(): void
602
+ }
603
+
604
+ export declare class EventSubscriptionVendor {
605
+ constructor()
606
+
607
+ /**
608
+ * Adds a subscription keyed by an event type.
609
+ *
610
+ */
611
+ addSubscription(eventType: string, subscription: EventSubscription): EventSubscription
612
+
613
+ /**
614
+ * Removes a bulk set of the subscriptions.
615
+ *
616
+ * @param eventType - Optional name of the event type whose
617
+ * registered subscriptions to remove, if null remove all subscriptions.
618
+ */
619
+ removeAllSubscriptions(eventType?: string): void
620
+
621
+ /**
622
+ * Removes a specific subscription. Instead of calling this function, call
623
+ * `subscription.remove()` directly.
624
+ *
625
+ */
626
+ removeSubscription(subscription: any): void
627
+
628
+ /**
629
+ * Returns the array of subscriptions that are currently registered for the
630
+ * given event type.
631
+ *
632
+ * Note: This array can be potentially sparse as subscriptions are deleted
633
+ * from it when they are removed.
634
+ *
635
+ */
636
+ getSubscriptionsForType(eventType: string): EventSubscription[]
637
+ }
638
+
639
+ export type Falsy = undefined | null | false | ''
640
+
641
+ export type FilterFunction =
642
+ | { brightness: number | string }
643
+ | { blur: number | string }
644
+ | { contrast: number | string }
645
+ | { grayscale: number | string }
646
+ | { hueRotate: number | string }
647
+ | { invert: number | string }
648
+ | { opacity: number | string }
649
+ | { saturate: number | string }
650
+ | { sepia: number | string }
651
+ | { dropShadow: DropShadowValue | string }
652
+
653
+ export type FlexAlignType = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'
654
+
655
+ export interface FlexStyle {
656
+ alignContent?:
657
+ | 'flex-start'
658
+ | 'flex-end'
659
+ | 'center'
660
+ | 'stretch'
661
+ | 'space-between'
662
+ | 'space-around'
663
+ | 'space-evenly'
664
+ | undefined
665
+ alignItems?: FlexAlignType | undefined
666
+ alignSelf?: 'auto' | FlexAlignType | undefined
667
+ aspectRatio?: number | string | undefined
668
+ borderBottomWidth?: number | undefined
669
+ borderEndWidth?: number | undefined
670
+ borderLeftWidth?: number | undefined
671
+ borderRightWidth?: number | undefined
672
+ borderStartWidth?: number | undefined
673
+ borderTopWidth?: number | undefined
674
+ borderWidth?: number | undefined
675
+ bottom?: DimensionValue | undefined
676
+ boxSizing?: 'border-box' | 'content-box' | undefined
677
+ display?: 'none' | 'flex' | 'contents' | undefined
678
+ end?: DimensionValue | undefined
679
+ flex?: number | undefined
680
+ flexBasis?: DimensionValue | undefined
681
+ flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse' | undefined
682
+ rowGap?: number | string | undefined
683
+ gap?: number | string | undefined
684
+ columnGap?: number | string | undefined
685
+ flexGrow?: number | undefined
686
+ flexShrink?: number | undefined
687
+ flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse' | undefined
688
+ height?: DimensionValue | undefined
689
+ justifyContent?:
690
+ | 'flex-start'
691
+ | 'flex-end'
692
+ | 'center'
693
+ | 'space-between'
694
+ | 'space-around'
695
+ | 'space-evenly'
696
+ | undefined
697
+ left?: DimensionValue | undefined
698
+ margin?: DimensionValue | undefined
699
+ marginBottom?: DimensionValue | undefined
700
+ marginEnd?: DimensionValue | undefined
701
+ marginHorizontal?: DimensionValue | undefined
702
+ marginLeft?: DimensionValue | undefined
703
+ marginRight?: DimensionValue | undefined
704
+ marginStart?: DimensionValue | undefined
705
+ marginTop?: DimensionValue | undefined
706
+ marginVertical?: DimensionValue | undefined
707
+ maxHeight?: DimensionValue | undefined
708
+ maxWidth?: DimensionValue | undefined
709
+ minHeight?: DimensionValue | undefined
710
+ minWidth?: DimensionValue | undefined
711
+ overflow?: 'visible' | 'hidden' | 'scroll' | undefined
712
+ padding?: DimensionValue | undefined
713
+ paddingBottom?: DimensionValue | undefined
714
+ paddingEnd?: DimensionValue | undefined
715
+ paddingHorizontal?: DimensionValue | undefined
716
+ paddingLeft?: DimensionValue | undefined
717
+ paddingRight?: DimensionValue | undefined
718
+ paddingStart?: DimensionValue | undefined
719
+ paddingTop?: DimensionValue | undefined
720
+ paddingVertical?: DimensionValue | undefined
721
+ position?: 'absolute' | 'relative' | 'static' | undefined
722
+ right?: DimensionValue | undefined
723
+ start?: DimensionValue | undefined
724
+ top?: DimensionValue | undefined
725
+ width?: DimensionValue | undefined
726
+ zIndex?: number | undefined
727
+ direction?: 'inherit' | 'ltr' | 'rtl' | undefined
728
+
729
+ /**
730
+ * Equivalent to `top`, `bottom`, `right` and `left`
731
+ */
732
+ inset?: DimensionValue | undefined
733
+
734
+ /**
735
+ * Equivalent to `top`, `bottom`
736
+ */
737
+ insetBlock?: DimensionValue | undefined
738
+
739
+ /**
740
+ * Equivalent to `bottom`
741
+ */
742
+ insetBlockEnd?: DimensionValue | undefined
743
+
744
+ /**
745
+ * Equivalent to `top`
746
+ */
747
+ insetBlockStart?: DimensionValue | undefined
748
+
749
+ /**
750
+ * Equivalent to `right` and `left`
751
+ */
752
+ insetInline?: DimensionValue | undefined
753
+
754
+ /**
755
+ * Equivalent to `right` or `left`
756
+ */
757
+ insetInlineEnd?: DimensionValue | undefined
758
+
759
+ /**
760
+ * Equivalent to `right` or `left`
761
+ */
762
+ insetInlineStart?: DimensionValue | undefined
763
+
764
+ /**
765
+ * Equivalent to `marginVertical`
766
+ */
767
+ marginBlock?: DimensionValue | undefined
768
+
769
+ /**
770
+ * Equivalent to `marginBottom`
771
+ */
772
+ marginBlockEnd?: DimensionValue | undefined
773
+
774
+ /**
775
+ * Equivalent to `marginTop`
776
+ */
777
+ marginBlockStart?: DimensionValue | undefined
778
+
779
+ /**
780
+ * Equivalent to `marginHorizontal`
781
+ */
782
+ marginInline?: DimensionValue | undefined
783
+
784
+ /**
785
+ * Equivalent to `marginEnd`
786
+ */
787
+ marginInlineEnd?: DimensionValue | undefined
788
+
789
+ /**
790
+ * Equivalent to `marginStart`
791
+ */
792
+ marginInlineStart?: DimensionValue | undefined
793
+
794
+ /**
795
+ * Equivalent to `paddingVertical`
796
+ */
797
+ paddingBlock?: DimensionValue | undefined
798
+
799
+ /**
800
+ * Equivalent to `paddingBottom`
801
+ */
802
+ paddingBlockEnd?: DimensionValue | undefined
803
+
804
+ /**
805
+ * Equivalent to `paddingTop`
806
+ */
807
+ paddingBlockStart?: DimensionValue | undefined
808
+
809
+ /**
810
+ * Equivalent to `paddingHorizontal`
811
+ */
812
+ paddingInline?: DimensionValue | undefined
813
+
814
+ /**
815
+ * Equivalent to `paddingEnd`
816
+ */
817
+ paddingInlineEnd?: DimensionValue | undefined
818
+
819
+ /**
820
+ * Equivalent to `paddingStart`
821
+ */
822
+ paddingInlineStart?: DimensionValue | undefined
823
+ }
824
+
825
+ export type FocusEvent = NativeSyntheticEvent<TargetedEvent>
826
+
827
+ export type FontVariant =
828
+ | 'small-caps'
829
+ | 'oldstyle-nums'
830
+ | 'lining-nums'
831
+ | 'tabular-nums'
832
+ | 'common-ligatures'
833
+ | 'no-common-ligatures'
834
+ | 'discretionary-ligatures'
835
+ | 'no-discretionary-ligatures'
836
+ | 'historical-ligatures'
837
+ | 'no-historical-ligatures'
838
+ | 'contextual'
839
+ | 'no-contextual'
840
+ | 'proportional-nums'
841
+ | 'stylistic-one'
842
+ | 'stylistic-two'
843
+ | 'stylistic-three'
844
+ | 'stylistic-four'
845
+ | 'stylistic-five'
846
+ | 'stylistic-six'
847
+ | 'stylistic-seven'
848
+ | 'stylistic-eight'
849
+ | 'stylistic-nine'
850
+ | 'stylistic-ten'
851
+ | 'stylistic-eleven'
852
+ | 'stylistic-twelve'
853
+ | 'stylistic-thirteen'
854
+ | 'stylistic-fourteen'
855
+ | 'stylistic-fifteen'
856
+ | 'stylistic-sixteen'
857
+ | 'stylistic-seventeen'
858
+ | 'stylistic-eighteen'
859
+ | 'stylistic-nineteen'
860
+ | 'stylistic-twenty'
861
+
862
+ export interface GestureResponderEvent extends NativeSyntheticEvent<NativeTouchEvent> {}
863
+
864
+ export interface GestureResponderHandlers {
865
+ /**
866
+ * A view can become the touch responder by implementing the correct negotiation methods.
867
+ * There are two methods to ask the view if it wants to become responder:
868
+ */
869
+
870
+ /**
871
+ * Does this view want to become responder on the start of a touch?
872
+ */
873
+ onStartShouldSetResponder?: ((event: GestureResponderEvent) => boolean) | undefined
874
+
875
+ /**
876
+ * Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness?
877
+ */
878
+ onMoveShouldSetResponder?: ((event: GestureResponderEvent) => boolean) | undefined
879
+
880
+ /**
881
+ * If the View returns true and attempts to become the responder, one of the following will happen:
882
+ */
883
+
884
+ onResponderEnd?: ((event: GestureResponderEvent) => void) | undefined
885
+
886
+ /**
887
+ * The View is now responding for touch events.
888
+ * This is the time to highlight and show the user what is happening
889
+ */
890
+ onResponderGrant?: ((event: GestureResponderEvent) => void) | undefined
891
+
892
+ /**
893
+ * Something else is the responder right now and will not release it
894
+ */
895
+ onResponderReject?: ((event: GestureResponderEvent) => void) | undefined
896
+
897
+ /**
898
+ * If the view is responding, the following handlers can be called:
899
+ */
900
+
901
+ /**
902
+ * The user is moving their finger
903
+ */
904
+ onResponderMove?: ((event: GestureResponderEvent) => void) | undefined
905
+
906
+ /**
907
+ * Fired at the end of the touch, ie "touchUp"
908
+ */
909
+ onResponderRelease?: ((event: GestureResponderEvent) => void) | undefined
910
+
911
+ onResponderStart?: ((event: GestureResponderEvent) => void) | undefined
912
+
913
+ /**
914
+ * Something else wants to become responder.
915
+ * Should this view release the responder? Returning true allows release
916
+ */
917
+ onResponderTerminationRequest?: ((event: GestureResponderEvent) => boolean) | undefined
918
+
919
+ /**
920
+ * The responder has been taken from the View.
921
+ * Might be taken by other views after a call to onResponderTerminationRequest,
922
+ * or might be taken by the OS without asking (happens with control center/ notification center on iOS)
923
+ */
924
+ onResponderTerminate?: ((event: GestureResponderEvent) => void) | undefined
925
+
926
+ /**
927
+ * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern,
928
+ * where the deepest node is called first.
929
+ * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers.
930
+ * This is desirable in most cases, because it makes sure all controls and buttons are usable.
931
+ *
932
+ * However, sometimes a parent will want to make sure that it becomes responder.
933
+ * This can be handled by using the capture phase.
934
+ * Before the responder system bubbles up from the deepest component,
935
+ * it will do a capture phase, firing on*ShouldSetResponderCapture.
936
+ * So if a parent View wants to prevent the child from becoming responder on a touch start,
937
+ * it should have a onStartShouldSetResponderCapture handler which returns true.
938
+ */
939
+ onStartShouldSetResponderCapture?:
940
+ | ((event: GestureResponderEvent) => boolean)
941
+ | undefined
942
+
943
+ /**
944
+ * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern,
945
+ * where the deepest node is called first.
946
+ * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers.
947
+ * This is desirable in most cases, because it makes sure all controls and buttons are usable.
948
+ *
949
+ * However, sometimes a parent will want to make sure that it becomes responder.
950
+ * This can be handled by using the capture phase.
951
+ * Before the responder system bubbles up from the deepest component,
952
+ * it will do a capture phase, firing on*ShouldSetResponderCapture.
953
+ * So if a parent View wants to prevent the child from becoming responder on a touch start,
954
+ * it should have a onStartShouldSetResponderCapture handler which returns true.
955
+ */
956
+ onMoveShouldSetResponderCapture?:
957
+ | ((event: GestureResponderEvent) => boolean)
958
+ | undefined
959
+ }
960
+
961
+ export type HostInstance = ReactNativeElement
962
+
963
+ export interface HTMLCollection<T> extends Iterable<T>, ArrayLike<T> {
964
+ [index: number]: T
965
+ readonly length: number
966
+ item(index: number): null | T
967
+ namedItem(name: string): null | T
968
+ [Symbol.iterator](): Iterator<T>
969
+ }
970
+
971
+ export declare class Image extends ImageBase {
972
+ static getSize(uri: string): Promise<ImageSize>
973
+ static getSize(
974
+ uri: string,
975
+ success: (width: number, height: number) => void,
976
+ failure?: (error: any) => void
977
+ ): void
978
+
979
+ static getSizeWithHeaders(
980
+ uri: string,
981
+ headers: { [index: string]: string }
982
+ ): Promise<ImageSize>
983
+ static getSizeWithHeaders(
984
+ uri: string,
985
+ headers: { [index: string]: string },
986
+ success: (width: number, height: number) => void,
987
+ failure?: (error: any) => void
988
+ ): void
989
+ static prefetch(url: string): Promise<boolean>
990
+ static prefetchWithMetadata(
991
+ url: string,
992
+ queryRootName: string,
993
+ rootTag?: number
994
+ ): Promise<boolean>
995
+ static abortPrefetch?(requestId: number): void
996
+ static queryCache?(
997
+ urls: string[]
998
+ ): Promise<{ [url: string]: 'memory' | 'disk' | 'disk/memory' }>
999
+
1000
+ /**
1001
+ * @see https://reactnative.dev/docs/image#resolveassetsource
1002
+ */
1003
+ static resolveAssetSource(source: ImageSourcePropType): ImageResolvedAssetSource
1004
+ }
1005
+
1006
+ export declare const ImageBase: Constructor<HostInstance> & typeof ImageComponent
1007
+
1008
+ export declare class ImageComponent extends React.Component<ImageProps> {}
1009
+
1010
+ export type ImageErrorEvent = NativeSyntheticEvent<ImageErrorEventData>
1011
+
1012
+ export interface ImageErrorEventData {
1013
+ error: any
1014
+ }
1015
+
1016
+ export type ImageLoadEvent = NativeSyntheticEvent<ImageLoadEventData>
1017
+
1018
+ export interface ImageLoadEventData {
1019
+ source: {
1020
+ height: number
1021
+ width: number
1022
+ uri: string
1023
+ }
1024
+ }
1025
+
1026
+ export interface ImageProgressEventDataIOS {
1027
+ loaded: number
1028
+ total: number
1029
+ }
1030
+
1031
+ export type ImageProgressEventIOS = NativeSyntheticEvent<ImageProgressEventDataIOS>
1032
+
1033
+ export interface ImageProps extends ImagePropsBase {
1034
+ /**
1035
+ *
1036
+ * Style
1037
+ */
1038
+ style?: StyleProp<ImageStyle> | undefined
1039
+ }
1040
+
1041
+ export interface ImagePropsAndroid {
1042
+ /**
1043
+ * The mechanism that should be used to resize the image when the image's dimensions
1044
+ * differ from the image view's dimensions. Defaults to `auto`.
1045
+ *
1046
+ * - `auto`: Use heuristics to pick between `resize` and `scale`.
1047
+ *
1048
+ * - `resize`: A software operation which changes the encoded image in memory before it
1049
+ * gets decoded. This should be used instead of `scale` when the image is much larger
1050
+ * than the view.
1051
+ *
1052
+ * - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
1053
+ * faster (usually hardware accelerated) and produces higher quality images. This
1054
+ * should be used if the image is smaller than the view. It should also be used if the
1055
+ * image is slightly bigger than the view.
1056
+ *
1057
+ * - `none`: No sampling is performed and the image is displayed in its full resolution. This
1058
+ * should only be used in rare circumstances because it is considered unsafe as Android will
1059
+ * throw a runtime exception when trying to render images that consume too much memory.
1060
+ *
1061
+ * More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
1062
+ *
1063
+ * @platform android
1064
+ */
1065
+ resizeMethod?: 'auto' | 'resize' | 'scale' | 'none' | undefined
1066
+
1067
+ /**
1068
+ * Duration of fade in animation in ms. Defaults to 300
1069
+ *
1070
+ * @platform android
1071
+ */
1072
+ fadeDuration?: number | undefined
1073
+ }
1074
+
1075
+ export interface ImagePropsBase
1076
+ extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps {
1077
+ /**
1078
+ * Used to reference react managed images from native code.
1079
+ */
1080
+ id?: string | undefined
1081
+
1082
+ /**
1083
+ * onLayout function
1084
+ *
1085
+ * Invoked on mount and layout changes with
1086
+ *
1087
+ * {nativeEvent: { layout: {x, y, width, height} }}.
1088
+ */
1089
+ onLayout?: ((event: LayoutChangeEvent) => void) | undefined
1090
+
1091
+ /**
1092
+ * Invoked on load error with {nativeEvent: {error}}
1093
+ */
1094
+ onError?: ((error: ImageErrorEvent) => void) | undefined
1095
+
1096
+ /**
1097
+ * Invoked when load completes successfully
1098
+ * { source: { uri, height, width } }.
1099
+ */
1100
+ onLoad?: ((event: ImageLoadEvent) => void) | undefined
1101
+
1102
+ /**
1103
+ * Invoked when load either succeeds or fails
1104
+ */
1105
+ onLoadEnd?: (() => void) | undefined
1106
+
1107
+ /**
1108
+ * Invoked on load start
1109
+ */
1110
+ onLoadStart?: (() => void) | undefined
1111
+
1112
+ progressiveRenderingEnabled?: boolean | undefined
1113
+
1114
+ borderRadius?: number | undefined
1115
+
1116
+ borderTopLeftRadius?: number | undefined
1117
+
1118
+ borderTopRightRadius?: number | undefined
1119
+
1120
+ borderBottomLeftRadius?: number | undefined
1121
+
1122
+ borderBottomRightRadius?: number | undefined
1123
+
1124
+ /**
1125
+ * Determines how to resize the image when the frame doesn't match the raw
1126
+ * image dimensions.
1127
+ *
1128
+ * 'cover': Scale the image uniformly (maintain the image's aspect ratio)
1129
+ * so that both dimensions (width and height) of the image will be equal
1130
+ * to or larger than the corresponding dimension of the view (minus padding).
1131
+ *
1132
+ * 'contain': Scale the image uniformly (maintain the image's aspect ratio)
1133
+ * so that both dimensions (width and height) of the image will be equal to
1134
+ * or less than the corresponding dimension of the view (minus padding).
1135
+ *
1136
+ * 'stretch': Scale width and height independently, This may change the
1137
+ * aspect ratio of the src.
1138
+ *
1139
+ * 'repeat': Repeat the image to cover the frame of the view.
1140
+ * The image will keep it's size and aspect ratio. (iOS only)
1141
+ *
1142
+ * 'center': Scale the image down so that it is completely visible,
1143
+ * if bigger than the area of the view.
1144
+ * The image will not be scaled up.
1145
+ *
1146
+ * 'none': Do not resize the image. The image will be displayed at its intrinsic size.
1147
+ */
1148
+ resizeMode?: ImageResizeMode | undefined
1149
+
1150
+ /**
1151
+ * The image source (either a remote URL or a local file resource).
1152
+ *
1153
+ * This prop can also contain several remote URLs, specified together with their width and height and potentially with scale/other URI arguments.
1154
+ * The native side will then choose the best uri to display based on the measured size of the image container.
1155
+ * A cache property can be added to control how networked request interacts with the local cache.
1156
+ *
1157
+ * The currently supported formats are png, jpg, jpeg, bmp, gif, webp (Android only), psd (iOS only).
1158
+ */
1159
+ source?: ImageSourcePropType | undefined
1160
+
1161
+ /**
1162
+ * A string representing the resource identifier for the image. Similar to
1163
+ * src from HTML.
1164
+ *
1165
+ * See https://reactnative.dev/docs/image#src
1166
+ */
1167
+ src?: string | undefined
1168
+
1169
+ /**
1170
+ * Similar to srcset from HTML.
1171
+ *
1172
+ * See https://reactnative.dev/docs/image#srcset
1173
+ */
1174
+ srcSet?: string | undefined
1175
+
1176
+ /**
1177
+ * similarly to `source`, this property represents the resource used to render
1178
+ * the loading indicator for the image, displayed until image is ready to be
1179
+ * displayed, typically after when it got downloaded from network.
1180
+ */
1181
+ loadingIndicatorSource?: ImageURISource | undefined
1182
+
1183
+ /**
1184
+ * A unique identifier for this element to be used in UI Automation testing scripts.
1185
+ */
1186
+ testID?: string | undefined
1187
+
1188
+ /**
1189
+ * Used to reference react managed images from native code.
1190
+ */
1191
+ nativeID?: string | undefined
1192
+
1193
+ /**
1194
+ * A static image to display while downloading the final image off the network.
1195
+ */
1196
+ defaultSource?: ImageURISource | ImageRequireSource | undefined
1197
+
1198
+ /**
1199
+ * The text that's read by the screen reader when the user interacts with
1200
+ * the image.
1201
+ *
1202
+ * See https://reactnative.dev/docs/image#alt
1203
+ */
1204
+ alt?: string | undefined
1205
+
1206
+ /**
1207
+ * Height of the image component.
1208
+ *
1209
+ * See https://reactnative.dev/docs/image#height
1210
+ */
1211
+ height?: number | undefined
1212
+
1213
+ /**
1214
+ * Width of the image component.
1215
+ *
1216
+ * See https://reactnative.dev/docs/image#width
1217
+ */
1218
+ width?: number | undefined
1219
+
1220
+ /**
1221
+ * Adds the CORS related header to the request.
1222
+ * Similar to crossorigin from HTML.
1223
+ *
1224
+ * See https://reactnative.dev/docs/image#crossorigin
1225
+ */
1226
+ crossOrigin?: 'anonymous' | 'use-credentials' | undefined
1227
+
1228
+ /**
1229
+ * Changes the color of all the non-transparent pixels to the tintColor.
1230
+ *
1231
+ * See https://reactnative.dev/docs/image#tintcolor
1232
+ */
1233
+ tintColor?: ColorValue | undefined
1234
+
1235
+ /**
1236
+ * A string indicating which referrer to use when fetching the resource.
1237
+ * Similar to referrerpolicy from HTML.
1238
+ *
1239
+ * See https://reactnative.dev/docs/image#referrerpolicy
1240
+ */
1241
+ referrerPolicy?:
1242
+ | 'no-referrer'
1243
+ | 'no-referrer-when-downgrade'
1244
+ | 'origin'
1245
+ | 'origin-when-cross-origin'
1246
+ | 'same-origin'
1247
+ | 'strict-origin'
1248
+ | 'strict-origin-when-cross-origin'
1249
+ | 'unsafe-url'
1250
+ | undefined
1251
+ }
1252
+
1253
+ export interface ImagePropsIOS {
1254
+ /**
1255
+ * blurRadius: the blur radius of the blur filter added to the image
1256
+ * @platform ios
1257
+ */
1258
+ blurRadius?: number | undefined
1259
+
1260
+ /**
1261
+ * When the image is resized, the corners of the size specified by capInsets will stay a fixed size,
1262
+ * but the center content and borders of the image will be stretched.
1263
+ * This is useful for creating resizable rounded buttons, shadows, and other resizable assets.
1264
+ * More info on Apple documentation
1265
+ */
1266
+ capInsets?: Insets | undefined
1267
+
1268
+ /**
1269
+ * Invoked on download progress with {nativeEvent: {loaded, total}}
1270
+ */
1271
+ onProgress?: ((event: ImageProgressEventIOS) => void) | undefined
1272
+
1273
+ /**
1274
+ * Invoked when a partial load of the image is complete. The definition of
1275
+ * what constitutes a "partial load" is loader specific though this is meant
1276
+ * for progressive JPEG loads.
1277
+ * @platform ios
1278
+ */
1279
+ onPartialLoad?: (() => void) | undefined
1280
+ }
1281
+
1282
+ export type ImageRequireSource = number
1283
+
1284
+ export type ImageResizeMode =
1285
+ | 'cover'
1286
+ | 'contain'
1287
+ | 'stretch'
1288
+ | 'repeat'
1289
+ | 'center'
1290
+ | 'none'
1291
+
1292
+ export interface ImageResolvedAssetSource {
1293
+ height: number
1294
+ width: number
1295
+ scale: number
1296
+ uri: string
1297
+ }
1298
+
1299
+ export interface ImageSize {
1300
+ width: number
1301
+ height: number
1302
+ }
1303
+
1304
+ export type ImageSourcePropType = ImageURISource | ImageURISource[] | ImageRequireSource
1305
+
1306
+ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
1307
+ resizeMode?: ImageResizeMode | undefined
1308
+ backfaceVisibility?: 'visible' | 'hidden' | undefined
1309
+ borderBottomLeftRadius?: AnimatableNumericValue | string | undefined
1310
+ borderBottomRightRadius?: AnimatableNumericValue | string | undefined
1311
+ backgroundColor?: ColorValue | undefined
1312
+ borderColor?: ColorValue | undefined
1313
+ borderRadius?: AnimatableNumericValue | string | undefined
1314
+ borderTopLeftRadius?: AnimatableNumericValue | string | undefined
1315
+ borderTopRightRadius?: AnimatableNumericValue | string | undefined
1316
+ overflow?: 'visible' | 'hidden' | undefined
1317
+ overlayColor?: ColorValue | undefined
1318
+ tintColor?: ColorValue | undefined
1319
+ opacity?: AnimatableNumericValue | undefined
1320
+ objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none' | undefined
1321
+ cursor?: CursorValue | undefined
1322
+ }
1323
+
1324
+ export interface ImageURISource {
1325
+ /**
1326
+ * `uri` is a string representing the resource identifier for the image, which
1327
+ * could be an http address, a local file path, or the name of a static image
1328
+ * resource (which should be wrapped in the `require('./path/to/image.png')`
1329
+ * function).
1330
+ */
1331
+ uri?: string | undefined
1332
+ /**
1333
+ * `bundle` is the iOS asset bundle which the image is included in. This
1334
+ * will default to [NSBundle mainBundle] if not set.
1335
+ * @platform ios
1336
+ */
1337
+ bundle?: string | undefined
1338
+ /**
1339
+ * `method` is the HTTP Method to use. Defaults to GET if not specified.
1340
+ */
1341
+ method?: string | undefined
1342
+ /**
1343
+ * `headers` is an object representing the HTTP headers to send along with the
1344
+ * request for a remote image.
1345
+ */
1346
+ headers?: { [key: string]: string } | undefined
1347
+ /**
1348
+ * `cache` determines how the requests handles potentially cached
1349
+ * responses.
1350
+ *
1351
+ * - `default`: Use the native platforms default strategy. `useProtocolCachePolicy` on iOS.
1352
+ *
1353
+ * - `reload`: The data for the URL will be loaded from the originating source.
1354
+ * No existing cache data should be used to satisfy a URL load request.
1355
+ *
1356
+ * - `force-cache`: The existing cached data will be used to satisfy the request,
1357
+ * regardless of its age or expiration date. If there is no existing data in the cache
1358
+ * corresponding the request, the data is loaded from the originating source.
1359
+ *
1360
+ * - `only-if-cached`: The existing cache data will be used to satisfy a request, regardless of
1361
+ * its age or expiration date. If there is no existing data in the cache corresponding
1362
+ * to a URL load request, no attempt is made to load the data from the originating source,
1363
+ * and the load is considered to have failed.
1364
+ */
1365
+ cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined
1366
+ /**
1367
+ * `body` is the HTTP body to send with the request. This must be a valid
1368
+ * UTF-8 string, and will be sent exactly as specified, with no
1369
+ * additional encoding (e.g. URL-escaping or base64) applied.
1370
+ */
1371
+ body?: string | undefined
1372
+ /**
1373
+ * `width` and `height` can be specified if known at build time, in which case
1374
+ * these will be used to set the default `<Image/>` component dimensions.
1375
+ */
1376
+ width?: number | undefined
1377
+ height?: number | undefined
1378
+ /**
1379
+ * `scale` is used to indicate the scale factor of the image. Defaults to 1.0 if
1380
+ * unspecified, meaning that one image pixel equates to one display point / DIP.
1381
+ */
1382
+ scale?: number | undefined
1383
+ }
1384
+
1385
+ export type InputModeOptions =
1386
+ | 'none'
1387
+ | 'text'
1388
+ | 'decimal'
1389
+ | 'numeric'
1390
+ | 'tel'
1391
+ | 'search'
1392
+ | 'email'
1393
+ | 'url'
1394
+
1395
+ export interface Insets {
1396
+ top?: number | undefined
1397
+ left?: number | undefined
1398
+ bottom?: number | undefined
1399
+ right?: number | undefined
1400
+ }
1401
+
1402
+ export type KeyboardType =
1403
+ | 'default'
1404
+ | 'number-pad'
1405
+ | 'decimal-pad'
1406
+ | 'numeric'
1407
+ | 'email-address'
1408
+ | 'phone-pad'
1409
+ | 'url'
1410
+
1411
+ export type KeyboardTypeAndroid = 'visible-password'
1412
+
1413
+ export type KeyboardTypeIOS =
1414
+ | 'ascii-capable'
1415
+ | 'numbers-and-punctuation'
1416
+ | 'name-phone-pad'
1417
+ | 'twitter'
1418
+ | 'web-search'
1419
+
1420
+ export type KeyboardTypeOptions = KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS
1421
+
1422
+ export type LayoutChangeEvent = NativeSyntheticEvent<{ layout: LayoutRectangle }>
1423
+
1424
+ export interface LayoutRectangle {
1425
+ x: number
1426
+ y: number
1427
+ width: number
1428
+ height: number
1429
+ }
1430
+
1431
+ export type LinearGradientValue = {
1432
+ type: 'linear-gradient'
1433
+ // Angle or direction enums
1434
+ direction?: string | undefined
1435
+ colorStops: ReadonlyArray<{
1436
+ color: ColorValue | null
1437
+ positions?: ReadonlyArray<string> | undefined
1438
+ }>
1439
+ }
1440
+
1441
+ export interface MatrixTransform {
1442
+ matrix: AnimatableNumericValue[]
1443
+ }
1444
+
1445
+ export type MaximumOneOf<T, K extends keyof T = keyof T> = K extends keyof T
1446
+ ? { [P in K]: T[K] } & { [P in Exclude<keyof T, K>]?: never }
1447
+ : never
1448
+
1449
+ export type MeasureInWindowOnSuccessCallback = (
1450
+ x: number,
1451
+ y: number,
1452
+ width: number,
1453
+ height: number
1454
+ ) => void
1455
+
1456
+ export type MeasureLayoutOnSuccessCallback = (
1457
+ left: number,
1458
+ top: number,
1459
+ width: number,
1460
+ height: number
1461
+ ) => void
1462
+
1463
+ export type MeasureOnSuccessCallback = (
1464
+ x: number,
1465
+ y: number,
1466
+ width: number,
1467
+ height: number,
1468
+ pageX: number,
1469
+ pageY: number
1470
+ ) => void
1471
+
1472
+ export interface MouseEvent extends NativeSyntheticEvent<NativeMouseEvent> {}
1473
+
1474
+ export interface NativeMethods {
1475
+ /**
1476
+ * Determines the location on screen, width, and height of the given view and
1477
+ * returns the values via an async callback. If successful, the callback will
1478
+ * be called with the following arguments:
1479
+ *
1480
+ * - x
1481
+ * - y
1482
+ * - width
1483
+ * - height
1484
+ * - pageX
1485
+ * - pageY
1486
+ *
1487
+ * Note that these measurements are not available until after the rendering
1488
+ * has been completed in native. If you need the measurements as soon as
1489
+ * possible, consider using the [`onLayout`
1490
+ * prop](docs/view.html#onlayout) instead.
1491
+ */
1492
+ measure(callback: MeasureOnSuccessCallback): void
1493
+
1494
+ /**
1495
+ * Determines the location of the given view in the window and returns the
1496
+ * values via an async callback. If the React root view is embedded in
1497
+ * another native view, this will give you the absolute coordinates. If
1498
+ * successful, the callback will be called with the following
1499
+ * arguments:
1500
+ *
1501
+ * - x
1502
+ * - y
1503
+ * - width
1504
+ * - height
1505
+ *
1506
+ * Note that these measurements are not available until after the rendering
1507
+ * has been completed in native.
1508
+ */
1509
+ measureInWindow(callback: MeasureInWindowOnSuccessCallback): void
1510
+
1511
+ /**
1512
+ * Like [`measure()`](#measure), but measures the view relative an ancestor,
1513
+ * specified as `relativeToNativeComponentRef`. This means that the returned x, y
1514
+ * are relative to the origin x, y of the ancestor view.
1515
+ * _Can also be called with a relativeNativeNodeHandle but is deprecated._
1516
+ */
1517
+ measureLayout(
1518
+ relativeToNativeComponentRef: HostInstance | number,
1519
+ onSuccess: MeasureLayoutOnSuccessCallback,
1520
+ onFail?: () => void
1521
+ ): void
1522
+
1523
+ /**
1524
+ * This function sends props straight to native. They will not participate in
1525
+ * future diff process - this means that if you do not include them in the
1526
+ * next render, they will remain active (see [Direct
1527
+ * Manipulation](https://reactnative.dev/docs/the-new-architecture/direct-manipulation-new-architecture)).
1528
+ */
1529
+ setNativeProps(nativeProps: object): void
1530
+
1531
+ /**
1532
+ * Requests focus for the given input or view. The exact behavior triggered
1533
+ * will depend on the platform and type of view.
1534
+ */
1535
+ focus(): void
1536
+
1537
+ /**
1538
+ * Removes focus from an input or view. This is the opposite of `focus()`.
1539
+ */
1540
+ blur(): void
1541
+ }
1542
+
1543
+ export interface NativeMouseEvent extends NativeUIEvent {
1544
+ /**
1545
+ * The X coordinate of the mouse pointer in global (screen) coordinates.
1546
+ */
1547
+ readonly screenX: number
1548
+ /**
1549
+ * The Y coordinate of the mouse pointer in global (screen) coordinates.
1550
+ */
1551
+ readonly screenY: number
1552
+ /**
1553
+ * The X coordinate of the mouse pointer relative to the whole document.
1554
+ */
1555
+ readonly pageX: number
1556
+ /**
1557
+ * The Y coordinate of the mouse pointer relative to the whole document.
1558
+ */
1559
+ readonly pageY: number
1560
+ /**
1561
+ * The X coordinate of the mouse pointer in local (DOM content) coordinates.
1562
+ */
1563
+ readonly clientX: number
1564
+ /**
1565
+ * The Y coordinate of the mouse pointer in local (DOM content) coordinates.
1566
+ */
1567
+ readonly clientY: number
1568
+ /**
1569
+ * Alias for NativeMouseEvent.clientX
1570
+ */
1571
+ readonly x: number
1572
+ /**
1573
+ * Alias for NativeMouseEvent.clientY
1574
+ */
1575
+ readonly y: number
1576
+ /**
1577
+ * Returns true if the control key was down when the mouse event was fired.
1578
+ */
1579
+ readonly ctrlKey: boolean
1580
+ /**
1581
+ * Returns true if the shift key was down when the mouse event was fired.
1582
+ */
1583
+ readonly shiftKey: boolean
1584
+ /**
1585
+ * Returns true if the alt key was down when the mouse event was fired.
1586
+ */
1587
+ readonly altKey: boolean
1588
+ /**
1589
+ * Returns true if the meta key was down when the mouse event was fired.
1590
+ */
1591
+ readonly metaKey: boolean
1592
+ /**
1593
+ * The button number that was pressed (if applicable) when the mouse event was fired.
1594
+ */
1595
+ readonly button: number
1596
+ /**
1597
+ * The buttons being depressed (if any) when the mouse event was fired.
1598
+ */
1599
+ readonly buttons: number
1600
+ /**
1601
+ * The secondary target for the event, if there is one.
1602
+ */
1603
+ readonly relatedTarget: null | number | HostInstance
1604
+ // offset is proposed: https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface
1605
+ /**
1606
+ * The X coordinate of the mouse pointer between that event and the padding edge of the target node
1607
+ */
1608
+ readonly offsetX: number
1609
+ /**
1610
+ * The Y coordinate of the mouse pointer between that event and the padding edge of the target node
1611
+ */
1612
+ readonly offsetY: number
1613
+ }
1614
+
1615
+ export interface NativePointerEvent extends NativeMouseEvent {
1616
+ /**
1617
+ * A unique identifier for the pointer causing the event.
1618
+ */
1619
+ readonly pointerId: number
1620
+ /**
1621
+ * The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer
1622
+ */
1623
+ readonly width: number
1624
+ /**
1625
+ * The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
1626
+ */
1627
+ readonly height: number
1628
+ /**
1629
+ * The normalized pressure of the pointer input in the range 0 to 1, where 0 and 1 represent
1630
+ * the minimum and maximum pressure the hardware is capable of detecting, respectively.
1631
+ */
1632
+ readonly pressure: number
1633
+ /**
1634
+ * The normalized tangential pressure of the pointer input (also known as barrel pressure or
1635
+ * cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control.
1636
+ */
1637
+ readonly tangentialPressure: number
1638
+ /**
1639
+ * The plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane
1640
+ * containing both the pointer (e.g. pen stylus) axis and the Y axis.
1641
+ */
1642
+ readonly tiltX: number
1643
+ /**
1644
+ * The plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane
1645
+ * containing both the pointer (e.g. pen stylus) axis and the X axis.
1646
+ */
1647
+ readonly tiltY: number
1648
+ /**
1649
+ * The clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees,
1650
+ * with a value in the range 0 to 359.
1651
+ */
1652
+ readonly twist: number
1653
+ /**
1654
+ * Indicates the device type that caused the event (mouse, pen, touch, etc.)
1655
+ */
1656
+ readonly pointerType: string
1657
+ /**
1658
+ * Indicates if the pointer represents the primary pointer of this pointer type.
1659
+ */
1660
+ readonly isPrimary: boolean
1661
+ }
1662
+
1663
+ export interface NativeSyntheticEvent<T> extends React.BaseSyntheticEvent<
1664
+ T,
1665
+ HostInstance,
1666
+ HostInstance
1667
+ > {}
1668
+
1669
+ export interface NativeTouchEvent {
1670
+ /**
1671
+ * Array of all touch events that have changed since the last event
1672
+ */
1673
+ changedTouches: NativeTouchEvent[]
1674
+
1675
+ /**
1676
+ * The ID of the touch
1677
+ */
1678
+ identifier: string
1679
+
1680
+ /**
1681
+ * The X position of the touch, relative to the element
1682
+ */
1683
+ locationX: number
1684
+
1685
+ /**
1686
+ * The Y position of the touch, relative to the element
1687
+ */
1688
+ locationY: number
1689
+
1690
+ /**
1691
+ * The X position of the touch, relative to the screen
1692
+ */
1693
+ pageX: number
1694
+
1695
+ /**
1696
+ * The Y position of the touch, relative to the screen
1697
+ */
1698
+ pageY: number
1699
+
1700
+ /**
1701
+ * The node id of the element receiving the touch event
1702
+ */
1703
+ target: string
1704
+
1705
+ /**
1706
+ * A time identifier for the touch, useful for velocity calculation
1707
+ */
1708
+ timestamp: number
1709
+
1710
+ /**
1711
+ * Array of all current touches on the screen
1712
+ */
1713
+ touches: NativeTouchEvent[]
1714
+
1715
+ /**
1716
+ * 3D Touch reported force
1717
+ * @platform ios
1718
+ */
1719
+ force?: number | undefined
1720
+ }
1721
+
1722
+ export interface NativeUIEvent {
1723
+ /**
1724
+ * Returns a long with details about the event, depending on the event type.
1725
+ */
1726
+ readonly detail: number
1727
+ }
1728
+
1729
+ export interface NodeList<T> extends Iterable<T>, ArrayLike<T> {
1730
+ [index: number]: T
1731
+ readonly length: number
1732
+ entries(): Iterator<[number, T]>
1733
+ forEach<ThisType>(
1734
+ callbackFn: (value: T, index: number, array: NodeList<T>) => unknown,
1735
+ thisArg?: ThisType
1736
+ ): void
1737
+ item(index: number): null | T
1738
+ keys(): Iterator<number>
1739
+ values(): Iterator<T>
1740
+ [Symbol.iterator](): Iterator<T>
1741
+ }
1742
+
1743
+ export type OpaqueColorValue = symbol & { __TYPE__: 'Color' }
1744
+
1745
+ export interface PanResponderGestureState {
1746
+ /**
1747
+ * ID of the gestureState- persisted as long as there at least one touch on
1748
+ */
1749
+ stateID: number
1750
+
1751
+ /**
1752
+ * the latest screen coordinates of the recently-moved touch
1753
+ */
1754
+ moveX: number
1755
+
1756
+ /**
1757
+ * the latest screen coordinates of the recently-moved touch
1758
+ */
1759
+ moveY: number
1760
+
1761
+ /**
1762
+ * the screen coordinates of the responder grant
1763
+ */
1764
+ x0: number
1765
+
1766
+ /**
1767
+ * the screen coordinates of the responder grant
1768
+ */
1769
+ y0: number
1770
+
1771
+ /**
1772
+ * accumulated distance of the gesture since the touch started
1773
+ */
1774
+ dx: number
1775
+
1776
+ /**
1777
+ * accumulated distance of the gesture since the touch started
1778
+ */
1779
+ dy: number
1780
+
1781
+ /**
1782
+ * current velocity of the gesture
1783
+ */
1784
+ vx: number
1785
+
1786
+ /**
1787
+ * current velocity of the gesture
1788
+ */
1789
+ vy: number
1790
+
1791
+ /**
1792
+ * Number of touches currently on screen
1793
+ */
1794
+ numberActiveTouches: number
1795
+
1796
+ // All `gestureState` accounts for timeStamps up until:
1797
+ _accountsForMovesUpTo: number
1798
+ }
1799
+
1800
+ export interface PerspectiveTransform {
1801
+ perspective: AnimatableNumericValue
1802
+ }
1803
+
1804
+ export type PointerEvent = NativeSyntheticEvent<NativePointerEvent>
1805
+
1806
+ export interface PointerEvents {
1807
+ onPointerEnter?: ((event: PointerEvent) => void) | undefined
1808
+ onPointerEnterCapture?: ((event: PointerEvent) => void) | undefined
1809
+ onPointerLeave?: ((event: PointerEvent) => void) | undefined
1810
+ onPointerLeaveCapture?: ((event: PointerEvent) => void) | undefined
1811
+ onPointerMove?: ((event: PointerEvent) => void) | undefined
1812
+ onPointerMoveCapture?: ((event: PointerEvent) => void) | undefined
1813
+ onPointerCancel?: ((event: PointerEvent) => void) | undefined
1814
+ onPointerCancelCapture?: ((event: PointerEvent) => void) | undefined
1815
+ onPointerDown?: ((event: PointerEvent) => void) | undefined
1816
+ onPointerDownCapture?: ((event: PointerEvent) => void) | undefined
1817
+ onPointerUp?: ((event: PointerEvent) => void) | undefined
1818
+ onPointerUpCapture?: ((event: PointerEvent) => void) | undefined
1819
+ }
1820
+
1821
+ export interface PressableAndroidRippleConfig {
1822
+ color?: null | ColorValue | undefined
1823
+ borderless?: null | boolean | undefined
1824
+ radius?: null | number | undefined
1825
+ foreground?: null | boolean | undefined
1826
+ alpha?: null | number | undefined
1827
+ }
1828
+
1829
+ export interface PressableProps
1830
+ extends AccessibilityProps, Omit<ViewProps, 'children' | 'style' | 'hitSlop'> {
1831
+ /**
1832
+ * Called when the hover is activated to provide visual feedback.
1833
+ */
1834
+ onHoverIn?: null | ((event: MouseEvent) => void) | undefined
1835
+
1836
+ /**
1837
+ * Called when the hover is deactivated to undo visual feedback.
1838
+ */
1839
+ onHoverOut?: null | ((event: MouseEvent) => void) | undefined
1840
+
1841
+ /**
1842
+ * Called when a single tap gesture is detected.
1843
+ */
1844
+ onPress?: null | ((event: GestureResponderEvent) => void) | undefined
1845
+
1846
+ /**
1847
+ * Called when a touch is engaged before `onPress`.
1848
+ */
1849
+ onPressIn?: null | ((event: GestureResponderEvent) => void) | undefined
1850
+
1851
+ /**
1852
+ * Called when the press location moves.
1853
+ */
1854
+ onPressMove?: null | ((event: GestureResponderEvent) => void) | undefined
1855
+
1856
+ /**
1857
+ * Called when a touch is released before `onPress`.
1858
+ */
1859
+ onPressOut?: null | ((event: GestureResponderEvent) => void) | undefined
1860
+
1861
+ /**
1862
+ * Called when a long-tap gesture is detected.
1863
+ */
1864
+ onLongPress?: null | ((event: GestureResponderEvent) => void) | undefined
1865
+
1866
+ /**
1867
+ * Called after the element loses focus.
1868
+ * @platform macos windows
1869
+ */
1870
+ onBlur?: null | ((event: NativeSyntheticEvent<TargetedEvent>) => void) | undefined
1871
+
1872
+ /**
1873
+ * Called after the element is focused.
1874
+ * @platform macos windows
1875
+ */
1876
+ onFocus?: null | ((event: NativeSyntheticEvent<TargetedEvent>) => void) | undefined
1877
+
1878
+ /**
1879
+ * Either children or a render prop that receives a boolean reflecting whether
1880
+ * the component is currently pressed.
1881
+ */
1882
+ children?:
1883
+ | React.ReactNode
1884
+ | ((state: PressableStateCallbackType) => React.ReactNode)
1885
+ | undefined
1886
+
1887
+ /**
1888
+ * Whether a press gesture can be interrupted by a parent gesture such as a
1889
+ * scroll event. Defaults to true.
1890
+ */
1891
+ cancelable?: null | boolean | undefined
1892
+
1893
+ /**
1894
+ * Duration to wait after hover in before calling `onHoverIn`.
1895
+ * @platform macos windows
1896
+ */
1897
+ delayHoverIn?: number | null | undefined
1898
+
1899
+ /**
1900
+ * Duration to wait after hover out before calling `onHoverOut`.
1901
+ * @platform macos windows
1902
+ */
1903
+ delayHoverOut?: number | null | undefined
1904
+
1905
+ /**
1906
+ * Duration (in milliseconds) from `onPressIn` before `onLongPress` is called.
1907
+ */
1908
+ delayLongPress?: null | number | undefined
1909
+
1910
+ /**
1911
+ * Whether the press behavior is disabled.
1912
+ */
1913
+ disabled?: null | boolean | undefined
1914
+
1915
+ /**
1916
+ * Additional distance outside of this view in which a press is detected.
1917
+ */
1918
+ hitSlop?: null | Insets | number | undefined
1919
+
1920
+ /**
1921
+ * Additional distance outside of this view in which a touch is considered a
1922
+ * press before `onPressOut` is triggered.
1923
+ */
1924
+ pressRetentionOffset?: null | Insets | number | undefined
1925
+
1926
+ /**
1927
+ * If true, doesn't play system sound on touch.
1928
+ */
1929
+ android_disableSound?: null | boolean | undefined
1930
+
1931
+ /**
1932
+ * Enables the Android ripple effect and configures its color.
1933
+ */
1934
+ android_ripple?: null | PressableAndroidRippleConfig | undefined
1935
+
1936
+ /**
1937
+ * Used only for documentation or testing (e.g. snapshot testing).
1938
+ */
1939
+ testOnly_pressed?: null | boolean | undefined
1940
+
1941
+ /**
1942
+ * Either view styles or a function that receives a boolean reflecting whether
1943
+ * the component is currently pressed and returns view styles.
1944
+ */
1945
+ style?:
1946
+ | StyleProp<ViewStyle>
1947
+ | ((state: PressableStateCallbackType) => StyleProp<ViewStyle>)
1948
+ | undefined
1949
+
1950
+ /**
1951
+ * Duration (in milliseconds) to wait after press down before calling onPressIn.
1952
+ */
1953
+ unstable_pressDelay?: number | undefined
1954
+ }
1955
+
1956
+ export interface PressableStateCallbackType {
1957
+ readonly pressed: boolean
1958
+ }
1959
+
1960
+ export type RadialExtent =
1961
+ | 'closest-corner'
1962
+ | 'closest-side'
1963
+ | 'farthest-corner'
1964
+ | 'farthest-side'
1965
+
1966
+ export type RadialGradientPosition =
1967
+ | {
1968
+ top: number | string
1969
+ left: number | string
1970
+ }
1971
+ | {
1972
+ top: number | string
1973
+ right: number | string
1974
+ }
1975
+ | {
1976
+ bottom: number | string
1977
+ left: number | string
1978
+ }
1979
+ | {
1980
+ bottom: number | string
1981
+ right: number | string
1982
+ }
1983
+
1984
+ export type RadialGradientShape = 'circle' | 'ellipse'
1985
+
1986
+ export type RadialGradientSize =
1987
+ | RadialExtent
1988
+ | {
1989
+ x: string | number
1990
+ y: string | number
1991
+ }
1992
+
1993
+ export type RadialGradientValue = {
1994
+ type: 'radial-gradient'
1995
+ shape: RadialGradientShape
1996
+ size: RadialGradientSize
1997
+ position: RadialGradientPosition
1998
+ colorStops: ReadonlyArray<{
1999
+ color: ColorValue | null
2000
+ positions?: ReadonlyArray<string> | undefined
2001
+ }>
2002
+ }
2003
+
2004
+ export interface ReactNativeDocument extends ReadOnlyNode {
2005
+ get childElementCount(): number
2006
+ get children(): HTMLCollection<ReadOnlyElement>
2007
+ get documentElement(): ReactNativeElement
2008
+ get firstElementChild(): null | ReadOnlyElement
2009
+ getElementById(id: string): null | ReadOnlyElement
2010
+ get lastElementChild(): null | ReadOnlyElement
2011
+ get nodeName(): string
2012
+ get nodeType(): number
2013
+ get nodeValue(): null
2014
+ }
2015
+
2016
+ export interface ReactNativeElement extends ReadOnlyElement, NativeMethods {
2017
+ blur(): void
2018
+ focus(): void
2019
+ get offsetHeight(): number
2020
+ get offsetLeft(): number
2021
+ get offsetParent(): null | ReadOnlyElement
2022
+ get offsetTop(): number
2023
+ get offsetWidth(): number
2024
+ setNativeProps(nativeProps: {}): void
2025
+ }
2026
+
2027
+ export interface ReadOnlyElement extends ReadOnlyNode {
2028
+ get childElementCount(): number
2029
+ get children(): HTMLCollection<ReadOnlyElement>
2030
+ get clientHeight(): number
2031
+ get clientLeft(): number
2032
+ get clientTop(): number
2033
+ get clientWidth(): number
2034
+ get firstElementChild(): null | ReadOnlyElement
2035
+ getBoundingClientRect(): DOMRect
2036
+ hasPointerCapture(pointerId: number): boolean
2037
+ get id(): string
2038
+ get lastElementChild(): null | ReadOnlyElement
2039
+ get nextElementSibling(): null | ReadOnlyElement
2040
+ get nodeName(): string
2041
+ get nodeType(): number
2042
+ get nodeValue(): null | string
2043
+ set nodeValue(value: string)
2044
+ get previousElementSibling(): null | ReadOnlyElement
2045
+ releasePointerCapture(pointerId: number): void
2046
+ get scrollHeight(): number
2047
+ get scrollLeft(): number
2048
+ get scrollTop(): number
2049
+ get scrollWidth(): number
2050
+ setPointerCapture(pointerId: number): void
2051
+ get tagName(): string
2052
+ get textContent(): string
2053
+ }
2054
+
2055
+ export interface ReadOnlyNode {
2056
+ get childNodes(): NodeList<ReadOnlyNode>
2057
+ compareDocumentPosition(otherNode: ReadOnlyNode): number
2058
+ contains(otherNode: ReadOnlyNode): boolean
2059
+ get firstChild(): null | ReadOnlyNode
2060
+ getRootNode(): ReadOnlyNode
2061
+ hasChildNodes(): boolean
2062
+ get isConnected(): boolean
2063
+ get lastChild(): null | ReadOnlyNode
2064
+ get nextSibling(): null | ReadOnlyNode
2065
+ get nodeName(): string
2066
+ get nodeType(): number
2067
+ get nodeValue(): null | string
2068
+ get ownerDocument(): null | ReactNativeDocument
2069
+ get parentElement(): null | ReadOnlyElement
2070
+ get parentNode(): null | ReadOnlyNode
2071
+ get previousSibling(): null | ReadOnlyNode
2072
+ get textContent(): string
2073
+ }
2074
+
2075
+ export interface RecursiveArray<T> extends Array<
2076
+ T | ReadonlyArray<T> | RecursiveArray<T>
2077
+ > {}
2078
+
2079
+ export type ReturnKeyType = 'done' | 'go' | 'next' | 'search' | 'send'
2080
+
2081
+ export type ReturnKeyTypeAndroid = 'none' | 'previous'
2082
+
2083
+ export type ReturnKeyTypeIOS =
2084
+ | 'default'
2085
+ | 'google'
2086
+ | 'join'
2087
+ | 'route'
2088
+ | 'yahoo'
2089
+ | 'emergency-call'
2090
+
2091
+ export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS
2092
+
2093
+ export type Role =
2094
+ | 'alert'
2095
+ | 'alertdialog'
2096
+ | 'application'
2097
+ | 'article'
2098
+ | 'banner'
2099
+ | 'button'
2100
+ | 'cell'
2101
+ | 'checkbox'
2102
+ | 'columnheader'
2103
+ | 'combobox'
2104
+ | 'complementary'
2105
+ | 'contentinfo'
2106
+ | 'definition'
2107
+ | 'dialog'
2108
+ | 'directory'
2109
+ | 'document'
2110
+ | 'feed'
2111
+ | 'figure'
2112
+ | 'form'
2113
+ | 'grid'
2114
+ | 'group'
2115
+ | 'heading'
2116
+ | 'img'
2117
+ | 'link'
2118
+ | 'list'
2119
+ | 'listitem'
2120
+ | 'log'
2121
+ | 'main'
2122
+ | 'marquee'
2123
+ | 'math'
2124
+ | 'menu'
2125
+ | 'menubar'
2126
+ | 'menuitem'
2127
+ | 'meter'
2128
+ | 'navigation'
2129
+ | 'none'
2130
+ | 'note'
2131
+ | 'option'
2132
+ | 'presentation'
2133
+ | 'progressbar'
2134
+ | 'radio'
2135
+ | 'radiogroup'
2136
+ | 'region'
2137
+ | 'row'
2138
+ | 'rowgroup'
2139
+ | 'rowheader'
2140
+ | 'scrollbar'
2141
+ | 'searchbox'
2142
+ | 'separator'
2143
+ | 'slider'
2144
+ | 'spinbutton'
2145
+ | 'status'
2146
+ | 'summary'
2147
+ | 'switch'
2148
+ | 'tab'
2149
+ | 'table'
2150
+ | 'tablist'
2151
+ | 'tabpanel'
2152
+ | 'term'
2153
+ | 'timer'
2154
+ | 'toolbar'
2155
+ | 'tooltip'
2156
+ | 'tree'
2157
+ | 'treegrid'
2158
+ | 'treeitem'
2159
+
2160
+ export interface RotateTransform {
2161
+ rotate: AnimatableStringValue
2162
+ }
2163
+
2164
+ export interface RotateXTransform {
2165
+ rotateX: AnimatableStringValue
2166
+ }
2167
+
2168
+ export interface RotateYTransform {
2169
+ rotateY: AnimatableStringValue
2170
+ }
2171
+
2172
+ export interface RotateZTransform {
2173
+ rotateZ: AnimatableStringValue
2174
+ }
2175
+
2176
+ export interface ScaledSize {
2177
+ width: number
2178
+ height: number
2179
+ scale: number
2180
+ fontScale: number
2181
+ }
2182
+
2183
+ export interface ScaleTransform {
2184
+ scale: AnimatableNumericValue
2185
+ }
2186
+
2187
+ export interface ScaleXTransform {
2188
+ scaleX: AnimatableNumericValue
2189
+ }
2190
+
2191
+ export interface ScaleYTransform {
2192
+ scaleY: AnimatableNumericValue
2193
+ }
2194
+
2195
+ export interface ShadowStyleIOS {
2196
+ shadowColor?: ColorValue | undefined
2197
+ shadowOffset?: Readonly<{ width: number; height: number }> | undefined
2198
+ shadowOpacity?: AnimatableNumericValue | undefined
2199
+ shadowRadius?: number | undefined
2200
+ }
2201
+
2202
+ export interface SkewXTransform {
2203
+ skewX: AnimatableStringValue
2204
+ }
2205
+
2206
+ export interface SkewYTransform {
2207
+ skewY: AnimatableStringValue
2208
+ }
2209
+
2210
+ export type StyleProp<T> = T | RecursiveArray<T | Falsy> | Falsy
2211
+
2212
+ export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline'
2213
+
2214
+ export interface SwitchChangeEvent extends NativeSyntheticEvent<SwitchChangeEventData> {}
2215
+
2216
+ export interface SwitchChangeEventData extends TargetedEvent {
2217
+ value: boolean
2218
+ }
2219
+
2220
+ export interface SwitchProps extends SwitchPropsIOS {
2221
+ /**
2222
+ * Color of the foreground switch grip.
2223
+ */
2224
+ thumbColor?: ColorValue | undefined
2225
+
2226
+ /**
2227
+ * Custom colors for the switch track
2228
+ *
2229
+ * Color when false and color when true
2230
+ */
2231
+ trackColor?:
2232
+ | {
2233
+ false?: ColorValue | null | undefined
2234
+ true?: ColorValue | null | undefined
2235
+ }
2236
+ | undefined
2237
+
2238
+ /**
2239
+ * If true the user won't be able to toggle the switch.
2240
+ * Default value is false.
2241
+ */
2242
+ disabled?: boolean | undefined
2243
+
2244
+ /**
2245
+ * Invoked with the change event as an argument when the value changes.
2246
+ */
2247
+ onChange?: ((event: SwitchChangeEvent) => Promise<void> | void) | null | undefined
2248
+
2249
+ /**
2250
+ * Invoked with the new value when the value changes.
2251
+ */
2252
+ onValueChange?: ((value: boolean) => Promise<void> | void) | null | undefined
2253
+
2254
+ /**
2255
+ * Used to locate this view in end-to-end tests.
2256
+ */
2257
+ testID?: string | undefined
2258
+
2259
+ /**
2260
+ * The value of the switch. If true the switch will be turned on.
2261
+ * Default value is false.
2262
+ */
2263
+ value?: boolean | undefined
2264
+
2265
+ /**
2266
+ * On iOS, custom color for the background.
2267
+ * Can be seen when the switch value is false or when the switch is disabled.
2268
+ */
2269
+ ios_backgroundColor?: ColorValue | undefined
2270
+
2271
+ style?: StyleProp<ViewStyle> | undefined
2272
+ }
2273
+
2274
+ export interface SwitchPropsIOS extends ViewProps {
2275
+ /**
2276
+ * Background color when the switch is turned on.
2277
+ *
2278
+ * @deprecated use trackColor instead
2279
+ */
2280
+ onTintColor?: ColorValue | undefined
2281
+
2282
+ /**
2283
+ * Color of the foreground switch grip.
2284
+ *
2285
+ * @deprecated use thumbColor instead
2286
+ */
2287
+ thumbTintColor?: ColorValue | undefined
2288
+
2289
+ /**
2290
+ * Background color when the switch is turned off.
2291
+ *
2292
+ * @deprecated use trackColor instead
2293
+ */
2294
+ tintColor?: ColorValue | undefined
2295
+ }
2296
+
2297
+ export interface TargetedEvent {
2298
+ target: number
2299
+ }
2300
+
2301
+ export declare class Text extends TextBase {}
2302
+
2303
+ export declare const TextBase: Constructor<HostInstance> & typeof TextComponent
2304
+
2305
+ export declare class TextComponent extends React.Component<TextProps> {}
2306
+
2307
+ export declare class TextInput extends TextInputBase {
2308
+ /**
2309
+ * Access the current focus state.
2310
+ */
2311
+ static State: TextInputState
2312
+
2313
+ /**
2314
+ * Returns if the input is currently focused.
2315
+ */
2316
+ isFocused: () => boolean
2317
+
2318
+ /**
2319
+ * Removes all text from the input.
2320
+ */
2321
+ clear: () => void
2322
+
2323
+ /**
2324
+ * Sets the start and end positions of text selection.
2325
+ */
2326
+ setSelection: (start: number, end: number) => void
2327
+ }
2328
+
2329
+ export interface TextInputAndroidProps {
2330
+ /**
2331
+ * When provided it will set the color of the cursor (or "caret") in the component.
2332
+ * Unlike the behavior of `selectionColor` the cursor color will be set independently
2333
+ * from the color of the text selection box.
2334
+ * @platform android
2335
+ */
2336
+ cursorColor?: ColorValue | null | undefined
2337
+
2338
+ /**
2339
+ * When provided it will set the color of the selection handles when highlighting text.
2340
+ * Unlike the behavior of `selectionColor` the handle color will be set independently
2341
+ * from the color of the text selection box.
2342
+ * @platform android
2343
+ */
2344
+ selectionHandleColor?: ColorValue | null | undefined
2345
+
2346
+ /**
2347
+ * Determines whether the individual fields in your app should be included in a
2348
+ * view structure for autofill purposes on Android API Level 26+. Defaults to auto.
2349
+ * To disable auto complete, use `off`.
2350
+ *
2351
+ * *Android Only*
2352
+ *
2353
+ * The following values work on Android only:
2354
+ *
2355
+ * - `auto` - let Android decide
2356
+ * - `no` - not important for autofill
2357
+ * - `noExcludeDescendants` - this view and its children aren't important for autofill
2358
+ * - `yes` - is important for autofill
2359
+ * - `yesExcludeDescendants` - this view is important for autofill but its children aren't
2360
+ */
2361
+ importantForAutofill?:
2362
+ | 'auto'
2363
+ | 'no'
2364
+ | 'noExcludeDescendants'
2365
+ | 'yes'
2366
+ | 'yesExcludeDescendants'
2367
+ | undefined
2368
+
2369
+ /**
2370
+ * When false, if there is a small amount of space available around a text input (e.g. landscape orientation on a phone),
2371
+ * the OS may choose to have the user edit the text inside of a full screen text input mode.
2372
+ * When true, this feature is disabled and users will always edit the text directly inside of the text input.
2373
+ * Defaults to false.
2374
+ */
2375
+ disableFullscreenUI?: boolean | undefined
2376
+
2377
+ /**
2378
+ * If defined, the provided image resource will be rendered on the left.
2379
+ */
2380
+ inlineImageLeft?: string | undefined
2381
+
2382
+ /**
2383
+ * Padding between the inline image, if any, and the text input itself.
2384
+ */
2385
+ inlineImagePadding?: number | undefined
2386
+
2387
+ /**
2388
+ * Sets the number of lines for a TextInput.
2389
+ * Use it with multiline set to true to be able to fill the lines.
2390
+ */
2391
+ numberOfLines?: number | undefined
2392
+
2393
+ /**
2394
+ * Sets the return key to the label. Use it instead of `returnKeyType`.
2395
+ * @platform android
2396
+ */
2397
+ returnKeyLabel?: string | undefined
2398
+
2399
+ /**
2400
+ * Set text break strategy on Android API Level 23+, possible values are simple, highQuality, balanced
2401
+ * The default value is simple.
2402
+ */
2403
+ textBreakStrategy?: 'simple' | 'highQuality' | 'balanced' | undefined
2404
+
2405
+ /**
2406
+ * The color of the textInput underline.
2407
+ */
2408
+ underlineColorAndroid?: ColorValue | undefined
2409
+
2410
+ /**
2411
+ * Vertically align text when `multiline` is set to true
2412
+ */
2413
+ textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | undefined
2414
+
2415
+ /**
2416
+ * When false, it will prevent the soft keyboard from showing when the field is focused. The default value is true
2417
+ */
2418
+ showSoftInputOnFocus?: boolean | undefined
2419
+
2420
+ /**
2421
+ * Vertically align text when `multiline` is set to true
2422
+ */
2423
+ verticalAlign?: 'auto' | 'top' | 'bottom' | 'middle' | undefined
2424
+ }
2425
+
2426
+ export declare const TextInputBase: Constructor<HostInstance> &
2427
+ Constructor<TimerMixin> &
2428
+ typeof TextInputComponent
2429
+
2430
+ export type TextInputChangeEvent = NativeSyntheticEvent<TextInputChangeEventData>
2431
+
2432
+ export interface TextInputChangeEventData extends TargetedEvent {
2433
+ eventCount: number
2434
+ text: string
2435
+ }
2436
+
2437
+ export declare class TextInputComponent extends React.Component<TextInputProps> {}
2438
+
2439
+ export type TextInputContentSizeChangeEvent =
2440
+ NativeSyntheticEvent<TextInputContentSizeChangeEventData>
2441
+
2442
+ export interface TextInputContentSizeChangeEventData {
2443
+ contentSize: { width: number; height: number }
2444
+ }
2445
+
2446
+ export type TextInputEndEditingEvent = NativeSyntheticEvent<TextInputEndEditingEventData>
2447
+
2448
+ export interface TextInputEndEditingEventData {
2449
+ text: string
2450
+ }
2451
+
2452
+ export interface TextInputIOSProps {
2453
+ /**
2454
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
2455
+ */
2456
+ disableKeyboardShortcuts?: boolean | undefined
2457
+
2458
+ /**
2459
+ * enum('never', 'while-editing', 'unless-editing', 'always')
2460
+ * When the clear button should appear on the right side of the text view
2461
+ */
2462
+ clearButtonMode?: 'never' | 'while-editing' | 'unless-editing' | 'always' | undefined
2463
+
2464
+ /**
2465
+ * If true, clears the text field automatically when editing begins
2466
+ */
2467
+ clearTextOnFocus?: boolean | undefined
2468
+
2469
+ /**
2470
+ * Determines the types of data converted to clickable URLs in the text input.
2471
+ * Only valid if `multiline={true}` and `editable={false}`.
2472
+ * By default no data types are detected.
2473
+ *
2474
+ * You can provide one type or an array of many types.
2475
+ *
2476
+ * Possible values for `dataDetectorTypes` are:
2477
+ *
2478
+ * - `'phoneNumber'`
2479
+ * - `'link'`
2480
+ * - `'address'`
2481
+ * - `'calendarEvent'`
2482
+ * - `'none'`
2483
+ * - `'all'`
2484
+ */
2485
+ dataDetectorTypes?: DataDetectorTypes | DataDetectorTypes[] | undefined
2486
+
2487
+ /**
2488
+ * If true, the keyboard disables the return key when there is no text and automatically enables it when there is text.
2489
+ * The default value is false.
2490
+ */
2491
+ enablesReturnKeyAutomatically?: boolean | undefined
2492
+
2493
+ /**
2494
+ * Determines the color of the keyboard.
2495
+ */
2496
+ keyboardAppearance?: 'default' | 'light' | 'dark' | undefined
2497
+
2498
+ /**
2499
+ * Provide rules for your password.
2500
+ * 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.
2501
+ * "required: upper; required: lower; required: digit; max-consecutive: 2; minlength: 8;"
2502
+ */
2503
+ passwordRules?: string | null | undefined
2504
+
2505
+ /**
2506
+ * If `true`, allows TextInput to pass touch events to the parent component.
2507
+ * This allows components to be swipeable from the TextInput on iOS,
2508
+ * as is the case on Android by default.
2509
+ * If `false`, TextInput always asks to handle the input (except when disabled).
2510
+ */
2511
+ rejectResponderTermination?: boolean | null | undefined
2512
+
2513
+ /**
2514
+ * See DocumentSelectionState.js, some state that is responsible for maintaining selection information for a document
2515
+ */
2516
+ selectionState?: DocumentSelectionState | undefined
2517
+
2518
+ /**
2519
+ * If false, disables spell-check style (i.e. red underlines). The default value is inherited from autoCorrect
2520
+ */
2521
+ spellCheck?: boolean | undefined
2522
+
2523
+ /**
2524
+ * Give the keyboard and the system information about the expected
2525
+ * semantic meaning for the content that users enter.
2526
+ *
2527
+ * To disable autofill, set textContentType to `none`.
2528
+ *
2529
+ * Possible values for `textContentType` are:
2530
+ *
2531
+ * - `'none'`
2532
+ * - `'URL'`
2533
+ * - `'addressCity'`
2534
+ * - `'addressCityAndState'`
2535
+ * - `'addressState'`
2536
+ * - `'countryName'`
2537
+ * - `'creditCardNumber'`
2538
+ * - `'creditCardExpiration'` (iOS 17+)
2539
+ * - `'creditCardExpirationMonth'` (iOS 17+)
2540
+ * - `'creditCardExpirationYear'` (iOS 17+)
2541
+ * - `'creditCardSecurityCode'` (iOS 17+)
2542
+ * - `'creditCardType'` (iOS 17+)
2543
+ * - `'creditCardName'` (iOS 17+)
2544
+ * - `'creditCardGivenName'` (iOS 17+)
2545
+ * - `'creditCardMiddleName'` (iOS 17+)
2546
+ * - `'creditCardFamilyName'` (iOS 17+)
2547
+ * - `'emailAddress'`
2548
+ * - `'familyName'`
2549
+ * - `'fullStreetAddress'`
2550
+ * - `'givenName'`
2551
+ * - `'jobTitle'`
2552
+ * - `'location'`
2553
+ * - `'middleName'`
2554
+ * - `'name'`
2555
+ * - `'namePrefix'`
2556
+ * - `'nameSuffix'`
2557
+ * - `'nickname'`
2558
+ * - `'organizationName'`
2559
+ * - `'postalCode'`
2560
+ * - `'streetAddressLine1'`
2561
+ * - `'streetAddressLine2'`
2562
+ * - `'sublocality'`
2563
+ * - `'telephoneNumber'`
2564
+ * - `'username'`
2565
+ * - `'password'`
2566
+ * - `'newPassword'`
2567
+ * - `'oneTimeCode'`
2568
+ * - `'birthdate'` (iOS 17+)
2569
+ * - `'birthdateDay'` (iOS 17+)
2570
+ * - `'birthdateMonth'` (iOS 17+)
2571
+ * - `'birthdateYear'` (iOS 17+)
2572
+ * - `'cellularEID'` (iOS 17.4+)
2573
+ * - `'cellularIMEI'` (iOS 17.4+)
2574
+ * - `'dateTime'` (iOS 15+)
2575
+ * - `'flightNumber'` (iOS 15+)
2576
+ * - `'shipmentTrackingNumber'` (iOS 15+)
2577
+ *
2578
+ */
2579
+ textContentType?:
2580
+ | 'none'
2581
+ | 'URL'
2582
+ | 'addressCity'
2583
+ | 'addressCityAndState'
2584
+ | 'addressState'
2585
+ | 'countryName'
2586
+ | 'creditCardNumber'
2587
+ | 'creditCardExpiration'
2588
+ | 'creditCardExpirationMonth'
2589
+ | 'creditCardExpirationYear'
2590
+ | 'creditCardSecurityCode'
2591
+ | 'creditCardType'
2592
+ | 'creditCardName'
2593
+ | 'creditCardGivenName'
2594
+ | 'creditCardMiddleName'
2595
+ | 'creditCardFamilyName'
2596
+ | 'emailAddress'
2597
+ | 'familyName'
2598
+ | 'fullStreetAddress'
2599
+ | 'givenName'
2600
+ | 'jobTitle'
2601
+ | 'location'
2602
+ | 'middleName'
2603
+ | 'name'
2604
+ | 'namePrefix'
2605
+ | 'nameSuffix'
2606
+ | 'nickname'
2607
+ | 'organizationName'
2608
+ | 'postalCode'
2609
+ | 'streetAddressLine1'
2610
+ | 'streetAddressLine2'
2611
+ | 'sublocality'
2612
+ | 'telephoneNumber'
2613
+ | 'username'
2614
+ | 'password'
2615
+ | 'newPassword'
2616
+ | 'oneTimeCode'
2617
+ | 'birthdate'
2618
+ | 'birthdateDay'
2619
+ | 'birthdateMonth'
2620
+ | 'birthdateYear'
2621
+ | 'cellularEID'
2622
+ | 'cellularIMEI'
2623
+ | 'dateTime'
2624
+ | 'flightNumber'
2625
+ | 'shipmentTrackingNumber'
2626
+ | undefined
2627
+
2628
+ /**
2629
+ * If false, scrolling of the text view will be disabled. The default value is true. Only works with multiline={true}
2630
+ */
2631
+ scrollEnabled?: boolean | undefined
2632
+
2633
+ /**
2634
+ * Set line break strategy on iOS.
2635
+ */
2636
+ lineBreakStrategyIOS?: 'none' | 'standard' | 'hangul-word' | 'push-out' | undefined
2637
+
2638
+ /**
2639
+ * Set line break mode on iOS.
2640
+ * @platform ios
2641
+ */
2642
+ lineBreakModeIOS?:
2643
+ | 'wordWrapping'
2644
+ | 'char'
2645
+ | 'clip'
2646
+ | 'head'
2647
+ | 'middle'
2648
+ | 'tail'
2649
+ | undefined
2650
+
2651
+ /**
2652
+ * If `false`, the iOS system will not insert an extra space after a paste operation
2653
+ * neither delete one or two spaces after a cut or delete operation.
2654
+ *
2655
+ * The default value is `true`.
2656
+ */
2657
+ smartInsertDelete?: boolean | undefined
2658
+ }
2659
+
2660
+ export type TextInputKeyPressEvent = NativeSyntheticEvent<TextInputKeyPressEventData>
2661
+
2662
+ export interface TextInputKeyPressEventData {
2663
+ key: string
2664
+ }
2665
+
2666
+ export interface TextInputProps
2667
+ extends ViewProps, TextInputIOSProps, TextInputAndroidProps, AccessibilityProps {
2668
+ /**
2669
+ * Specifies whether fonts should scale to respect Text Size accessibility settings.
2670
+ * The default is `true`.
2671
+ */
2672
+ allowFontScaling?: boolean | undefined
2673
+
2674
+ /**
2675
+ * Can tell TextInput to automatically capitalize certain characters.
2676
+ * characters: all characters,
2677
+ * words: first letter of each word
2678
+ * sentences: first letter of each sentence (default)
2679
+ * none: don't auto capitalize anything
2680
+ *
2681
+ * https://reactnative.dev/docs/textinput#autocapitalize
2682
+ */
2683
+ autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters' | undefined
2684
+
2685
+ /**
2686
+ * Specifies autocomplete hints for the system, so it can provide autofill.
2687
+ * On Android, the system will always attempt to offer autofill by using heuristics to identify the type of content.
2688
+ * To disable autocomplete, set autoComplete to off.
2689
+ *
2690
+ * The following values work across platforms:
2691
+ *
2692
+ * - `additional-name`
2693
+ * - `address-line1`
2694
+ * - `address-line2`
2695
+ * - `cc-number`
2696
+ * - `country`
2697
+ * - `current-password`
2698
+ * - `email`
2699
+ * - `family-name`
2700
+ * - `given-name`
2701
+ * - `honorific-prefix`
2702
+ * - `honorific-suffix`
2703
+ * - `name`
2704
+ * - `new-password`
2705
+ * - `off`
2706
+ * - `one-time-code`
2707
+ * - `postal-code`
2708
+ * - `street-address`
2709
+ * - `tel`
2710
+ * - `username`
2711
+ *
2712
+ * The following values work on iOS only:
2713
+ *
2714
+ * - `nickname`
2715
+ * - `organization`
2716
+ * - `organization-title`
2717
+ * - `url`
2718
+ *
2719
+ * The following values work on Android only:
2720
+ *
2721
+ * - `birthdate-day`
2722
+ * - `birthdate-full`
2723
+ * - `birthdate-month`
2724
+ * - `birthdate-year`
2725
+ * - `cc-csc`
2726
+ * - `cc-exp`
2727
+ * - `cc-exp-day`
2728
+ * - `cc-exp-month`
2729
+ * - `cc-exp-year`
2730
+ * - `2fa-app-otp`
2731
+ * - `email-otp`
2732
+ * - `flight-confirmation-code`
2733
+ * - `flight-number`
2734
+ * - `gender`
2735
+ * - `gift-card-number`
2736
+ * - `gift-card-pin`
2737
+ * - `loyalty-account-number`
2738
+ * - `name-family`
2739
+ * - `name-given`
2740
+ * - `name-middle`
2741
+ * - `name-middle-initial`
2742
+ * - `name-prefix`
2743
+ * - `name-suffix`
2744
+ * - `password`
2745
+ * - `password-new`
2746
+ * - `postal-address`
2747
+ * - `postal-address-country`
2748
+ * - `postal-address-dependent-locality`
2749
+ * - `postal-address-extended`
2750
+ * - `postal-address-extended-postal-code`
2751
+ * - `postal-address-locality`
2752
+ * - `postal-address-region`
2753
+ * - `postal-address-unit`
2754
+ * - `promo-code`
2755
+ * - `sms-otp`
2756
+ * - `tel-country-code`
2757
+ * - `tel-national`
2758
+ * - `tel-device`
2759
+ * - `upi-vpa`
2760
+ * - `wifi-password`
2761
+ * - `username-new`
2762
+ */
2763
+ autoComplete?:
2764
+ | '2fa-app-otp'
2765
+ | 'additional-name'
2766
+ | 'address-line1'
2767
+ | 'address-line2'
2768
+ | 'birthdate-day'
2769
+ | 'birthdate-full'
2770
+ | 'birthdate-month'
2771
+ | 'birthdate-year'
2772
+ | 'cc-csc'
2773
+ | 'cc-exp'
2774
+ | 'cc-exp-day'
2775
+ | 'cc-exp-month'
2776
+ | 'cc-exp-year'
2777
+ | 'cc-number'
2778
+ | 'cc-name'
2779
+ | 'cc-given-name'
2780
+ | 'cc-middle-name'
2781
+ | 'cc-family-name'
2782
+ | 'cc-type'
2783
+ | 'country'
2784
+ | 'current-password'
2785
+ | 'email'
2786
+ | 'email-otp'
2787
+ | 'flight-confirmation-code'
2788
+ | 'flight-number'
2789
+ | 'family-name'
2790
+ | 'gender'
2791
+ | 'gift-card-number'
2792
+ | 'gift-card-pin'
2793
+ | 'given-name'
2794
+ | 'honorific-prefix'
2795
+ | 'honorific-suffix'
2796
+ | 'loyalty-account-number'
2797
+ | 'name'
2798
+ | 'name-family'
2799
+ | 'name-given'
2800
+ | 'name-middle'
2801
+ | 'name-middle-initial'
2802
+ | 'name-prefix'
2803
+ | 'name-suffix'
2804
+ | 'new-password'
2805
+ | 'nickname'
2806
+ | 'one-time-code'
2807
+ | 'organization'
2808
+ | 'organization-title'
2809
+ | 'password'
2810
+ | 'password-new'
2811
+ | 'postal-address'
2812
+ | 'postal-address-country'
2813
+ | 'postal-address-dependent-locality'
2814
+ | 'postal-address-extended'
2815
+ | 'postal-address-extended-postal-code'
2816
+ | 'postal-address-locality'
2817
+ | 'postal-address-region'
2818
+ | 'postal-address-unit'
2819
+ | 'postal-code'
2820
+ | 'promo-code'
2821
+ | 'street-address'
2822
+ | 'sms-otp'
2823
+ | 'tel'
2824
+ | 'tel-country-code'
2825
+ | 'tel-national'
2826
+ | 'tel-device'
2827
+ | 'upi-vpa'
2828
+ | 'url'
2829
+ | 'wifi-password'
2830
+ | 'username'
2831
+ | 'username-new'
2832
+ | 'off'
2833
+ | undefined
2834
+
2835
+ /**
2836
+ * If false, disables auto-correct.
2837
+ * The default value is true.
2838
+ */
2839
+ autoCorrect?: boolean | undefined
2840
+
2841
+ /**
2842
+ * If true, focuses the input on componentDidMount.
2843
+ * The default value is false.
2844
+ */
2845
+ autoFocus?: boolean | undefined
2846
+
2847
+ /**
2848
+ * If `true`, the text field will blur when submitted.
2849
+ * The default value is true for single-line fields and false for
2850
+ * multiline fields. Note that for multiline fields, setting `blurOnSubmit`
2851
+ * to `true` means that pressing return will blur the field and trigger the
2852
+ * `onSubmitEditing` event instead of inserting a newline into the field.
2853
+ *
2854
+ * @deprecated
2855
+ * Note that `submitBehavior` now takes the place of `blurOnSubmit` and will
2856
+ * override any behavior defined by `blurOnSubmit`.
2857
+ * @see submitBehavior
2858
+ */
2859
+ blurOnSubmit?: boolean | undefined
2860
+
2861
+ /**
2862
+ * When the return key is pressed,
2863
+ *
2864
+ * For single line inputs:
2865
+ *
2866
+ * - `'newline`' defaults to `'blurAndSubmit'`
2867
+ * - `undefined` defaults to `'blurAndSubmit'`
2868
+ *
2869
+ * For multiline inputs:
2870
+ *
2871
+ * - `'newline'` adds a newline
2872
+ * - `undefined` defaults to `'newline'`
2873
+ *
2874
+ * For both single line and multiline inputs:
2875
+ *
2876
+ * - `'submit'` will only send a submit event and not blur the input
2877
+ * - `'blurAndSubmit`' will both blur the input and send a submit event
2878
+ */
2879
+ submitBehavior?: SubmitBehavior | undefined
2880
+
2881
+ /**
2882
+ * If true, caret is hidden. The default value is false.
2883
+ */
2884
+ caretHidden?: boolean | undefined
2885
+
2886
+ /**
2887
+ * If true, context menu is hidden. The default value is false.
2888
+ */
2889
+ contextMenuHidden?: boolean | undefined
2890
+
2891
+ /**
2892
+ * Provides an initial value that will change when the user starts typing.
2893
+ * Useful for simple use-cases where you don't want to deal with listening to events
2894
+ * and updating the value prop to keep the controlled state in sync.
2895
+ */
2896
+ defaultValue?: string | undefined
2897
+
2898
+ /**
2899
+ * If false, text is not editable. The default value is true.
2900
+ */
2901
+ editable?: boolean | undefined
2902
+
2903
+ /**
2904
+ * enum("default", 'numeric', 'email-address', "ascii-capable", 'numbers-and-punctuation', 'url', 'number-pad', 'phone-pad', 'name-phone-pad',
2905
+ * 'decimal-pad', 'twitter', 'web-search', 'visible-password')
2906
+ * Determines which keyboard to open, e.g.numeric.
2907
+ * The following values work across platforms: - default - numeric - email-address - phone-pad
2908
+ * The following values work on iOS: - ascii-capable - numbers-and-punctuation - url - number-pad - name-phone-pad - decimal-pad - twitter - web-search
2909
+ * The following values work on Android: - visible-password
2910
+ */
2911
+ keyboardType?: KeyboardTypeOptions | undefined
2912
+
2913
+ /**
2914
+ * Works like the inputmode attribute in HTML, it determines which keyboard to open, e.g. numeric and has precedence over keyboardType.
2915
+ */
2916
+ inputMode?: InputModeOptions | undefined
2917
+
2918
+ /**
2919
+ * Limits the maximum number of characters that can be entered.
2920
+ * Use this instead of implementing the logic in JS to avoid flicker.
2921
+ */
2922
+ maxLength?: number | undefined
2923
+
2924
+ /**
2925
+ * If true, the text input can be multiple lines. The default value is false.
2926
+ */
2927
+ multiline?: boolean | undefined
2928
+
2929
+ /**
2930
+ * Callback that is called when the text input is blurred
2931
+ *
2932
+ * Note: If you are trying to find the last value of TextInput, you can use the `onEndEditing`
2933
+ * event, which is fired upon completion of editing.
2934
+ */
2935
+ onBlur?: ((e: BlurEvent) => void) | undefined
2936
+
2937
+ /**
2938
+ * Callback that is called when the text input's text changes.
2939
+ */
2940
+ onChange?: ((e: TextInputChangeEvent) => void) | undefined
2941
+
2942
+ /**
2943
+ * Callback that is called when the text input's text changes.
2944
+ * Changed text is passed as an argument to the callback handler.
2945
+ */
2946
+ onChangeText?: ((text: string) => void) | undefined
2947
+
2948
+ /**
2949
+ * Callback that is called when the text input's content size changes.
2950
+ * This will be called with
2951
+ * `{ nativeEvent: { contentSize: { width, height } } }`.
2952
+ *
2953
+ * Only called for multiline text inputs.
2954
+ */
2955
+ onContentSizeChange?: ((e: TextInputContentSizeChangeEvent) => void) | undefined
2956
+
2957
+ /**
2958
+ * Callback that is called when text input ends.
2959
+ */
2960
+ onEndEditing?: ((e: TextInputEndEditingEvent) => void) | undefined
2961
+
2962
+ /**
2963
+ * Called when a single tap gesture is detected.
2964
+ */
2965
+ onPress?: ((e: NativeSyntheticEvent<NativeTouchEvent>) => void) | undefined
2966
+
2967
+ /**
2968
+ * Callback that is called when a touch is engaged.
2969
+ */
2970
+ onPressIn?: ((e: NativeSyntheticEvent<NativeTouchEvent>) => void) | undefined
2971
+
2972
+ /**
2973
+ * Callback that is called when a touch is released.
2974
+ */
2975
+ onPressOut?: ((e: NativeSyntheticEvent<NativeTouchEvent>) => void) | undefined
2976
+
2977
+ /**
2978
+ * Callback that is called when the text input is focused
2979
+ */
2980
+ onFocus?: ((e: FocusEvent) => void) | undefined
2981
+
2982
+ /**
2983
+ * Callback that is called when the text input selection is changed.
2984
+ */
2985
+ onSelectionChange?: ((e: TextInputSelectionChangeEvent) => void) | undefined
2986
+
2987
+ /**
2988
+ * Callback that is called when the text input's submit button is pressed.
2989
+ */
2990
+ onSubmitEditing?: ((e: TextInputSubmitEditingEvent) => void) | undefined
2991
+
2992
+ /**
2993
+ * Invoked on content scroll with
2994
+ * `{ nativeEvent: { contentOffset: { x, y } } }`.
2995
+ *
2996
+ * May also contain other properties from ScrollEvent but on Android contentSize is not provided for performance reasons.
2997
+ */
2998
+ onScroll?: ((e: TextInputScrollEvent) => void) | undefined
2999
+
3000
+ /**
3001
+ * Callback that is called when a key is pressed.
3002
+ * This will be called with
3003
+ * `{ nativeEvent: { key: keyValue } }`
3004
+ * where keyValue is 'Enter' or 'Backspace' for respective keys and the typed-in character otherwise including ' ' for space.
3005
+ *
3006
+ * Fires before onChange callbacks.
3007
+ * Note: on Android only the inputs from soft keyboard are handled, not the hardware keyboard inputs.
3008
+ */
3009
+ onKeyPress?: ((e: TextInputKeyPressEvent) => void) | undefined
3010
+
3011
+ /**
3012
+ * The string that will be rendered before text input has been entered
3013
+ */
3014
+ placeholder?: string | undefined
3015
+
3016
+ /**
3017
+ * The text color of the placeholder string
3018
+ */
3019
+ placeholderTextColor?: ColorValue | undefined
3020
+
3021
+ /**
3022
+ * If `true`, text is not editable. The default value is `false`.
3023
+ */
3024
+ readOnly?: boolean | undefined
3025
+
3026
+ /**
3027
+ * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call')
3028
+ * Determines how the return key should look.
3029
+ */
3030
+ returnKeyType?: ReturnKeyTypeOptions | undefined
3031
+
3032
+ /**
3033
+ * Determines what text should be shown to the return key on virtual keyboards.
3034
+ * Has precedence over the returnKeyType prop.
3035
+ */
3036
+ enterKeyHint?: EnterKeyHintTypeOptions | undefined
3037
+
3038
+ /**
3039
+ * If true, the text input obscures the text entered so that sensitive text like passwords stay secure.
3040
+ * The default value is false.
3041
+ */
3042
+ secureTextEntry?: boolean | undefined
3043
+
3044
+ /**
3045
+ * If true, all text will automatically be selected on focus
3046
+ */
3047
+ selectTextOnFocus?: boolean | undefined
3048
+
3049
+ /**
3050
+ * The start and end of the text input's selection. Set start and end to
3051
+ * the same value to position the cursor.
3052
+ */
3053
+ selection?: { start: number; end?: number | undefined } | undefined
3054
+
3055
+ /**
3056
+ * The highlight (and cursor on ios) color of the text input
3057
+ */
3058
+ selectionColor?: ColorValue | undefined
3059
+
3060
+ /**
3061
+ * Styles
3062
+ */
3063
+ style?: StyleProp<TextStyle> | undefined
3064
+
3065
+ /**
3066
+ * Align the input text to the left, center, or right sides of the input field.
3067
+ */
3068
+ textAlign?: 'left' | 'center' | 'right' | undefined
3069
+
3070
+ /**
3071
+ * Used to locate this view in end-to-end tests
3072
+ */
3073
+ testID?: string | undefined
3074
+
3075
+ /**
3076
+ * Used to connect to an InputAccessoryView. Not part of react-natives documentation, but present in examples and
3077
+ * code.
3078
+ * See https://reactnative.dev/docs/inputaccessoryview for more information.
3079
+ */
3080
+ inputAccessoryViewID?: string | undefined
3081
+
3082
+ /**
3083
+ * An optional label that overrides the default input accessory view button label.
3084
+ * @platform ios
3085
+ */
3086
+ inputAccessoryViewButtonLabel?: string | undefined
3087
+
3088
+ /**
3089
+ * The value to show for the text input. TextInput is a controlled component,
3090
+ * which means the native value will be forced to match this value prop if provided.
3091
+ * For most uses this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same.
3092
+ * In addition to simply setting the same value, either set editable={false},
3093
+ * or set/update maxLength to prevent unwanted edits without flicker.
3094
+ */
3095
+ value?: string | undefined
3096
+
3097
+ /**
3098
+ * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:
3099
+ * - null/undefined (default): inherit from the parent node or the global default (0)
3100
+ * - 0: no max, ignore parent/global default
3101
+ * - >= 1: sets the maxFontSizeMultiplier of this node to this value
3102
+ */
3103
+ maxFontSizeMultiplier?: number | null | undefined
3104
+ }
3105
+
3106
+ export type TextInputScrollEvent = NativeSyntheticEvent<TextInputScrollEventData>
3107
+
3108
+ export interface TextInputScrollEventData {
3109
+ contentOffset: { x: number; y: number }
3110
+ }
3111
+
3112
+ export type TextInputSelectionChangeEvent =
3113
+ NativeSyntheticEvent<TextInputSelectionChangeEventData>
3114
+
3115
+ export interface TextInputSelectionChangeEventData extends TargetedEvent {
3116
+ selection: {
3117
+ start: number
3118
+ end: number
3119
+ }
3120
+ }
3121
+
3122
+ export interface TextInputState {
3123
+ /**
3124
+ * @deprecated Use currentlyFocusedInput
3125
+ * Returns the ID of the currently focused text field, if one exists
3126
+ * If no text field is focused it returns null
3127
+ */
3128
+ currentlyFocusedField(): number
3129
+
3130
+ /**
3131
+ * Returns the ref of the currently focused text field, if one exists
3132
+ * If no text field is focused it returns null
3133
+ */
3134
+ currentlyFocusedInput(): HostInstance
3135
+
3136
+ /**
3137
+ * @param textField ref of the text field to focus
3138
+ * Focuses the specified text field
3139
+ * noop if the text field was already focused
3140
+ */
3141
+ focusTextInput(textField?: HostInstance): void
3142
+
3143
+ /**
3144
+ * @param textField ref of the text field to focus
3145
+ * Unfocuses the specified text field
3146
+ * noop if it wasn't focused
3147
+ */
3148
+ blurTextInput(textField?: HostInstance): void
3149
+ }
3150
+
3151
+ export type TextInputSubmitEditingEvent =
3152
+ NativeSyntheticEvent<TextInputSubmitEditingEventData>
3153
+
3154
+ export interface TextInputSubmitEditingEventData {
3155
+ text: string
3156
+ }
3157
+
3158
+ export type TextLayoutEvent = NativeSyntheticEvent<TextLayoutEventData>
3159
+
3160
+ export interface TextLayoutEventData extends TargetedEvent {
3161
+ lines: TextLayoutLine[]
3162
+ }
3163
+
3164
+ export interface TextLayoutLine {
3165
+ ascender: number
3166
+ capHeight: number
3167
+ descender: number
3168
+ height: number
3169
+ text: string
3170
+ width: number
3171
+ x: number
3172
+ xHeight: number
3173
+ y: number
3174
+ }
3175
+
3176
+ export interface TextProps extends TextPropsIOS, TextPropsAndroid, AccessibilityProps {
3177
+ /**
3178
+ * Specifies whether fonts should scale to respect Text Size accessibility settings.
3179
+ * The default is `true`.
3180
+ */
3181
+ allowFontScaling?: boolean | undefined
3182
+
3183
+ children?: React.ReactNode | undefined
3184
+
3185
+ /**
3186
+ * This can be one of the following values:
3187
+ *
3188
+ * - `head` - The line is displayed so that the end fits in the container and the missing text
3189
+ * at the beginning of the line is indicated by an ellipsis glyph. e.g., "...wxyz"
3190
+ * - `middle` - The line is displayed so that the beginning and end fit in the container and the
3191
+ * missing text in the middle is indicated by an ellipsis glyph. "ab...yz"
3192
+ * - `tail` - The line is displayed so that the beginning fits in the container and the
3193
+ * missing text at the end of the line is indicated by an ellipsis glyph. e.g., "abcd..."
3194
+ * - `clip` - Lines are not drawn past the edge of the text container.
3195
+ *
3196
+ * The default is `tail`.
3197
+ *
3198
+ * `numberOfLines` must be set in conjunction with this prop.
3199
+ *
3200
+ * > `clip` is working only for iOS
3201
+ */
3202
+ ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined
3203
+
3204
+ /**
3205
+ * Used to reference react managed views from native code.
3206
+ */
3207
+ id?: string | undefined
3208
+
3209
+ /**
3210
+ * Line Break mode. Works only with numberOfLines.
3211
+ * clip is working only for iOS
3212
+ */
3213
+ lineBreakMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined
3214
+
3215
+ /**
3216
+ * Used to truncate the text with an ellipsis after computing the text
3217
+ * layout, including line wrapping, such that the total number of lines
3218
+ * does not exceed this number.
3219
+ *
3220
+ * This prop is commonly used with `ellipsizeMode`.
3221
+ */
3222
+ numberOfLines?: number | undefined
3223
+
3224
+ /**
3225
+ * Invoked on mount and layout changes with
3226
+ *
3227
+ * {nativeEvent: { layout: {x, y, width, height}}}.
3228
+ */
3229
+ onLayout?: ((event: LayoutChangeEvent) => void) | undefined
3230
+
3231
+ /**
3232
+ * Invoked on Text layout
3233
+ */
3234
+ onTextLayout?: ((event: TextLayoutEvent) => void) | undefined
3235
+
3236
+ /**
3237
+ * This function is called on press.
3238
+ * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting).
3239
+ */
3240
+ onPress?: ((event: GestureResponderEvent) => void) | undefined
3241
+
3242
+ onPressIn?: ((event: GestureResponderEvent) => void) | undefined
3243
+ onPressOut?: ((event: GestureResponderEvent) => void) | undefined
3244
+
3245
+ /**
3246
+ * This function is called on long press.
3247
+ * e.g., `onLongPress={this.increaseSize}>`
3248
+ */
3249
+ onLongPress?: ((event: GestureResponderEvent) => void) | undefined
3250
+
3251
+ /**
3252
+ * @see https://reactnative.dev/docs/text#style
3253
+ */
3254
+ style?: StyleProp<TextStyle> | undefined
3255
+
3256
+ /**
3257
+ * Used to locate this view in end-to-end tests.
3258
+ */
3259
+ testID?: string | undefined
3260
+
3261
+ /**
3262
+ * Used to reference react managed views from native code.
3263
+ */
3264
+ nativeID?: string | undefined
3265
+
3266
+ /**
3267
+ * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:
3268
+ * - null/undefined (default): inherit from the parent node or the global default (0)
3269
+ * - 0: no max, ignore parent/global default
3270
+ * - >= 1: sets the maxFontSizeMultiplier of this node to this value
3271
+ */
3272
+ maxFontSizeMultiplier?: number | null | undefined
3273
+
3274
+ /**
3275
+ * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).
3276
+ */
3277
+ minimumFontScale?: number | undefined
3278
+
3279
+ /**
3280
+ * Controls how touch events are handled. Similar to `View`'s `pointerEvents`.
3281
+ */
3282
+ pointerEvents?: ViewStyle['pointerEvents'] | undefined
3283
+
3284
+ /**
3285
+ * Defines how far your touch may move off of the button, before deactivating the button.
3286
+ */
3287
+ pressRetentionOffset?:
3288
+ | { top: number; left: number; bottom: number; right: number }
3289
+ | undefined
3290
+ }
3291
+
3292
+ export interface TextPropsAndroid {
3293
+ /**
3294
+ * Specifies the disabled state of the text view for testing purposes.
3295
+ */
3296
+ disabled?: boolean | undefined
3297
+
3298
+ /**
3299
+ * Lets the user select text, to use the native copy and paste functionality.
3300
+ */
3301
+ selectable?: boolean | undefined
3302
+
3303
+ /**
3304
+ * The highlight color of the text.
3305
+ */
3306
+ selectionColor?: ColorValue | undefined
3307
+
3308
+ /**
3309
+ * Set text break strategy on Android API Level 23+
3310
+ * default is `highQuality`.
3311
+ */
3312
+ textBreakStrategy?: 'simple' | 'highQuality' | 'balanced' | undefined
3313
+
3314
+ /**
3315
+ * Determines the types of data converted to clickable URLs in the text element.
3316
+ * By default no data types are detected.
3317
+ */
3318
+ dataDetectorType?: null | 'phoneNumber' | 'link' | 'email' | 'none' | 'all' | undefined
3319
+
3320
+ /**
3321
+ * Hyphenation strategy
3322
+ */
3323
+ android_hyphenationFrequency?: 'normal' | 'none' | 'full' | undefined
3324
+ }
3325
+
3326
+ export interface TextPropsIOS {
3327
+ /**
3328
+ * Specifies whether font should be scaled down automatically to fit given style constraints.
3329
+ */
3330
+ adjustsFontSizeToFit?: boolean | undefined
3331
+
3332
+ /**
3333
+ * The Dynamic Type scale ramp to apply to this element on iOS.
3334
+ */
3335
+ dynamicTypeRamp?:
3336
+ | 'caption2'
3337
+ | 'caption1'
3338
+ | 'footnote'
3339
+ | 'subheadline'
3340
+ | 'callout'
3341
+ | 'body'
3342
+ | 'headline'
3343
+ | 'title3'
3344
+ | 'title2'
3345
+ | 'title1'
3346
+ | 'largeTitle'
3347
+ | undefined
3348
+
3349
+ /**
3350
+ * When `true`, no visual change is made when text is pressed down. By
3351
+ * default, a gray oval highlights the text on press down.
3352
+ */
3353
+ suppressHighlighting?: boolean | undefined
3354
+
3355
+ /**
3356
+ * Set line break strategy on iOS.
3357
+ */
3358
+ lineBreakStrategyIOS?: 'none' | 'standard' | 'hangul-word' | 'push-out' | undefined
3359
+ }
3360
+
3361
+ export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle {
3362
+ color?: ColorValue | undefined
3363
+ fontFamily?: string | undefined
3364
+ fontSize?: number | undefined
3365
+ fontStyle?: 'normal' | 'italic' | undefined
3366
+ /**
3367
+ * Specifies font weight. The values 'normal' and 'bold' are supported
3368
+ * for most fonts. Not all fonts have a variant for each of the numeric
3369
+ * values, in that case the closest one is chosen.
3370
+ */
3371
+ fontWeight?:
3372
+ | 'normal'
3373
+ | 'bold'
3374
+ | '100'
3375
+ | '200'
3376
+ | '300'
3377
+ | '400'
3378
+ | '500'
3379
+ | '600'
3380
+ | '700'
3381
+ | '800'
3382
+ | '900'
3383
+ | 100
3384
+ | 200
3385
+ | 300
3386
+ | 400
3387
+ | 500
3388
+ | 600
3389
+ | 700
3390
+ | 800
3391
+ | 900
3392
+ | 'ultralight'
3393
+ | 'thin'
3394
+ | 'light'
3395
+ | 'medium'
3396
+ | 'regular'
3397
+ | 'semibold'
3398
+ | 'condensedBold'
3399
+ | 'condensed'
3400
+ | 'heavy'
3401
+ | 'black'
3402
+ | undefined
3403
+ letterSpacing?: number | undefined
3404
+ lineHeight?: number | undefined
3405
+ textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | undefined
3406
+ textDecorationLine?:
3407
+ | 'none'
3408
+ | 'underline'
3409
+ | 'line-through'
3410
+ | 'underline line-through'
3411
+ | undefined
3412
+ textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed' | undefined
3413
+ textDecorationColor?: ColorValue | undefined
3414
+ textShadowColor?: ColorValue | undefined
3415
+ textShadowOffset?: { width: number; height: number } | undefined
3416
+ textShadowRadius?: number | undefined
3417
+ textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase' | undefined
3418
+ userSelect?: 'auto' | 'none' | 'text' | 'contain' | 'all' | undefined
3419
+ }
3420
+
3421
+ export interface TextStyleAndroid extends ViewStyle {
3422
+ textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | undefined
3423
+ verticalAlign?: 'auto' | 'top' | 'bottom' | 'middle' | undefined
3424
+ includeFontPadding?: boolean | undefined
3425
+ }
3426
+
3427
+ export interface TextStyleIOS extends ViewStyle {
3428
+ fontVariant?: FontVariant[] | undefined
3429
+ textDecorationColor?: ColorValue | undefined
3430
+ textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed' | undefined
3431
+ writingDirection?: 'auto' | 'ltr' | 'rtl' | undefined
3432
+ }
3433
+
3434
+ export interface TimerMixin {
3435
+ setTimeout: typeof setTimeout
3436
+ clearTimeout: typeof clearTimeout
3437
+ setInterval: typeof setInterval
3438
+ clearInterval: typeof clearInterval
3439
+ setImmediate: typeof setImmediate
3440
+ clearImmediate: typeof clearImmediate
3441
+ requestAnimationFrame: typeof requestAnimationFrame
3442
+ cancelAnimationFrame: typeof cancelAnimationFrame
3443
+ }
3444
+
3445
+ export interface Touchable {
3446
+ onTouchStart?: ((event: GestureResponderEvent) => void) | undefined
3447
+ onTouchMove?: ((event: GestureResponderEvent) => void) | undefined
3448
+ onTouchEnd?: ((event: GestureResponderEvent) => void) | undefined
3449
+ onTouchCancel?: ((event: GestureResponderEvent) => void) | undefined
3450
+ onTouchEndCapture?: ((event: GestureResponderEvent) => void) | undefined
3451
+ }
3452
+
3453
+ export interface TransformsStyle {
3454
+ transform?:
3455
+ | Readonly<
3456
+ MaximumOneOf<
3457
+ PerspectiveTransform &
3458
+ RotateTransform &
3459
+ RotateXTransform &
3460
+ RotateYTransform &
3461
+ RotateZTransform &
3462
+ ScaleTransform &
3463
+ ScaleXTransform &
3464
+ ScaleYTransform &
3465
+ TranslateXTransform &
3466
+ TranslateYTransform &
3467
+ SkewXTransform &
3468
+ SkewYTransform &
3469
+ MatrixTransform
3470
+ >[]
3471
+ >
3472
+ | string
3473
+ | undefined
3474
+ transformOrigin?: Array<string | number> | string | undefined
3475
+
3476
+ /**
3477
+ * @deprecated Use matrix in transform prop instead.
3478
+ */
3479
+ transformMatrix?: Array<number> | undefined
3480
+ /**
3481
+ * @deprecated Use rotate in transform prop instead.
3482
+ */
3483
+ rotation?: AnimatableNumericValue | undefined
3484
+ /**
3485
+ * @deprecated Use scaleX in transform prop instead.
3486
+ */
3487
+ scaleX?: AnimatableNumericValue | undefined
3488
+ /**
3489
+ * @deprecated Use scaleY in transform prop instead.
3490
+ */
3491
+ scaleY?: AnimatableNumericValue | undefined
3492
+ /**
3493
+ * @deprecated Use translateX in transform prop instead.
3494
+ */
3495
+ translateX?: AnimatableNumericValue | undefined
3496
+ /**
3497
+ * @deprecated Use translateY in transform prop instead.
3498
+ */
3499
+ translateY?: AnimatableNumericValue | undefined
3500
+ }
3501
+
3502
+ export interface TranslateXTransform {
3503
+ translateX: AnimatableNumericValue | `${number}%`
3504
+ }
3505
+
3506
+ export interface TranslateYTransform {
3507
+ translateY: AnimatableNumericValue | `${number}%`
3508
+ }
3509
+
3510
+ export interface TVViewPropsIOS {
3511
+ /**
3512
+ * *(Apple TV only)* When set to true, this view will be focusable
3513
+ * and navigable using the Apple TV remote.
3514
+ *
3515
+ * @platform ios
3516
+ */
3517
+ isTVSelectable?: boolean | undefined
3518
+
3519
+ /**
3520
+ * *(Apple TV only)* May be set to true to force the Apple TV focus engine to move focus to this view.
3521
+ *
3522
+ * @platform ios
3523
+ * @deprecated Use `focusable` instead
3524
+ */
3525
+ hasTVPreferredFocus?: boolean | undefined
3526
+
3527
+ /**
3528
+ * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0.
3529
+ *
3530
+ * @platform ios
3531
+ */
3532
+ tvParallaxShiftDistanceX?: number | undefined
3533
+
3534
+ /**
3535
+ * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0.
3536
+ *
3537
+ * @platform ios
3538
+ */
3539
+ tvParallaxShiftDistanceY?: number | undefined
3540
+
3541
+ /**
3542
+ * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 0.05.
3543
+ *
3544
+ * @platform ios
3545
+ */
3546
+ tvParallaxTiltAngle?: number | undefined
3547
+
3548
+ /**
3549
+ * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 1.0.
3550
+ *
3551
+ * @platform ios
3552
+ */
3553
+ tvParallaxMagnification?: number | undefined
3554
+ }
3555
+
3556
+ export declare class View extends ViewBase {
3557
+ /**
3558
+ * Is 3D Touch / Force Touch available (i.e. will touch events include `force`)
3559
+ * @platform ios
3560
+ */
3561
+ static forceTouchAvailable: boolean
3562
+ }
3563
+
3564
+ export declare const ViewBase: Constructor<HostInstance> & typeof ViewComponent
3565
+
3566
+ export declare class ViewComponent extends React.Component<ViewProps> {}
3567
+
3568
+ export interface ViewProps
3569
+ extends
3570
+ ViewPropsAndroid,
3571
+ ViewPropsIOS,
3572
+ GestureResponderHandlers,
3573
+ Touchable,
3574
+ PointerEvents,
3575
+ AccessibilityProps {
3576
+ children?: React.ReactNode | undefined
3577
+ /**
3578
+ * This defines how far a touch event can start away from the view.
3579
+ * Typical interface guidelines recommend touch targets that are at least
3580
+ * 30 - 40 points/density-independent pixels. If a Touchable view has
3581
+ * a height of 20 the touchable height can be extended to 40 with
3582
+ * hitSlop={{top: 10, bottom: 10, left: 0, right: 0}}
3583
+ * NOTE The touch area never extends past the parent view bounds and
3584
+ * the Z-index of sibling views always takes precedence if a touch
3585
+ * hits two overlapping views.
3586
+ */
3587
+ hitSlop?: null | Insets | number | undefined
3588
+
3589
+ /**
3590
+ * Used to reference react managed views from native code.
3591
+ */
3592
+ id?: string | undefined
3593
+
3594
+ /**
3595
+ * Whether this view needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior.
3596
+ * The default (false) falls back to drawing the component and its children
3597
+ * with an alpha applied to the paint used to draw each element instead of rendering the full component offscreen and compositing it back with an alpha value.
3598
+ * This default may be noticeable and undesired in the case where the View you are setting an opacity on
3599
+ * has multiple overlapping elements (e.g. multiple overlapping Views, or text and a background).
3600
+ *
3601
+ * Rendering offscreen to preserve correct alpha behavior is extremely expensive
3602
+ * and hard to debug for non-native developers, which is why it is not turned on by default.
3603
+ * If you do need to enable this property for an animation,
3604
+ * consider combining it with renderToHardwareTextureAndroid if the view contents are static (i.e. it doesn't need to be redrawn each frame).
3605
+ * If that property is enabled, this View will be rendered off-screen once,
3606
+ * saved in a hardware texture, and then composited onto the screen with an alpha each frame without having to switch rendering targets on the GPU.
3607
+ */
3608
+ needsOffscreenAlphaCompositing?: boolean | undefined
3609
+
3610
+ /**
3611
+ * Invoked on mount and layout changes with
3612
+ *
3613
+ * {nativeEvent: { layout: {x, y, width, height}}}.
3614
+ */
3615
+ onLayout?: ((event: LayoutChangeEvent) => void) | undefined
3616
+
3617
+ /**
3618
+ *
3619
+ * In the absence of auto property, none is much like CSS's none value. box-none is as if you had applied the CSS class:
3620
+ *
3621
+ * .box-none {
3622
+ * pointer-events: none;
3623
+ * }
3624
+ * .box-none * {
3625
+ * pointer-events: all;
3626
+ * }
3627
+ *
3628
+ * box-only is the equivalent of
3629
+ *
3630
+ * .box-only {
3631
+ * pointer-events: all;
3632
+ * }
3633
+ * .box-only * {
3634
+ * pointer-events: none;
3635
+ * }
3636
+ *
3637
+ * But since pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes,
3638
+ * we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform.
3639
+ */
3640
+ pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined
3641
+
3642
+ /**
3643
+ *
3644
+ * This is a special performance property exposed by RCTView and is useful for scrolling content when there are many subviews,
3645
+ * most of which are offscreen. For this property to be effective, it must be applied to a view that contains many subviews that extend outside its bound.
3646
+ * The subviews must also have overflow: hidden, as should the containing view (or one of its superviews).
3647
+ */
3648
+ removeClippedSubviews?: boolean | undefined
3649
+
3650
+ style?: StyleProp<ViewStyle> | undefined
3651
+
3652
+ /**
3653
+ * Used to locate this view in end-to-end tests.
3654
+ */
3655
+ testID?: string | undefined
3656
+
3657
+ /**
3658
+ * Used to reference react managed views from native code.
3659
+ */
3660
+ nativeID?: string | undefined
3661
+
3662
+ /**
3663
+ * Views that are only used to layout their children or otherwise don't draw anything
3664
+ * may be automatically removed from the native hierarchy as an optimization.
3665
+ * Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy.
3666
+ */
3667
+ collapsable?: boolean | undefined
3668
+
3669
+ /**
3670
+ * Setting to false prevents direct children of the view from being removed
3671
+ * from the native view hierarchy, similar to the effect of setting
3672
+ * `collapsable={false}` on each child.
3673
+ */
3674
+ collapsableChildren?: boolean | undefined
3675
+ }
3676
+
3677
+ export interface ViewPropsAndroid {
3678
+ /**
3679
+ * Callback that is called when the view is blurred.
3680
+ *
3681
+ * Note: This will only be called if the view is focusable.
3682
+ */
3683
+ onBlur?: ((e: BlurEvent) => void) | null | undefined
3684
+
3685
+ /**
3686
+ * Callback that is called when the view is focused.
3687
+ *
3688
+ * Note: This will only be called if the view is focusable.
3689
+ */
3690
+ onFocus?: ((e: FocusEvent) => void) | null | undefined
3691
+
3692
+ /**
3693
+ * Whether this view should render itself (and all of its children) into a single hardware texture on the GPU.
3694
+ *
3695
+ * On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale:
3696
+ * in those cases, the view doesn't have to be redrawn and display lists don't need to be re-executed. The texture can just be
3697
+ * re-used and re-composited with different parameters. The downside is that this can use up limited video memory, so this prop should be set back to false at the end of the interaction/animation.
3698
+ */
3699
+ renderToHardwareTextureAndroid?: boolean | undefined
3700
+
3701
+ /**
3702
+ * Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
3703
+ */
3704
+ focusable?: boolean | undefined
3705
+
3706
+ /**
3707
+ * Indicates whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
3708
+ * See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
3709
+ * for more details.
3710
+ *
3711
+ * Supports the following values:
3712
+ * - 0 (View is focusable)
3713
+ * - -1 (View is not focusable)
3714
+ */
3715
+ tabIndex?: 0 | -1 | undefined
3716
+ }
3717
+
3718
+ export interface ViewPropsIOS extends TVViewPropsIOS {
3719
+ /**
3720
+ * Whether this view should be rendered as a bitmap before compositing.
3721
+ *
3722
+ * On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children;
3723
+ * for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view
3724
+ * and quickly composite it during each frame.
3725
+ *
3726
+ * Rasterization incurs an off-screen drawing pass and the bitmap consumes memory.
3727
+ * Test and measure when using this property.
3728
+ */
3729
+ shouldRasterizeIOS?: boolean | undefined
3730
+ }
3731
+
3732
+ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
3733
+ backfaceVisibility?: 'visible' | 'hidden' | undefined
3734
+ backgroundColor?: ColorValue | undefined
3735
+ borderBlockColor?: ColorValue | undefined
3736
+ borderBlockEndColor?: ColorValue | undefined
3737
+ borderBlockStartColor?: ColorValue | undefined
3738
+ borderBottomColor?: ColorValue | undefined
3739
+ borderBottomEndRadius?: AnimatableNumericValue | string | undefined
3740
+ borderBottomLeftRadius?: AnimatableNumericValue | string | undefined
3741
+ borderBottomRightRadius?: AnimatableNumericValue | string | undefined
3742
+ borderBottomStartRadius?: AnimatableNumericValue | string | undefined
3743
+ borderColor?: ColorValue | undefined
3744
+ /**
3745
+ * On iOS 13+, it is possible to change the corner curve of borders.
3746
+ * @platform ios
3747
+ */
3748
+ borderCurve?: 'circular' | 'continuous' | undefined
3749
+ borderEndColor?: ColorValue | undefined
3750
+ borderEndEndRadius?: AnimatableNumericValue | string | undefined
3751
+ borderEndStartRadius?: AnimatableNumericValue | string | undefined
3752
+ borderLeftColor?: ColorValue | undefined
3753
+ borderRadius?: AnimatableNumericValue | string | undefined
3754
+ borderRightColor?: ColorValue | undefined
3755
+ borderStartColor?: ColorValue | undefined
3756
+ borderStartEndRadius?: AnimatableNumericValue | string | undefined
3757
+ borderStartStartRadius?: AnimatableNumericValue | string | undefined
3758
+ borderStyle?: 'solid' | 'dotted' | 'dashed' | undefined
3759
+ borderTopColor?: ColorValue | undefined
3760
+ borderTopEndRadius?: AnimatableNumericValue | string | undefined
3761
+ borderTopLeftRadius?: AnimatableNumericValue | string | undefined
3762
+ borderTopRightRadius?: AnimatableNumericValue | string | undefined
3763
+ borderTopStartRadius?: AnimatableNumericValue | string | undefined
3764
+ outlineColor?: ColorValue | undefined
3765
+ outlineOffset?: AnimatableNumericValue | undefined
3766
+ outlineStyle?: 'solid' | 'dotted' | 'dashed' | undefined
3767
+ outlineWidth?: AnimatableNumericValue | undefined
3768
+ opacity?: AnimatableNumericValue | undefined
3769
+ /**
3770
+ * Sets the elevation of a view, using Android's underlying
3771
+ * [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
3772
+ * This adds a drop shadow to the item and affects z-order for overlapping views.
3773
+ * Only supported on Android 5.0+, has no effect on earlier versions.
3774
+ *
3775
+ * @platform android
3776
+ */
3777
+ elevation?: number | undefined
3778
+ /**
3779
+ * Controls whether the View can be the target of touch events.
3780
+ */
3781
+ pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined
3782
+ isolation?: 'auto' | 'isolate' | undefined
3783
+ cursor?: CursorValue | undefined
3784
+ boxShadow?: ReadonlyArray<BoxShadowValue> | string | undefined
3785
+ filter?: ReadonlyArray<FilterFunction> | string | undefined
3786
+
3787
+ mixBlendMode?: BlendMode | undefined
3788
+ experimental_backgroundImage?: ReadonlyArray<BackgroundImageValue> | string | undefined
3789
+ experimental_backgroundSize?: ReadonlyArray<BackgroundSizeValue> | string | undefined
3790
+ experimental_backgroundPosition?:
3791
+ | ReadonlyArray<BackgroundPositionValue>
3792
+ | string
3793
+ | undefined
3794
+ experimental_backgroundRepeat?:
3795
+ | ReadonlyArray<BackgroundRepeatValue>
3796
+ | string
3797
+ | undefined
3798
+ }