@office-iss/react-native-win32 0.0.0-canary.287 → 0.0.0-canary.289
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.
- package/.flowconfig +6 -2
- package/CHANGELOG.json +63 -1
- package/CHANGELOG.md +24 -4
- package/Libraries/Alert/Alert.d.ts +4 -1
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/{Modal/ModalInjection.js → Alert/RCTAlertManager.js.flow} +7 -4
- package/Libraries/Animated/Animated.js +8 -37
- package/Libraries/Animated/Animated.js.flow +15 -0
- package/Libraries/Animated/AnimatedExports.js +47 -0
- package/Libraries/Animated/AnimatedExports.js.flow +48 -0
- package/Libraries/Animated/Easing.js +13 -15
- package/Libraries/Animated/createAnimatedComponent.js +24 -12
- package/Libraries/Animated/nodes/AnimatedNode.js +2 -1
- package/Libraries/Animated/nodes/AnimatedProps.js +18 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +6 -2
- package/Libraries/Animated/useAnimatedValue.js +1 -3
- package/Libraries/Blob/URL.js +23 -10
- package/Libraries/Blob/URLSearchParams.js.flow +23 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js.flow +20 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +8 -8
- package/Libraries/Components/Button.js +2 -2
- package/Libraries/Components/Button.win32.js +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +14 -100
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +64 -4
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +138 -0
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +7 -4
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +6 -4
- package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +18 -63
- package/Libraries/Components/Pressable/Pressable.win32.js +19 -65
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +2 -2
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +4 -46
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +10 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +54 -0
- package/Libraries/Components/RefreshControl/RefreshControl.js +10 -7
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +2 -1
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +1 -1
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +1 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +2 -4
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +2 -4
- package/Libraries/Components/ScrollView/ScrollView.js +43 -59
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -4
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -7
- package/Libraries/Components/StatusBar/StatusBar.js +33 -22
- package/Libraries/Components/Switch/Switch.js +70 -41
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +2 -4
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +2 -4
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +2 -4
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/Tests/TextInputTest.d.ts +2 -1
- package/Libraries/Components/TextInput/Tests/TextInputTest.js.map +1 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +6 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +45 -14
- package/Libraries/Components/TextInput/TextInput.js +121 -136
- package/Libraries/Components/TextInput/TextInput.win32.js +122 -137
- package/Libraries/Components/TextInput/TextInputState.js +2 -18
- package/Libraries/Components/TextInput/TextInputState.win32.js +2 -18
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.d.ts +2 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/Touchable.js +7 -7
- package/Libraries/Components/Touchable/Touchable.win32.js +7 -7
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +35 -14
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +95 -47
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +248 -43
- package/Libraries/Components/Touchable/TouchableOpacity.js +52 -10
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +112 -59
- package/Libraries/Components/View/View.js +1 -1
- package/Libraries/Components/View/View.win32.js +1 -1
- package/Libraries/Components/View/ViewNativeComponent.js +2 -4
- package/Libraries/Components/View/ViewPropTypes.js +15 -12
- package/Libraries/Components/View/ViewPropTypes.win32.js +74 -71
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/setUpReactDevTools.js +2 -0
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +10 -7
- package/Libraries/Image/Image.android.js +1 -1
- package/Libraries/Image/Image.js.flow +27 -0
- package/Libraries/Image/ImageBackground.js +1 -1
- package/Libraries/Image/ImageProps.js +97 -30
- package/Libraries/Image/ImageTypes.flow.js +16 -6
- package/Libraries/Image/ImageViewNativeComponent.js +3 -5
- package/Libraries/Image/Tests/ImageWin32Test.d.ts +2 -1
- package/Libraries/Image/Tests/ImageWin32Test.js.map +1 -1
- package/Libraries/Image/TextInlineImageNativeComponent.js +2 -4
- package/Libraries/Interaction/InteractionManager.js +9 -1
- package/Libraries/Interaction/PanResponder.js +11 -11
- package/Libraries/Interaction/TaskQueue.js +3 -2
- package/Libraries/Lists/FlatList.js +8 -7
- package/Libraries/LogBox/LogBox.js +1 -1
- package/Libraries/Modal/Modal.js +30 -4
- package/Libraries/NativeComponent/BaseViewConfig.js.flow +14 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
- package/Libraries/Network/RCTNetworking.js.flow +44 -0
- package/Libraries/Network/XMLHttpRequest_new.js +3 -0
- package/Libraries/Network/XMLHttpRequest_old.js +3 -0
- package/Libraries/Pressability/HoverState.js +1 -0
- package/Libraries/Pressability/HoverState.win32.js +1 -0
- package/Libraries/Pressability/Pressability.js +2 -2
- package/Libraries/Pressability/Pressability.win32.js +3 -3
- package/Libraries/ReactNative/AppRegistry.flow.js +49 -0
- package/Libraries/ReactNative/AppRegistry.js +2 -322
- package/Libraries/ReactNative/AppRegistry.js.flow +23 -0
- package/Libraries/ReactNative/AppRegistryImpl.js +316 -0
- package/Libraries/ReactNative/FabricUIManager.js +5 -3
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +7 -5
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -4
- package/Libraries/ReactNative/RendererImplementation.js +3 -5
- package/Libraries/ReactNative/requireNativeComponent.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +12 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +39 -91
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +22 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +6 -0
- package/Libraries/StyleSheet/StyleSheet.js +5 -197
- package/Libraries/StyleSheet/StyleSheet.js.flow +166 -0
- package/Libraries/StyleSheet/{StyleSheet.win32.js → StyleSheetExports.js} +2 -151
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +110 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +42 -18
- package/Libraries/Text/Text.d.ts +1 -1
- package/Libraries/Text/Text.js +3 -1
- package/Libraries/Text/Text.win32.js +3 -1
- package/Libraries/Text/TextNativeComponent.js +1 -1
- package/Libraries/Text/TextNativeComponent.win32.js +1 -1
- package/Libraries/Text/TextProps.js +124 -84
- package/Libraries/Text/TextProps.win32.js +124 -84
- package/Libraries/Types/CodegenTypesNamespace.d.ts +45 -0
- package/Libraries/Types/CodegenTypesNamespace.js +14 -0
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.win32.js +1 -1
- package/Libraries/Types/ReactDevToolsTypes.js +4 -8
- package/Libraries/Utilities/BackHandler.js.flow +25 -0
- package/Libraries/Utilities/DevSettings.js +14 -0
- package/Libraries/Utilities/Dimensions.js +5 -0
- package/Libraries/Utilities/Dimensions.win32.js +5 -0
- package/{flow/Position.js → Libraries/Utilities/Platform.js.flow} +3 -6
- package/Libraries/Utilities/PlatformTypes.js +97 -7
- package/Libraries/Utilities/codegenNativeCommands.d.ts +18 -0
- package/Libraries/Utilities/codegenNativeComponent.d.ts +26 -0
- package/Libraries/Utilities/codegenNativeComponent.js +1 -1
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +2 -4
- package/Libraries/vendor/emitter/EventEmitter.js +6 -2
- package/flow/global.js +1 -0
- package/flow/jest.js +4 -2
- package/index.js +47 -43
- package/index.win32.js +63 -59
- package/overrides.json +27 -35
- package/package.json +18 -18
- package/src/private/animated/NativeAnimatedHelper.js +18 -7
- package/src/private/animated/NativeAnimatedHelper.win32.js +18 -7
- package/src/private/animated/createAnimatedPropsHook.js +34 -15
- package/src/private/components/HScrollViewNativeComponents.js +1 -1
- package/src/private/components/VScrollViewNativeComponents.js +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +24 -36
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +9 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +4 -4
- package/src/private/inspector/getInspectorDataForViewAtPoint.js +2 -4
- package/src/private/setup/setUpDOM.js +36 -1
- package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +1 -1
- package/src/private/types/HostComponent.js +16 -0
- package/src/private/types/HostInstance.js +50 -0
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +1 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +40 -32
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -19
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +6 -0
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +4 -4
- package/src/private/webapis/mutationobserver/MutationObserver.js +9 -9
- package/src/private/webapis/performance/PerformanceObserver.js +6 -6
- package/src/types/globals.d.ts +628 -0
- package/src/types/third_party/event-target-shim.d.ts +392 -0
- package/src-win/Libraries/Components/TextInput/Tests/TextInputTest.tsx +7 -7
- package/src-win/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +3 -3
- package/src-win/Libraries/Image/Tests/ImageWin32Test.tsx +1 -1
- package/src-win/Libraries/Text/Text.d.ts +1 -1
- package/types/index.d.ts +5 -52
- package/types/modules/globals.d.ts +0 -599
|
@@ -14,8 +14,22 @@ import NativeEventEmitter from '../EventEmitter/NativeEventEmitter';
|
|
|
14
14
|
import NativeDevSettings from '../NativeModules/specs/NativeDevSettings';
|
|
15
15
|
import Platform from '../Utilities/Platform';
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* The DevSettings module exposes methods for customizing settings for developers in development.
|
|
19
|
+
*/
|
|
17
20
|
let DevSettings: {
|
|
21
|
+
/**
|
|
22
|
+
* Adds a custom menu item to the developer menu.
|
|
23
|
+
*
|
|
24
|
+
* @param title - The title of the menu item. Is internally used as id and should therefore be unique.
|
|
25
|
+
* @param handler - The callback invoked when pressing the menu item.
|
|
26
|
+
*/
|
|
18
27
|
addMenuItem(title: string, handler: () => mixed): void,
|
|
28
|
+
/**
|
|
29
|
+
* Reload the application.
|
|
30
|
+
*
|
|
31
|
+
* @param reason
|
|
32
|
+
*/
|
|
19
33
|
reload(reason?: string): void,
|
|
20
34
|
onFastRefresh(): void,
|
|
21
35
|
} = {
|
|
@@ -19,6 +19,11 @@ import NativeDeviceInfo, {
|
|
|
19
19
|
} from './NativeDeviceInfo';
|
|
20
20
|
import invariant from 'invariant';
|
|
21
21
|
|
|
22
|
+
export type {DisplayMetrics, DisplayMetricsAndroid};
|
|
23
|
+
|
|
24
|
+
/** @deprecated Use DisplayMetrics */
|
|
25
|
+
export type ScaledSize = DisplayMetrics;
|
|
26
|
+
|
|
22
27
|
const eventEmitter = new EventEmitter<{
|
|
23
28
|
change: [DimensionsPayload],
|
|
24
29
|
}>();
|
|
@@ -17,6 +17,11 @@ import NativeDeviceInfo, {
|
|
|
17
17
|
} from './NativeDeviceInfo';
|
|
18
18
|
import invariant from 'invariant';
|
|
19
19
|
|
|
20
|
+
export type {DisplayMetrics, DisplayMetricsAndroid};
|
|
21
|
+
|
|
22
|
+
/** @deprecated Use DisplayMetrics */
|
|
23
|
+
export type ScaledSize = DisplayMetrics;
|
|
24
|
+
|
|
20
25
|
const eventEmitter = new EventEmitter<{
|
|
21
26
|
change: [DimensionsPayload],
|
|
22
27
|
}>();
|
|
@@ -5,12 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @flow strict
|
|
8
|
-
* @nolint
|
|
9
8
|
* @format
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
mocked: boolean;
|
|
16
|
-
}
|
|
11
|
+
import type {Platform} from './PlatformTypes';
|
|
12
|
+
|
|
13
|
+
declare export default Platform;
|
|
@@ -8,14 +8,18 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
export type PlatformOSType =
|
|
12
|
+
| 'ios'
|
|
13
|
+
| 'android'
|
|
14
|
+
| 'macos'
|
|
15
|
+
| 'windows'
|
|
16
|
+
| 'win32' // [Windows]
|
|
17
|
+
| 'web'
|
|
18
|
+
| 'native';
|
|
19
|
+
|
|
11
20
|
export type PlatformSelectSpec<T> = {
|
|
12
21
|
default?: T,
|
|
13
|
-
|
|
14
|
-
ios?: T,
|
|
15
|
-
android?: T,
|
|
16
|
-
win32?: T,
|
|
17
|
-
windows?: T,
|
|
18
|
-
...
|
|
22
|
+
[PlatformOSType]: T,
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
type IOSPlatform = {
|
|
@@ -90,6 +94,66 @@ type AndroidPlatform = {
|
|
|
90
94
|
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
91
95
|
};
|
|
92
96
|
|
|
97
|
+
type WindowsPlatform = {
|
|
98
|
+
__constants: null,
|
|
99
|
+
OS: 'windows',
|
|
100
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
101
|
+
get Version(): number,
|
|
102
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
103
|
+
get constants(): {
|
|
104
|
+
// [Windows]
|
|
105
|
+
isTesting: boolean,
|
|
106
|
+
isDisableAnimations?: boolean,
|
|
107
|
+
reactNativeVersion: {
|
|
108
|
+
major: number,
|
|
109
|
+
minor: number,
|
|
110
|
+
patch: number,
|
|
111
|
+
prerelease: ?string,
|
|
112
|
+
},
|
|
113
|
+
reactNativeWindowsVersion: {
|
|
114
|
+
major: number,
|
|
115
|
+
minor: number,
|
|
116
|
+
patch: number,
|
|
117
|
+
},
|
|
118
|
+
osVersion: number,
|
|
119
|
+
},
|
|
120
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
121
|
+
get isTesting(): boolean,
|
|
122
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
123
|
+
get isDisableAnimations(): boolean,
|
|
124
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
125
|
+
get isTV(): boolean,
|
|
126
|
+
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
type MacOSPlatform = {
|
|
130
|
+
__constants: null,
|
|
131
|
+
OS: 'macos',
|
|
132
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
133
|
+
get Version(): string,
|
|
134
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
135
|
+
get constants(): {
|
|
136
|
+
isTesting: boolean,
|
|
137
|
+
osVersion: string,
|
|
138
|
+
reactNativeVersion: {
|
|
139
|
+
major: number,
|
|
140
|
+
minor: number,
|
|
141
|
+
patch: number,
|
|
142
|
+
prerelease: ?number,
|
|
143
|
+
},
|
|
144
|
+
systemName: string,
|
|
145
|
+
},
|
|
146
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
147
|
+
get isTV(): boolean,
|
|
148
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
149
|
+
get isVision(): boolean,
|
|
150
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
151
|
+
get isTesting(): boolean,
|
|
152
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
153
|
+
get isDisableAnimations(): boolean,
|
|
154
|
+
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
155
|
+
};
|
|
156
|
+
|
|
93
157
|
type Win32Platform = {
|
|
94
158
|
__constants: null,
|
|
95
159
|
// $FlowFixMe[cannot-resolve-name]
|
|
@@ -123,4 +187,30 @@ type Win32Platform = {
|
|
|
123
187
|
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
124
188
|
};
|
|
125
189
|
|
|
126
|
-
|
|
190
|
+
type WebPlatform = {
|
|
191
|
+
OS: 'web',
|
|
192
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
193
|
+
get constants(): {
|
|
194
|
+
reactNativeVersion: {
|
|
195
|
+
major: number,
|
|
196
|
+
minor: number,
|
|
197
|
+
patch: number,
|
|
198
|
+
prerelease: ?string,
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
202
|
+
get isTV(): boolean,
|
|
203
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
204
|
+
get isTesting(): boolean,
|
|
205
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
206
|
+
get isDisableAnimations(): boolean,
|
|
207
|
+
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export type Platform =
|
|
211
|
+
| IOSPlatform
|
|
212
|
+
| AndroidPlatform
|
|
213
|
+
| WindowsPlatform
|
|
214
|
+
| Win32Platform // [Windows]
|
|
215
|
+
| MacOSPlatform
|
|
216
|
+
| WebPlatform;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
interface Options<T extends string> {
|
|
11
|
+
readonly supportedCommands: ReadonlyArray<T>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare function codegenNativeCommands<T extends object>(
|
|
15
|
+
options: Options<keyof T extends string ? keyof T : never>,
|
|
16
|
+
): T;
|
|
17
|
+
|
|
18
|
+
export default codegenNativeCommands;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {HostComponent} from 'react-native';
|
|
11
|
+
|
|
12
|
+
interface Options {
|
|
13
|
+
readonly interfaceOnly?: boolean | undefined;
|
|
14
|
+
readonly paperComponentName?: string | undefined;
|
|
15
|
+
readonly paperComponentNameDeprecated?: string | undefined;
|
|
16
|
+
readonly excludedPlatforms?: ReadonlyArray<'iOS' | 'android'> | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type NativeComponentType<T> = HostComponent<T>;
|
|
20
|
+
|
|
21
|
+
declare function codegenNativeComponent<Props extends object>(
|
|
22
|
+
componentName: string,
|
|
23
|
+
options?: Options,
|
|
24
|
+
): NativeComponentType<Props>;
|
|
25
|
+
|
|
26
|
+
export default codegenNativeComponent;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
// TODO: move this file to shims/ReactNative (requires React update and sync)
|
|
12
12
|
|
|
13
|
-
import type {HostComponent} from '../../
|
|
13
|
+
import type {HostComponent} from '../../src/private/types/HostComponent';
|
|
14
14
|
|
|
15
15
|
import requireNativeComponent from '../../Libraries/ReactNative/requireNativeComponent';
|
|
16
16
|
import UIManager from '../ReactNative/UIManager';
|
|
@@ -8,10 +8,8 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
12
|
-
|
|
13
|
-
HostInstance,
|
|
14
|
-
} from '../Renderer/shims/ReactNativeTypes';
|
|
11
|
+
import type {HostComponent} from '../../src/private/types/HostComponent';
|
|
12
|
+
import type {HostInstance} from '../../src/private/types/HostInstance';
|
|
15
13
|
|
|
16
14
|
import * as React from 'react';
|
|
17
15
|
|
|
@@ -72,8 +72,12 @@ export default class EventEmitter<
|
|
|
72
72
|
> = $ReadOnly<Record<string, $ReadOnlyArray<UnsafeObject>>>,
|
|
73
73
|
> implements IEventEmitter<TEventToArgsMap>
|
|
74
74
|
{
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
#registry: Registry<TEventToArgsMap>;
|
|
76
|
+
|
|
77
|
+
constructor() {
|
|
78
|
+
// $FlowFixMe[incompatible-type]
|
|
79
|
+
this.#registry = {};
|
|
80
|
+
}
|
|
77
81
|
|
|
78
82
|
/**
|
|
79
83
|
* Registers a listener that is called when the supplied event is emitted.
|
package/flow/global.js
CHANGED
package/flow/jest.js
CHANGED
|
@@ -1040,10 +1040,12 @@ declare var describe: {
|
|
|
1040
1040
|
* @param {table} table of Test
|
|
1041
1041
|
*/
|
|
1042
1042
|
each(
|
|
1043
|
-
...table:
|
|
1043
|
+
...table:
|
|
1044
|
+
| $ReadOnlyArray<$ReadOnlyArray<mixed> | mixed>
|
|
1045
|
+
| [$ReadOnlyArray<string>, string]
|
|
1044
1046
|
): (
|
|
1045
1047
|
name: JestTestName,
|
|
1046
|
-
fn?: (...args:
|
|
1048
|
+
fn?: (...args: $ReadOnlyArray<any>) => ?Promise<mixed>,
|
|
1047
1049
|
timeout?: number,
|
|
1048
1050
|
) => void,
|
|
1049
1051
|
...
|
package/index.js
CHANGED
|
@@ -31,14 +31,7 @@ const warnOnce = require('./Libraries/Utilities/warnOnce').default;
|
|
|
31
31
|
const invariant = require('invariant');
|
|
32
32
|
|
|
33
33
|
module.exports = {
|
|
34
|
-
get registerCallableModule() {
|
|
35
|
-
return require('./Libraries/Core/registerCallableModule').default;
|
|
36
|
-
},
|
|
37
34
|
// #region Components
|
|
38
|
-
get AccessibilityInfo() {
|
|
39
|
-
return require('./Libraries/Components/AccessibilityInfo/AccessibilityInfo')
|
|
40
|
-
.default;
|
|
41
|
-
},
|
|
42
35
|
get ActivityIndicator() {
|
|
43
36
|
return require('./Libraries/Components/ActivityIndicator/ActivityIndicator')
|
|
44
37
|
.default;
|
|
@@ -63,14 +56,14 @@ module.exports = {
|
|
|
63
56
|
return require('./Libraries/Components/TextInput/InputAccessoryView')
|
|
64
57
|
.default;
|
|
65
58
|
},
|
|
66
|
-
get experimental_LayoutConformance() {
|
|
67
|
-
return require('./Libraries/Components/LayoutConformance/LayoutConformance')
|
|
68
|
-
.default;
|
|
69
|
-
},
|
|
70
59
|
get KeyboardAvoidingView() {
|
|
71
60
|
return require('./Libraries/Components/Keyboard/KeyboardAvoidingView')
|
|
72
61
|
.default;
|
|
73
62
|
},
|
|
63
|
+
get experimental_LayoutConformance() {
|
|
64
|
+
return require('./Libraries/Components/LayoutConformance/LayoutConformance')
|
|
65
|
+
.default;
|
|
66
|
+
},
|
|
74
67
|
get Modal() {
|
|
75
68
|
return require('./Libraries/Modal/Modal').default;
|
|
76
69
|
},
|
|
@@ -141,6 +134,10 @@ module.exports = {
|
|
|
141
134
|
},
|
|
142
135
|
// #endregion
|
|
143
136
|
// #region APIs
|
|
137
|
+
get AccessibilityInfo() {
|
|
138
|
+
return require('./Libraries/Components/AccessibilityInfo/AccessibilityInfo')
|
|
139
|
+
.default;
|
|
140
|
+
},
|
|
144
141
|
get ActionSheetIOS() {
|
|
145
142
|
return require('./Libraries/ActionSheetIOS/ActionSheetIOS').default;
|
|
146
143
|
},
|
|
@@ -156,7 +153,7 @@ module.exports = {
|
|
|
156
153
|
return require('./Libraries/Utilities/Appearance');
|
|
157
154
|
},
|
|
158
155
|
get AppRegistry() {
|
|
159
|
-
return require('./Libraries/ReactNative/AppRegistry').
|
|
156
|
+
return require('./Libraries/ReactNative/AppRegistry').AppRegistry;
|
|
160
157
|
},
|
|
161
158
|
get AppState() {
|
|
162
159
|
return require('./Libraries/AppState/AppState').default;
|
|
@@ -173,6 +170,15 @@ module.exports = {
|
|
|
173
170
|
);
|
|
174
171
|
return require('./Libraries/Components/Clipboard/Clipboard').default;
|
|
175
172
|
},
|
|
173
|
+
get codegenNativeCommands() {
|
|
174
|
+
return require('./Libraries/Utilities/codegenNativeCommands').default;
|
|
175
|
+
},
|
|
176
|
+
get codegenNativeComponent() {
|
|
177
|
+
return require('./Libraries/Utilities/codegenNativeComponent').default;
|
|
178
|
+
},
|
|
179
|
+
get DeviceEventEmitter() {
|
|
180
|
+
return require('./Libraries/EventEmitter/RCTDeviceEventEmitter').default;
|
|
181
|
+
},
|
|
176
182
|
get DeviceInfo() {
|
|
177
183
|
return require('./Libraries/Utilities/DeviceInfo').default;
|
|
178
184
|
},
|
|
@@ -185,6 +191,10 @@ module.exports = {
|
|
|
185
191
|
get Dimensions() {
|
|
186
192
|
return require('./Libraries/Utilities/Dimensions').default;
|
|
187
193
|
},
|
|
194
|
+
get DynamicColorIOS() {
|
|
195
|
+
return require('./Libraries/StyleSheet/PlatformColorValueTypesIOS')
|
|
196
|
+
.DynamicColorIOS;
|
|
197
|
+
},
|
|
188
198
|
get Easing() {
|
|
189
199
|
return require('./Libraries/Animated/Easing').default;
|
|
190
200
|
},
|
|
@@ -209,6 +219,9 @@ module.exports = {
|
|
|
209
219
|
get LogBox() {
|
|
210
220
|
return require('./Libraries/LogBox/LogBox').default;
|
|
211
221
|
},
|
|
222
|
+
get NativeAppEventEmitter() {
|
|
223
|
+
return require('./Libraries/EventEmitter/RCTNativeAppEventEmitter').default;
|
|
224
|
+
},
|
|
212
225
|
get NativeDialogManagerAndroid() {
|
|
213
226
|
return require('./Libraries/NativeModules/specs/NativeDialogManagerAndroid')
|
|
214
227
|
.default;
|
|
@@ -216,6 +229,9 @@ module.exports = {
|
|
|
216
229
|
get NativeEventEmitter() {
|
|
217
230
|
return require('./Libraries/EventEmitter/NativeEventEmitter').default;
|
|
218
231
|
},
|
|
232
|
+
get NativeModules() {
|
|
233
|
+
return require('./Libraries/BatchedBridge/NativeModules').default;
|
|
234
|
+
},
|
|
219
235
|
get Networking() {
|
|
220
236
|
return require('./Libraries/Network/RCTNetworking').default;
|
|
221
237
|
},
|
|
@@ -228,6 +244,13 @@ module.exports = {
|
|
|
228
244
|
get PixelRatio() {
|
|
229
245
|
return require('./Libraries/Utilities/PixelRatio').default;
|
|
230
246
|
},
|
|
247
|
+
get Platform() {
|
|
248
|
+
return require('./Libraries/Utilities/Platform').default;
|
|
249
|
+
},
|
|
250
|
+
get PlatformColor() {
|
|
251
|
+
return require('./Libraries/StyleSheet/PlatformColorValueTypes')
|
|
252
|
+
.PlatformColor;
|
|
253
|
+
},
|
|
231
254
|
get PushNotificationIOS() {
|
|
232
255
|
warnOnce(
|
|
233
256
|
'pushNotificationIOS-moved',
|
|
@@ -238,6 +261,18 @@ module.exports = {
|
|
|
238
261
|
return require('./Libraries/PushNotificationIOS/PushNotificationIOS')
|
|
239
262
|
.default;
|
|
240
263
|
},
|
|
264
|
+
get processColor() {
|
|
265
|
+
return require('./Libraries/StyleSheet/processColor').default;
|
|
266
|
+
},
|
|
267
|
+
get registerCallableModule() {
|
|
268
|
+
return require('./Libraries/Core/registerCallableModule').default;
|
|
269
|
+
},
|
|
270
|
+
get requireNativeComponent() {
|
|
271
|
+
return require('./Libraries/ReactNative/requireNativeComponent').default;
|
|
272
|
+
},
|
|
273
|
+
get RootTagContext() {
|
|
274
|
+
return require('./Libraries/ReactNative/RootTag').RootTagContext;
|
|
275
|
+
},
|
|
241
276
|
get Settings() {
|
|
242
277
|
return require('./Libraries/Settings/Settings').default;
|
|
243
278
|
},
|
|
@@ -279,37 +314,6 @@ module.exports = {
|
|
|
279
314
|
return require('./Libraries/Vibration/Vibration').default;
|
|
280
315
|
},
|
|
281
316
|
// #endregion
|
|
282
|
-
// #region Plugins
|
|
283
|
-
get DeviceEventEmitter() {
|
|
284
|
-
return require('./Libraries/EventEmitter/RCTDeviceEventEmitter').default;
|
|
285
|
-
},
|
|
286
|
-
get DynamicColorIOS() {
|
|
287
|
-
return require('./Libraries/StyleSheet/PlatformColorValueTypesIOS')
|
|
288
|
-
.DynamicColorIOS;
|
|
289
|
-
},
|
|
290
|
-
get NativeAppEventEmitter() {
|
|
291
|
-
return require('./Libraries/EventEmitter/RCTNativeAppEventEmitter').default;
|
|
292
|
-
},
|
|
293
|
-
get NativeModules() {
|
|
294
|
-
return require('./Libraries/BatchedBridge/NativeModules').default;
|
|
295
|
-
},
|
|
296
|
-
get Platform() {
|
|
297
|
-
return require('./Libraries/Utilities/Platform').default;
|
|
298
|
-
},
|
|
299
|
-
get PlatformColor() {
|
|
300
|
-
return require('./Libraries/StyleSheet/PlatformColorValueTypes')
|
|
301
|
-
.PlatformColor;
|
|
302
|
-
},
|
|
303
|
-
get processColor() {
|
|
304
|
-
return require('./Libraries/StyleSheet/processColor').default;
|
|
305
|
-
},
|
|
306
|
-
get requireNativeComponent() {
|
|
307
|
-
return require('./Libraries/ReactNative/requireNativeComponent').default;
|
|
308
|
-
},
|
|
309
|
-
get RootTagContext() {
|
|
310
|
-
return require('./Libraries/ReactNative/RootTag').RootTagContext;
|
|
311
|
-
},
|
|
312
|
-
// #endregion
|
|
313
317
|
} as ReactNativePublicAPI;
|
|
314
318
|
|
|
315
319
|
if (__DEV__) {
|