@@ -455,22 +455,33 @@ export interface TextInputAndroidProps {
455
455
}
456
456
457
457
/**
458
- * @see TextInputProps.onFocus
458
+ * @deprecated Use `TextInputFocusEvent` instead
459
459
*/
460
460
export interface TextInputFocusEventData extends TargetedEvent {
461
461
text : string ;
462
462
eventCount : number ;
463
463
}
464
464
465
465
/**
466
- * @see TextInputProps.onScroll
466
+ * @see TextInputProps.onFocus
467
+ */
468
+ export type TextInputFocusEvent = NativeSyntheticEvent < TextInputFocusEventData > ;
469
+
470
+ /**
471
+ * @deprecated Use `TextInputScrollEvent` instead
467
472
*/
468
473
export interface TextInputScrollEventData {
469
474
contentOffset : { x : number ; y : number } ;
470
475
}
471
476
472
477
/**
473
- * @see TextInputProps.onSelectionChange
478
+ * @see TextInputProps.onScroll
479
+ */
480
+ export type TextInputScrollEvent =
481
+ NativeSyntheticEvent < TextInputScrollEventData > ;
482
+
483
+ /**
484
+ * @deprecated Use `TextInputSelectionChangeEvent` instead
474
485
*/
475
486
export interface TextInputSelectionChangeEventData extends TargetedEvent {
476
487
selection : {
@@ -480,41 +491,77 @@ export interface TextInputSelectionChangeEventData extends TargetedEvent {
480
491
}
481
492
482
493
/**
483
- * @see TextInputProps.onKeyPress
494
+ * @see TextInputProps.onSelectionChange
495
+ */
496
+ export type TextInputSelectionChangeEvent =
497
+ NativeSyntheticEvent < TextInputSelectionChangeEventData > ;
498
+
499
+ /**
500
+ * @deprecated Use `TextInputKeyPressEvent` instead
484
501
*/
485
502
export interface TextInputKeyPressEventData {
486
503
key : string ;
487
504
}
488
505
489
506
/**
490
- * @see TextInputProps.onChange
507
+ * @see TextInputProps.onKeyPress
508
+ */
509
+ export type TextInputKeyPressEvent =
510
+ NativeSyntheticEvent < TextInputKeyPressEventData > ;
511
+
512
+ /**
513
+ * @deprecated Use `TextInputChangeEvent` instead
491
514
*/
492
515
export interface TextInputChangeEventData extends TargetedEvent {
493
516
eventCount : number ;
494
517
text : string ;
495
518
}
496
519
497
520
/**
498
- * @see TextInputProps.onContentSizeChange
521
+ * @see TextInputProps.onChange
522
+ */
523
+ export type TextInputChangeEvent =
524
+ NativeSyntheticEvent < TextInputChangeEventData > ;
525
+
526
+ /**
527
+ * @deprecated Use `TextInputContentSizeChangeEvent` instead
499
528
*/
500
529
export interface TextInputContentSizeChangeEventData {
501
530
contentSize : { width : number ; height : number } ;
502
531
}
503
532
504
533
/**
505
- * @see TextInputProps.onEndEditing
534
+ * @see TextInputProps.onContentSizeChange
535
+ */
536
+ export type TextInputContentSizeChangeEvent =
537
+ NativeSyntheticEvent < TextInputContentSizeChangeEventData > ;
538
+
539
+ /**
540
+ * @deprecated Use `TextInputEndEditingEvent` instead
506
541
*/
507
542
export interface TextInputEndEditingEventData {
508
543
text : string ;
509
544
}
510
545
511
546
/**
512
- * @see TextInputProps.onSubmitEditing
547
+ * @see TextInputProps.onEndEditing
548
+ */
549
+ export type TextInputEndEditingEvent =
550
+ NativeSyntheticEvent < TextInputEndEditingEventData > ;
551
+
552
+ /**
553
+ * @deprecated Use `TextInputSubmitEditingEvent` instead
513
554
*/
514
555
export interface TextInputSubmitEditingEventData {
515
556
text : string ;
516
557
}
517
558
559
+ /**
560
+ * @see TextInputProps.onSubmitEditing
561
+ */
562
+ export type TextInputSubmitEditingEvent =
563
+ NativeSyntheticEvent < TextInputSubmitEditingEventData > ;
564
+
518
565
/**
519
566
* @see https://reactnative.dev/docs/textinput#props
520
567
*/
@@ -763,16 +810,12 @@ export interface TextInputProps
763
810
/**
764
811
* Callback that is called when the text input is blurred
765
812
*/
766
- onBlur ?:
767
- | ( ( e : NativeSyntheticEvent < TextInputFocusEventData > ) => void )
768
- | undefined ;
813
+ onBlur ?: ( ( e : TextInputFocusEvent ) => void ) | undefined ;
769
814
770
815
/**
771
816
* Callback that is called when the text input's text changes.
772
817
*/
773
- onChange ?:
774
- | ( ( e : NativeSyntheticEvent < TextInputChangeEventData > ) => void )
775
- | undefined ;
818
+ onChange ?: ( ( e : TextInputChangeEvent ) => void ) | undefined ;
776
819
777
820
/**
778
821
* Callback that is called when the text input's text changes.
@@ -788,15 +831,13 @@ export interface TextInputProps
788
831
* Only called for multiline text inputs.
789
832
*/
790
833
onContentSizeChange ?:
791
- | ( ( e : NativeSyntheticEvent < TextInputContentSizeChangeEventData > ) => void )
834
+ | ( ( e : TextInputContentSizeChangeEvent ) => void )
792
835
| undefined ;
793
836
794
837
/**
795
838
* Callback that is called when text input ends.
796
839
*/
797
- onEndEditing ?:
798
- | ( ( e : NativeSyntheticEvent < TextInputEndEditingEventData > ) => void )
799
- | undefined ;
840
+ onEndEditing ?: ( ( e : TextInputEndEditingEvent ) => void ) | undefined ;
800
841
801
842
/**
802
843
* Called when a single tap gesture is detected.
@@ -818,33 +859,25 @@ export interface TextInputProps
818
859
/**
819
860
* Callback that is called when the text input is focused
820
861
*/
821
- onFocus ?:
822
- | ( ( e : NativeSyntheticEvent < TextInputFocusEventData > ) => void )
823
- | undefined ;
862
+ onFocus ?: ( ( e : TextInputFocusEvent ) => void ) | undefined ;
824
863
825
864
/**
826
865
* Callback that is called when the text input selection is changed.
827
866
*/
828
- onSelectionChange ?:
829
- | ( ( e : NativeSyntheticEvent < TextInputSelectionChangeEventData > ) => void )
830
- | undefined ;
867
+ onSelectionChange ?: ( ( e : TextInputSelectionChangeEvent ) => void ) | undefined ;
831
868
832
869
/**
833
870
* Callback that is called when the text input's submit button is pressed.
834
871
*/
835
- onSubmitEditing ?:
836
- | ( ( e : NativeSyntheticEvent < TextInputSubmitEditingEventData > ) => void )
837
- | undefined ;
872
+ onSubmitEditing ?: ( ( e : TextInputSubmitEditingEvent ) => void ) | undefined ;
838
873
839
874
/**
840
875
* Invoked on content scroll with
841
876
* `{ nativeEvent: { contentOffset: { x, y } } }`.
842
877
*
843
878
* May also contain other properties from ScrollEvent but on Android contentSize is not provided for performance reasons.
844
879
*/
845
- onScroll ?:
846
- | ( ( e : NativeSyntheticEvent < TextInputScrollEventData > ) => void )
847
- | undefined ;
880
+ onScroll ?: ( ( e : TextInputScrollEvent ) => void ) | undefined ;
848
881
849
882
/**
850
883
* Callback that is called when a key is pressed.
@@ -855,9 +888,7 @@ export interface TextInputProps
855
888
* Fires before onChange callbacks.
856
889
* Note: on Android only the inputs from soft keyboard are handled, not the hardware keyboard inputs.
857
890
*/
858
- onKeyPress ?:
859
- | ( ( e : NativeSyntheticEvent < TextInputKeyPressEventData > ) => void )
860
- | undefined ;
891
+ onKeyPress ?: ( ( e : TextInputKeyPressEvent ) => void ) | undefined ;
861
892
862
893
/**
863
894
* The string that will be rendered before text input has been entered
0 commit comments