Skip to content

Commit 92676d3

Browse files
Introduce the supported member types of Union (facebook#54591)
Summary: Pull Request resolved: facebook#54591 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 e311d38 commit 92676d3

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
@@ -388,6 +388,15 @@ export type UnionTypeAnnotationMemberType =
388388
| 'ObjectTypeAnnotation'
389389
| 'StringTypeAnnotation';
390390

391+
export type NativeModuleUnionTypeAnnotationMemberType =
392+
| NativeModuleObjectTypeAnnotation
393+
| StringLiteralTypeAnnotation
394+
| NumberLiteralTypeAnnotation
395+
| BooleanLiteralTypeAnnotation
396+
| BooleanTypeAnnotation
397+
| StringTypeAnnotation
398+
| NumberTypeAnnotation;
399+
391400
export interface NativeModuleUnionTypeAnnotation {
392401
readonly type: 'UnionTypeAnnotation';
393402
readonly memberType: UnionTypeAnnotationMemberType;

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,15 @@ export type UnionTypeAnnotationMemberType =
377377
| 'ObjectTypeAnnotation'
378378
| 'StringTypeAnnotation';
379379

380+
export type NativeModuleUnionTypeAnnotationMemberType =
381+
| NativeModuleObjectTypeAnnotation
382+
| StringLiteralTypeAnnotation
383+
| NumberLiteralTypeAnnotation
384+
| BooleanLiteralTypeAnnotation
385+
| BooleanTypeAnnotation
386+
| StringTypeAnnotation
387+
| NumberTypeAnnotation;
388+
380389
export type NativeModuleUnionTypeAnnotation = $ReadOnly<{
381390
type: 'UnionTypeAnnotation',
382391
memberType: UnionTypeAnnotationMemberType,

0 commit comments

Comments
 (0)