Type alias PlayerEvent<T>

PlayerEvent<T>: {
    event: T;
} & (T extends "Stopped"
    ? {
        play_request_id: bigint;
        track_id: string;
    }
    : T extends "Loading"
        ? {
            play_request_id: bigint;
            position_ms: number;
            track_id: string;
        }
        : T extends "Preloading"
            ? {
                track_id: string;
            }
            : T extends "Playing"
                ? {
                    play_request_id: bigint;
                    position_ms: number;
                    track_id: string;
                }
                : T extends "Paused"
                    ? {
                        play_request_id: bigint;
                        position_ms: number;
                        track_id: string;
                    }
                    : T extends "TimeToPreloadNextTrack"
                        ? {
                            play_request_id: bigint;
                            track_id: string;
                        }
                        : T extends "EndOfTrack"
                            ? {
                                play_request_id: bigint;
                                track_id: string;
                            }
                            : T extends "Unavailable"
                                ? {
                                    play_request_id: bigint;
                                    track_id: string;
                                }
                                : T extends "VolumeChanged"
                                    ? {
                                        volume: number;
                                    }
                                    : T extends "PositionCorrection"
                                        ? {
                                            play_request_id: bigint;
                                            position_ms: number;
                                            track_id: string;
                                        }
                                        : T extends "Seeked"
                                            ? {
                                                play_request_id: bigint;
                                                position_ms: number;
                                                track_id: string;
                                            }
                                            : T extends "TrackChanged"
                                                ? {
                                                    audio_item: string;
                                                }
                                                : T extends "SessionConnected"
                                                    ? {
                                                        connection_id: string;
                                                        user_name: string;
                                                    }
                                                    : T extends "SessionDisconnected"
                                                        ? {
                                                            connection_id: string;
                                                            user_name: string;
                                                        }
                                                        : T extends "SessionClientChanged"
                                                            ? {
                                                                client_brand_name: string;
                                                                client_id: string;
                                                                client_model_name: string;
                                                                client_name: string;
                                                            }
                                                            : T extends "ShuffleChanged"
                                                                ? {
                                                                    shuffle: boolean;
                                                                }
                                                                : T extends "RepeatChanged"
                                                                    ? {
                                                                        repeat: boolean;
                                                                    }
                                                                    : T extends "AutoPlayChanged"
                                                                        ? {
                                                                            auto_play: boolean;
                                                                        }
                                                                        : T extends "FilterExplicitContentChanged"
                                                                            ? {
                                                                                filter: boolean;
                                                                            }
                                                                            : T extends "TimeUpdated"
                                                                                ? {
                                                                                    position_ms: number;
                                                                                }
                                                                                : T extends "PlayerInitialized"
                                                                                    ? undefined
                                                                                    : T extends "InitializationError"
                                                                                        ? {
                                                                                            error: Error;
                                                                                        }
                                                                                        : unknown)

Type Parameters

Generated using TypeDoc