mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Codemod : to extends to a few react-native-github package (#56025)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56025 Flow is migrating from colon style type parameter bound to `extends` Changelog:[internal] Reviewed By: SamChou19815 Differential Revision: D95867062 fbshipit-source-id: 201483bcbae9b628c8fbd9ffda70d8adfa3a2dc6
This commit is contained in:
1 parent
665b80113f
commit
4f0bd0ee93
2 files changed
+9
-8
No files matched your search
+7
-6
@@ -265,14 +265,15 @@ export type ReservedTypeAnnotation = Readonly<{
|
||||
/**
|
||||
* NativeModule Types
|
||||
*/
|
||||
export type Nullable<+T: NativeModuleTypeAnnotation> =
|
||||
export type Nullable<+T extends NativeModuleTypeAnnotation> =
|
||||
| NullableTypeAnnotation<T>
|
||||
| T;
|
||||
|
||||
export type NullableTypeAnnotation<+T: NativeModuleTypeAnnotation> = Readonly<{
|
||||
type: 'NullableTypeAnnotation',
|
||||
typeAnnotation: T,
|
||||
}>;
|
||||
export type NullableTypeAnnotation<+T extends NativeModuleTypeAnnotation> =
|
||||
Readonly<{
|
||||
type: 'NullableTypeAnnotation',
|
||||
typeAnnotation: T,
|
||||
}>;
|
||||
|
||||
export type NativeModuleSchema = Readonly<{
|
||||
type: 'NativeModule',
|
||||
@@ -316,7 +317,7 @@ export type NativeModuleObjectTypeAnnotation = ObjectTypeAnnotation<
|
||||
>;
|
||||
|
||||
export type NativeModuleArrayTypeAnnotation<
|
||||
+T: Nullable<NativeModuleBaseTypeAnnotation>,
|
||||
+T extends Nullable<NativeModuleBaseTypeAnnotation>,
|
||||
> = ArrayTypeAnnotation<
|
||||
| T
|
||||
/**
|
||||
|
||||
@@ -107,7 +107,7 @@ function wrapModuleSchema(
|
||||
}
|
||||
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
function unwrapNullable<+T: NativeModuleTypeAnnotation>(
|
||||
function unwrapNullable<+T extends NativeModuleTypeAnnotation>(
|
||||
x: Nullable<T>,
|
||||
): [T, boolean] {
|
||||
if (x.type === 'NullableTypeAnnotation') {
|
||||
@@ -118,7 +118,7 @@ function unwrapNullable<+T: NativeModuleTypeAnnotation>(
|
||||
}
|
||||
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
function wrapNullable<+T: NativeModuleTypeAnnotation>(
|
||||
function wrapNullable<+T extends NativeModuleTypeAnnotation>(
|
||||
nullable: boolean,
|
||||
typeAnnotation: T,
|
||||
): Nullable<T> {
|
||||
|
||||
Reference in new issue
Block a user