From 1ee406b9ccbecc52dff3e77d65c6d9b4837e6dab Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Thu, 5 Nov 2020 17:43:23 -0800 Subject: [PATCH] Pull out ReservedPropTypeAnnotation into type alias Summary: This type annotation was declared inline twice. Just pulling it out into a type alias in this diff. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D24723191 fbshipit-source-id: 9f2061087172979ea838dfdf2533e17b9b559c71 --- .../react-native-codegen/src/CodegenSchema.js | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index a0c87b5e7db..4aec6a45332 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -153,14 +153,7 @@ export type PropTypeAnnotation = default: number, options: $ReadOnlyArray, |}> - | $ReadOnly<{| - type: 'ReservedPropTypeAnnotation', - name: - | 'ColorPrimitive' - | 'ImageSourcePrimitive' - | 'PointPrimitive' - | 'EdgeInsetsPrimitive', - |}> + | ReservedPropTypeAnnotation | ObjectTypeAnnotation | $ReadOnly<{| type: 'ArrayTypeAnnotation', @@ -176,20 +169,22 @@ export type PropTypeAnnotation = options: $ReadOnlyArray, |}> | ObjectTypeAnnotation - | $ReadOnly<{| - type: 'ReservedPropTypeAnnotation', - name: - | 'ColorPrimitive' - | 'ImageSourcePrimitive' - | 'PointPrimitive' - | 'EdgeInsetsPrimitive', - |}> + | ReservedPropTypeAnnotation | $ReadOnly<{| type: 'ArrayTypeAnnotation', elementType: ObjectTypeAnnotation, |}>, |}>; +type ReservedPropTypeAnnotation = $ReadOnly<{| + type: 'ReservedPropTypeAnnotation', + name: + | 'ColorPrimitive' + | 'ImageSourcePrimitive' + | 'PointPrimitive' + | 'EdgeInsetsPrimitive', +|}>; + export type CommandTypeAnnotation = FunctionTypeAnnotation< CommandParamTypeAnnotation, VoidTypeAnnotation,