Rename NativeModuleNumberLiteralTypeAnnotation & NativeModuleStringLiteralTypeAnnotation in TS (#54588)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54588

`NativeModuleNumberLiteralTypeAnnotation` -> `NumberLiteralTypeAnnotation` & `NativeModuleStringLiteralTypeAnnotation` -> `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]

Reviewed By: elicwhite

Differential Revision: D87375511

fbshipit-source-id: c35afff132c2efa20ce1c45dc23ef2c64c91613c
This commit is contained in:
Arushi Kesarwani authored and meta-codesync[bot] committed 2025-11-19 22:30:28 -08:00
1 parent b99c69a194
commit 1d9d3ae4a4
1 file changed
+8 -8
+8 -8
View File
@@ -299,7 +299,7 @@ export interface UnsafeAnyTypeAnnotation {
readonly type: 'AnyTypeAnnotation',
}
export interface NativeModuleNumberLiteralTypeAnnotation {
export interface NumberLiteralTypeAnnotation {
readonly type: 'NumberLiteralTypeAnnotation';
readonly value: number;
}
@@ -308,14 +308,14 @@ export interface NativeModuleStringTypeAnnotation {
readonly type: 'StringTypeAnnotation';
}
export interface NativeModuleStringLiteralTypeAnnotation {
export interface StringLiteralTypeAnnotation {
readonly type: 'StringLiteralTypeAnnotation';
readonly value: string;
}
export interface StringLiteralUnionTypeAnnotation {
readonly type: 'StringLiteralUnionTypeAnnotation';
readonly types: NativeModuleStringLiteralTypeAnnotation[];
readonly types: StringLiteralTypeAnnotation[];
}
export interface NativeModuleNumberTypeAnnotation {
@@ -340,7 +340,7 @@ export interface NativeModuleBooleanTypeAnnotation {
export type NativeModuleEnumMember = {
readonly name: string;
readonly value: NativeModuleStringLiteralTypeAnnotation | NativeModuleNumberLiteralTypeAnnotation,
readonly value: StringLiteralTypeAnnotation | NumberLiteralTypeAnnotation,
};
export type NativeModuleEnumMemberType =
@@ -398,9 +398,9 @@ export type NativeModuleEventEmitterBaseTypeAnnotation =
| NativeModuleFloatTypeAnnotation
| NativeModuleInt32TypeAnnotation
| NativeModuleNumberTypeAnnotation
| NativeModuleNumberLiteralTypeAnnotation
| NumberLiteralTypeAnnotation
| NativeModuleStringTypeAnnotation
| NativeModuleStringLiteralTypeAnnotation
| StringLiteralTypeAnnotation
| StringLiteralUnionTypeAnnotation
| NativeModuleTypeAliasTypeAnnotation
| NativeModuleGenericObjectTypeAnnotation
@@ -412,10 +412,10 @@ export type NativeModuleEventEmitterTypeAnnotation =
export type NativeModuleBaseTypeAnnotation =
NativeModuleStringTypeAnnotation
| NativeModuleStringLiteralTypeAnnotation
| StringLiteralTypeAnnotation
| StringLiteralUnionTypeAnnotation
| NativeModuleNumberTypeAnnotation
| NativeModuleNumberLiteralTypeAnnotation
| NumberLiteralTypeAnnotation
| NativeModuleInt32TypeAnnotation
| NativeModuleDoubleTypeAnnotation
| NativeModuleFloatTypeAnnotation