react-native-track-player
Version:
A fully fledged audio module created for music apps
62 lines (61 loc) • 3.11 kB
TypeScript
import { Event } from '../../constants';
import type { PlaybackState } from '../PlaybackState';
import type { PlaybackActiveTrackChangedEvent } from './PlaybackActiveTrackChangedEvent';
import type { PlaybackErrorEvent } from './PlaybackErrorEvent';
import type { PlaybackMetadataReceivedEvent } from './PlaybackMetadataReceivedEvent';
import type { AudioMetadataReceivedEvent } from './AudioMetadataReceivedEvent';
import type { AudioCommonMetadataReceivedEvent } from './AudioMetadataReceivedEvent';
import type { PlaybackPlayWhenReadyChangedEvent } from './PlaybackPlayWhenReadyChangedEvent';
import type { PlaybackProgressUpdatedEvent } from './PlaybackProgressUpdatedEvent';
import type { PlaybackQueueEndedEvent } from './PlaybackQueueEndedEvent';
import type { PlaybackTrackChangedEvent } from './PlaybackTrackChangedEvent';
import { PlayerErrorEvent } from './PlayerErrorEvent';
import type { RemoteDuckEvent } from './RemoteDuckEvent';
import type { RemoteJumpBackwardEvent } from './RemoteJumpBackwardEvent';
import type { RemoteJumpForwardEvent } from './RemoteJumpForwardEvent';
import type { RemotePlayIdEvent } from './RemotePlayIdEvent';
import type { RemotePlaySearchEvent } from './RemotePlaySearchEvent';
import type { RemoteSeekEvent } from './RemoteSeekEvent';
import type { RemoteSetRatingEvent } from './RemoteSetRatingEvent';
import type { RemoteSkipEvent } from './RemoteSkipEvent';
export type EventPayloadByEvent = {
[ ]: PlayerErrorEvent;
[ ]: PlaybackState;
[ ]: PlaybackErrorEvent;
[ ]: PlaybackQueueEndedEvent;
[ ]: PlaybackTrackChangedEvent;
[ ]: PlaybackActiveTrackChangedEvent;
[ ]: PlaybackMetadataReceivedEvent;
[ ]: PlaybackPlayWhenReadyChangedEvent;
[ ]: PlaybackProgressUpdatedEvent;
[ ]: never;
[ ]: RemotePlayIdEvent;
[ ]: RemotePlaySearchEvent;
[ ]: never;
[ ]: never;
[ ]: RemoteSkipEvent;
[ ]: never;
[ ]: never;
[ ]: RemoteJumpForwardEvent;
[ ]: RemoteJumpBackwardEvent;
[ ]: RemoteSeekEvent;
[ ]: RemoteSetRatingEvent;
[ ]: RemoteDuckEvent;
[ ]: never;
[ ]: never;
[ ]: never;
[ ]: AudioMetadataReceivedEvent;
[ ]: AudioMetadataReceivedEvent;
[ ]: AudioCommonMetadataReceivedEvent;
};
type Simplify<T> = {
[ ]: T[KeyType];
} & {};
export type EventPayloadByEventWithType = {
[ ]: EventPayloadByEvent[K] extends never ? {
type: K;
} : Simplify<EventPayloadByEvent[K] & {
type: K;
}>;
};
export {};