Introduce generic UnionTypeAnnotation (#54587)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54587

Adding the generic type T UnionTypeAnnotation. This will be used later to create Unions of types String, Number & Boolean.

Changelog: [Internal]

Reviewed By: elicwhite

Differential Revision: D87374445

fbshipit-source-id: 7844f969111af14e42d2b57891e4c0935a0dce53
This commit is contained in:
Arushi Kesarwani authored and meta-codesync[bot] committed 2025-11-19 22:30:28 -08:00
1 parent f5e27e48a8
commit b99c69a194
2 files changed
+10

No files matched your search

+5
View File
@@ -53,6 +53,11 @@ export interface ObjectTypeAnnotation<T> {
readonly baseTypes?: readonly string[] | undefined;
}
export interface UnionTypeAnnotation<T> {
readonly type: 'UnionTypeAnnotation';
readonly types: readonly T[];
}
export interface MixedTypeAnnotation {
readonly type: 'MixedTypeAnnotation';
}
+5
View File
@@ -72,6 +72,11 @@ export type ObjectTypeAnnotation<+T> = $ReadOnly<{
baseTypes?: $ReadOnlyArray<string>,
}>;
export type UnionTypeAnnotation<+T> = $ReadOnly<{
type: 'UnionTypeAnnotation',
types: $ReadOnlyArray<T>,
}>;
export type MixedTypeAnnotation = $ReadOnly<{
type: 'MixedTypeAnnotation',
}>;