mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 14:38:20 +08:00
Fix incorrect enum declaration (#25300)
This commit is contained in:
committed by
Wesley Wigham
parent
c2b2901115
commit
014cf5df60
13
types/spotify-web-playback-sdk/index.d.ts
vendored
13
types/spotify-web-playback-sdk/index.d.ts
vendored
@@ -64,7 +64,12 @@ declare namespace Spotify {
|
||||
duration: number;
|
||||
paused: boolean;
|
||||
position: number;
|
||||
repeat_mode: RepeatMode;
|
||||
/**
|
||||
* 0: NO_REPEAT
|
||||
* 1: ONCE_REPEAT
|
||||
* 2: FULL_REPEAT
|
||||
*/
|
||||
repeat_mode: 0 | 1 | 2;
|
||||
shuffle: boolean;
|
||||
restrictions: PlaybackRestrictions;
|
||||
track_window: PlaybackTrackWindow;
|
||||
@@ -82,12 +87,6 @@ declare namespace Spotify {
|
||||
volume?: number;
|
||||
}
|
||||
|
||||
enum RepeatMode {
|
||||
NO_REPEAT = 0,
|
||||
ONCE_REPEAT = 1,
|
||||
FULL_REPEAT = 2,
|
||||
}
|
||||
|
||||
type ErrorListener = (err: Error) => void;
|
||||
type PlaybackInstanceListener = (inst: WebPlaybackInstance) => void;
|
||||
type PlaybackStateListener = (s: PlaybackState) => void;
|
||||
|
||||
@@ -27,6 +27,7 @@ player.addListener("ready", (data) => {
|
||||
player.getCurrentState().then((playbackState: Spotify.PlaybackState | null) => {
|
||||
if (playbackState) {
|
||||
const { current_track, next_tracks } = playbackState.track_window;
|
||||
const repeatMode: 0 | 1 | 2 = playbackState.repeat_mode;
|
||||
|
||||
console.log("Currently Playing", current_track);
|
||||
console.log("Playing Next", next_tracks[0]);
|
||||
|
||||
Reference in New Issue
Block a user