@office-iss/react-native-win32 0.0.0-canary.270 → 0.0.0-canary.271

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 (96) hide show
  1. package/CHANGELOG.json +16 -1
  2. package/CHANGELOG.md +12 -4
  3. package/Libraries/Animated/animations/Animation.js +63 -24
  4. package/Libraries/Animated/animations/DecayAnimation.js +26 -38
  5. package/Libraries/Animated/animations/SpringAnimation.js +33 -39
  6. package/Libraries/Animated/animations/TimingAnimation.js +34 -42
  7. package/Libraries/Animated/createAnimatedComponent.js +46 -32
  8. package/Libraries/Animated/nodes/AnimatedProps.js +16 -10
  9. package/Libraries/Animated/nodes/AnimatedStyle.js +4 -0
  10. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  11. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +61 -3
  12. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +61 -3
  13. package/Libraries/Components/Button.js +6 -4
  14. package/Libraries/Components/Button.win32.js +9 -4
  15. package/Libraries/Components/ScrollView/ScrollView.js +5 -5
  16. package/Libraries/Components/Switch/Switch.js +8 -6
  17. package/Libraries/Components/TextInput/TextInput.d.ts +4 -4
  18. package/Libraries/Components/TextInput/TextInput.flow.js +7 -10
  19. package/Libraries/Components/TextInput/TextInput.js +7 -7
  20. package/Libraries/Components/TextInput/TextInput.win32.js +7 -7
  21. package/Libraries/Components/TextInput/TextInputState.js +11 -13
  22. package/Libraries/Components/TextInput/TextInputState.win32.js +13 -16
  23. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  24. package/Libraries/Components/View/ViewNativeComponent.js +3 -10
  25. package/Libraries/Core/ReactNativeVersion.js +1 -1
  26. package/Libraries/Core/setUpBatchedBridge.js +1 -10
  27. package/Libraries/Core/setUpReactDevTools.js +3 -3
  28. package/Libraries/Core/setUpSegmentFetcher.js +1 -0
  29. package/Libraries/Core/setUpTimers.js +8 -8
  30. package/Libraries/Image/ImageBackground.js +2 -5
  31. package/Libraries/Image/ImageProps.js +1 -1
  32. package/Libraries/Image/ImageViewNativeComponent.js +2 -2
  33. package/Libraries/Inspector/ReactDevToolsOverlay.js +0 -1
  34. package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
  35. package/Libraries/JSInspector/NetworkAgent.js +1 -1
  36. package/Libraries/Lists/FlatList.d.ts +1 -2
  37. package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
  38. package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
  39. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  40. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
  41. package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
  42. package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
  43. package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -0
  44. package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
  45. package/Libraries/Network/XMLHttpRequest.js +26 -1
  46. package/Libraries/Pressability/HoverState.js +2 -0
  47. package/Libraries/Pressability/HoverState.win32.js +2 -0
  48. package/Libraries/Pressability/Pressability.js +2 -3
  49. package/Libraries/Pressability/Pressability.win32.js +2 -3
  50. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
  51. package/Libraries/ReactNative/RendererImplementation.js +4 -3
  52. package/Libraries/Renderer/shims/ReactNativeTypes.js +13 -18
  53. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -0
  54. package/Libraries/StyleSheet/StyleSheetTypes.js +13 -0
  55. package/Libraries/StyleSheet/processTransform.js +3 -34
  56. package/Libraries/Text/Text.js +251 -249
  57. package/Libraries/Text/Text.win32.js +285 -295
  58. package/Libraries/Types/CoreEventTypes.d.ts +3 -10
  59. package/Libraries/Types/CoreEventTypes.js +4 -6
  60. package/Libraries/Types/CoreEventTypes.win32.js +4 -6
  61. package/Libraries/Utilities/Platform.flow.js +2 -2
  62. package/Libraries/Utilities/Platform.flow.win32.js +2 -2
  63. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +5 -4
  64. package/index.js +5 -2
  65. package/index.win32.js +5 -2
  66. package/jest/setup.js +30 -0
  67. package/overrides.json +18 -17
  68. package/package.json +13 -13
  69. package/src/private/animated/NativeAnimatedHelper.js +2 -4
  70. package/src/private/animated/NativeAnimatedHelper.win32.js +2 -3
  71. package/src/private/components/HScrollViewNativeComponents.js +4 -5
  72. package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
  73. package/src/private/featureflags/ReactNativeFeatureFlags.js +14 -23
  74. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -5
  75. package/src/private/specs/modules/NativeAccessibilityInfo.js +3 -0
  76. package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +3 -0
  77. package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
  78. package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
  79. package/src/private/webapis/performance/EventTiming.js +13 -8
  80. package/src/private/webapis/performance/Performance.js +30 -40
  81. package/src/private/webapis/performance/PerformanceEntry.js +2 -5
  82. package/src/private/webapis/performance/PerformanceObserver.js +20 -32
  83. package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
  84. package/src/private/webapis/performance/UserTiming.js +6 -2
  85. package/src/private/webapis/performance/Utilities.js +0 -7
  86. package/src/private/webapis/performance/specs/NativePerformance.js +53 -0
  87. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +247 -0
  88. package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  89. package/types/public/ReactNativeTypes.d.ts +4 -4
  90. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -69
  91. package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -69
  92. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -154
  93. /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
  94. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.android.js +0 -0
  95. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.ios.js +0 -0
  96. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.win32.js +0 -0
@@ -260,7 +260,7 @@ type EnableArgs = {
260
260
  };
261
261
 
262
262
  class NetworkAgent extends InspectorAgent {
263
- static DOMAIN: $TEMPORARY$string<'Network'> = 'Network';
263
+ static DOMAIN: string = 'Network';
264
264
 
265
265
  _sendEvent: EventSender;
266
266
  _interceptor: ?Interceptor;
@@ -235,8 +235,7 @@ export abstract class FlatListComponent<
235
235
 
236
236
  getScrollableNode: () => any;
237
237
 
238
- // TODO: use `unknown` instead of `any` for Typescript >= 3.0
239
- setNativeProps: (props: {[key: string]: any}) => void;
238
+ setNativeProps: (props: {[key: string]: unknown}) => void;
240
239
  }
241
240
 
242
241
  export class FlatList<ItemT = any> extends FlatListComponent<
@@ -75,7 +75,7 @@ module.exports = {
75
75
  );
76
76
  },
77
77
 
78
- testBadRenderItemFunction(): $TEMPORARY$array<React.Node> {
78
+ testBadRenderItemFunction(): $ReadOnlyArray<React.Node> {
79
79
  const data = [
80
80
  {
81
81
  title: 'foo',
@@ -105,7 +105,7 @@ module.exports = {
105
105
  ];
106
106
  },
107
107
 
108
- testOtherBadProps(): $TEMPORARY$array<React.Node> {
108
+ testOtherBadProps(): $ReadOnlyArray<React.Node> {
109
109
  return [
110
110
  // $FlowExpectedError - bad numColumns type "lots"
111
111
  <FlatList renderItem={renderMyListItem} data={[]} numColumns="lots" />,
@@ -44,7 +44,7 @@ module.exports = {
44
44
  return <SectionList renderItem={renderMyListItem} sections={sections} />;
45
45
  },
46
46
 
47
- testBadRenderItemFunction(): $TEMPORARY$array<React.Node> {
47
+ testBadRenderItemFunction(): $ReadOnlyArray<React.Node> {
48
48
  const sections = [
49
49
  {
50
50
  key: 'a',
@@ -18,7 +18,7 @@ import type {
18
18
  Message,
19
19
  } from './parseLogBoxLog';
20
20
 
21
- import DebuggerSessionObserver from '../../../src/private/fusebox/FuseboxSessionObserver';
21
+ import DebuggerSessionObserver from '../../../src/private/debugging/FuseboxSessionObserver';
22
22
  import parseErrorStack from '../../Core/Devtools/parseErrorStack';
23
23
  import NativeDevSettings from '../../NativeModules/specs/NativeDevSettings';
24
24
  import NativeLogBox from '../../NativeModules/specs/NativeLogBox';
@@ -138,7 +138,7 @@ function StackFrameList(props: {
138
138
  }
139
139
 
140
140
  function StackFrameFooter(
141
- props: $TEMPORARY$object<{message: string, onPress: () => void}>,
141
+ props: $ReadOnly<{message: string, onPress: () => void}>,
142
142
  ) {
143
143
  return (
144
144
  <View style={stackStyles.collapseContainer}>
@@ -59,7 +59,7 @@ function TappableLinks(props: {
59
59
 
60
60
  // URLs were detected. Construct array of Text nodes.
61
61
 
62
- let fragments: Array<React.Node> = [];
62
+ const fragments: Array<React.Node> = [];
63
63
  let indexCounter = 0;
64
64
  let startIndex = 0;
65
65
 
@@ -115,7 +115,7 @@ function LogBoxMessage(props: Props): React.Node {
115
115
  const elements = [];
116
116
  let length = 0;
117
117
  const createUnderLength = (
118
- key: string | $TEMPORARY$string<'-1'>,
118
+ key: string,
119
119
  message: string,
120
120
  style: void | TextStyleProp,
121
121
  ) => {
@@ -227,6 +227,7 @@ const validAttributesForNonEventProps = {
227
227
  justifyContent: true,
228
228
  overflow: true,
229
229
  display: true,
230
+ boxSizing: true,
230
231
 
231
232
  margin: true,
232
233
  marginBlock: true,
@@ -348,6 +348,7 @@ const validAttributesForNonEventProps = {
348
348
  alignContent: true,
349
349
  position: true,
350
350
  aspectRatio: true,
351
+ boxSizing: true,
351
352
 
352
353
  // Also declared as ViewProps
353
354
  // overflow: true,
@@ -339,6 +339,7 @@ const validAttributesForNonEventProps = {
339
339
  alignContent: true,
340
340
  position: true,
341
341
  aspectRatio: true,
342
+ boxSizing: true,
342
343
 
343
344
  // Also declared as ViewProps
344
345
  // overflow: true,
@@ -22,6 +22,7 @@ const base64 = require('base64-js');
22
22
  const invariant = require('invariant');
23
23
 
24
24
  const DEBUG_NETWORK_SEND_DELAY: false = false; // Set to a number of milliseconds when debugging
25
+ const LABEL_FOR_MISSING_URL_FOR_PROFILING = 'Unknown URL';
25
26
 
26
27
  export type NativeResponseType = 'base64' | 'blob' | 'text';
27
28
  export type ResponseType =
@@ -101,6 +102,7 @@ class XMLHttpRequest extends (EventTarget(...XHR_EVENTS): typeof EventTarget) {
101
102
  static DONE: number = DONE;
102
103
 
103
104
  static _interceptor: ?XHRInterceptor = null;
105
+ static _profiling: boolean = false;
104
106
 
105
107
  UNSENT: number = UNSENT;
106
108
  OPENED: number = OPENED;
@@ -144,12 +146,17 @@ class XMLHttpRequest extends (EventTarget(...XHR_EVENTS): typeof EventTarget) {
144
146
  _timedOut: boolean = false;
145
147
  _trackingName: string = 'unknown';
146
148
  _incrementalEvents: boolean = false;
149
+ _startTime: ?number = null;
147
150
  _performanceLogger: IPerformanceLogger = GlobalPerformanceLogger;
148
151
 
149
152
  static setInterceptor(interceptor: ?XHRInterceptor) {
150
153
  XMLHttpRequest._interceptor = interceptor;
151
154
  }
152
155
 
156
+ static enableProfiling(enableProfiling: boolean): void {
157
+ XMLHttpRequest._profiling = enableProfiling;
158
+ }
159
+
153
160
  constructor() {
154
161
  super();
155
162
  this._reset();
@@ -356,6 +363,11 @@ class XMLHttpRequest extends (EventTarget(...XHR_EVENTS): typeof EventTarget) {
356
363
  this._response += responseText;
357
364
  }
358
365
 
366
+ if (XMLHttpRequest._profiling) {
367
+ performance.mark(
368
+ 'Track:XMLHttpRequest:Incremental Data: ' + this._getMeasureURL(),
369
+ );
370
+ }
359
371
  XMLHttpRequest._interceptor &&
360
372
  XMLHttpRequest._interceptor.dataReceived(requestId, responseText);
361
373
 
@@ -398,7 +410,13 @@ class XMLHttpRequest extends (EventTarget(...XHR_EVENTS): typeof EventTarget) {
398
410
  this._clearSubscriptions();
399
411
  this._requestId = null;
400
412
  this.setReadyState(this.DONE);
401
-
413
+ if (XMLHttpRequest._profiling && this._startTime != null) {
414
+ const start = this._startTime;
415
+ performance.measure('Track:XMLHttpRequest:' + this._getMeasureURL(), {
416
+ start,
417
+ end: performance.now(),
418
+ });
419
+ }
402
420
  if (error) {
403
421
  XMLHttpRequest._interceptor &&
404
422
  XMLHttpRequest._interceptor.loadingFailed(requestId, error);
@@ -572,6 +590,7 @@ class XMLHttpRequest extends (EventTarget(...XHR_EVENTS): typeof EventTarget) {
572
590
  this._trackingName !== 'unknown' ? this._trackingName : this._url;
573
591
  this._perfKey = 'network_XMLHttpRequest_' + String(friendlyName);
574
592
  this._performanceLogger.startTimespan(this._perfKey);
593
+ this._startTime = performance.now();
575
594
  invariant(
576
595
  this._method,
577
596
  'XMLHttpRequest method needs to be defined (%s).',
@@ -668,6 +687,12 @@ class XMLHttpRequest extends (EventTarget(...XHR_EVENTS): typeof EventTarget) {
668
687
  }
669
688
  super.addEventListener(type, listener);
670
689
  }
690
+
691
+ _getMeasureURL(): string {
692
+ return (
693
+ this._trackingName ?? this._url ?? LABEL_FOR_MISSING_URL_FOR_PROFILING
694
+ );
695
+ }
671
696
  }
672
697
 
673
698
  module.exports = XMLHttpRequest;
@@ -12,6 +12,8 @@ import Platform from '../Utilities/Platform';
12
12
 
13
13
  let isEnabled = false;
14
14
 
15
+ /* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
16
+ * Platform.flow.js */
15
17
  if (Platform.OS === 'web') {
16
18
  const canUseDOM = Boolean(
17
19
  typeof window !== 'undefined' &&
@@ -12,6 +12,8 @@ import Platform from '../Utilities/Platform';
12
12
 
13
13
  let isEnabled = false;
14
14
 
15
+ /* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
16
+ * Platform.flow.js */
15
17
  if (Platform.OS === 'web') {
16
18
  const canUseDOM = Boolean(
17
19
  typeof window !== 'undefined' &&
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
11
+ import type {HostInstance} from '../Renderer/shims/ReactNativeTypes';
12
12
  import type {
13
13
  BlurEvent,
14
14
  FocusEvent,
@@ -26,7 +26,6 @@ import {isHoverEnabled} from './HoverState';
26
26
  import PressabilityPerformanceEventEmitter from './PressabilityPerformanceEventEmitter.js';
27
27
  import {type PressabilityTouchSignal as TouchSignal} from './PressabilityTypes.js';
28
28
  import invariant from 'invariant';
29
- import * as React from 'react';
30
29
 
31
30
  export type PressabilityConfig = $ReadOnly<{|
32
31
  /**
@@ -378,7 +377,7 @@ export default class Pressability {
378
377
  _longPressDelayTimeout: ?TimeoutID = null;
379
378
  _pressDelayTimeout: ?TimeoutID = null;
380
379
  _pressOutDelayTimeout: ?TimeoutID = null;
381
- _responderID: ?number | React.ElementRef<HostComponent<mixed>> = null;
380
+ _responderID: ?number | HostInstance = null;
382
381
  _responderRegion: ?$ReadOnly<{|
383
382
  bottom: number,
384
383
  left: number,
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
11
+ import type {HostInstance} from '../Renderer/shims/ReactNativeTypes';
12
12
  import type {
13
13
  BlurEvent,
14
14
  FocusEvent,
@@ -27,7 +27,6 @@ import {isHoverEnabled} from './HoverState';
27
27
  import PressabilityPerformanceEventEmitter from './PressabilityPerformanceEventEmitter.js';
28
28
  import {type PressabilityTouchSignal as TouchSignal} from './PressabilityTypes.js';
29
29
  import invariant from 'invariant';
30
- import * as React from 'react';
31
30
 
32
31
  export type PressabilityConfig = $ReadOnly<{|
33
32
  /**
@@ -409,7 +408,7 @@ export default class Pressability {
409
408
  _longPressDelayTimeout: ?TimeoutID = null;
410
409
  _pressDelayTimeout: ?TimeoutID = null;
411
410
  _pressOutDelayTimeout: ?TimeoutID = null;
412
- _responderID: ?number | React.ElementRef<HostComponent<mixed>> = null;
411
+ _responderID: ?number | HostInstance = null;
413
412
  _responderRegion: ?$ReadOnly<{|
414
413
  bottom: number,
415
414
  left: number,
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import type {
12
- HostComponent,
12
+ HostInstance,
13
13
  INativeMethods,
14
14
  InternalInstanceHandle,
15
15
  MeasureInWindowOnSuccessCallback,
@@ -17,7 +17,6 @@ import type {
17
17
  MeasureOnSuccessCallback,
18
18
  ViewConfig,
19
19
  } from '../../Renderer/shims/ReactNativeTypes';
20
- import type {ElementRef} from 'react';
21
20
 
22
21
  import TextInputState from '../../Components/TextInput/TextInputState';
23
22
  import {getNodeFromInternalInstanceHandle} from '../../ReactNative/RendererProxy';
@@ -85,7 +84,7 @@ export default class ReactFabricHostComponent implements INativeMethods {
85
84
  }
86
85
 
87
86
  measureLayout(
88
- relativeToNativeNode: number | ElementRef<HostComponent<mixed>>,
87
+ relativeToNativeNode: number | HostInstance,
89
88
  onSuccess: MeasureLayoutOnSuccessCallback,
90
89
  onFail?: () => void /* currently unused */,
91
90
  ) {
@@ -10,6 +10,7 @@
10
10
 
11
11
  import type {
12
12
  HostComponent,
13
+ HostInstance,
13
14
  InternalInstanceHandle,
14
15
  Node,
15
16
  } from '../Renderer/shims/ReactNativeTypes';
@@ -61,7 +62,7 @@ export function renderElement({
61
62
 
62
63
  export function findHostInstance_DEPRECATED<TElementType: ElementType>(
63
64
  componentOrHandle: ?(ElementRef<TElementType> | number),
64
- ): ?ElementRef<HostComponent<mixed>> {
65
+ ): ?HostInstance {
65
66
  return require('../Renderer/shims/ReactNative').findHostInstance_DEPRECATED(
66
67
  componentOrHandle,
67
68
  );
@@ -76,7 +77,7 @@ export function findNodeHandle<TElementType: ElementType>(
76
77
  }
77
78
 
78
79
  export function dispatchCommand(
79
- handle: ElementRef<HostComponent<mixed>>,
80
+ handle: HostInstance,
80
81
  command: string,
81
82
  args: Array<mixed>,
82
83
  ): void {
@@ -98,7 +99,7 @@ export function dispatchCommand(
98
99
  }
99
100
 
100
101
  export function sendAccessibilityEvent(
101
- handle: ElementRef<HostComponent<mixed>>,
102
+ handle: HostInstance,
102
103
  eventType: string,
103
104
  ): void {
104
105
  return require('../Renderer/shims/ReactNative').sendAccessibilityEvent(
@@ -7,7 +7,7 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict
10
- * @generated SignedSource<<b803401b6dd721b9caffdac1f8b6fd1c>>
10
+ * @generated SignedSource<<9e6c8931d3b0c36d35ad5da90b721b85>>
11
11
  */
12
12
 
13
13
  import type {
@@ -113,31 +113,32 @@ export interface INativeMethods {
113
113
  measure(callback: MeasureOnSuccessCallback): void;
114
114
  measureInWindow(callback: MeasureInWindowOnSuccessCallback): void;
115
115
  measureLayout(
116
- relativeToNativeNode: number | ElementRef<HostComponent<mixed>>,
116
+ relativeToNativeNode: number | HostInstance,
117
117
  onSuccess: MeasureLayoutOnSuccessCallback,
118
118
  onFail?: () => void,
119
119
  ): void;
120
120
  setNativeProps(nativeProps: {...}): void;
121
121
  }
122
122
 
123
- export type NativeMethods = $ReadOnly<{|
123
+ export type NativeMethods = $ReadOnly<{
124
124
  blur(): void,
125
125
  focus(): void,
126
126
  measure(callback: MeasureOnSuccessCallback): void,
127
127
  measureInWindow(callback: MeasureInWindowOnSuccessCallback): void,
128
128
  measureLayout(
129
- relativeToNativeNode: number | ElementRef<HostComponent<mixed>>,
129
+ relativeToNativeNode: number | HostInstance,
130
130
  onSuccess: MeasureLayoutOnSuccessCallback,
131
131
  onFail?: () => void,
132
132
  ): void,
133
133
  setNativeProps(nativeProps: {...}): void,
134
- |}>;
134
+ }>;
135
135
 
136
136
  // This validates that INativeMethods and NativeMethods stay in sync using Flow!
137
137
  declare const ensureNativeMethodsAreSynced: NativeMethods;
138
138
  (ensureNativeMethodsAreSynced: INativeMethods);
139
139
 
140
- export type HostComponent<T> = AbstractComponent<T, $ReadOnly<NativeMethods>>;
140
+ export type HostInstance = NativeMethods;
141
+ export type HostComponent<Config> = AbstractComponent<Config, HostInstance>;
141
142
 
142
143
  type SecretInternalsType = {
143
144
  computeComponentStackForErrorReporting(tag: number): string,
@@ -210,7 +211,7 @@ export type RenderRootOptions = {
210
211
  export type ReactNativeType = {
211
212
  findHostInstance_DEPRECATED<TElementType: ElementType>(
212
213
  componentOrHandle: ?(ElementRef<TElementType> | number),
213
- ): ?ElementRef<HostComponent<mixed>>,
214
+ ): ?HostInstance,
214
215
  findNodeHandle<TElementType: ElementType>(
215
216
  componentOrHandle: ?(ElementRef<TElementType> | number),
216
217
  ): ?number,
@@ -219,14 +220,11 @@ export type ReactNativeType = {
219
220
  child: PublicInstance | HostComponent<mixed>,
220
221
  ): boolean,
221
222
  dispatchCommand(
222
- handle: ElementRef<HostComponent<mixed>>,
223
+ handle: HostInstance,
223
224
  command: string,
224
225
  args: Array<mixed>,
225
226
  ): void,
226
- sendAccessibilityEvent(
227
- handle: ElementRef<HostComponent<mixed>>,
228
- eventType: string,
229
- ): void,
227
+ sendAccessibilityEvent(handle: HostInstance, eventType: string): void,
230
228
  render(
231
229
  element: MixedElement,
232
230
  containerTag: number,
@@ -248,20 +246,17 @@ type PublicTextInstance = mixed;
248
246
  export type ReactFabricType = {
249
247
  findHostInstance_DEPRECATED<TElementType: ElementType>(
250
248
  componentOrHandle: ?(ElementRef<TElementType> | number),
251
- ): ?ElementRef<HostComponent<mixed>>,
249
+ ): ?HostInstance,
252
250
  findNodeHandle<TElementType: ElementType>(
253
251
  componentOrHandle: ?(ElementRef<TElementType> | number),
254
252
  ): ?number,
255
253
  dispatchCommand(
256
- handle: ElementRef<HostComponent<mixed>>,
254
+ handle: HostInstance,
257
255
  command: string,
258
256
  args: Array<mixed>,
259
257
  ): void,
260
258
  isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
261
- sendAccessibilityEvent(
262
- handle: ElementRef<HostComponent<mixed>>,
263
- eventType: string,
264
- ): void,
259
+ sendAccessibilityEvent(handle: HostInstance, eventType: string): void,
265
260
  render(
266
261
  element: MixedElement,
267
262
  containerTag: number,
@@ -55,6 +55,7 @@ export interface FlexStyle {
55
55
  borderTopWidth?: number | undefined;
56
56
  borderWidth?: number | undefined;
57
57
  bottom?: DimensionValue | undefined;
58
+ boxSizing?: 'border-box' | 'content-box' | undefined;
58
59
  display?: 'none' | 'flex' | undefined;
59
60
  end?: DimensionValue | undefined;
60
61
  flex?: number | undefined;
@@ -612,6 +612,19 @@ type ____LayoutStyle_Internal = $ReadOnly<{
612
612
  */
613
613
  aspectRatio?: number | string,
614
614
 
615
+ /**
616
+ * Box sizing controls whether certain size properties apply to the node's
617
+ * content box or border box. The size properties in question include `width`,
618
+ * `height`, `minWidth`, `minHeight`, `maxWidth`, `maxHeight`, and `flexBasis`.
619
+ *
620
+ * e.g: Say a node has 10px of padding and 10px of borders on all
621
+ * sides and a defined `width` and `height` of 100px and 50px. Then the total
622
+ * size of the node (content area + padding + border) would be 100px by 50px
623
+ * under `boxSizing: border-box` and 120px by 70px under
624
+ * `boxSizing: content-box`.
625
+ */
626
+ boxSizing?: 'border-box' | 'content-box',
627
+
615
628
  /** `zIndex` controls which components display on top of others.
616
629
  * Normally, you don't use `zIndex`. Components render according to
617
630
  * their order in the document tree, so later components draw over
@@ -26,7 +26,7 @@ function processTransform(
26
26
  ): Array<Object> | Array<number> {
27
27
  if (typeof transform === 'string') {
28
28
  const regex = new RegExp(/(\w+)\(([^)]+)\)/g);
29
- let transformArray: Array<Object> = [];
29
+ const transformArray: Array<Object> = [];
30
30
  let matches;
31
31
 
32
32
  while ((matches = regex.exec(transform))) {
@@ -50,23 +50,7 @@ function processTransform(
50
50
  }
51
51
 
52
52
  const _getKeyAndValueFromCSSTransform: (
53
- key:
54
- | string
55
- | $TEMPORARY$string<'matrix'>
56
- | $TEMPORARY$string<'perspective'>
57
- | $TEMPORARY$string<'rotate'>
58
- | $TEMPORARY$string<'rotateX'>
59
- | $TEMPORARY$string<'rotateY'>
60
- | $TEMPORARY$string<'rotateZ'>
61
- | $TEMPORARY$string<'scale'>
62
- | $TEMPORARY$string<'scaleX'>
63
- | $TEMPORARY$string<'scaleY'>
64
- | $TEMPORARY$string<'skewX'>
65
- | $TEMPORARY$string<'skewY'>
66
- | $TEMPORARY$string<'translate'>
67
- | $TEMPORARY$string<'translate3d'>
68
- | $TEMPORARY$string<'translateX'>
69
- | $TEMPORARY$string<'translateY'>,
53
+ key: string,
70
54
  args: string,
71
55
  ) => {key: string, value?: Array<string | number> | number | string} = (
72
56
  key,
@@ -169,22 +153,7 @@ function _validateTransforms(transform: Array<Object>): void {
169
153
  }
170
154
 
171
155
  function _validateTransform(
172
- key:
173
- | string
174
- | $TEMPORARY$string<'matrix'>
175
- | $TEMPORARY$string<'perspective'>
176
- | $TEMPORARY$string<'rotate'>
177
- | $TEMPORARY$string<'rotateX'>
178
- | $TEMPORARY$string<'rotateY'>
179
- | $TEMPORARY$string<'rotateZ'>
180
- | $TEMPORARY$string<'scale'>
181
- | $TEMPORARY$string<'scaleX'>
182
- | $TEMPORARY$string<'scaleY'>
183
- | $TEMPORARY$string<'skewX'>
184
- | $TEMPORARY$string<'skewY'>
185
- | $TEMPORARY$string<'translate'>
186
- | $TEMPORARY$string<'translateX'>
187
- | $TEMPORARY$string<'translateY'>,
156
+ key: string,
188
157
  value: any | number | string,
189
158
  transformation: any,
190
159
  ) {