Skip to content

Commit 13a1fc7

Browse files
Introduce UnionTypeAnnotation for Number & Boolean (facebook#54592)
Summary: Adding `NumberLiteralUnionTypeAnnotation` & `BooleanLiteralUnionTypeAnnotation` to Flow & TypeScript so that they are in parity with other Union type : `StringLiteralUnionTypeAnnotation`. Number & Boolean aren't used anywhere yet. Changelog: [Internal] Differential Revision: D87386144
1 parent 0b8f7d0 commit 13a1fc7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/react-native-codegen/src/CodegenSchema.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,12 @@ export interface StringLiteralUnionTypeAnnotation {
340340
readonly types: NativeModuleStringLiteralTypeAnnotation[];
341341
}
342342

343+
export type NumberLiteralUnionTypeAnnotation =
344+
UnionTypeAnnotation<NumberLiteralTypeAnnotation>;
345+
346+
export type BooleanLiteralUnionTypeAnnotation =
347+
UnionTypeAnnotation<BooleanLiteralTypeAnnotation>;
348+
343349
export interface NativeModuleNumberTypeAnnotation {
344350
readonly type: 'NumberTypeAnnotation';
345351
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ export type StringLiteralUnionTypeAnnotation = $ReadOnly<{
6666
types: $ReadOnlyArray<StringLiteralTypeAnnotation>,
6767
}>;
6868

69+
export type NumberLiteralUnionTypeAnnotation =
70+
UnionTypeAnnotation<NumberLiteralTypeAnnotation>;
71+
72+
export type BooleanLiteralUnionTypeAnnotation =
73+
UnionTypeAnnotation<BooleanLiteralTypeAnnotation>;
74+
6975
export type VoidTypeAnnotation = $ReadOnly<{
7076
type: 'VoidTypeAnnotation',
7177
}>;

0 commit comments

Comments
 (0)