mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Refactor: Make NativeModuleArrayTypeAnnotation elementType customizable
Summary: In the future, we'll use `NativeModuleArrayTypeAnnotation` inside JS struct objects. Structs cannot contain `ObjectTypeAnnotations` anywhere. Therefore, we need the elementType of `NativeModuuleArrayTypeAnnotation`'s elementType customizable. Changelog: [Internal] Reviewed By: hramos Differential Revision: D23645210 fbshipit-source-id: 97abb993d59536ebd68ec08b18ce7f2801c68a2d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4927de6011
commit
91a7da087b
+5
-3
@@ -306,13 +306,15 @@ export type NativeModuleObjectTypeAnnotation = $ReadOnly<{|
|
||||
nullable: boolean,
|
||||
|}>;
|
||||
|
||||
export type NativeModuleArrayTypeAnnotation = $ReadOnly<{|
|
||||
export type NativeModuleArrayTypeAnnotation<
|
||||
T = NativeModuleBaseTypeAnnotation,
|
||||
> = $ReadOnly<{|
|
||||
type: 'ArrayTypeAnnotation',
|
||||
/**
|
||||
* TODO(T72031674): Migrate all our NativeModule specs to not use
|
||||
* invalid Array ElementTypes. Then, make the elementType required.
|
||||
*/
|
||||
elementType?: NativeModuleBaseTypeAnnotation,
|
||||
elementType?: T,
|
||||
nullable: boolean,
|
||||
|}>;
|
||||
|
||||
@@ -383,7 +385,7 @@ export type NativeModuleBaseTypeAnnotation =
|
||||
| NativeModuleGenericObjectTypeAnnotation
|
||||
| NativeModuleReservedFunctionValueTypeAnnotation
|
||||
| NativeModuleTypeAliasTypeAnnotation
|
||||
| NativeModuleArrayTypeAnnotation
|
||||
| NativeModuleArrayTypeAnnotation<>
|
||||
| NativeModuleObjectTypeAnnotation;
|
||||
|
||||
export type NativeModuleParamTypeAnnotation =
|
||||
|
||||
Reference in New Issue
Block a user