Migrate rn-tester codegen types imports to use root exported CodegenTypes namespace (#50976)

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

This is the second part of the migration of `rn-tester` package to use root imports. In this diff the `CodegenTypes` namespace is used to define Codegen primitives.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73780584

fbshipit-source-id: c13c2dfcfa4d023978a9463af1d2a3bf7b72476c
This commit is contained in:
Dawid Małecki
2025-04-29 06:06:16 -07:00
committed by Facebook GitHub Bot
parent 9666a68977
commit 7959a63a1a
3 changed files with 18 additions and 26 deletions
@@ -8,8 +8,7 @@
* @format
*/
import type {TurboModule} from 'react-native';
import type {EventEmitter} from 'react-native/Libraries/Types/CodegenTypes';
import type {CodegenTypes, TurboModule} from 'react-native';
import {TurboModuleRegistry} from 'react-native';
@@ -77,11 +76,11 @@ export type CustomDeviceEvent = {
};
export interface Spec extends TurboModule {
+onPress: EventEmitter<void>;
+onClick: EventEmitter<string>;
+onChange: EventEmitter<ObjectStruct>;
+onSubmit: EventEmitter<ObjectStruct[]>;
+onEvent: EventEmitter<EnumNone>;
+onPress: CodegenTypes.EventEmitter<void>;
+onClick: CodegenTypes.EventEmitter<string>;
+onChange: CodegenTypes.EventEmitter<ObjectStruct>;
+onSubmit: CodegenTypes.EventEmitter<ObjectStruct[]>;
+onEvent: CodegenTypes.EventEmitter<EnumNone>;
+getArray: (arg: Array<ObjectStruct | null>) => Array<ObjectStruct | null>;
+getBool: (arg: boolean) => boolean;
+getConstants: () => ConstantsStruct;