Skip to content

Commit e38c9b4

Browse files
Introduce the supported member types of Union (facebook#54591)
Summary: Following types will be supported in Union currently: 1. Number : NumberType + NumberLiteralType 2. Boolean : BooleanType + BooleanLiteralType 3. String : StringType + StringLiteralType 4. Object: NativeModuleObjectType These are the only ones that exist today as per : https://docs.google.com/document/d/1pTBMOEIov5n5-0L9z925XPvGX1YxlmI6n6FJvd0oXtE/edit?tab=t.0#heading=h.fhe5py9plytd Changelog: [Internal] Differential Revision: D87384995
1 parent 986feff commit e38c9b4

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/react-native-codegen/src/CodegenSchema.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,15 @@ export type UnionTypeAnnotationMemberType =
405405
| 'ObjectTypeAnnotation'
406406
| 'StringTypeAnnotation';
407407

408+
export type NativeModuleUnionTypeAnnotationMemberType =
409+
| NativeModuleObjectTypeAnnotation
410+
| StringLiteralTypeAnnotation
411+
| NumberLiteralTypeAnnotation
412+
| BooleanLiteralTypeAnnotation
413+
| BooleanTypeAnnotation
414+
| StringTypeAnnotation
415+
| NumberTypeAnnotation;
416+
408417
export interface NativeModuleUnionTypeAnnotation {
409418
readonly type: 'UnionTypeAnnotation';
410419
readonly memberType: UnionTypeAnnotationMemberType;

packages/react-native-codegen/src/CodegenSchema.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,15 @@ export type UnionTypeAnnotationMemberType =
384384
| 'ObjectTypeAnnotation'
385385
| 'StringTypeAnnotation';
386386

387+
export type NativeModuleUnionTypeAnnotationMemberType =
388+
| NativeModuleObjectTypeAnnotation
389+
| StringLiteralTypeAnnotation
390+
| NumberLiteralTypeAnnotation
391+
| BooleanLiteralTypeAnnotation
392+
| BooleanTypeAnnotation
393+
| StringTypeAnnotation
394+
| NumberTypeAnnotation;
395+
387396
export type NativeModuleUnionTypeAnnotation = $ReadOnly<{
388397
type: 'UnionTypeAnnotation',
389398
memberType: UnionTypeAnnotationMemberType,

0 commit comments

Comments
 (0)