Fix flow test case input in react-native-codegen package that has syntax errors. (#26316)
Summary: Fix flow test case input in react-native-codegen package that has syntax errors. Missing ";" after export type, Missing ";" or "," after interface/object type member signature, Missing ":" in method signature, etc ## Changelog [General] [Fixed] - Fix flow test case input in react-native-codegen package Pull Request resolved: https://github.com/facebook/react-native/pull/26316 Test Plan: Parsed files using flow parser, but some test cases are intended to have syntax error, in this case I fixed unexpected ones. Reviewed By: rickhanlonii Differential Revision: D17194969 Pulled By: osdnk fbshipit-source-id: 262d0af4d9e7e74f7ba3eb30c4fd9753c08f3bf7
This commit is contained in:
Родитель
a31c76fbd3
Коммит
d63c46de7e
|
@ -43,19 +43,19 @@ const EVENT_DEFINITION = `
|
|||
|
||||
object_required: {
|
||||
boolean_required: boolean,
|
||||
}
|
||||
},
|
||||
|
||||
object_optional_key?: {
|
||||
string_optional_key?: string,
|
||||
}
|
||||
},
|
||||
|
||||
object_optional_value: ?{
|
||||
float_optional_value: ?Float,
|
||||
}
|
||||
},
|
||||
|
||||
object_optional_both?: ?{
|
||||
int32_optional_both?: ?Int32,
|
||||
}
|
||||
},
|
||||
|
||||
object_required_nested_2_layers: {
|
||||
object_optional_nested_1_layer?: ?{
|
||||
|
@ -65,7 +65,7 @@ const EVENT_DEFINITION = `
|
|||
float_optional_value: ?Float,
|
||||
int32_optional_both?: ?Int32,
|
||||
}
|
||||
}
|
||||
},
|
||||
`;
|
||||
|
||||
const ONE_OF_EACH_PROP_EVENT_DEFAULT_AND_OPTIONS = `
|
||||
|
@ -500,7 +500,7 @@ const codegenNativeComponent = require('codegenNativeComponent');
|
|||
|
||||
type DeepSpread = $ReadOnly<{|
|
||||
otherStringProp: string,
|
||||
|}>
|
||||
|}>;
|
||||
|
||||
export type PropsInFile = $ReadOnly<{|
|
||||
...DeepSpread,
|
||||
|
@ -511,11 +511,11 @@ export type PropsInFile = $ReadOnly<{|
|
|||
export type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|
||||
...PropsInFile
|
||||
...PropsInFile,
|
||||
|
||||
localType: $ReadOnly<{|
|
||||
...PropsInFile
|
||||
|}>
|
||||
|}>,
|
||||
|
||||
localArr: $ReadOnlyArray<PropsInFile>
|
||||
|}>;
|
||||
|
@ -898,7 +898,7 @@ export type ModuleProps = $ReadOnly<{|
|
|||
|
||||
type NativeType = NativeComponent<ModuleProps>;
|
||||
|
||||
export type ScrollTo = (viewRef: React.ElementRef<NativeType>, y: Int, animated: Boolean) => Void
|
||||
export type ScrollTo = (viewRef: React.ElementRef<NativeType>, y: Int, animated: Boolean) => Void;
|
||||
|
||||
interface NativeCommands {
|
||||
+scrollTo: ScrollTo;
|
||||
|
|
|
@ -199,11 +199,11 @@ import type {TurboModule} from '../RCTExport';
|
|||
import * as TurboModuleRegistry from '../TurboModuleRegistry';
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getSth(a : ?number) => void
|
||||
+getSth: (a : ?number) => void
|
||||
}
|
||||
|
||||
export interface Spec2 extends TurboModule {
|
||||
+getSth(a : ?number) => void
|
||||
+getSth: (a : ?number) => void
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ const NATIVE_MODULE_WITH_COMPLEX_OBJECTS = `
|
|||
import type {TurboModule} from '../RCTExport';
|
||||
import * as TurboModuleRegistry from '../TurboModuleRegistry';
|
||||
|
||||
export type String = string
|
||||
export type String = string;
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
// Exported methods.
|
||||
|
@ -208,7 +208,7 @@ import type {TurboModule} from '../RCTExport';
|
|||
import * as TurboModuleRegistry from '../TurboModuleRegistry';
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getObject(o : Object) => Object,
|
||||
+getObject: (o : Object) => Object,
|
||||
}
|
||||
|
||||
export default TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
|
||||
|
@ -390,7 +390,7 @@ const NATIVE_MODULE_WITH_PROMISE = `/**
|
|||
import type {TurboModule} from '../RCTExport';
|
||||
import * as TurboModuleRegistry from '../TurboModuleRegistry';
|
||||
|
||||
export type String = string
|
||||
export type String = string;
|
||||
export type SomeObj = {| a: string |};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
|
|
Загрузка…
Ссылка в новой задаче