diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index 25dc03eff64676..8d18b0472defb4 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -286,30 +286,10 @@ export type NativeModuleArrayTypeAnnotation< elementType?: T, }>; -export type NativeModuleStringTypeAnnotation = $ReadOnly<{ - type: 'StringTypeAnnotation', -}>; - export type NativeModuleNumberTypeAnnotation = $ReadOnly<{ type: 'NumberTypeAnnotation', }>; -export type NativeModuleInt32TypeAnnotation = $ReadOnly<{ - type: 'Int32TypeAnnotation', -}>; - -export type NativeModuleDoubleTypeAnnotation = $ReadOnly<{ - type: 'DoubleTypeAnnotation', -}>; - -export type NativeModuleFloatTypeAnnotation = $ReadOnly<{ - type: 'FloatTypeAnnotation', -}>; - -export type NativeModuleBooleanTypeAnnotation = $ReadOnly<{ - type: 'BooleanTypeAnnotation', -}>; - export type NativeModuleEnumMembers = $ReadOnlyArray< $ReadOnly<{ name: string, @@ -367,12 +347,12 @@ export type NativeModuleMixedTypeAnnotation = $ReadOnly<{ }>; type NativeModuleEventEmitterBaseTypeAnnotation = - | NativeModuleBooleanTypeAnnotation - | NativeModuleDoubleTypeAnnotation - | NativeModuleFloatTypeAnnotation - | NativeModuleInt32TypeAnnotation + | BooleanTypeAnnotation + | DoubleTypeAnnotation + | FloatTypeAnnotation + | Int32TypeAnnotation | NativeModuleNumberTypeAnnotation - | NativeModuleStringTypeAnnotation + | StringTypeAnnotation | NativeModuleTypeAliasTypeAnnotation | NativeModuleGenericObjectTypeAnnotation | VoidTypeAnnotation; @@ -385,12 +365,12 @@ export type NativeModuleEventEmitterTypeAnnotation = }; export type NativeModuleBaseTypeAnnotation = - | NativeModuleStringTypeAnnotation + | StringTypeAnnotation | NativeModuleNumberTypeAnnotation - | NativeModuleInt32TypeAnnotation - | NativeModuleDoubleTypeAnnotation - | NativeModuleFloatTypeAnnotation - | NativeModuleBooleanTypeAnnotation + | Int32TypeAnnotation + | DoubleTypeAnnotation + | FloatTypeAnnotation + | BooleanTypeAnnotation | NativeModuleEnumDeclaration | NativeModuleGenericObjectTypeAnnotation | ReservedTypeAnnotation diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js index d85d093948ad27..8df8ec47dd68b7 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js @@ -13,15 +13,15 @@ import type { NativeModuleArrayTypeAnnotation, NativeModuleBaseTypeAnnotation, - NativeModuleBooleanTypeAnnotation, - NativeModuleDoubleTypeAnnotation, + BooleanTypeAnnotation, + DoubleTypeAnnotation, NativeModuleEnumDeclaration, - NativeModuleFloatTypeAnnotation, + FloatTypeAnnotation, NativeModuleGenericObjectTypeAnnotation, - NativeModuleInt32TypeAnnotation, + Int32TypeAnnotation, NativeModuleNumberTypeAnnotation, NativeModuleObjectTypeAnnotation, - NativeModuleStringTypeAnnotation, + StringTypeAnnotation, NativeModuleTypeAliasTypeAnnotation, Nullable, ReservedTypeAnnotation, @@ -57,12 +57,12 @@ export type StructProperty = $ReadOnly<{ }>; export type StructTypeAnnotation = - | NativeModuleStringTypeAnnotation + | StringTypeAnnotation | NativeModuleNumberTypeAnnotation - | NativeModuleInt32TypeAnnotation - | NativeModuleDoubleTypeAnnotation - | NativeModuleFloatTypeAnnotation - | NativeModuleBooleanTypeAnnotation + | Int32TypeAnnotation + | DoubleTypeAnnotation + | FloatTypeAnnotation + | BooleanTypeAnnotation | NativeModuleEnumDeclaration | NativeModuleGenericObjectTypeAnnotation | ReservedTypeAnnotation diff --git a/packages/react-native-codegen/src/parsers/parsers-primitives.js b/packages/react-native-codegen/src/parsers/parsers-primitives.js index ca967120cb0c00..8c05216f841693 100644 --- a/packages/react-native-codegen/src/parsers/parsers-primitives.js +++ b/packages/react-native-codegen/src/parsers/parsers-primitives.js @@ -20,7 +20,7 @@ import type { NativeModuleBaseTypeAnnotation, NativeModuleEnumDeclaration, NativeModuleEnumMap, - NativeModuleFloatTypeAnnotation, + FloatTypeAnnotation, NativeModuleFunctionTypeAnnotation, NativeModuleGenericObjectTypeAnnotation, NativeModuleMixedTypeAnnotation, @@ -368,9 +368,7 @@ function emitObject( }); } -function emitFloat( - nullable: boolean, -): Nullable { +function emitFloat(nullable: boolean): Nullable { return wrapNullable(nullable, { type: 'FloatTypeAnnotation', });