Skip to content

Commit 8f4eceb

Browse files
Introduce BooleanLiteralTypeAnnotation (facebook#54590)
Summary: Introduce `BooleanLiteralTypeAnnotation` in Flow & TypeScript to match the existing `StringLiteralTypeAnnotation` & `NumberLiteralTypeAnnotation` since Unions will be supporting Booleans along with String & Number Changelog: [Internal] Differential Revision: D87384473
1 parent a8f8878 commit 8f4eceb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export interface StringLiteralTypeAnnotation {
5656
readonly value: string;
5757
}
5858

59+
export interface BooleanLiteralTypeAnnotation {
60+
readonly type: 'BooleanLiteralTypeAnnotation';
61+
readonly value: boolean;
62+
}
63+
5964
export interface ObjectTypeAnnotation<T> {
6065
readonly type: 'ObjectTypeAnnotation';
6166
readonly properties: readonly NamedShape<T>[];

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export type StringLiteralTypeAnnotation = $ReadOnly<{
5656
value: string,
5757
}>;
5858

59+
export type BooleanLiteralTypeAnnotation = $ReadOnly<{
60+
type: 'BooleanLiteralTypeAnnotation',
61+
value: boolean,
62+
}>;
63+
5964
export type StringLiteralUnionTypeAnnotation = $ReadOnly<{
6065
type: 'StringLiteralUnionTypeAnnotation',
6166
types: $ReadOnlyArray<StringLiteralTypeAnnotation>,

0 commit comments

Comments
 (0)