From 25a44d10b8d550bed8f44f02d1a8fa3b4b10e37d Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 17 Apr 2023 11:01:04 -0700 Subject: [PATCH] Export EmitterSubscription TypeScript Type (#36632) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36632 Discovered when bumping the RN documentation to typecheck against 0.72, https://github.com/facebook/react-native/pull/36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Reviewed By: cortinico Differential Revision: D44375081 fbshipit-source-id: 4f5e2b36a42c5917cea37a6f0cd0b53420cf6b27 --- packages/react-native/types/__typetests__/index.tsx | 2 ++ packages/react-native/types/index.d.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/packages/react-native/types/__typetests__/index.tsx b/packages/react-native/types/__typetests__/index.tsx index 23b15ad3171d6e..d73b93d1459ae6 100644 --- a/packages/react-native/types/__typetests__/index.tsx +++ b/packages/react-native/types/__typetests__/index.tsx @@ -40,6 +40,8 @@ import { DrawerLayoutAndroid, DrawerSlideEvent, DynamicColorIOS, + EmitterSubscription, + EventSubscription, FlatList, FlatListProps, GestureResponderEvent, diff --git a/packages/react-native/types/index.d.ts b/packages/react-native/types/index.d.ts index d50dd04b12b602..5177707cc0f7b4 100644 --- a/packages/react-native/types/index.d.ts +++ b/packages/react-native/types/index.d.ts @@ -147,6 +147,10 @@ export * from '../Libraries/Utilities/Platform'; export * from '../Libraries/Vibration/Vibration'; export * from '../Libraries/YellowBox/YellowBoxDeprecated'; export * from '../Libraries/vendor/core/ErrorUtils'; +export { + EmitterSubscription, + EventSubscription, +} from '../Libraries/vendor/emitter/EventEmitter'; export * from './public/DeprecatedPropertiesAlias'; export * from './public/Insets';