@office-iss/react-native-win32 0.71.0 → 0.71.2
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 -0
- package/CHANGELOG.json +12667 -12652
- package/CHANGELOG.md +23 -15
- package/Libraries/Components/Button/ButtonWin32.Props.d.ts +2 -2
- package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
- package/Libraries/Components/Button/ButtonWin32.js +6 -4
- package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
- package/Libraries/Components/Pressable/Pressable.win32.js +0 -1
- package/Libraries/Components/Text/TextWin32.Props.d.ts +3 -9
- package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
- package/Libraries/Components/Text/TextWin32.d.ts +1 -1
- package/Libraries/Components/Text/TextWin32.js.map +1 -1
- package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +9 -9
- package/Libraries/Components/TextInput/TextInput.win32.js +1150 -154
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +4 -4
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -16
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +99 -24
- package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +2 -2
- package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.Types.d.ts +9 -9
- package/Libraries/Components/Touchable/TouchableWin32.js +5 -6
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +29 -10
- package/Libraries/Components/View/Tests/ViewWin32Test.js +31 -51
- package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
- package/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
- package/Libraries/Components/View/ViewAccessibility.win32.js +178 -0
- package/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
- package/Libraries/Components/View/ViewPropTypes.win32.js +23 -0
- package/Libraries/Components/View/ViewWin32.d.ts +30 -12
- package/Libraries/Components/View/ViewWin32.js +161 -71
- package/Libraries/Image/Image.win32.js +0 -1
- package/Libraries/Pressability/Pressability.win32.js +2 -2
- package/Libraries/Utilities/AcessibilityMapping.win32.js +156 -0
- package/Libraries/__tests__/ButtonWin32-test.js +1 -1
- package/Libraries/platform-types.d.ts +7 -13
- package/index.win32.js +1 -1
- package/jest.config.js +2 -4
- package/overrides.json +38 -8
- package/package.json +5 -5
- package/src/Libraries/Components/Button/ButtonWin32.tsx +8 -8
- package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -15
- package/src/Libraries/Components/Text/TextWin32.tsx +6 -2
- package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +5 -5
- package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -0
- package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +1 -1
- package/src/Libraries/Components/Touchable/TouchableWin32.tsx +6 -7
- package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +28 -52
- package/src/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
- package/src/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
- package/src/Libraries/Components/View/ViewWin32.d.ts +30 -0
- package/src/Libraries/platform-types.d.ts +7 -13
- package/types/modules/BatchedBridge.d.ts +32 -0
- package/types/modules/Codegen.d.ts +74 -0
- package/types/modules/Devtools.d.ts +31 -0
- package/types/modules/LaunchScreen.d.ts +18 -0
- package/types/modules/globals.d.ts +577 -0
- package/types/private/TimerMixin.d.ts +19 -0
- package/types/private/Utilities.d.ts +10 -0
- package/types/public/DeprecatedPropertiesAlias.d.ts +205 -0
- package/types/public/Insets.d.ts +15 -0
- package/types/public/ReactNativeRenderer.d.ts +149 -0
- package/types/public/ReactNativeTypes.d.ts +143 -0
- package/Libraries/Components/TextInput/TextInput.win32.d.ts +0 -68
- package/Libraries/Components/TextInput/TextInput.win32.js.map +0 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.d.ts +0 -7
- package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js +0 -3
- package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js.map +0 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +0 -1
- package/Libraries/Components/View/ViewWin32.Props.d.ts +0 -174
- package/Libraries/Components/View/ViewWin32.Props.js +0 -11
- package/Libraries/Components/View/ViewWin32.Props.js.map +0 -1
- package/Libraries/Components/View/ViewWin32.js.map +0 -1
- package/src/Libraries/Components/TextInput/TextInput.win32.tsx +0 -217
- package/src/Libraries/Components/Touchable/TouchableNativeFeedback.Props.ts +0 -9
- package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.tsx +0 -27
- package/src/Libraries/Components/View/ViewWin32.Props.ts +0 -281
- package/src/Libraries/Components/View/ViewWin32.tsx +0 -119
|
@@ -0,0 +1,372 @@
|
|
|
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 * as React from 'react';
|
|
11
|
+
import {Insets} from 'react-native/types/public/Insets';
|
|
12
|
+
import {GestureResponderHandlers} from 'react-native/types/public/ReactNativeRenderer';
|
|
13
|
+
import {StyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
|
14
|
+
import {ViewStyle} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
|
|
15
|
+
import {
|
|
16
|
+
LayoutChangeEvent,
|
|
17
|
+
MouseEvent, // Win32
|
|
18
|
+
NativeSyntheticEvent, // Win32
|
|
19
|
+
PointerEvents,
|
|
20
|
+
} from 'react-native/Libraries/Types/CoreEventTypes';
|
|
21
|
+
import {Touchable} from 'react-native/Libraries/Components/Touchable/Touchable';
|
|
22
|
+
import {AccessibilityProps} from './ViewAccessibility';
|
|
23
|
+
|
|
24
|
+
export type TVParallaxProperties = {
|
|
25
|
+
/**
|
|
26
|
+
* If true, parallax effects are enabled. Defaults to true.
|
|
27
|
+
*/
|
|
28
|
+
enabled?: boolean | undefined;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Defaults to 2.0.
|
|
32
|
+
*/
|
|
33
|
+
shiftDistanceX?: number | undefined;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Defaults to 2.0.
|
|
37
|
+
*/
|
|
38
|
+
shiftDistanceY?: number | undefined;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Defaults to 0.05.
|
|
42
|
+
*/
|
|
43
|
+
tiltAngle?: number | undefined;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Defaults to 1.0
|
|
47
|
+
*/
|
|
48
|
+
magnification?: number | undefined;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Defaults to 1.0
|
|
52
|
+
*/
|
|
53
|
+
pressMagnification?: number | undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Defaults to 0.3
|
|
57
|
+
*/
|
|
58
|
+
pressDuration?: number | undefined;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Defaults to 0.3
|
|
62
|
+
*/
|
|
63
|
+
pressDelay?: number | undefined;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export interface TVViewPropsIOS {
|
|
67
|
+
/**
|
|
68
|
+
* *(Apple TV only)* When set to true, this view will be focusable
|
|
69
|
+
* and navigable using the Apple TV remote.
|
|
70
|
+
*
|
|
71
|
+
* @platform ios
|
|
72
|
+
*/
|
|
73
|
+
isTVSelectable?: boolean | undefined;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* *(Apple TV only)* May be set to true to force the Apple TV focus engine to move focus to this view.
|
|
77
|
+
*
|
|
78
|
+
* @platform ios
|
|
79
|
+
*/
|
|
80
|
+
hasTVPreferredFocus?: boolean | undefined;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* *(Apple TV only)* Object with properties to control Apple TV parallax effects.
|
|
84
|
+
*
|
|
85
|
+
* @platform ios
|
|
86
|
+
*/
|
|
87
|
+
tvParallaxProperties?: TVParallaxProperties | undefined;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* *(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.
|
|
91
|
+
*
|
|
92
|
+
* @platform ios
|
|
93
|
+
*/
|
|
94
|
+
tvParallaxShiftDistanceX?: number | undefined;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* *(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.
|
|
98
|
+
*
|
|
99
|
+
* @platform ios
|
|
100
|
+
*/
|
|
101
|
+
tvParallaxShiftDistanceY?: number | undefined;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* *(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.
|
|
105
|
+
*
|
|
106
|
+
* @platform ios
|
|
107
|
+
*/
|
|
108
|
+
tvParallaxTiltAngle?: number | undefined;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* *(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.
|
|
112
|
+
*
|
|
113
|
+
* @platform ios
|
|
114
|
+
*/
|
|
115
|
+
tvParallaxMagnification?: number | undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface ViewPropsIOS extends TVViewPropsIOS {
|
|
119
|
+
/**
|
|
120
|
+
* Whether this view should be rendered as a bitmap before compositing.
|
|
121
|
+
*
|
|
122
|
+
* On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children;
|
|
123
|
+
* for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view
|
|
124
|
+
* and quickly composite it during each frame.
|
|
125
|
+
*
|
|
126
|
+
* Rasterization incurs an off-screen drawing pass and the bitmap consumes memory.
|
|
127
|
+
* Test and measure when using this property.
|
|
128
|
+
*/
|
|
129
|
+
shouldRasterizeIOS?: boolean | undefined;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface ViewPropsAndroid {
|
|
133
|
+
/**
|
|
134
|
+
* Views that are only used to layout their children or otherwise don't draw anything
|
|
135
|
+
* may be automatically removed from the native hierarchy as an optimization.
|
|
136
|
+
* Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy.
|
|
137
|
+
*/
|
|
138
|
+
collapsable?: boolean | undefined;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Whether this view needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior.
|
|
142
|
+
* The default (false) falls back to drawing the component and its children
|
|
143
|
+
* 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.
|
|
144
|
+
* This default may be noticeable and undesired in the case where the View you are setting an opacity on
|
|
145
|
+
* has multiple overlapping elements (e.g. multiple overlapping Views, or text and a background).
|
|
146
|
+
*
|
|
147
|
+
* Rendering offscreen to preserve correct alpha behavior is extremely expensive
|
|
148
|
+
* and hard to debug for non-native developers, which is why it is not turned on by default.
|
|
149
|
+
* If you do need to enable this property for an animation,
|
|
150
|
+
* consider combining it with renderToHardwareTextureAndroid if the view contents are static (i.e. it doesn't need to be redrawn each frame).
|
|
151
|
+
* If that property is enabled, this View will be rendered off-screen once,
|
|
152
|
+
* 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.
|
|
153
|
+
*/
|
|
154
|
+
needsOffscreenAlphaCompositing?: boolean | undefined;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Whether this view should render itself (and all of its children) into a single hardware texture on the GPU.
|
|
158
|
+
*
|
|
159
|
+
* On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale:
|
|
160
|
+
* 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
|
|
161
|
+
* 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.
|
|
162
|
+
*/
|
|
163
|
+
renderToHardwareTextureAndroid?: boolean | undefined;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
167
|
+
*/
|
|
168
|
+
focusable?: boolean | undefined;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// [Win32
|
|
172
|
+
|
|
173
|
+
export type Cursor =
|
|
174
|
+
| 'auto'
|
|
175
|
+
| 'default'
|
|
176
|
+
| 'pointer'
|
|
177
|
+
| 'help'
|
|
178
|
+
| 'not-allowed'
|
|
179
|
+
| 'wait'
|
|
180
|
+
| 'move'
|
|
181
|
+
| 'nesw-resize'
|
|
182
|
+
| 'ns-resize'
|
|
183
|
+
| 'nwse-resize'
|
|
184
|
+
| 'we-resize'
|
|
185
|
+
| 'text';
|
|
186
|
+
|
|
187
|
+
export interface INativeKeyboardEvent {
|
|
188
|
+
altKey: boolean;
|
|
189
|
+
ctrlKey: boolean;
|
|
190
|
+
metaKey: boolean;
|
|
191
|
+
shiftKey: boolean;
|
|
192
|
+
key: string;
|
|
193
|
+
}
|
|
194
|
+
export type IKeyboardEvent = NativeSyntheticEvent<INativeKeyboardEvent>;
|
|
195
|
+
|
|
196
|
+
// All of T becomes optional except for Keys
|
|
197
|
+
type PartiallyRequired<T, Keys extends keyof T = keyof T> = Pick<
|
|
198
|
+
Partial<T>,
|
|
199
|
+
Exclude<keyof T, Keys>
|
|
200
|
+
> &
|
|
201
|
+
Pick<T, Keys>;
|
|
202
|
+
|
|
203
|
+
export type IHandledKeyboardEvent = PartiallyRequired<
|
|
204
|
+
INativeKeyboardEvent,
|
|
205
|
+
'key'
|
|
206
|
+
>;
|
|
207
|
+
// Win32]
|
|
208
|
+
|
|
209
|
+
export interface ViewPropsWin32 {
|
|
210
|
+
onKeyDown?: (args: IKeyboardEvent) => void;
|
|
211
|
+
onKeyDownCapture?: (args: IKeyboardEvent) => void;
|
|
212
|
+
onKeyUp?: (args: IKeyboardEvent) => void;
|
|
213
|
+
onKeyUpCapture?: (args: IKeyboardEvent) => void;
|
|
214
|
+
|
|
215
|
+
keyDownEvents?: IHandledKeyboardEvent[];
|
|
216
|
+
keyUpEvents?: IHandledKeyboardEvent[];
|
|
217
|
+
|
|
218
|
+
onMouseLeave?: ?((event: MouseEvent) => void);
|
|
219
|
+
onMouseEnter?: ?((event: MouseEvent) => void);
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Specifies the Tooltip for the view
|
|
223
|
+
* @platform windows
|
|
224
|
+
*/
|
|
225
|
+
tooltip?: ?string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Tab Index
|
|
229
|
+
* @platform windows
|
|
230
|
+
*/
|
|
231
|
+
tabIndex?: ?number;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Specifies if the control should show System focus visuals
|
|
235
|
+
*/
|
|
236
|
+
enableFocusRing?: ?boolean;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
|
|
240
|
+
* Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
|
|
241
|
+
*
|
|
242
|
+
* `ev.target === ev.currentTarget` when the focus is being lost from this component.
|
|
243
|
+
* `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
|
|
244
|
+
*/
|
|
245
|
+
onBlur?: (ev: NativeSyntheticEvent<{}>) => void;
|
|
246
|
+
/**
|
|
247
|
+
* The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
|
|
248
|
+
* Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
|
|
249
|
+
*
|
|
250
|
+
* `ev.target === ev.currentTarget` when the focus is being lost from this component.
|
|
251
|
+
* `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
|
|
252
|
+
*/
|
|
253
|
+
onBlurCapture?: (ev: NativeSyntheticEvent<{}>) => void;
|
|
254
|
+
/**
|
|
255
|
+
* The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
|
|
256
|
+
* Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
|
|
257
|
+
*
|
|
258
|
+
* `ev.target === ev.currentTarget` when the focus is being lost from this component.
|
|
259
|
+
* `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
|
|
260
|
+
*/
|
|
261
|
+
onFocus?: (ev: NativeSyntheticEvent<{}>) => void;
|
|
262
|
+
/**
|
|
263
|
+
* The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
|
|
264
|
+
* Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
|
|
265
|
+
*
|
|
266
|
+
* `ev.target === ev.currentTarget` when the focus is being lost from this component.
|
|
267
|
+
* `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
|
|
268
|
+
*/
|
|
269
|
+
onFocusCapture?: (ev: NativeSyntheticEvent<{}>) => void;
|
|
270
|
+
|
|
271
|
+
cursor?: Cursor;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
275
|
+
*/
|
|
276
|
+
focusable?: boolean | undefined;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Specified an AirSpace animation class to apply to this view
|
|
280
|
+
*/
|
|
281
|
+
animationClass?: string;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* @see https://reactnative.dev/docs/view#props
|
|
286
|
+
*/
|
|
287
|
+
export interface ViewProps
|
|
288
|
+
extends ViewPropsAndroid,
|
|
289
|
+
ViewPropsIOS,
|
|
290
|
+
ViewPropsWin32,
|
|
291
|
+
GestureResponderHandlers,
|
|
292
|
+
Touchable,
|
|
293
|
+
PointerEvents,
|
|
294
|
+
AccessibilityProps {
|
|
295
|
+
children?: React.ReactNode;
|
|
296
|
+
/**
|
|
297
|
+
* This defines how far a touch event can start away from the view.
|
|
298
|
+
* Typical interface guidelines recommend touch targets that are at least
|
|
299
|
+
* 30 - 40 points/density-independent pixels. If a Touchable view has
|
|
300
|
+
* a height of 20 the touchable height can be extended to 40 with
|
|
301
|
+
* hitSlop={{top: 10, bottom: 10, left: 0, right: 0}}
|
|
302
|
+
* NOTE The touch area never extends past the parent view bounds and
|
|
303
|
+
* the Z-index of sibling views always takes precedence if a touch
|
|
304
|
+
* hits two overlapping views.
|
|
305
|
+
*/
|
|
306
|
+
hitSlop?: Insets | undefined;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Used to reference react managed views from native code.
|
|
310
|
+
*/
|
|
311
|
+
id?: string | undefined;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Invoked on mount and layout changes with
|
|
315
|
+
*
|
|
316
|
+
* {nativeEvent: { layout: {x, y, width, height}}}.
|
|
317
|
+
*/
|
|
318
|
+
onLayout?: ((event: LayoutChangeEvent) => void) | undefined;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
*
|
|
322
|
+
* 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:
|
|
323
|
+
*
|
|
324
|
+
* .box-none {
|
|
325
|
+
* pointer-events: none;
|
|
326
|
+
* }
|
|
327
|
+
* .box-none * {
|
|
328
|
+
* pointer-events: all;
|
|
329
|
+
* }
|
|
330
|
+
*
|
|
331
|
+
* box-only is the equivalent of
|
|
332
|
+
*
|
|
333
|
+
* .box-only {
|
|
334
|
+
* pointer-events: all;
|
|
335
|
+
* }
|
|
336
|
+
* .box-only * {
|
|
337
|
+
* pointer-events: none;
|
|
338
|
+
* }
|
|
339
|
+
*
|
|
340
|
+
* But since pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes,
|
|
341
|
+
* 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.
|
|
342
|
+
*/
|
|
343
|
+
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
*
|
|
347
|
+
* This is a special performance property exposed by RCTView and is useful for scrolling content when there are many subviews,
|
|
348
|
+
* 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.
|
|
349
|
+
* The subviews must also have overflow: hidden, as should the containing view (or one of its superviews).
|
|
350
|
+
*/
|
|
351
|
+
removeClippedSubviews?: boolean | undefined;
|
|
352
|
+
|
|
353
|
+
style?: StyleProp<ViewStyle> | undefined;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Used to locate this view in end-to-end tests.
|
|
357
|
+
*/
|
|
358
|
+
testID?: string | undefined;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Used to reference react managed views from native code.
|
|
362
|
+
*/
|
|
363
|
+
nativeID?: string | undefined;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// For backwards compat.... // Win32
|
|
367
|
+
export interface IViewWin32 {
|
|
368
|
+
focus: () => void;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// For backwards compat.... // Win32
|
|
372
|
+
export type IViewWin32Props = ViewProps;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 * as React from 'react';
|
|
11
|
+
import {Constructor} from 'react-native/types/private/Utilities';
|
|
12
|
+
import {ViewProps} from './ViewPropTypes';
|
|
13
|
+
import {NativeMethods} from 'react-native/types/public/ReactNativeTypes';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The most fundamental component for building UI, View is a container that supports layout with flexbox, style, some touch handling,
|
|
17
|
+
* and accessibility controls, and is designed to be nested inside other views and to have 0 to many children of any type.
|
|
18
|
+
* View maps directly to the native view equivalent on whatever platform React is running on,
|
|
19
|
+
* whether that is a UIView, <div>, android.view, etc.
|
|
20
|
+
*/
|
|
21
|
+
declare class ViewWin32Component extends React.Component<ViewProps> {}
|
|
22
|
+
declare const ViewWin32Base: Constructor<NativeMethods> &
|
|
23
|
+
typeof ViewWin32Component;
|
|
24
|
+
export class ViewWin32 extends ViewWin32Base {
|
|
25
|
+
/**
|
|
26
|
+
* Is 3D Touch / Force Touch available (i.e. will touch events include `force`)
|
|
27
|
+
* @platform ios
|
|
28
|
+
*/
|
|
29
|
+
static forceTouchAvailable: boolean;
|
|
30
|
+
}
|
|
@@ -5,19 +5,13 @@
|
|
|
5
5
|
* need to also be added to index.win32.js
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from './Components/
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export * from './Components/Text/TextWin32.Props';
|
|
16
|
-
export * from './Components/Text/TextWin32';
|
|
17
|
-
export * from './Components/Button/ButtonWin32.Props';
|
|
18
|
-
export * from './Components/Button/ButtonWin32';
|
|
19
|
-
export * from './StyleSheet/PlatformColorValueTypesWin32';
|
|
20
|
-
export * from './Components/Touchable/TouchableWin32.Props';
|
|
8
|
+
export {ViewWin32} from './Components/View/ViewWin32';
|
|
9
|
+
export {TextWin32TextStyle, ITextWin32Props } from './Components/Text/TextWin32.Props';
|
|
10
|
+
export {TextWin32} from './Components/Text/TextWin32';
|
|
11
|
+
export {IButtonWin32Props, IButtonWin32Style} from './Components/Button/ButtonWin32.Props';
|
|
12
|
+
export {ButtonWin32} from './Components/Button/ButtonWin32';
|
|
13
|
+
export {GradientColorStop, GradientColorValueWin32, ColorGradientWin32} from './StyleSheet/PlatformColorValueTypesWin32';
|
|
14
|
+
export {ITouchableWin32Props} from './Components/Touchable/TouchableWin32.Props';
|
|
21
15
|
export * from './Components/Touchable/TouchableWin32.Types';
|
|
22
16
|
export * from './Components/Touchable/TouchableWin32';
|
|
23
17
|
export * from './PersonaCoin/PersonaCoin';
|
|
@@ -0,0 +1,32 @@
|
|
|
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 SpyData {
|
|
11
|
+
type: number;
|
|
12
|
+
module?: string | undefined;
|
|
13
|
+
method: string | number;
|
|
14
|
+
args: any[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare class MessageQueue {
|
|
18
|
+
static spy(spyOrToggle: boolean | ((data: SpyData) => void)): void;
|
|
19
|
+
|
|
20
|
+
getCallableModule(name: string): Object;
|
|
21
|
+
registerCallableModule(name: string, module: Object): void;
|
|
22
|
+
registerLazyCallableModule(name: string, factory: () => Object): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare module 'react-native/Libraries/BatchedBridge/BatchedBridge' {
|
|
26
|
+
const BatchedBridge: MessageQueue;
|
|
27
|
+
export default BatchedBridge;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare module 'react-native/Libraries/BatchedBridge/MessageQueue' {
|
|
31
|
+
export default MessageQueue;
|
|
32
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
declare module 'react-native/Libraries/Utilities/codegenNativeCommands' {
|
|
11
|
+
export interface Options<T extends string> {
|
|
12
|
+
readonly supportedCommands: ReadonlyArray<T>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function codegenNativeCommands<T extends object>(
|
|
16
|
+
options: Options<keyof T extends string ? keyof T : never>,
|
|
17
|
+
): T;
|
|
18
|
+
|
|
19
|
+
export default codegenNativeCommands;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module 'react-native/Libraries/Utilities/codegenNativeComponent' {
|
|
23
|
+
import type {HostComponent} from 'react-native';
|
|
24
|
+
|
|
25
|
+
export interface Options {
|
|
26
|
+
readonly interfaceOnly?: boolean;
|
|
27
|
+
readonly paperComponentName?: string;
|
|
28
|
+
readonly paperComponentNameDeprecated?: string;
|
|
29
|
+
readonly excludedPlatforms?: ReadonlyArray<'iOS' | 'android'>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type NativeComponentType<T> = HostComponent<T>;
|
|
33
|
+
|
|
34
|
+
function codegenNativeComponent<Props extends object>(
|
|
35
|
+
componentName: string,
|
|
36
|
+
options?: Options,
|
|
37
|
+
): NativeComponentType<Props>;
|
|
38
|
+
|
|
39
|
+
export default codegenNativeComponent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module 'react-native/Libraries/Types/CodegenTypes' {
|
|
43
|
+
import type {NativeSyntheticEvent} from 'react-native';
|
|
44
|
+
|
|
45
|
+
// Event types
|
|
46
|
+
// We're not using the PaperName, it is only used to codegen view config settings
|
|
47
|
+
|
|
48
|
+
export type BubblingEventHandler<
|
|
49
|
+
T,
|
|
50
|
+
PaperName extends string | never = never,
|
|
51
|
+
> = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
|
|
52
|
+
export type DirectEventHandler<
|
|
53
|
+
T,
|
|
54
|
+
PaperName extends string | never = never,
|
|
55
|
+
> = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
|
|
56
|
+
|
|
57
|
+
// Prop types
|
|
58
|
+
export type Double = number;
|
|
59
|
+
export type Float = number;
|
|
60
|
+
export type Int32 = number;
|
|
61
|
+
export type UnsafeObject = object;
|
|
62
|
+
|
|
63
|
+
type DefaultTypes = number | boolean | string | ReadonlyArray<string>;
|
|
64
|
+
// Default handling, ignore the unused value
|
|
65
|
+
// we're only using it for type checking
|
|
66
|
+
//
|
|
67
|
+
// TODO: (rickhanlonii) T44881457 If a default is provided, it should always be optional
|
|
68
|
+
// but that is currently not supported in the codegen since we require a default
|
|
69
|
+
|
|
70
|
+
export type WithDefault<
|
|
71
|
+
Type extends DefaultTypes,
|
|
72
|
+
Value extends Type | string | undefined | null,
|
|
73
|
+
> = Type | undefined | null;
|
|
74
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
declare module 'react-native/Libraries/Core/Devtools/parseErrorStack' {
|
|
11
|
+
export type StackFrame = {
|
|
12
|
+
file: string;
|
|
13
|
+
methodName: string;
|
|
14
|
+
lineNumber: number;
|
|
15
|
+
column: number | null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export interface ExtendedError extends Error {
|
|
19
|
+
framesToPop?: number | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default function parseErrorStack(error: ExtendedError): StackFrame[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare module 'react-native/Libraries/Core/Devtools/symbolicateStackTrace' {
|
|
26
|
+
import {StackFrame} from 'react-native/Libraries/Core/Devtools/parseErrorStack';
|
|
27
|
+
|
|
28
|
+
export default function symbolicateStackTrace(
|
|
29
|
+
stack: ReadonlyArray<StackFrame>,
|
|
30
|
+
): Promise<StackFrame[]>;
|
|
31
|
+
}
|
|
@@ -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
|
+
// Adds the JSX elements used in the launch screen.
|
|
11
|
+
|
|
12
|
+
declare module 'react-native/Libraries/NewAppScreen' {
|
|
13
|
+
export const Header: any;
|
|
14
|
+
export const LearnMoreLinks: any;
|
|
15
|
+
export const Colors: any;
|
|
16
|
+
export const DebugInstructions: any;
|
|
17
|
+
export const ReloadInstructions: any;
|
|
18
|
+
}
|