@office-iss/react-native-win32 0.0.0-canary.289 → 0.0.0-canary.290
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 +1 -2
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +13 -5
- package/Libraries/Animated/Animated.js.flow +1 -3
- package/Libraries/Animated/AnimatedExports.js.flow +12 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +2 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
- package/Libraries/Animated/createAnimatedComponent.js +92 -56
- package/Libraries/Animated/nodes/AnimatedProps.js +29 -26
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/AppState/AppState.js +1 -1
- package/Libraries/Blob/URL.js +1 -1
- package/Libraries/Blob/URLSearchParams.js +106 -31
- package/Libraries/Blob/URLSearchParams.js.flow +12 -7
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
- package/Libraries/Components/Keyboard/Keyboard.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +14 -3
- package/Libraries/Components/Pressable/Pressable.win32.js +14 -3
- package/Libraries/Components/ScrollView/ScrollView.d.ts +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +14 -17
- package/Libraries/Components/Switch/Switch.d.ts +3 -0
- package/Libraries/Components/Switch/Switch.js +1 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +64 -33
- package/Libraries/Components/TextInput/TextInput.flow.js +15 -16
- package/Libraries/Components/TextInput/TextInput.js +34 -27
- package/Libraries/Components/TextInput/TextInput.win32.js +34 -27
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +2 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +2 -2
- package/Libraries/Components/Touchable/TouchableOpacity.js +2 -1
- package/Libraries/Components/View/ViewAccessibility.js +2 -1
- package/Libraries/Components/View/ViewAccessibility.win32.js +2 -1
- package/Libraries/Components/View/ViewPropTypes.js +49 -3
- package/Libraries/Components/View/ViewPropTypes.win32.js +49 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
- package/Libraries/EventEmitter/NativeEventEmitter.js +4 -2
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +2 -2
- package/Libraries/Image/Image.d.ts +26 -10
- package/Libraries/Image/Image.js.flow +3 -3
- package/Libraries/Image/ImageBackground.js +2 -0
- package/Libraries/Image/ImageProps.js +19 -14
- package/Libraries/Interaction/InteractionManager.d.ts +13 -0
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/PanResponder.js +3 -3
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +7 -10
- package/Libraries/Lists/SectionList.js +39 -42
- package/Libraries/Lists/SectionListModern.js +22 -31
- package/Libraries/Lists/VirtualizedList.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworking.win32.js +1 -1
- package/Libraries/NewAppScreen/components/DebugInstructions.js +1 -3
- package/Libraries/NewAppScreen/components/Header.js +1 -3
- package/Libraries/NewAppScreen/components/HermesBadge.js +1 -3
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +1 -3
- package/Libraries/NewAppScreen/components/ReloadInstructions.js +1 -3
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.win32.js +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
- package/Libraries/ReactNative/RendererImplementation.js +4 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
- package/Libraries/StyleSheet/StyleSheet.js +25 -2
- package/Libraries/StyleSheet/StyleSheet.js.flow +24 -2
- package/Libraries/StyleSheet/StyleSheetTypes.js +13 -3
- package/Libraries/StyleSheet/flattenStyle.js +7 -3
- package/Libraries/StyleSheet/private/_TransformStyle.js +3 -3
- package/Libraries/Text/Text.d.ts +2 -5
- package/Libraries/Text/TextProps.js +3 -2
- package/Libraries/Text/TextProps.win32.js +3 -2
- package/Libraries/Types/CoreEventTypes.d.ts +6 -1
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.win32.js +1 -1
- package/Libraries/Utilities/DeviceInfo.js +2 -0
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/Dimensions.win32.js +1 -1
- package/Libraries/Utilities/PlatformTypes.js +9 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/vendor/core/ErrorUtils.js +2 -0
- package/flow/global.js +2 -0
- package/index.js +3 -0
- package/index.win32.js +3 -0
- package/interface.js +0 -4
- package/overrides.json +19 -25
- package/package.json +13 -13
- package/src/private/animated/NativeAnimatedHelper.js +3 -1
- package/src/private/animated/NativeAnimatedHelper.win32.js +3 -1
- package/src/private/animated/createAnimatedPropsHook.js +1 -0
- package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +18 -18
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -3
- package/src/private/inspector/getInspectorDataForViewAtPoint.js +2 -2
- package/src/private/types/HostInstance.js +61 -3
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
- package/src-win/Libraries/Text/Text.d.ts +2 -5
- package/types/modules/LaunchScreen.d.ts +9 -1
- package/Libraries/Utilities/DeviceInfo.win32.js +0 -19
- package/flow/jest.js +0 -1289
- package/src/private/utilities/ensureInstance.js +0 -21
|
@@ -71,7 +71,7 @@ else if (Platform.OS === 'win32') {
|
|
|
71
71
|
/**
|
|
72
72
|
* @see TextInputProps.onChange
|
|
73
73
|
*/
|
|
74
|
-
|
|
74
|
+
type TextInputChangeEventData = $ReadOnly<{
|
|
75
75
|
eventCount: number,
|
|
76
76
|
target: number,
|
|
77
77
|
text: string,
|
|
@@ -93,10 +93,7 @@ export type TextInputEvent = NativeSyntheticEvent<
|
|
|
93
93
|
}>,
|
|
94
94
|
>;
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
* @see TextInputProps.onContentSizeChange
|
|
98
|
-
*/
|
|
99
|
-
export type TextInputContentSizeChangeEventData = $ReadOnly<{
|
|
96
|
+
type TextInputContentSizeChangeEventData = $ReadOnly<{
|
|
100
97
|
target: number,
|
|
101
98
|
contentSize: $ReadOnly<{
|
|
102
99
|
width: number,
|
|
@@ -104,6 +101,9 @@ export type TextInputContentSizeChangeEventData = $ReadOnly<{
|
|
|
104
101
|
}>,
|
|
105
102
|
}>;
|
|
106
103
|
|
|
104
|
+
/**
|
|
105
|
+
* @see TextInputProps.onContentSizeChange
|
|
106
|
+
*/
|
|
107
107
|
export type TextInputContentSizeChangeEvent =
|
|
108
108
|
NativeSyntheticEvent<TextInputContentSizeChangeEventData>;
|
|
109
109
|
|
|
@@ -111,71 +111,78 @@ export type TargetEvent = $ReadOnly<{
|
|
|
111
111
|
target: number,
|
|
112
112
|
}>;
|
|
113
113
|
|
|
114
|
+
type TextInputFocusEventData = TargetEvent;
|
|
115
|
+
|
|
114
116
|
/**
|
|
115
|
-
* @see TextInputProps.
|
|
117
|
+
* @see TextInputProps.onBlur
|
|
116
118
|
*/
|
|
117
|
-
export type TextInputFocusEventData = TargetEvent;
|
|
118
|
-
|
|
119
119
|
export type TextInputBlurEvent = NativeSyntheticEvent<TextInputFocusEventData>;
|
|
120
|
-
export type TextInputFocusEvent = NativeSyntheticEvent<TextInputFocusEventData>;
|
|
121
120
|
|
|
122
121
|
/**
|
|
123
|
-
* @see TextInputProps.
|
|
122
|
+
* @see TextInputProps.onFocus
|
|
124
123
|
*/
|
|
125
|
-
export type
|
|
124
|
+
export type TextInputFocusEvent = NativeSyntheticEvent<TextInputFocusEventData>;
|
|
125
|
+
|
|
126
|
+
type TextInputScrollEventData = {
|
|
126
127
|
contentOffset: {x: number, y: number},
|
|
127
128
|
};
|
|
128
129
|
|
|
130
|
+
/**
|
|
131
|
+
* @see TextInputProps.onScroll
|
|
132
|
+
*/
|
|
133
|
+
export type TextInputScrollEvent =
|
|
134
|
+
NativeSyntheticEvent<TextInputScrollEventData>;
|
|
135
|
+
|
|
129
136
|
type Selection = $ReadOnly<{
|
|
130
137
|
start: number,
|
|
131
138
|
end: number,
|
|
132
139
|
}>;
|
|
133
140
|
|
|
134
|
-
|
|
135
|
-
* @see TextInputProps.onSelectionChange
|
|
136
|
-
*/
|
|
137
|
-
export type TextInputSelectionChangeEventData = $ReadOnly<{
|
|
141
|
+
type TextInputSelectionChangeEventData = $ReadOnly<{
|
|
138
142
|
...TargetEvent,
|
|
139
143
|
selection: Selection,
|
|
140
144
|
}>;
|
|
141
145
|
|
|
146
|
+
/**
|
|
147
|
+
* @see TextInputProps.onSelectionChange
|
|
148
|
+
*/
|
|
142
149
|
export type TextInputSelectionChangeEvent =
|
|
143
150
|
NativeSyntheticEvent<TextInputSelectionChangeEventData>;
|
|
144
151
|
|
|
145
|
-
|
|
146
|
-
* @see TextInputProps.onKeyPress
|
|
147
|
-
*/
|
|
148
|
-
export type TextInputKeyPressEventData = $ReadOnly<{
|
|
152
|
+
type TextInputKeyPressEventData = $ReadOnly<{
|
|
149
153
|
...TargetEvent,
|
|
150
154
|
key: string,
|
|
151
155
|
target?: ?number,
|
|
152
156
|
eventCount?: ?number,
|
|
153
157
|
}>;
|
|
154
158
|
|
|
159
|
+
/**
|
|
160
|
+
* @see TextInputProps.onKeyPress
|
|
161
|
+
*/
|
|
155
162
|
export type TextInputKeyPressEvent =
|
|
156
163
|
NativeSyntheticEvent<TextInputKeyPressEventData>;
|
|
157
164
|
|
|
158
|
-
|
|
159
|
-
* @see TextInputProps.onEndEditing
|
|
160
|
-
*/
|
|
161
|
-
export type TextInputEndEditingEventData = $ReadOnly<{
|
|
165
|
+
type TextInputEndEditingEventData = $ReadOnly<{
|
|
162
166
|
...TargetEvent,
|
|
163
167
|
eventCount: number,
|
|
164
168
|
text: string,
|
|
165
169
|
}>;
|
|
166
170
|
|
|
171
|
+
/**
|
|
172
|
+
* @see TextInputProps.onEndEditing
|
|
173
|
+
*/
|
|
167
174
|
export type TextInputEndEditingEvent =
|
|
168
175
|
NativeSyntheticEvent<TextInputEndEditingEventData>;
|
|
169
176
|
|
|
170
|
-
|
|
171
|
-
* @see TextInputProps.onSubmitEditing
|
|
172
|
-
*/
|
|
173
|
-
export type TextInputSubmitEditingEventData = $ReadOnly<{
|
|
177
|
+
type TextInputSubmitEditingEventData = $ReadOnly<{
|
|
174
178
|
...TargetEvent,
|
|
175
179
|
eventCount: number,
|
|
176
180
|
text: string,
|
|
177
181
|
}>;
|
|
178
182
|
|
|
183
|
+
/**
|
|
184
|
+
* @see TextInputProps.onSubmitEditing
|
|
185
|
+
*/
|
|
179
186
|
export type TextInputSubmitEditingEvent =
|
|
180
187
|
NativeSyntheticEvent<TextInputSubmitEditingEventData>;
|
|
181
188
|
|
|
@@ -173,7 +173,8 @@ class TouchableBounce extends React.Component<Props, State> {
|
|
|
173
173
|
importantForAccessibility={
|
|
174
174
|
this.props['aria-hidden'] === true
|
|
175
175
|
? 'no-hide-descendants'
|
|
176
|
-
: this
|
|
176
|
+
: // $FlowFixMe[incompatible-type] - AnimatedProps types were made more strict and need refining at this call site
|
|
177
|
+
this.props.importantForAccessibility
|
|
177
178
|
}
|
|
178
179
|
accessibilityViewIsModal={
|
|
179
180
|
this.props['aria-modal'] ?? this.props.accessibilityViewIsModal
|
|
@@ -58,7 +58,7 @@ type TouchableHighlightBaseProps = $ReadOnly<{
|
|
|
58
58
|
hostRef: React.RefSetter<React.ElementRef<typeof View>>,
|
|
59
59
|
}>;
|
|
60
60
|
|
|
61
|
-
type TouchableHighlightProps = $ReadOnly<{
|
|
61
|
+
export type TouchableHighlightProps = $ReadOnly<{
|
|
62
62
|
...TouchableWithoutFeedbackProps,
|
|
63
63
|
...AndroidProps,
|
|
64
64
|
...IOSProps,
|
|
@@ -253,7 +253,7 @@ class TouchableNativeFeedback extends React.Component<
|
|
|
253
253
|
|
|
254
254
|
_dispatchPressedStateChange(pressed: boolean): void {
|
|
255
255
|
if (Platform.OS === 'android') {
|
|
256
|
-
const hostComponentRef = findHostInstance_DEPRECATED(this);
|
|
256
|
+
const hostComponentRef = findHostInstance_DEPRECATED<$FlowFixMe>(this);
|
|
257
257
|
if (hostComponentRef == null) {
|
|
258
258
|
console.warn(
|
|
259
259
|
'Touchable: Unable to find HostComponent instance. ' +
|
|
@@ -268,7 +268,7 @@ class TouchableNativeFeedback extends React.Component<
|
|
|
268
268
|
_dispatchHotspotUpdate(event: GestureResponderEvent): void {
|
|
269
269
|
if (Platform.OS === 'android') {
|
|
270
270
|
const {locationX, locationY} = event.nativeEvent;
|
|
271
|
-
const hostComponentRef = findHostInstance_DEPRECATED(this);
|
|
271
|
+
const hostComponentRef = findHostInstance_DEPRECATED<$FlowFixMe>(this);
|
|
272
272
|
if (hostComponentRef == null) {
|
|
273
273
|
console.warn(
|
|
274
274
|
'Touchable: Unable to find HostComponent instance. ' +
|
|
@@ -252,7 +252,7 @@ class TouchableNativeFeedback extends React.Component<
|
|
|
252
252
|
|
|
253
253
|
_dispatchPressedStateChange(pressed: boolean): void {
|
|
254
254
|
if (Platform.OS === 'android') {
|
|
255
|
-
const hostComponentRef = findHostInstance_DEPRECATED(this);
|
|
255
|
+
const hostComponentRef = findHostInstance_DEPRECATED<$FlowFixMe>(this);
|
|
256
256
|
if (hostComponentRef == null) {
|
|
257
257
|
console.warn(
|
|
258
258
|
'Touchable: Unable to find HostComponent instance. ' +
|
|
@@ -267,7 +267,7 @@ class TouchableNativeFeedback extends React.Component<
|
|
|
267
267
|
_dispatchHotspotUpdate(event: GestureResponderEvent): void {
|
|
268
268
|
if (Platform.OS === 'android') {
|
|
269
269
|
const {locationX, locationY} = event.nativeEvent;
|
|
270
|
-
const hostComponentRef = findHostInstance_DEPRECATED(this);
|
|
270
|
+
const hostComponentRef = findHostInstance_DEPRECATED<$FlowFixMe>(this);
|
|
271
271
|
if (hostComponentRef == null) {
|
|
272
272
|
console.warn(
|
|
273
273
|
'Touchable: Unable to find HostComponent instance. ' +
|
|
@@ -308,7 +308,8 @@ class TouchableOpacity extends React.Component<TouchableOpacityProps, State> {
|
|
|
308
308
|
importantForAccessibility={
|
|
309
309
|
this.props['aria-hidden'] === true
|
|
310
310
|
? 'no-hide-descendants'
|
|
311
|
-
: this
|
|
311
|
+
: // $FlowFixMe[incompatible-type] - AnimatedProps types were made more strict and need refining at this call site
|
|
312
|
+
this.props.importantForAccessibility
|
|
312
313
|
}
|
|
313
314
|
accessibilityViewIsModal={
|
|
314
315
|
this.props['aria-modal'] ?? this.props.accessibilityViewIsModal
|
|
@@ -15,17 +15,18 @@ import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
|
|
|
15
15
|
import type {
|
|
16
16
|
BlurEvent,
|
|
17
17
|
FocusEvent,
|
|
18
|
+
GestureResponderEvent,
|
|
18
19
|
LayoutChangeEvent,
|
|
19
20
|
LayoutRectangle,
|
|
20
21
|
MouseEvent,
|
|
21
22
|
PointerEvent,
|
|
22
|
-
GestureResponderEvent,
|
|
23
23
|
} from '../../Types/CoreEventTypes';
|
|
24
24
|
import type {
|
|
25
25
|
AccessibilityActionEvent,
|
|
26
26
|
AccessibilityProps,
|
|
27
27
|
} from './ViewAccessibility';
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
import React from 'react';
|
|
29
30
|
|
|
30
31
|
export type ViewLayout = LayoutRectangle;
|
|
31
32
|
export type ViewLayoutEvent = LayoutChangeEvent;
|
|
@@ -345,6 +346,51 @@ export type ViewPropsAndroid = $ReadOnly<{
|
|
|
345
346
|
onClick?: ?(event: GestureResponderEvent) => mixed,
|
|
346
347
|
}>;
|
|
347
348
|
|
|
349
|
+
export type TVViewPropsIOS = $ReadOnly<{
|
|
350
|
+
/**
|
|
351
|
+
* *(Apple TV only)* When set to true, this view will be focusable
|
|
352
|
+
* and navigable using the Apple TV remote.
|
|
353
|
+
*
|
|
354
|
+
* @platform ios
|
|
355
|
+
*/
|
|
356
|
+
isTVSelectable?: boolean,
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* *(Apple TV only)* May be set to true to force the Apple TV focus engine to move focus to this view.
|
|
360
|
+
*
|
|
361
|
+
* @platform ios
|
|
362
|
+
*/
|
|
363
|
+
hasTVPreferredFocus?: boolean,
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* *(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.
|
|
367
|
+
*
|
|
368
|
+
* @platform ios
|
|
369
|
+
*/
|
|
370
|
+
tvParallaxShiftDistanceX?: number,
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* *(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.
|
|
374
|
+
*
|
|
375
|
+
* @platform ios
|
|
376
|
+
*/
|
|
377
|
+
tvParallaxShiftDistanceY?: number,
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* *(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.
|
|
381
|
+
*
|
|
382
|
+
* @platform ios
|
|
383
|
+
*/
|
|
384
|
+
tvParallaxTiltAngle?: number,
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* *(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.
|
|
388
|
+
*
|
|
389
|
+
* @platform ios
|
|
390
|
+
*/
|
|
391
|
+
tvParallaxMagnification?: number,
|
|
392
|
+
}>;
|
|
393
|
+
|
|
348
394
|
export type ViewPropsIOS = $ReadOnly<{
|
|
349
395
|
/**
|
|
350
396
|
* Whether this `View` should be rendered as a bitmap before compositing.
|
|
@@ -357,7 +403,7 @@ export type ViewPropsIOS = $ReadOnly<{
|
|
|
357
403
|
}>;
|
|
358
404
|
|
|
359
405
|
type ViewBaseProps = $ReadOnly<{
|
|
360
|
-
children?: Node,
|
|
406
|
+
children?: React.Node,
|
|
361
407
|
style?: ?ViewStyleProp,
|
|
362
408
|
|
|
363
409
|
/**
|
|
@@ -15,18 +15,19 @@ import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
|
|
|
15
15
|
import type {
|
|
16
16
|
BlurEvent,
|
|
17
17
|
FocusEvent,
|
|
18
|
+
GestureResponderEvent,
|
|
18
19
|
LayoutChangeEvent,
|
|
19
20
|
LayoutRectangle,
|
|
20
21
|
MouseEvent,
|
|
21
22
|
PointerEvent,
|
|
22
|
-
GestureResponderEvent,
|
|
23
23
|
KeyEvent, // [Windows]
|
|
24
24
|
} from '../../Types/CoreEventTypes';
|
|
25
25
|
import type {
|
|
26
26
|
AccessibilityActionEvent,
|
|
27
27
|
AccessibilityProps,
|
|
28
28
|
} from './ViewAccessibility';
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
import React from 'react';
|
|
30
31
|
|
|
31
32
|
export type ViewLayout = LayoutRectangle;
|
|
32
33
|
export type ViewLayoutEvent = LayoutChangeEvent;
|
|
@@ -346,6 +347,51 @@ export type ViewPropsAndroid = $ReadOnly<{
|
|
|
346
347
|
onClick?: ?(event: GestureResponderEvent) => mixed,
|
|
347
348
|
}>;
|
|
348
349
|
|
|
350
|
+
export type TVViewPropsIOS = $ReadOnly<{
|
|
351
|
+
/**
|
|
352
|
+
* *(Apple TV only)* When set to true, this view will be focusable
|
|
353
|
+
* and navigable using the Apple TV remote.
|
|
354
|
+
*
|
|
355
|
+
* @platform ios
|
|
356
|
+
*/
|
|
357
|
+
isTVSelectable?: boolean,
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* *(Apple TV only)* May be set to true to force the Apple TV focus engine to move focus to this view.
|
|
361
|
+
*
|
|
362
|
+
* @platform ios
|
|
363
|
+
*/
|
|
364
|
+
hasTVPreferredFocus?: boolean,
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* *(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.
|
|
368
|
+
*
|
|
369
|
+
* @platform ios
|
|
370
|
+
*/
|
|
371
|
+
tvParallaxShiftDistanceX?: number,
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* *(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.
|
|
375
|
+
*
|
|
376
|
+
* @platform ios
|
|
377
|
+
*/
|
|
378
|
+
tvParallaxShiftDistanceY?: number,
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* *(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.
|
|
382
|
+
*
|
|
383
|
+
* @platform ios
|
|
384
|
+
*/
|
|
385
|
+
tvParallaxTiltAngle?: number,
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* *(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.
|
|
389
|
+
*
|
|
390
|
+
* @platform ios
|
|
391
|
+
*/
|
|
392
|
+
tvParallaxMagnification?: number,
|
|
393
|
+
}>;
|
|
394
|
+
|
|
349
395
|
export type ViewPropsIOS = $ReadOnly<{
|
|
350
396
|
/**
|
|
351
397
|
* Whether this `View` should be rendered as a bitmap before compositing.
|
|
@@ -358,7 +404,7 @@ export type ViewPropsIOS = $ReadOnly<{
|
|
|
358
404
|
}>;
|
|
359
405
|
|
|
360
406
|
type ViewBaseProps = $ReadOnly<{
|
|
361
|
-
children?: Node,
|
|
407
|
+
children?: React.Node,
|
|
362
408
|
style?: ?ViewStyleProp,
|
|
363
409
|
|
|
364
410
|
/**
|
|
@@ -35,8 +35,8 @@ import processColor from '../StyleSheet/processColor';
|
|
|
35
35
|
|
|
36
36
|
// TODO(T171193075): __REACT_DEVTOOLS_GLOBAL_HOOK__ is always injected in dev-bundles,
|
|
37
37
|
// but it is not mocked in some Jest tests. We should update Jest tests setup, so it would be the same as expected testing environment.
|
|
38
|
-
const reactDevToolsHook: ?ReactDevToolsGlobalHook =
|
|
39
|
-
|
|
38
|
+
const reactDevToolsHook: ?ReactDevToolsGlobalHook = (window: $FlowFixMe)
|
|
39
|
+
.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
40
40
|
|
|
41
41
|
export type DebuggingOverlayRegistrySubscriberProtocol = {
|
|
42
42
|
rootViewRef: AppContainerRootViewRef,
|
|
@@ -226,7 +226,7 @@ class DebuggingOverlayRegistry {
|
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
const instanceReactTag = findNodeHandle(node);
|
|
229
|
+
const instanceReactTag = findNodeHandle<$FlowFixMe>(node);
|
|
230
230
|
if (instanceReactTag == null) {
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
@@ -25,6 +25,8 @@ interface NativeModule {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export type {EventSubscription};
|
|
28
|
+
/** @deprecated Use `EventSubscription` instead. */
|
|
29
|
+
export type NativeEventSubscription = EventSubscription;
|
|
28
30
|
|
|
29
31
|
// $FlowFixMe[unclear-type] unclear type of events
|
|
30
32
|
type UnsafeObject = Object;
|
|
@@ -80,7 +82,7 @@ export default class NativeEventEmitter<
|
|
|
80
82
|
|
|
81
83
|
addListener<TEvent: $Keys<TEventToArgsMap>>(
|
|
82
84
|
eventType: TEvent,
|
|
83
|
-
listener: (...args:
|
|
85
|
+
listener: (...args: TEventToArgsMap[TEvent]) => mixed,
|
|
84
86
|
context?: mixed,
|
|
85
87
|
): EventSubscription {
|
|
86
88
|
this._nativeModule?.addListener(eventType);
|
|
@@ -104,7 +106,7 @@ export default class NativeEventEmitter<
|
|
|
104
106
|
|
|
105
107
|
emit<TEvent: $Keys<TEventToArgsMap>>(
|
|
106
108
|
eventType: TEvent,
|
|
107
|
-
...args:
|
|
109
|
+
...args: TEventToArgsMap[TEvent]
|
|
108
110
|
): void {
|
|
109
111
|
// Generally, `RCTDeviceEventEmitter` is directly invoked. But this is
|
|
110
112
|
// included for completeness.
|
|
@@ -24,7 +24,7 @@ export default class NativeEventEmitter<
|
|
|
24
24
|
{
|
|
25
25
|
addListener<TEvent: $Keys<TEventToArgsMap>>(
|
|
26
26
|
eventType: TEvent,
|
|
27
|
-
listener: (...args:
|
|
27
|
+
listener: (...args: TEventToArgsMap[TEvent]) => mixed,
|
|
28
28
|
context?: mixed,
|
|
29
29
|
): EventSubscription {
|
|
30
30
|
return RCTDeviceEventEmitter.addListener(eventType, listener, context);
|
|
@@ -32,7 +32,7 @@ export default class NativeEventEmitter<
|
|
|
32
32
|
|
|
33
33
|
emit<TEvent: $Keys<TEventToArgsMap>>(
|
|
34
34
|
eventType: TEvent,
|
|
35
|
-
...args:
|
|
35
|
+
...args: TEventToArgsMap[TEvent]
|
|
36
36
|
): void {
|
|
37
37
|
RCTDeviceEventEmitter.emit(eventType, ...args);
|
|
38
38
|
}
|
|
@@ -19,13 +19,19 @@ import {ImageResizeMode} from './ImageResizeMode';
|
|
|
19
19
|
import {ImageRequireSource, ImageURISource} from './ImageSource';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* @
|
|
22
|
+
* @deprecated Use `ImageProgressEventIOS` instead.
|
|
23
23
|
*/
|
|
24
24
|
export interface ImageProgressEventDataIOS {
|
|
25
25
|
loaded: number;
|
|
26
26
|
total: number;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* @see https://reactnative.dev/docs/image#onprogress
|
|
31
|
+
*/
|
|
32
|
+
export type ImageProgressEventIOS =
|
|
33
|
+
NativeSyntheticEvent<ImageProgressEventDataIOS>;
|
|
34
|
+
|
|
29
35
|
export interface ImagePropsIOS {
|
|
30
36
|
/**
|
|
31
37
|
* blurRadius: the blur radius of the blur filter added to the image
|
|
@@ -44,9 +50,7 @@ export interface ImagePropsIOS {
|
|
|
44
50
|
/**
|
|
45
51
|
* Invoked on download progress with {nativeEvent: {loaded, total}}
|
|
46
52
|
*/
|
|
47
|
-
onProgress?:
|
|
48
|
-
| ((event: NativeSyntheticEvent<ImageProgressEventDataIOS>) => void)
|
|
49
|
-
| undefined;
|
|
53
|
+
onProgress?: ((event: ImageProgressEventIOS) => void) | undefined;
|
|
50
54
|
|
|
51
55
|
/**
|
|
52
56
|
* Invoked when a partial load of the image is complete. The definition of
|
|
@@ -99,6 +103,9 @@ export type ImageSourcePropType =
|
|
|
99
103
|
| ImageURISource[]
|
|
100
104
|
| ImageRequireSource;
|
|
101
105
|
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated Use `ImageLoadEvent` instead.
|
|
108
|
+
*/
|
|
102
109
|
export interface ImageLoadEventData {
|
|
103
110
|
source: {
|
|
104
111
|
height: number;
|
|
@@ -107,10 +114,23 @@ export interface ImageLoadEventData {
|
|
|
107
114
|
};
|
|
108
115
|
}
|
|
109
116
|
|
|
117
|
+
/**
|
|
118
|
+
* @see https://reactnative.dev/docs/image#onload
|
|
119
|
+
*/
|
|
120
|
+
export type ImageLoadEvent = NativeSyntheticEvent<ImageLoadEventData>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated Use `ImageErrorEvent` instead.
|
|
124
|
+
*/
|
|
110
125
|
export interface ImageErrorEventData {
|
|
111
126
|
error: any;
|
|
112
127
|
}
|
|
113
128
|
|
|
129
|
+
/**
|
|
130
|
+
* @see https://reactnative.dev/docs/image#onerror
|
|
131
|
+
*/
|
|
132
|
+
export type ImageErrorEvent = NativeSyntheticEvent<ImageErrorEventData>;
|
|
133
|
+
|
|
114
134
|
/**
|
|
115
135
|
* @see https://reactnative.dev/docs/image#resolveassetsource
|
|
116
136
|
*/
|
|
@@ -145,17 +165,13 @@ export interface ImagePropsBase
|
|
|
145
165
|
/**
|
|
146
166
|
* Invoked on load error with {nativeEvent: {error}}
|
|
147
167
|
*/
|
|
148
|
-
onError?:
|
|
149
|
-
| ((error: NativeSyntheticEvent<ImageErrorEventData>) => void)
|
|
150
|
-
| undefined;
|
|
168
|
+
onError?: ((error: ImageErrorEvent) => void) | undefined;
|
|
151
169
|
|
|
152
170
|
/**
|
|
153
171
|
* Invoked when load completes successfully
|
|
154
172
|
* { source: { uri, height, width } }.
|
|
155
173
|
*/
|
|
156
|
-
onLoad?:
|
|
157
|
-
| ((event: NativeSyntheticEvent<ImageLoadEventData>) => void)
|
|
158
|
-
| undefined;
|
|
174
|
+
onLoad?: ((event: ImageLoadEvent) => void) | undefined;
|
|
159
175
|
|
|
160
176
|
/**
|
|
161
177
|
* Invoked when load either succeeds or fails
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
import type {Image} from './ImageTypes.flow';
|
|
12
12
|
|
|
13
13
|
export type {
|
|
14
|
-
|
|
14
|
+
ImageProgressEventIOS,
|
|
15
15
|
ImagePropsIOS,
|
|
16
16
|
ImagePropsAndroid,
|
|
17
17
|
ImageSourcePropType,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
ImageLoadEvent,
|
|
19
|
+
ImageErrorEvent,
|
|
20
20
|
ImagePropsBase,
|
|
21
21
|
ImageProps,
|
|
22
22
|
ImageBackgroundProps,
|
|
@@ -17,6 +17,8 @@ import StyleSheet from '../StyleSheet/StyleSheet';
|
|
|
17
17
|
import Image from './Image';
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
|
|
20
|
+
export type {ImageBackgroundProps} from './ImageProps';
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* Very simple drop-in replacement for <Image> which supports nesting views.
|
|
22
24
|
*
|
|
@@ -24,23 +24,32 @@ import type {
|
|
|
24
24
|
import typeof Image from './Image';
|
|
25
25
|
import type {ImageResizeMode} from './ImageResizeMode';
|
|
26
26
|
import type {ImageSource, ImageURISource} from './ImageSource';
|
|
27
|
-
import type
|
|
27
|
+
import type React from 'react';
|
|
28
|
+
import type {ElementRef, RefSetter} from 'react';
|
|
28
29
|
|
|
29
30
|
export type ImageSourcePropType = ImageSource;
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
* @see ImagePropsIOS.onProgress
|
|
33
|
-
*/
|
|
34
|
-
export type ImageProgressEventDataIOS = {
|
|
32
|
+
type ImageProgressEventDataIOS = {
|
|
35
33
|
loaded: number,
|
|
36
34
|
total: number,
|
|
37
35
|
};
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @see ImagePropsIOS.onProgress
|
|
39
|
+
*/
|
|
40
|
+
export type ImageProgressEventIOS = NativeSyntheticEvent<
|
|
41
|
+
$ReadOnly<ImageProgressEventDataIOS>,
|
|
42
|
+
>;
|
|
43
|
+
|
|
44
|
+
type ImageErrorEventData = {
|
|
40
45
|
error: string,
|
|
41
46
|
};
|
|
42
47
|
|
|
43
|
-
export type
|
|
48
|
+
export type ImageErrorEvent = NativeSyntheticEvent<
|
|
49
|
+
$ReadOnly<ImageErrorEventData>,
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
type ImageLoadEventData = {
|
|
44
53
|
source: {
|
|
45
54
|
height: number,
|
|
46
55
|
width: number,
|
|
@@ -70,9 +79,7 @@ export type ImagePropsIOS = $ReadOnly<{
|
|
|
70
79
|
*
|
|
71
80
|
* See https://reactnative.dev/docs/image#onprogress
|
|
72
81
|
*/
|
|
73
|
-
onProgress?: ?(
|
|
74
|
-
event: NativeSyntheticEvent<$ReadOnly<ImageProgressEventDataIOS>>,
|
|
75
|
-
) => void,
|
|
82
|
+
onProgress?: ?(event: ImageProgressEventIOS) => void,
|
|
76
83
|
}>;
|
|
77
84
|
|
|
78
85
|
export type ImagePropsAndroid = $ReadOnly<{
|
|
@@ -201,9 +208,7 @@ export type ImagePropsBase = $ReadOnly<{
|
|
|
201
208
|
*
|
|
202
209
|
* See https://reactnative.dev/docs/image#onerror
|
|
203
210
|
*/
|
|
204
|
-
onError?: ?(
|
|
205
|
-
event: NativeSyntheticEvent<$ReadOnly<ImageErrorEventData>>,
|
|
206
|
-
) => void,
|
|
211
|
+
onError?: ?(event: ImageErrorEvent) => void,
|
|
207
212
|
|
|
208
213
|
/**
|
|
209
214
|
* onLayout function
|
|
@@ -341,7 +346,7 @@ export type ImageProps = $ReadOnly<{
|
|
|
341
346
|
|
|
342
347
|
export type ImageBackgroundProps = $ReadOnly<{
|
|
343
348
|
...ImageProps,
|
|
344
|
-
children?: Node,
|
|
349
|
+
children?: React.Node,
|
|
345
350
|
|
|
346
351
|
/**
|
|
347
352
|
* Style applied to the outer View component
|