Revert recent Flow syntax codemods in react-native-github (#56998)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56998

Reverts the recent Flow syntax codemods applied across `packages/`, `private/`, and `scripts/` in react-native-github. Specifically restores the previous form for:

- `+T` / `+Instance` style variance annotations on generic type parameters that had been converted to the newer `out T` / `in T` keyword form.
- `+field:` covariant object/interface properties that had been converted to the `readonly field:` modifier form.
- `+[K in keyof T]:` mapped-type covariance that had been converted to `readonly [K in keyof T]:`.

These are purely Flow type-annotation changes with no runtime behavior impact, restoring the form that the rest of the toolchain (in particular Fantom) already supports.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D106813102

fbshipit-source-id: 6bf915d530e130eba9c9d96a2b6c3dc8853594d1
This commit is contained in:
Rubén Norte authored and meta-codesync[bot] committed 2026-05-29 14:09:58 -07:00
1 parent 5b16cdff9d
commit 833144fcec
232 files changed
+1487 -1668

No files matched your search

@@ -76,52 +76,48 @@ export type CustomDeviceEvent = {
};
export interface Spec extends TurboModule {
readonly onPress: CodegenTypes.EventEmitter<void>;
readonly onClick: CodegenTypes.EventEmitter<string>;
readonly onChange: CodegenTypes.EventEmitter<ObjectStruct>;
readonly onSubmit: CodegenTypes.EventEmitter<ObjectStruct[]>;
readonly onEvent: CodegenTypes.EventEmitter<EnumNone>;
readonly getArray: (
arg: Array<ObjectStruct | null>,
) => Array<ObjectStruct | null>;
readonly getArrayBuffer: (payload: ArrayBuffer) => ArrayBuffer;
readonly createNativeBuffer: (size: number) => ArrayBuffer;
readonly processAsyncBuffer: (payload: ArrayBuffer) => Promise<number>;
readonly getAsyncBuffer: (size: number) => Promise<ArrayBuffer>;
readonly getBool: (arg: boolean) => boolean;
readonly getConstants: () => ConstantsStruct;
readonly getCustomEnum: (arg: EnumInt) => EnumInt;
readonly getCustomHostObject: () => CustomHostObject;
readonly consumeCustomHostObject: (
customHostObject: CustomHostObject,
) => string;
readonly getBinaryTreeNode: (arg: BinaryTreeNode) => BinaryTreeNode;
readonly getGraphNode: (arg: GraphNode) => GraphNode;
readonly getNumEnum: (arg: EnumInt) => EnumInt;
readonly getStrEnum: (arg: EnumNone) => EnumStr;
readonly getMap: (arg: {[key: string]: ?number}) => {[key: string]: ?number};
readonly getNumber: (arg: number) => number;
readonly getObject: (arg: ObjectStruct) => ObjectStruct;
readonly getSet: (arg: Array<number>) => Array<number>;
readonly getString: (arg: string) => string;
readonly getUnion: (x: UnionFloat, y: UnionString, z: UnionObject) => string;
readonly getValue: (x: number, y: string, z: ObjectStruct) => ValueStruct;
readonly getValueWithCallback: (callback: (value: string) => void) => void;
readonly setValueCallbackWithSubscription: (
+onPress: CodegenTypes.EventEmitter<void>;
+onClick: CodegenTypes.EventEmitter<string>;
+onChange: CodegenTypes.EventEmitter<ObjectStruct>;
+onSubmit: CodegenTypes.EventEmitter<ObjectStruct[]>;
+onEvent: CodegenTypes.EventEmitter<EnumNone>;
+getArray: (arg: Array<ObjectStruct | null>) => Array<ObjectStruct | null>;
+getArrayBuffer: (payload: ArrayBuffer) => ArrayBuffer;
+createNativeBuffer: (size: number) => ArrayBuffer;
+processAsyncBuffer: (payload: ArrayBuffer) => Promise<number>;
+getAsyncBuffer: (size: number) => Promise<ArrayBuffer>;
+getBool: (arg: boolean) => boolean;
+getConstants: () => ConstantsStruct;
+getCustomEnum: (arg: EnumInt) => EnumInt;
+getCustomHostObject: () => CustomHostObject;
+consumeCustomHostObject: (customHostObject: CustomHostObject) => string;
+getBinaryTreeNode: (arg: BinaryTreeNode) => BinaryTreeNode;
+getGraphNode: (arg: GraphNode) => GraphNode;
+getNumEnum: (arg: EnumInt) => EnumInt;
+getStrEnum: (arg: EnumNone) => EnumStr;
+getMap: (arg: {[key: string]: ?number}) => {[key: string]: ?number};
+getNumber: (arg: number) => number;
+getObject: (arg: ObjectStruct) => ObjectStruct;
+getSet: (arg: Array<number>) => Array<number>;
+getString: (arg: string) => string;
+getUnion: (x: UnionFloat, y: UnionString, z: UnionObject) => string;
+getValue: (x: number, y: string, z: ObjectStruct) => ValueStruct;
+getValueWithCallback: (callback: (value: string) => void) => void;
+setValueCallbackWithSubscription: (
callback: (value: string) => void,
) => () => void;
readonly getValueWithPromise: (error: boolean) => Promise<string>;
readonly getWithWithOptionalArgs: (optionalArg?: boolean) => ?boolean;
readonly voidFunc: () => void;
readonly voidPromise: () => Promise<void>;
readonly setMenu: (menuItem: MenuItem) => void;
readonly emitCustomDeviceEvent: (eventName: string) => void;
readonly voidFuncThrows: () => void;
readonly getObjectThrows: (arg: ObjectStruct) => ObjectStruct;
readonly promiseThrows: () => Promise<void>;
readonly voidFuncAssert: () => void;
readonly getObjectAssert: (arg: ObjectStruct) => ObjectStruct;
readonly promiseAssert: () => Promise<void>;
+getValueWithPromise: (error: boolean) => Promise<string>;
+getWithWithOptionalArgs: (optionalArg?: boolean) => ?boolean;
+voidFunc: () => void;
+voidPromise: () => Promise<void>;
+setMenu: (menuItem: MenuItem) => void;
+emitCustomDeviceEvent: (eventName: string) => void;
+voidFuncThrows: () => void;
+getObjectThrows: (arg: ObjectStruct) => ObjectStruct;
+promiseThrows: () => Promise<void>;
+voidFuncAssert: () => void;
+getObjectAssert: (arg: ObjectStruct) => ObjectStruct;
+promiseAssert: () => Promise<void>;
}
export default TurboModuleRegistry.get<Spec>(