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