Skip to content

Commit d88c1c0

Browse files
Un-special Case StringLiteralUnionTypeAnnotation (facebook#54595)
Summary: Now that UnionTypeAnnotation itself supports both the member types and value, we can fold the StringLiteralUnionTypeAnnotation into the UnionTypeAnnotation and un-special case the StringLiteralUnionTypeAnnotation Changelog: [Internal] Differential Revision: D87388948
1 parent afab820 commit d88c1c0

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,8 @@ export interface NativeModuleStringLiteralTypeAnnotation {
335335
readonly value: string;
336336
}
337337

338-
export interface StringLiteralUnionTypeAnnotation {
339-
readonly type: 'StringLiteralUnionTypeAnnotation';
340-
readonly types: NativeModuleStringLiteralTypeAnnotation[];
341-
}
338+
export type StringLiteralUnionTypeAnnotation =
339+
UnionTypeAnnotation<StringLiteralTypeAnnotation>;
342340

343341
export type NumberLiteralUnionTypeAnnotation =
344342
UnionTypeAnnotation<NumberLiteralTypeAnnotation>;

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ export type BooleanLiteralTypeAnnotation = $ReadOnly<{
6161
value: boolean,
6262
}>;
6363

64-
export type StringLiteralUnionTypeAnnotation = $ReadOnly<{
65-
type: 'StringLiteralUnionTypeAnnotation',
66-
types: $ReadOnlyArray<StringLiteralTypeAnnotation>,
67-
}>;
64+
export type StringLiteralUnionTypeAnnotation =
65+
UnionTypeAnnotation<StringLiteralTypeAnnotation>;
6866

6967
export type NumberLiteralUnionTypeAnnotation =
7068
UnionTypeAnnotation<NumberLiteralTypeAnnotation>;

0 commit comments

Comments
 (0)