Skip to content

Commit 803b143

Browse files
Add BooleanLiteralTypeAnnotation to the NativeModuleBaseTypeAnnotation in Flow (facebook#54593)
Summary: Just as `NumberLiteralTypeAnnotation` was part of the `NativeModuleBaseTypeAnnotation` in Flow, adding the `BooleanLiteralTypeAnnotation`. Similarly adding it to the StructCollector since this is needed for Flow exhaustiveness check in generators/modules in D87410022 NOTE: Didn't add this change for TS as both `NumberLiteralTypeAnnotation` was not included as part of `NativeModuleBaseTypeAnnotation` in TS, also the generators were not failing in TS for this. Changelog: [Internal] Differential Revision: D87392274
1 parent fa5c71a commit 803b143

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ export type NativeModuleBaseTypeAnnotation =
432432
| StringLiteralUnionTypeAnnotation
433433
| NativeModuleNumberTypeAnnotation
434434
| NumberLiteralTypeAnnotation
435+
| BooleanLiteralTypeAnnotation
435436
| Int32TypeAnnotation
436437
| DoubleTypeAnnotation
437438
| FloatTypeAnnotation

packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'use strict';
1212

1313
import type {
14+
BooleanLiteralTypeAnnotation,
1415
BooleanTypeAnnotation,
1516
DoubleTypeAnnotation,
1617
FloatTypeAnnotation,
@@ -65,6 +66,7 @@ export type StructTypeAnnotation =
6566
| StringLiteralUnionTypeAnnotation
6667
| NativeModuleNumberTypeAnnotation
6768
| NumberLiteralTypeAnnotation
69+
| BooleanLiteralTypeAnnotation
6870
| Int32TypeAnnotation
6971
| DoubleTypeAnnotation
7072
| FloatTypeAnnotation

0 commit comments

Comments
 (0)