Skip to content

Commit c082dfc

Browse files
huntiefacebook-github-bot
authored andcommitted
Remove NativeMethods exports (Strict API) (#57032)
Summary: Actions the existing/pending deprecations in the preceding diff. In our Flow source / Strict TypeScript API, the `NativeMethods` type was already deprecated (differing from D107119545). Changelog: [General][Breaking] - **Strict TypeScript API**: Remove legacy `NativeMethods` and `NativeMethodsMixin` types Differential Revision: D107129357
1 parent 5a45083 commit c082dfc

4 files changed

Lines changed: 105 additions & 116 deletions

File tree

packages/react-native/ReactNativeApi.d.ts

Lines changed: 100 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<88d962e8bf936576e85b897a4192f39a>>
7+
* @generated SignedSource<<24d69f60ce36233e1ae541c1940a7cd6>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -3256,8 +3256,6 @@ declare type NativeMeasureOnSuccessCallback = (
32563256
pageX: number,
32573257
pageY: number,
32583258
) => void
3259-
declare type NativeMethods = LegacyHostInstanceMethods
3260-
declare type NativeMethodsMixin = LegacyHostInstanceMethods
32613259
declare type NativeModeChangeEvent = {
32623260
readonly mode: Int32
32633261
readonly targetRect: {
@@ -4007,7 +4005,7 @@ declare type ReactNativeDocumentInstanceHandle = symbol & {
40074005
}
40084006
declare class ReactNativeElement_default
40094007
extends ReadOnlyElement_default
4010-
implements NativeMethods
4008+
implements LegacyHostInstanceMethods
40114009
{
40124010
blur(): void
40134011
protected constructor()
@@ -5942,23 +5940,23 @@ declare type WrapperComponentProvider = (
59425940
appParameters: Object,
59435941
) => React.ComponentType<any>
59445942
export {
5945-
AccessibilityActionEvent, // 9ead30c4
5946-
AccessibilityInfo, // f7cbfa51
5943+
AccessibilityActionEvent, // eb8d64ea
5944+
AccessibilityInfo, // 0fa92c7c
59475945
AccessibilityProps, // 5a2836fc
59485946
AccessibilityRole, // f2f2e066
59495947
AccessibilityState, // b0c2b3f7
59505948
AccessibilityValue, // cf8bcb74
59515949
ActionSheetIOS, // b558559e
59525950
ActionSheetIOSOptions, // 1756eb5a
5953-
ActivityIndicator, // 7c0fa2e8
5954-
ActivityIndicatorProps, // d3357183
5951+
ActivityIndicator, // 719c3a24
5952+
ActivityIndicatorProps, // 001bc486
59555953
Alert, // 5bf12165
59565954
AlertButton, // bf1a3b60
59575955
AlertButtonStyle, // ec9fb242
59585956
AlertOptions, // a0cdac0f
59595957
AlertType, // 5ab91217
59605958
AndroidKeyboardEvent, // e03becc8
5961-
Animated, // d3264d4b
5959+
Animated, // 40acce3d
59625960
AppConfig, // ce4209a7
59635961
AppRegistry, // 5edf0524
59645962
AppState, // 12012be5
@@ -5968,12 +5966,12 @@ export {
59685966
AutoCapitalize, // c0e857a0
59695967
BackHandler, // f139fc69
59705968
BackPressEventName, // 4620fb76
5971-
BlurEvent, // 4d39aa26
5969+
BlurEvent, // b743fd53
59725970
BoxShadowValue, // b679703f
5973-
Button, // 2a455f1c
5974-
ButtonProps, // b276cb7a
5971+
Button, // 4025e2d5
5972+
ButtonProps, // 7d1a7e1d
59755973
Clipboard, // 41addb89
5976-
CodegenTypes, // 51ca21ff
5974+
CodegenTypes, // e12367da
59775975
ColorSchemeName, // 6615edd6
59785976
ColorValue, // 98989a8f
59795977
ComponentProvider, // b5c60ddd
@@ -5989,9 +5987,9 @@ export {
59895987
DimensionsPayload, // 653bc26c
59905988
DisplayMetrics, // 1dc35cef
59915989
DisplayMetricsAndroid, // 872e62eb
5992-
DrawerLayoutAndroid, // 3939f773
5993-
DrawerLayoutAndroidProps, // ec039f19
5994-
DrawerSlideEvent, // 6a679d9c
5990+
DrawerLayoutAndroid, // b70a7dd7
5991+
DrawerLayoutAndroidProps, // 36182b8c
5992+
DrawerSlideEvent, // 8006928e
59955993
DropShadowValue, // e9df2606
59965994
DynamicColorIOS, // d96c228c
59975995
DynamicColorIOSTuple, // 023ce58e
@@ -6005,28 +6003,28 @@ export {
60056003
EventSubscription, // b8d084aa
60066004
ExtendedExceptionData, // 5a6ccf5a
60076005
FilterFunction, // bf24c0e3
6008-
FlatList, // fda604e6
6009-
FlatListProps, // 4386b761
6010-
FocusEvent, // 4fab86b8
6006+
FlatList, // 6db979fa
6007+
FlatListProps, // f1a49f9d
6008+
FocusEvent, // af103409
60116009
FontVariant, // 7c7558bb
6012-
GestureResponderEvent, // 30249124
6013-
GestureResponderHandlers, // 23b0d45f
6014-
HostComponent, // 277fe52e
6015-
HostInstance, // 3a2a75ad
6010+
GestureResponderEvent, // bb8dcd23
6011+
GestureResponderHandlers, // 75258f84
6012+
HostComponent, // dfdae661
6013+
HostInstance, // 5cce1edc
60166014
I18nManager, // f9870e00
60176015
IEventEmitter, // fbef6131
60186016
IOSKeyboardEvent, // e67bfe3a
60196017
IgnorePattern, // ec6f6ece
6020-
Image, // 10e30790
6021-
ImageBackground, // ab05f7c3
6022-
ImageBackgroundProps, // a35908a1
6023-
ImageErrorEvent, // 3c2e70cc
6024-
ImageLoadEvent, // 6d3e7731
6025-
ImageProgressEventIOS, // fb9bbc86
6026-
ImageProps, // 196f0d32
6018+
Image, // 86f7c129
6019+
ImageBackground, // a2f95e2e
6020+
ImageBackgroundProps, // ab7997ed
6021+
ImageErrorEvent, // 32facb1f
6022+
ImageLoadEvent, // ca721da3
6023+
ImageProgressEventIOS, // 0cb4f99a
6024+
ImageProps, // fa25bf89
60276025
ImagePropsAndroid, // 9fd9bcbb
6028-
ImagePropsBase, // fdbd3b49
6029-
ImagePropsIOS, // 32e6747c
6026+
ImagePropsBase, // c8c1c7d2
6027+
ImagePropsIOS, // 4ee078a1
60306028
ImageRequireSource, // 681d683b
60316029
ImageResolvedAssetSource, // f3060931
60326030
ImageSize, // 1c47cf88
@@ -6038,12 +6036,12 @@ export {
60386036
InputAccessoryViewProps, // ac36060b
60396037
InputModeOptions, // 4e8581b9
60406038
Insets, // e7fe432a
6041-
KeyDownEvent, // e446406b
6039+
KeyDownEvent, // a0da2b6a
60426040
KeyEvent, // 20fa4267
6043-
KeyUpEvent, // d4b54d8e
6041+
KeyUpEvent, // fc218328
60446042
Keyboard, // 49414c97
6045-
KeyboardAvoidingView, // 6192aeef
6046-
KeyboardAvoidingViewProps, // 7c8e6d80
6043+
KeyboardAvoidingView, // 23eb6f21
6044+
KeyboardAvoidingViewProps, // c393325e
60476045
KeyboardEvent, // c3f895d4
60486046
KeyboardEventEasing, // af4091c8
60496047
KeyboardEventName, // 59299ad6
@@ -6056,7 +6054,7 @@ export {
60566054
LayoutAnimationProperty, // 52995f01
60576055
LayoutAnimationType, // 2da0a29b
60586056
LayoutAnimationTypes, // 081b3bde
6059-
LayoutChangeEvent, // b0cb1b07
6057+
LayoutChangeEvent, // 40465ddb
60606058
LayoutConformanceProps, // 055f03b8
60616059
LayoutRectangle, // 6601b294
60626060
Linking, // 9a6a174d
@@ -6068,34 +6066,32 @@ export {
60686066
MeasureInWindowOnSuccessCallback, // a285f598
60696067
MeasureLayoutOnSuccessCallback, // 3592502a
60706068
MeasureOnSuccessCallback, // 82824e59
6071-
Modal, // 48ace2d7
6072-
ModalBaseProps, // ad1ae814
6073-
ModalProps, // 04199141
6069+
Modal, // 85ab531e
6070+
ModalBaseProps, // 46686bba
6071+
ModalProps, // 7a1f1f1b
60746072
ModalPropsAndroid, // 515fb173
6075-
ModalPropsIOS, // c16dab61
6076-
ModeChangeEvent, // b030f9be
6077-
MouseEvent, // a33f8058
6073+
ModalPropsIOS, // 14982dbf
6074+
ModeChangeEvent, // 3e4ffb0d
6075+
MouseEvent, // 0bbf7012
60786076
NativeAppEventEmitter, // 08d4c47d
60796077
NativeColorValue, // d2094c29
6080-
NativeComponentRegistry, // 6497d2b6
6078+
NativeComponentRegistry, // 1ab90198
60816079
NativeDialogManagerAndroid, // 5be8497e
60826080
NativeEventEmitter, // 27f97c1a
60836081
NativeEventSubscription, // de3942e7
6084-
NativeMethods, // ce1a8622
6085-
NativeMethodsMixin, // 6127a27d
60866082
NativeModules, // 4597cd36
6087-
NativeMouseEvent, // ddcc5836
6088-
NativePointerEvent, // 49e97dbb
6083+
NativeMouseEvent, // 6c209ba8
6084+
NativePointerEvent, // 5887f100
60896085
NativeScrollEvent, // caad7f53
6090-
NativeSyntheticEvent, // 99ec1d60
6086+
NativeSyntheticEvent, // 4a2c3e8f
60916087
NativeTouchEvent, // 59b676df
60926088
NativeUIEvent, // 44ac26ac
60936089
Networking, // bbc5be42
60946090
OpaqueColorValue, // 25f3fa5b
6095-
PanResponder, // ff2437d5
6096-
PanResponderCallbacks, // 315230b0
6091+
PanResponder, // 968846ad
6092+
PanResponderCallbacks, // 096620ee
60976093
PanResponderGestureState, // 54baf558
6098-
PanResponderInstance, // 51c64e49
6094+
PanResponderInstance, // c32797a3
60996095
Permission, // 06473f4f
61006096
PermissionStatus, // 4b7de97b
61016097
PermissionsAndroid, // db2a401e
@@ -6105,51 +6101,51 @@ export {
61056101
PlatformOSType, // 0a17561e
61066102
PlatformSelectSpec, // 09ed7758
61076103
PointValue, // 69db075f
6108-
PointerEvent, // 8dd8fcfd
6109-
PressabilityConfig, // cf525d89
6110-
PressabilityEventHandlers, // 8fcdfdf6
6111-
Pressable, // 6039f73a
6104+
PointerEvent, // e8a6d3e6
6105+
PressabilityConfig, // 23b1573d
6106+
PressabilityEventHandlers, // 2a8d8df4
6107+
Pressable, // d811fbf2
61126108
PressableAndroidRippleConfig, // ee32eaca
6113-
PressableProps, // 13d5a2f1
6109+
PressableProps, // e9a2ec20
61146110
PressableStateCallbackType, // 9af36561
61156111
ProcessedColorValue, // 33f74304
6116-
ProgressBarAndroid, // 3ea5543a
6117-
ProgressBarAndroidProps, // 84635506
6112+
ProgressBarAndroid, // cdd54171
6113+
ProgressBarAndroidProps, // e8b5ba60
61186114
PublicRootInstance, // 8040afd7
6119-
PublicTextInstance, // 265237c6
6115+
PublicTextInstance, // aab16305
61206116
PushNotificationEventName, // 84e7e150
61216117
PushNotificationIOS, // b4d1fe78
61226118
PushNotificationPermissions, // c2e7ae4f
61236119
Rationale, // 5df1b1c1
61246120
ReactNativeVersion, // abd76827
6125-
RefreshControl, // 068b1015
6126-
RefreshControlProps, // 1b07a4c7
6121+
RefreshControl, // e2daf118
6122+
RefreshControlProps, // ac9fcf0f
61276123
RefreshControlPropsAndroid, // 99f64c97
61286124
RefreshControlPropsIOS, // 72a36381
61296125
Registry, // 6c39216d
6130-
ResponderSyntheticEvent, // 57478720
6126+
ResponderSyntheticEvent, // ecf9e8ca
61316127
ReturnKeyTypeOptions, // afd47ba3
61326128
Role, // af7b889d
61336129
RootTag, // 3cd10504
61346130
RootTagContext, // 38bfc8f6
61356131
RootViewStyleProvider, // d4818465
61366132
Runnable, // 594dd93a
61376133
Runnables, // 4367c557
6138-
SafeAreaView, // 13e5d7d8
6134+
SafeAreaView, // 7ee18fa8
61396135
ScaledSize, // 07e417c7
6140-
ScrollEvent, // 68939866
6141-
ScrollResponderType, // f696d6fb
6136+
ScrollEvent, // da4a8584
6137+
ScrollResponderType, // 0ea87180
61426138
ScrollToLocationParamsType, // d7ecdad1
6143-
ScrollView, // 21775fc8
6144-
ScrollViewImperativeMethods, // 314462c7
6145-
ScrollViewProps, // 3354a492
6139+
ScrollView, // 50e4116a
6140+
ScrollViewImperativeMethods, // 8be2a150
6141+
ScrollViewProps, // 2211c1e5
61466142
ScrollViewPropsAndroid, // 44210553
6147-
ScrollViewPropsIOS, // 7ca110e7
6143+
ScrollViewPropsIOS, // 07eb6168
61486144
ScrollViewScrollToOptions, // 3313411e
61496145
SectionBase, // b376bddc
6150-
SectionList, // f04d848d
6146+
SectionList, // 0591a5b4
61516147
SectionListData, // 119baf83
6152-
SectionListProps, // 9c8b2b1e
6148+
SectionListProps, // cdacfe42
61536149
SectionListRenderItem, // 1fad0435
61546150
SectionListRenderItemInfo, // 745e1992
61556151
Separators, // 6a45f7e3
@@ -6167,66 +6163,66 @@ export {
61676163
StyleProp, // fa0e9b4a
61686164
StyleSheet, // e77dd046
61696165
SubmitBehavior, // c4ddf490
6170-
Switch, // bf145836
6171-
SwitchChangeEvent, // f3013e4e
6172-
SwitchProps, // 9b60edbf
6166+
Switch, // ed13369a
6167+
SwitchChangeEvent, // c376657f
6168+
SwitchProps, // 34b7a133
61736169
Systrace, // 626d178c
61746170
TVViewPropsIOS, // 330ce7b5
61756171
TargetedEvent, // 16e98910
61766172
TaskProvider, // 266dedf2
6177-
Text, // 0937861d
6173+
Text, // aaf474ef
61786174
TextContentType, // 239b3ecc
6179-
TextInput, // ee8f6f5d
6175+
TextInput, // a42867e8
61806176
TextInputAndroidProps, // 3f09ce49
6181-
TextInputChangeEvent, // b5264e88
6182-
TextInputContentSizeChangeEvent, // a6612e5e
6183-
TextInputEndEditingEvent, // ffeb6ebd
6184-
TextInputFocusEvent, // 6ae5be45
6177+
TextInputChangeEvent, // ec94176a
6178+
TextInputContentSizeChangeEvent, // e3194f00
6179+
TextInputEndEditingEvent, // 17e4349a
6180+
TextInputFocusEvent, // ea52e1ac
61856181
TextInputIOSProps, // 0d05a855
6186-
TextInputKeyPressEvent, // fcead0c9
6187-
TextInputProps, // 0fa27aa2
6188-
TextInputSelectionChangeEvent, // 1a6383cf
6189-
TextInputSubmitEditingEvent, // e3152e2d
6190-
TextLayoutEvent, // c3e8821d
6191-
TextProps, // fb3a9124
6182+
TextInputKeyPressEvent, // 4405eb24
6183+
TextInputProps, // a6253f51
6184+
TextInputSelectionChangeEvent, // 2f71c273
6185+
TextInputSubmitEditingEvent, // 14ed1846
6186+
TextLayoutEvent, // 197a5c21
6187+
TextProps, // 621ce553
61926188
TextStyle, // bb9b7a58
61936189
ToastAndroid, // 88a8969a
6194-
Touchable, // a05e8365
6195-
TouchableHighlight, // 4f247d12
6196-
TouchableHighlightProps, // 384d8d78
6197-
TouchableNativeFeedback, // 855953dc
6198-
TouchableNativeFeedbackProps, // 1d2c2871
6199-
TouchableOpacity, // eab90960
6200-
TouchableOpacityProps, // 38265cbb
6201-
TouchableWithoutFeedback, // f000a22f
6202-
TouchableWithoutFeedbackProps, // e7f63a63
6190+
Touchable, // 170b64e4
6191+
TouchableHighlight, // 86fc3d65
6192+
TouchableHighlightProps, // 82cb8154
6193+
TouchableNativeFeedback, // fe1dc584
6194+
TouchableNativeFeedbackProps, // 10053ba0
6195+
TouchableOpacity, // 07901fab
6196+
TouchableOpacityProps, // b6a03ec4
6197+
TouchableWithoutFeedback, // cf933e13
6198+
TouchableWithoutFeedbackProps, // 9a4b681e
62036199
TransformsStyle, // 65e70f18
62046200
TurboModule, // dfe29706
62056201
TurboModuleRegistry, // 4ace6db2
62066202
UIManager, // a1a7cc01
62076203
UTFSequence, // ad625158
62086204
Vibration, // 31e4bbf8
6209-
View, // 5a1289a3
6210-
ViewProps, // 1c9bc89c
6211-
ViewPropsAndroid, // b95e4831
6205+
View, // 9ba78128
6206+
ViewProps, // fb74e9dd
6207+
ViewPropsAndroid, // 6c1a56c9
62126208
ViewPropsIOS, // 58ee19bf
62136209
ViewStyle, // 00a0f8fb
62146210
VirtualViewMode, // 6be59722
62156211
VirtualizedList, // 68c7345e
6216-
VirtualizedListProps, // cb75c897
6212+
VirtualizedListProps, // 4eb2d833
62176213
VirtualizedSectionList, // 9fd9cd61
6218-
VirtualizedSectionListProps, // e037ec57
6214+
VirtualizedSectionListProps, // d48bf69d
62196215
WrapperComponentProvider, // 9cf3844c
62206216
codegenNativeCommands, // 628a7c0a
6221-
codegenNativeComponent, // 65335a0c
6217+
codegenNativeComponent, // 4d91b9b2
62226218
findNodeHandle, // 93f80214
62236219
processColor, // 6e877698
62246220
registerCallableModule, // 839c8cfe
6225-
requireNativeComponent, // 35636f3c
6221+
requireNativeComponent, // 732fccdc
62266222
useAnimatedColor, // e3511f81
62276223
useAnimatedValue, // b18adb63
62286224
useAnimatedValueXY, // c7ee2332
62296225
useColorScheme, // d585efdb
6230-
usePressability, // 581a946a
6226+
usePressability, // db63d763
62316227
useWindowDimensions, // bb4b683f
62326228
}

packages/react-native/index.js.flow

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,6 @@ export type * from './Libraries/Types/CodegenTypesNamespace';
448448

449449
export type {
450450
HostInstance,
451-
NativeMethods,
452-
NativeMethodsMixin,
453451
MeasureInWindowOnSuccessCallback,
454452
MeasureLayoutOnSuccessCallback,
455453
MeasureOnSuccessCallback,

packages/react-native/src/private/types/HostInstance.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,3 @@ export interface LegacyHostInstanceMethods {
109109
}
110110

111111
export type HostInstance = ReactNativeElement;
112-
113-
/** @deprecated Use HostInstance instead */
114-
export type NativeMethods = LegacyHostInstanceMethods;
115-
116-
/**
117-
* @deprecated Use HostInstance instead.
118-
*/
119-
export type NativeMethodsMixin = LegacyHostInstanceMethods;

0 commit comments

Comments
 (0)