Change TouchedViewDataAtPoint type in ReactNativeTypes to use supported by Flow tooling syntax (#32382)

Summary:
## Summary

The `flow-api-translator` from the `hermes` repo does not support flow
type spreads. It is currently not able to digest the ReactNativeTypes
file as it contains unsupported syntax. The simplest solution is to
change the type of the `TouchedViewDataAtPoint` to equivalent, yet
supported by the Flow tooling. In this case the intersection can be used
as
the `TouchedViewDataAtPoint` and `InspectorData` have no common
property.

## How did you test this change?

Run yarn flow native

DiffTrain build for [e670e72fa076449e40172e20d17cc67c1c15419c](https://github.com/facebook/react/commit/e670e72fa076449e40172e20d17cc67c1c15419c)

Reviewed By: rickhanlonii

Differential Revision: D69661050

fbshipit-source-id: 1732bd9ac9c1af1e4c0b95758e92d9ccf3b807e6
This commit is contained in:
Ruslan Lesiutin
2025-02-24 08:29:34 -08:00
committed by Facebook GitHub Bot
parent e3b176a598
commit 8bce4a37e1
@@ -7,7 +7,7 @@
* @noformat
* @nolint
* @flow strict
* @generated SignedSource<<c1ce40ef01008fe3cd38df1d9ff46f56>>
* @generated SignedSource<<d020970c0862ae39beaffe31c0a54f08>>
*/
import type {ElementRef, ElementType, MixedElement} from 'react';
@@ -165,18 +165,19 @@ export type InspectorData = $ReadOnly<{
componentStack: string,
}>;
export type TouchedViewDataAtPoint = $ReadOnly<{
pointerY: number,
touchedViewTag?: number,
frame: $ReadOnly<{
top: number,
left: number,
width: number,
height: number,
}>,
closestPublicInstance?: PublicInstance,
...InspectorData,
}>;
export type TouchedViewDataAtPoint = $ReadOnly<
{
pointerY: number,
touchedViewTag?: number,
frame: $ReadOnly<{
top: number,
left: number,
width: number,
height: number,
}>,
closestPublicInstance?: PublicInstance,
} & InspectorData,
>;
export type RenderRootOptions = {
onUncaughtError?: (