@office-iss/react-native-win32 0.71.0-preview.2 → 0.71.1

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.
Files changed (99) hide show
  1. package/.flowconfig +2 -0
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +21 -5
  4. package/Libraries/Animated/Animated.d.ts +28 -0
  5. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +29 -0
  6. package/Libraries/Components/Button/ButtonWin32.Props.d.ts +2 -2
  7. package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
  8. package/Libraries/Components/Button/ButtonWin32.js +6 -4
  9. package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
  10. package/Libraries/Components/Pressable/Pressable.win32.js +0 -1
  11. package/Libraries/Components/ScrollView/ScrollView.d.ts +3 -3
  12. package/Libraries/Components/Text/TextWin32.Props.d.ts +3 -9
  13. package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
  14. package/Libraries/Components/Text/TextWin32.d.ts +1 -1
  15. package/Libraries/Components/Text/TextWin32.js.map +1 -1
  16. package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +9 -9
  17. package/Libraries/Components/TextInput/TextInput.win32.js +1150 -154
  18. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +4 -4
  19. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  20. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -16
  21. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +99 -24
  22. package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +2 -2
  23. package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
  24. package/Libraries/Components/Touchable/TouchableWin32.Types.d.ts +9 -9
  25. package/Libraries/Components/Touchable/TouchableWin32.js +5 -6
  26. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  27. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +29 -10
  28. package/Libraries/Components/View/Tests/ViewWin32Test.js +31 -51
  29. package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
  30. package/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
  31. package/Libraries/Components/View/ViewAccessibility.win32.js +178 -0
  32. package/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
  33. package/Libraries/Components/View/ViewPropTypes.win32.js +23 -0
  34. package/Libraries/Components/View/ViewWin32.d.ts +30 -12
  35. package/Libraries/Components/View/ViewWin32.js +161 -71
  36. package/Libraries/Core/ReactNativeVersion.js +1 -1
  37. package/Libraries/Image/Image.win32.js +0 -1
  38. package/Libraries/Image/ImageSource.js +0 -2
  39. package/Libraries/Lists/FlatList.d.ts +1 -42
  40. package/Libraries/Lists/FlatList.js +1 -0
  41. package/Libraries/Lists/SectionList.d.ts +0 -42
  42. package/Libraries/Lists/VirtualizedList.d.ts +31 -1
  43. package/Libraries/Lists/VirtualizedList.js +1 -0
  44. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -2
  45. package/Libraries/Pressability/Pressability.win32.js +2 -2
  46. package/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +20 -0
  47. package/Libraries/ReactNative/AppRegistry.d.ts +51 -0
  48. package/Libraries/ReactNative/AppRegistry.js +3 -1
  49. package/Libraries/ReactNative/RootTag.d.ts +13 -0
  50. package/Libraries/StyleSheet/StyleSheet.d.ts +7 -3
  51. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +0 -1
  52. package/Libraries/Utilities/AcessibilityMapping.win32.js +156 -0
  53. package/Libraries/Utilities/createPerformanceLogger.d.ts +48 -0
  54. package/Libraries/Vibration/Vibration.d.ts +1 -1
  55. package/Libraries/__tests__/ButtonWin32-test.js +1 -1
  56. package/Libraries/platform-types.d.ts +7 -13
  57. package/index.win32.js +1 -1
  58. package/jest.config.js +2 -4
  59. package/overrides.json +39 -9
  60. package/package.json +17 -17
  61. package/src/Libraries/Components/Button/ButtonWin32.tsx +8 -8
  62. package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -15
  63. package/src/Libraries/Components/Text/TextWin32.tsx +6 -2
  64. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +5 -5
  65. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -0
  66. package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +1 -1
  67. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +6 -7
  68. package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +28 -52
  69. package/src/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
  70. package/src/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
  71. package/src/Libraries/Components/View/ViewWin32.d.ts +30 -0
  72. package/src/Libraries/platform-types.d.ts +7 -13
  73. package/types/index.d.ts +1 -0
  74. package/types/modules/BatchedBridge.d.ts +32 -0
  75. package/types/modules/Codegen.d.ts +74 -0
  76. package/types/modules/Devtools.d.ts +31 -0
  77. package/types/modules/LaunchScreen.d.ts +18 -0
  78. package/types/modules/globals.d.ts +577 -0
  79. package/types/private/TimerMixin.d.ts +19 -0
  80. package/types/private/Utilities.d.ts +10 -0
  81. package/types/public/DeprecatedPropertiesAlias.d.ts +205 -0
  82. package/types/public/Insets.d.ts +15 -0
  83. package/types/public/ReactNativeRenderer.d.ts +149 -0
  84. package/types/public/ReactNativeTypes.d.ts +143 -0
  85. package/Libraries/Components/TextInput/TextInput.win32.d.ts +0 -68
  86. package/Libraries/Components/TextInput/TextInput.win32.js.map +0 -1
  87. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.d.ts +0 -7
  88. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js +0 -3
  89. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js.map +0 -1
  90. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +0 -1
  91. package/Libraries/Components/View/ViewWin32.Props.d.ts +0 -174
  92. package/Libraries/Components/View/ViewWin32.Props.js +0 -11
  93. package/Libraries/Components/View/ViewWin32.Props.js.map +0 -1
  94. package/Libraries/Components/View/ViewWin32.js.map +0 -1
  95. package/src/Libraries/Components/TextInput/TextInput.win32.tsx +0 -217
  96. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.Props.ts +0 -9
  97. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.tsx +0 -27
  98. package/src/Libraries/Components/View/ViewWin32.Props.ts +0 -281
  99. package/src/Libraries/Components/View/ViewWin32.tsx +0 -119
@@ -25,7 +25,6 @@ import ImageInjection from './ImageInjection';
25
25
  import {getImageSourcesFromImageProps} from './ImageSourceUtils';
26
26
  import {convertObjectFitToResizeMode} from './ImageUtils';
27
27
  import ImageViewNativeComponent from './ImageViewNativeComponent';
28
- import NativeImageLoaderIOS from './NativeImageLoaderIOS';
29
28
  import resolveAssetSource from './resolveAssetSource';
30
29
  import * as React from 'react';
31
30
 
@@ -11,8 +11,6 @@
11
11
  'use strict';
12
12
 
13
13
  /**
14
- * Keep this in sync with `DeprecatedImageSourcePropType.js`.
15
- *
16
14
  * This type is intentionally inexact in order to permit call sites that supply
17
15
  * extra properties.
18
16
  */
@@ -19,48 +19,6 @@ import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
19
19
  import {View} from '../Components/View/View';
20
20
 
21
21
  export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
22
- /**
23
- * Rendered in between each item, but not at the top or bottom
24
- */
25
- ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
26
-
27
- /**
28
- * Rendered when the list is empty.
29
- */
30
- ListEmptyComponent?:
31
- | React.ComponentType<any>
32
- | React.ReactElement
33
- | null
34
- | undefined;
35
-
36
- /**
37
- * Rendered at the very end of the list.
38
- */
39
- ListFooterComponent?:
40
- | React.ComponentType<any>
41
- | React.ReactElement
42
- | null
43
- | undefined;
44
-
45
- /**
46
- * Styling for internal View for ListFooterComponent
47
- */
48
- ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
49
-
50
- /**
51
- * Rendered at the very beginning of the list.
52
- */
53
- ListHeaderComponent?:
54
- | React.ComponentType<any>
55
- | React.ReactElement
56
- | null
57
- | undefined;
58
-
59
- /**
60
- * Styling for internal View for ListHeaderComponent
61
- */
62
- ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
63
-
64
22
  /**
65
23
  * Optional custom style for multi-item rows generated when numColumns > 1
66
24
  */
@@ -248,6 +206,7 @@ export class FlatList<ItemT = any> extends React.Component<
248
206
  scrollToItem: (params: {
249
207
  animated?: boolean | null | undefined;
250
208
  item: ItemT;
209
+ viewOffset?: number | undefined;
251
210
  viewPosition?: number | undefined;
252
211
  }) => void;
253
212
 
@@ -334,6 +334,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
334
334
  scrollToItem(params: {
335
335
  animated?: ?boolean,
336
336
  item: ItemT,
337
+ viewOffset?: number,
337
338
  viewPosition?: number,
338
339
  ...
339
340
  }) {
@@ -61,48 +61,6 @@ export type SectionListRenderItem<ItemT, SectionT = DefaultSectionT> = (
61
61
 
62
62
  export interface SectionListProps<ItemT, SectionT = DefaultSectionT>
63
63
  extends VirtualizedListWithoutRenderItemProps<ItemT> {
64
- /**
65
- * Rendered in between adjacent Items within each section.
66
- */
67
- ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
68
-
69
- /**
70
- * Rendered when the list is empty.
71
- */
72
- ListEmptyComponent?:
73
- | React.ComponentType<any>
74
- | React.ReactElement
75
- | null
76
- | undefined;
77
-
78
- /**
79
- * Rendered at the very end of the list.
80
- */
81
- ListFooterComponent?:
82
- | React.ComponentType<any>
83
- | React.ReactElement
84
- | null
85
- | undefined;
86
-
87
- /**
88
- * Styling for internal View for ListFooterComponent
89
- */
90
- ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined | null;
91
-
92
- /**
93
- * Rendered at the very beginning of the list.
94
- */
95
- ListHeaderComponent?:
96
- | React.ComponentType<any>
97
- | React.ReactElement
98
- | null
99
- | undefined;
100
-
101
- /**
102
- * Styling for internal View for ListHeaderComponent
103
- */
104
- ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined | null;
105
-
106
64
  /**
107
65
  * Rendered in between each section.
108
66
  */
@@ -9,7 +9,14 @@
9
9
 
10
10
  import type * as React from 'react';
11
11
  import type {LayoutChangeEvent} from '../../types';
12
- import type {ScrollViewProps} from '../Components/ScrollView/ScrollView';
12
+ import {StyleProp} from '../StyleSheet/StyleSheet';
13
+ import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
14
+ import type {
15
+ ScrollResponderMixin,
16
+ ScrollView,
17
+ ScrollViewProps,
18
+ } from '../Components/ScrollView/ScrollView';
19
+ import type {View} from '../Components/View/View';
13
20
 
14
21
  export interface ViewToken {
15
22
  item: any;
@@ -96,6 +103,7 @@ export class VirtualizedList<ItemT> extends React.Component<
96
103
  scrollToItem: (params: {
97
104
  animated?: boolean | undefined;
98
105
  item: ItemT;
106
+ viewOffset?: number | undefined;
99
107
  viewPosition?: number | undefined;
100
108
  }) => void;
101
109
 
@@ -111,6 +119,13 @@ export class VirtualizedList<ItemT> extends React.Component<
111
119
  }) => void;
112
120
 
113
121
  recordInteraction: () => void;
122
+
123
+ getScrollRef: () =>
124
+ | React.ElementRef<typeof ScrollView>
125
+ | React.ElementRef<typeof View>
126
+ | null;
127
+
128
+ getScrollResponder: () => ScrollResponderMixin | null;
114
129
  }
115
130
 
116
131
  /**
@@ -124,6 +139,11 @@ export interface VirtualizedListProps<ItemT>
124
139
 
125
140
  export interface VirtualizedListWithoutRenderItemProps<ItemT>
126
141
  extends ScrollViewProps {
142
+ /**
143
+ * Rendered in between each item, but not at the top or bottom
144
+ */
145
+ ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
146
+
127
147
  /**
128
148
  * Rendered when the list is empty. Can be a React Component Class, a render function, or
129
149
  * a rendered element.
@@ -144,6 +164,11 @@ export interface VirtualizedListWithoutRenderItemProps<ItemT>
144
164
  | null
145
165
  | undefined;
146
166
 
167
+ /**
168
+ * Styling for internal View for ListFooterComponent
169
+ */
170
+ ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
171
+
147
172
  /**
148
173
  * Rendered at the top of all the items. Can be a React Component Class, a render function, or
149
174
  * a rendered element.
@@ -154,6 +179,11 @@ export interface VirtualizedListWithoutRenderItemProps<ItemT>
154
179
  | null
155
180
  | undefined;
156
181
 
182
+ /**
183
+ * Styling for internal View for ListHeaderComponent
184
+ */
185
+ ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
186
+
157
187
  /**
158
188
  * The default accessor functions assume this is an Array<{key: string}> but you can override
159
189
  * getItem, getItemCount, and keyExtractor to handle any type of index-based data.
@@ -263,6 +263,7 @@ export default class VirtualizedList extends StateSafePureComponent<
263
263
  scrollToItem(params: {
264
264
  animated?: ?boolean,
265
265
  item: Item,
266
+ viewOffset?: number,
266
267
  viewPosition?: number,
267
268
  ...
268
269
  }) {
@@ -75,7 +75,8 @@ const PERMISSIONS = Object.freeze({
75
75
  ANSWER_PHONE_CALLS: 'android.permission.ANSWER_PHONE_CALLS',
76
76
  READ_PHONE_NUMBERS: 'android.permission.READ_PHONE_NUMBERS',
77
77
  UWB_RANGING: 'android.permission.UWB_RANGING',
78
- POST_NOTIFICATION: 'android.permission.POST_NOTIFICATIONS',
78
+ POST_NOTIFICATION: 'android.permission.POST_NOTIFICATIONS', // Remove in 0.72
79
+ POST_NOTIFICATIONS: 'android.permission.POST_NOTIFICATIONS',
79
80
  NEARBY_WIFI_DEVICES: 'android.permission.NEARBY_WIFI_DEVICES',
80
81
  });
81
82
 
@@ -106,7 +107,8 @@ class PermissionsAndroid {
106
107
  CAMERA: string,
107
108
  GET_ACCOUNTS: string,
108
109
  NEARBY_WIFI_DEVICES: string,
109
- POST_NOTIFICATION: string,
110
+ POST_NOTIFICATION: string, // Remove in 0.72
111
+ POST_NOTIFICATIONS: string,
110
112
  PROCESS_OUTGOING_CALLS: string,
111
113
  READ_CALENDAR: string,
112
114
  READ_CALL_LOG: string,
@@ -596,7 +596,7 @@ export default class Pressability {
596
596
  (event.nativeEvent.code === 'Space' ||
597
597
  event.nativeEvent.code === 'Enter' ||
598
598
  event.nativeEvent.code === 'GamepadA') &&
599
- event.defaultPrevented != true
599
+ event.defaultPrevented !== true
600
600
  ) {
601
601
  const {onPressOut, onPress} = this._config;
602
602
  // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
@@ -613,7 +613,7 @@ export default class Pressability {
613
613
  (event.nativeEvent.code === 'Space' ||
614
614
  event.nativeEvent.code === 'Enter' ||
615
615
  event.nativeEvent.code === 'GamepadA') &&
616
- event.defaultPrevented != true
616
+ event.defaultPrevented !== true
617
617
  ) {
618
618
  const {onPressIn} = this._config;
619
619
  // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
@@ -49,6 +49,11 @@ export interface PushNotification {
49
49
  */
50
50
  getData(): Object;
51
51
 
52
+ /**
53
+ * Gets the thread ID on the notif
54
+ */
55
+ getThreadId(): string;
56
+
52
57
  /**
53
58
  * iOS Only
54
59
  * Signifies remote notification handling is complete
@@ -135,6 +140,21 @@ export interface PushNotificationIOSStatic {
135
140
  */
136
141
  cancelAllLocalNotifications(): void;
137
142
 
143
+ /**
144
+ * Remove all delivered notifications from Notification Center.
145
+ */
146
+ removeAllDeliveredNotifications(): void;
147
+
148
+ /**
149
+ * Provides you with a list of the app’s notifications that are still displayed in Notification Center.
150
+ */
151
+ getDeliveredNotifications(callback: (notifications: Object[]) => void): void;
152
+
153
+ /**
154
+ * Removes the specified notifications from Notification Center
155
+ */
156
+ removeDeliveredNotifications(identifiers: string[]): void;
157
+
138
158
  /**
139
159
  * Cancel local notifications.
140
160
  * Optionally restricts the set of canceled notifications to those notifications whose userInfo fields match the corresponding fields in the userInfo argument.
@@ -8,9 +8,12 @@
8
8
  */
9
9
 
10
10
  import type * as React from 'react';
11
+ import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
11
12
 
12
13
  type Task = (taskData: any) => Promise<void>;
13
14
  type TaskProvider = () => Task;
15
+ type TaskCanceller = () => void;
16
+ type TaskCancelProvider = () => TaskCanceller;
14
17
 
15
18
  export type ComponentProvider = () => React.ComponentType<any>;
16
19
 
@@ -22,6 +25,15 @@ export type AppConfig = {
22
25
  run?: Runnable | undefined;
23
26
  };
24
27
 
28
+ export type ComponentProviderInstrumentationHook = (
29
+ component: ComponentProvider,
30
+ scopedPerformanceLogger: IPerformanceLogger,
31
+ ) => React.ComponentType<any>;
32
+
33
+ export type WrapperComponentProvider = (
34
+ appParameters: any,
35
+ ) => React.ComponentType<any>;
36
+
25
37
  /**
26
38
  * `AppRegistry` is the JS entry point to running all React Native apps. App
27
39
  * root components should register themselves with
@@ -38,17 +50,31 @@ export type AppConfig = {
38
50
  * `require`d.
39
51
  */
40
52
  export namespace AppRegistry {
53
+ export function setWrapperComponentProvider(
54
+ provider: WrapperComponentProvider,
55
+ ): void;
56
+
41
57
  export function registerConfig(config: AppConfig[]): void;
42
58
 
43
59
  export function registerComponent(
44
60
  appKey: string,
45
61
  getComponentFunc: ComponentProvider,
62
+ section?: boolean,
46
63
  ): string;
47
64
 
48
65
  export function registerRunnable(appKey: string, func: Runnable): string;
49
66
 
67
+ export function registerSection(
68
+ appKey: string,
69
+ component: ComponentProvider,
70
+ ): void;
71
+
50
72
  export function getAppKeys(): string[];
51
73
 
74
+ export function getSectionKeys(): string[];
75
+
76
+ export function getSections(): Record<string, Runnable>;
77
+
52
78
  export function unmountApplicationComponentAtRootTag(rootTag: number): void;
53
79
 
54
80
  export function runApplication(appKey: string, appParameters: any): void;
@@ -65,4 +91,29 @@ export namespace AppRegistry {
65
91
  ): void;
66
92
 
67
93
  export function getRunnable(appKey: string): Runnable | undefined;
94
+
95
+ export function getRegistry(): {sections: string[]; runnables: Runnable[]};
96
+
97
+ export function setComponentProviderInstrumentationHook(
98
+ hook: ComponentProviderInstrumentationHook,
99
+ ): void;
100
+
101
+ export function registerHeadlessTask(
102
+ taskKey: string,
103
+ taskProvider: TaskProvider,
104
+ ): void;
105
+
106
+ export function registerCancellableHeadlessTask(
107
+ taskKey: string,
108
+ taskProvider: TaskProvider,
109
+ taskCancelProvider: TaskCancelProvider,
110
+ ): void;
111
+
112
+ export function startHeadlessTask(
113
+ taskId: number,
114
+ taskKey: string,
115
+ data: any,
116
+ ): void;
117
+
118
+ export function cancelHeadlessTask(taskId: number, taskKey: string): void;
68
119
  }
@@ -51,7 +51,9 @@ export type Registry = {
51
51
  runnables: Runnables,
52
52
  ...
53
53
  };
54
- export type WrapperComponentProvider = any => React$ComponentType<any>;
54
+ export type WrapperComponentProvider = (
55
+ appParameters: any,
56
+ ) => React$ComponentType<any>;
55
57
 
56
58
  const runnables: Runnables = {};
57
59
  let runCount = 1;
@@ -0,0 +1,13 @@
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
+
12
+ export type RootTag = number;
13
+ export const RootTagContext: React.Context<RootTag>;
@@ -87,9 +87,13 @@ export namespace StyleSheet {
87
87
  * an array, saving allocations and maintaining reference equality for
88
88
  * PureComponent checks.
89
89
  */
90
- export function compose<T>(
91
- style1: StyleProp<T> | Array<StyleProp<T>>,
92
- style2: StyleProp<T> | Array<StyleProp<T>>,
90
+ export function compose<
91
+ T extends ViewStyle | TextStyle | ImageStyle,
92
+ U extends T,
93
+ V extends T,
94
+ >(
95
+ style1: StyleProp<U> | Array<StyleProp<U>>,
96
+ style2: StyleProp<V> | Array<StyleProp<V>>,
93
97
  ): StyleProp<T>;
94
98
 
95
99
  /**
@@ -236,7 +236,6 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
236
236
  borderTopWidth?: number | undefined;
237
237
  borderWidth?: number | undefined;
238
238
  opacity?: number | undefined;
239
- testID?: string | undefined;
240
239
  /**
241
240
  * Sets the elevation of a view, using Android's underlying
242
241
  * [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
@@ -0,0 +1,156 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ import type {
14
+ AccessibilityRole,
15
+ Role,
16
+ } from '../Components/View/ViewAccessibility';
17
+
18
+ // Map role values to AccessibilityRole values
19
+ export function getAccessibilityRoleFromRole(role: Role): ?AccessibilityRole {
20
+ switch (role) {
21
+ case 'alert':
22
+ return 'alert';
23
+ case 'alertdialog':
24
+ return 'alertdialog'; // Win32
25
+ case 'application':
26
+ return 'application'; // Win32
27
+ case 'article':
28
+ return undefined;
29
+ case 'banner':
30
+ return undefined;
31
+ case 'button':
32
+ return 'button';
33
+ case 'cell':
34
+ return undefined;
35
+ case 'checkbox':
36
+ return 'checkbox';
37
+ case 'columnheader':
38
+ return undefined;
39
+ case 'combobox':
40
+ return 'combobox';
41
+ case 'complementary':
42
+ return undefined;
43
+ case 'contentinfo':
44
+ return undefined;
45
+ case 'definition':
46
+ return undefined;
47
+ case 'dialog':
48
+ return 'dialog'; // Win32
49
+ case 'directory':
50
+ return undefined;
51
+ case 'document':
52
+ return undefined;
53
+ case 'feed':
54
+ return undefined;
55
+ case 'figure':
56
+ return undefined;
57
+ case 'form':
58
+ return undefined;
59
+ case 'grid':
60
+ return 'grid';
61
+ case 'group':
62
+ return 'group'; // Win32
63
+ case 'heading':
64
+ return 'header';
65
+ case 'img':
66
+ return 'image';
67
+ case 'link':
68
+ return 'link';
69
+ case 'list':
70
+ return 'list';
71
+ case 'listitem':
72
+ return 'listitem'; // Win32
73
+ case 'log':
74
+ return undefined;
75
+ case 'main':
76
+ return undefined;
77
+ case 'marquee':
78
+ return undefined;
79
+ case 'math':
80
+ return undefined;
81
+ case 'menu':
82
+ return 'menu';
83
+ case 'menubar':
84
+ return 'menubar';
85
+ case 'menuitem':
86
+ return 'menuitem';
87
+ case 'meter':
88
+ return undefined;
89
+ case 'navigation':
90
+ return undefined;
91
+ case 'none':
92
+ return 'none';
93
+ case 'note':
94
+ return undefined;
95
+ case 'option':
96
+ return undefined;
97
+ case 'presentation':
98
+ return 'presentation'; // Win32
99
+ case 'progressbar':
100
+ return 'progressbar';
101
+ case 'radio':
102
+ return 'radio';
103
+ case 'radiogroup':
104
+ return 'radiogroup';
105
+ case 'region':
106
+ return undefined;
107
+ case 'row':
108
+ return undefined;
109
+ case 'rowgroup':
110
+ return undefined;
111
+ case 'rowheader':
112
+ return undefined;
113
+ case 'scrollbar':
114
+ return 'scrollbar';
115
+ case 'searchbox':
116
+ return 'search';
117
+ case 'separator':
118
+ return undefined;
119
+ case 'slider':
120
+ return 'adjustable';
121
+ case 'spinbutton':
122
+ return 'spinbutton';
123
+ case 'status':
124
+ return undefined;
125
+ case 'summary':
126
+ return 'summary';
127
+ case 'switch':
128
+ return 'switch';
129
+ case 'tab':
130
+ return 'tab';
131
+ case 'table':
132
+ return undefined;
133
+ case 'tablist':
134
+ return 'tablist';
135
+ case 'tabpanel':
136
+ return 'tabpanel'; // Win32
137
+ case 'term':
138
+ return undefined;
139
+ case 'textbox': // Win32
140
+ return 'textbox'; // Win32
141
+ case 'timer':
142
+ return 'timer';
143
+ case 'toolbar':
144
+ return 'toolbar';
145
+ case 'tooltip':
146
+ return undefined;
147
+ case 'tree':
148
+ return 'tree'; // Win32
149
+ case 'treegrid':
150
+ return undefined;
151
+ case 'treeitem':
152
+ return 'treeitem'; // Win32
153
+ }
154
+
155
+ return undefined;
156
+ }
@@ -0,0 +1,48 @@
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
+ export type Timespan = {
11
+ startTime: number;
12
+ endTime?: number;
13
+ totalTime?: number;
14
+ startExtras?: Extras;
15
+ endExtras?: Extras;
16
+ };
17
+
18
+ // Extra values should be serializable primitives
19
+ export type ExtraValue = number | string | boolean;
20
+
21
+ export type Extras = {[key: string]: ExtraValue};
22
+
23
+ export interface IPerformanceLogger {
24
+ addTimespan(
25
+ key: string,
26
+ startTime: number,
27
+ endTime: number,
28
+ startExtras?: Extras,
29
+ endExtras?: Extras,
30
+ ): void;
31
+ append(logger: IPerformanceLogger): void;
32
+ clear(): void;
33
+ clearCompleted(): void;
34
+ close(): void;
35
+ currentTimestamp(): number;
36
+ getExtras(): {[key: string]: ExtraValue | null};
37
+ getPoints(): {[key: string]: number | null};
38
+ getPointExtras(): {[key: string]: Extras | null};
39
+ getTimespans(): {[key: string]: Timespan | null};
40
+ hasTimespan(key: string): boolean;
41
+ isClosed(): boolean;
42
+ logEverything(): void;
43
+ markPoint(key: string, timestamp?: number, extras?: Extras): void;
44
+ removeExtra(key: string): ExtraValue | null;
45
+ setExtra(key: string, value: ExtraValue): void;
46
+ startTimespan(key: string, timestamp?: number, extras?: Extras): void;
47
+ stopTimespan(key: string, timestamp?: number, extras?: Extras): void;
48
+ }
@@ -31,7 +31,7 @@
31
31
  * V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed)
32
32
  */
33
33
  export interface VibrationStatic {
34
- vibrate(pattern?: number | number[] | null, repeat?: boolean | null): void;
34
+ vibrate(pattern?: number | number[], repeat?: boolean): void;
35
35
 
36
36
  /**
37
37
  * Stop vibration
@@ -4,7 +4,7 @@
4
4
  const React = require('react');
5
5
  const ReactTestRenderer = require('react-test-renderer');
6
6
 
7
- const {ButtonWin32} = require('../Components/Button/ButtonWin32');
7
+ const {ButtonWin32} = require('@office-iss/react-native-win32');
8
8
 
9
9
  describe('ButtonWin32', () => {
10
10
  it('renders native component', () => {
@@ -5,19 +5,13 @@
5
5
  * need to also be added to index.win32.js
6
6
  */
7
7
 
8
- export type {
9
- AccessibilityActionInfo,
10
- AccessibilityActionName,
11
- AccessibilityState
12
- } from './Components/View/ViewWin32.Props';
13
- export * from './Components/View/ViewWin32.Props';
14
- export * from './Components/View/ViewWin32';
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';