mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
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:
1 parent
f5e27e48a8
commit
b99c69a194
2 files changed
+10
No files matched your search
@@ -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';
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
}>;
|
||||
|
||||
Reference in new issue
Block a user