mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fix a few readonly 10/n (#56948)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56948 ``` js1 flow-runner codemod flow/transformAllVariance --variance readonly --format-files=false ``` drop-conflicts landed-with-radar-review Reviewed By: SamChou19815 Differential Revision: D106144499 fbshipit-source-id: 85493334eae630d3dec7e5920633c076f8f09729
This commit is contained in:
1 parent
0676eb63a2
commit
09fc0432d1
193 files changed
+1473
-1312
No files matched your search
@@ -76,48 +76,52 @@ export type CustomDeviceEvent = {
|
||||
};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+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: (
|
||||
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: (
|
||||
callback: (value: string) => void,
|
||||
) => () => 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>;
|
||||
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>;
|
||||
}
|
||||
|
||||
export default TurboModuleRegistry.get<Spec>(
|
||||
|
||||
Reference in new issue
Block a user