diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index 14552f63f063be..e7fc38e4f3a919 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -412,6 +412,14 @@ type NativeModuleReturnOnlyTypeAnnotation = | NativeModulePromiseTypeAnnotation | VoidTypeAnnotation; +// Add the allowed component reserved types to the native module union +export type CompleteReservedTypeAnnotation = + | ReservedTypeAnnotation + | { + type: 'ReservedTypeAnnotation', + name: ReservedPropTypeAnnotation['name'], + }; + // Used by compatibility check which needs to handle all possible types // This will eventually also include the union of all view manager types export type CompleteTypeAnnotation = @@ -421,7 +429,6 @@ export type CompleteTypeAnnotation = | EventEmitterTypeAnnotation | NativeModuleEnumDeclarationWithMembers | UnsafeAnyTypeAnnotation - // Native Module event emitters and methods - | ObjectTypeAnnotation< - Nullable | EventEmitterTypeAnnotation, - >; + | ArrayTypeAnnotation + | ObjectTypeAnnotation + | CompleteReservedTypeAnnotation;