Skip to content

Commit 757fe0e

Browse files
Introduce NumberLiteralType & StringLiteralType in TS (facebook#54588)
Summary: Introduce NumberLiteralType & StringLiteralType in TypeScript just as they already exist in Flow here: https://www.internalfb.com/code/fbsource/[9b248afa0cd5548b81dd44f1042b230e6069432b]/xplat/js/react-native-github/packages/react-native-codegen/src/CodegenSchema.js?lines=41-53 Changelog: [Internal] Differential Revision: D87375511
1 parent 6b3e4af commit 757fe0e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ export interface VoidTypeAnnotation {
4646
readonly type: 'VoidTypeAnnotation';
4747
}
4848

49+
export interface NumberLiteralTypeAnnotation {
50+
readonly type: 'NumberLiteralTypeAnnotation';
51+
readonly value: number;
52+
}
53+
54+
export interface StringLiteralTypeAnnotation {
55+
readonly type: 'StringLiteralTypeAnnotation';
56+
readonly value: string;
57+
}
58+
4959
export interface ObjectTypeAnnotation<T> {
5060
readonly type: 'ObjectTypeAnnotation';
5161
readonly properties: readonly NamedShape<T>[];

0 commit comments

Comments
 (0)