From a5f71425f8379650dcbbe67e97517055f1aaba0a Mon Sep 17 00:00:00 2001 From: maciejmakowski2003 Date: Wed, 11 Mar 2026 12:09:42 +0100 Subject: [PATCH] fix: fixed type of callback parameter in addEventListener method of notification managers --- .../src/system/notification/PlaybackNotificationManager.ts | 4 ++-- .../src/system/notification/RecordingNotificationManager.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/react-native-audio-api/src/system/notification/PlaybackNotificationManager.ts b/packages/react-native-audio-api/src/system/notification/PlaybackNotificationManager.ts index 1ccc9e1e5..f73172e86 100644 --- a/packages/react-native-audio-api/src/system/notification/PlaybackNotificationManager.ts +++ b/packages/react-native-audio-api/src/system/notification/PlaybackNotificationManager.ts @@ -1,7 +1,7 @@ import { AudioEventEmitter, AudioEventSubscription } from '../../events'; import { NativeAudioAPIModule } from '../../specs'; import type { - NotificationEvents, + NotificationCallback, NotificationManager, PlaybackControlName, PlaybackNotificationEventName, @@ -113,7 +113,7 @@ class PlaybackNotificationManager */ addEventListener( eventName: T, - callback: (event: NotificationEvents[T]) => void + callback: NotificationCallback ): AudioEventSubscription { return this.audioEventEmitter.addAudioEventListener(eventName, callback); } diff --git a/packages/react-native-audio-api/src/system/notification/RecordingNotificationManager.ts b/packages/react-native-audio-api/src/system/notification/RecordingNotificationManager.ts index 101713a09..0a623c3b4 100644 --- a/packages/react-native-audio-api/src/system/notification/RecordingNotificationManager.ts +++ b/packages/react-native-audio-api/src/system/notification/RecordingNotificationManager.ts @@ -1,12 +1,11 @@ import { AudioEventEmitter, AudioEventSubscription } from '../../events'; import { NativeAudioAPIModule } from '../../specs'; import type { - RecordingNotificationEvent, + NotificationCallback, NotificationManager, RecordingNotificationEventName, RecordingNotificationInfo, } from './types'; - import { AudioApiError } from '../../errors'; class RecordingNotificationManager @@ -88,7 +87,7 @@ class RecordingNotificationManager */ addEventListener( eventName: T, - callback: (event: RecordingNotificationEvent[T]) => void + callback: NotificationCallback ): AudioEventSubscription { return this.audioEventEmitter.addAudioEventListener(eventName, callback); }