diff --git a/types/spotify-web-playback-sdk/index.d.ts b/types/spotify-web-playback-sdk/index.d.ts index ee3086e40e..93ad7af689 100644 --- a/types/spotify-web-playback-sdk/index.d.ts +++ b/types/spotify-web-playback-sdk/index.d.ts @@ -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; diff --git a/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts b/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts index 8f2c27f33d..1fc6f8fc4c 100644 --- a/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts +++ b/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts @@ -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]);