Skip to content

Instantly share code, notes, and snippets.

@Yidaotus
Created February 25, 2022 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yidaotus/c152e32bc9d55193e81ccf854e3bcf3d to your computer and use it in GitHub Desktop.
Save Yidaotus/c152e32bc9d55193e81ccf854e3bcf3d to your computer and use it in GitHub Desktop.
Currently Playing Types
export interface SpotifyImage {
height: number;
width: number;
url: string;
}
export interface SpotifyAlbum {
images: Array<SpotifyImage>;
name: string;
}
export interface SpotifyTrackItem {
name: string;
durationMs: number;
uri: string;
album: SpotifyAlbum;
artists: Array<{ name: string }>;
}
export interface SpotifyPlayer {
progressMs: number;
isPlaying: boolean | undefined;
item: SpotifyTrackItem;
}
export interface CurrentlyPlayingError {
message: string;
path: Array<string>;
}
export interface CurrentlyPlayingData {
me: {
spotify: {
player: SpotifyPlayer;
};
};
}
export interface CurrentlyPlayingAPI {
success: boolean;
CurrentlyPlayingErrors?: Array<CurrentlyPlayingError>;
CurrentlyPlayingData: CurrentlyPlayingData;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment