From 1d9d3ae4a427070bdbb7ecb615073567b3cb67a6 Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Wed, 19 Nov 2025 22:30:28 -0800 Subject: [PATCH] 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 --- .../react-native-codegen/src/CodegenSchema.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/react-native-codegen/src/CodegenSchema.d.ts b/packages/react-native-codegen/src/CodegenSchema.d.ts index fc68a172244..bc026fce48e 100644 --- a/packages/react-native-codegen/src/CodegenSchema.d.ts +++ b/packages/react-native-codegen/src/CodegenSchema.d.ts @@ -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