Skip to content

Commit 2571df0

Browse files
fix: fixed type of callback parameter in addEventListener method of notification managers (#983)
Co-authored-by: maciejmakowski2003 <maciejmakowski2003@users.noreply.github.com>
1 parent dc034a6 commit 2571df0

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

packages/react-native-audio-api/src/system/notification/PlaybackNotificationManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AudioEventEmitter, AudioEventSubscription } from '../../events';
22
import { NativeAudioAPIModule } from '../../specs';
33
import type {
4-
NotificationEvents,
4+
NotificationCallback,
55
NotificationManager,
66
PlaybackControlName,
77
PlaybackNotificationEventName,
@@ -113,7 +113,7 @@ class PlaybackNotificationManager
113113
*/
114114
addEventListener<T extends PlaybackNotificationEventName>(
115115
eventName: T,
116-
callback: (event: NotificationEvents[T]) => void
116+
callback: NotificationCallback<T>
117117
): AudioEventSubscription {
118118
return this.audioEventEmitter.addAudioEventListener(eventName, callback);
119119
}

packages/react-native-audio-api/src/system/notification/RecordingNotificationManager.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { AudioEventEmitter, AudioEventSubscription } from '../../events';
22
import { NativeAudioAPIModule } from '../../specs';
33
import type {
4-
RecordingNotificationEvent,
4+
NotificationCallback,
55
NotificationManager,
66
RecordingNotificationEventName,
77
RecordingNotificationInfo,
88
} from './types';
9-
109
import { AudioApiError } from '../../errors';
1110

1211
class RecordingNotificationManager
@@ -88,7 +87,7 @@ class RecordingNotificationManager
8887
*/
8988
addEventListener<T extends RecordingNotificationEventName>(
9089
eventName: T,
91-
callback: (event: RecordingNotificationEvent[T]) => void
90+
callback: NotificationCallback<T>
9291
): AudioEventSubscription {
9392
return this.audioEventEmitter.addAudioEventListener(eventName, callback);
9493
}

0 commit comments

Comments
 (0)