Skip to content

Commit

Permalink
Update method overloading to fix options beign ignored bug
Browse files Browse the repository at this point in the history
  • Loading branch information
schl3ck committed Jan 3, 2022
1 parent bfa99d1 commit 4b6992e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/typings/spotify-web-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,22 @@ declare namespace SpotifyWebApi {
* See [Get a List of a User's Playlists](https://developer.spotify.com/web-api/get-list-users-playlists/) on
* the Spotify Developer site for more information about the endpoint.
*
* @param {string} userId An optional id of the user. If you know the Spotify URI it is easy
* @param {Object} options A JSON object with options that can be passed
* @param {function(Object,Object)} callback An optional callback that receives 2 parameters. The first
* one is the error object (null if no error), and the second is the value if the request succeeded.
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
*/
getUserPlaylists(
options?: Object,
callback?: ResultsCallback<SpotifyApi.ListOfUsersPlaylistsResponse>
): Promise<SpotifyApi.ListOfUsersPlaylistsResponse>;

/**
* Fetches a list of the current user's playlists.
* See [Get a List of a User's Playlists](https://developer.spotify.com/web-api/get-list-users-playlists/) on
* the Spotify Developer site for more information about the endpoint.
*
* @param {string} userId An id of the user. If you know the Spotify URI it is easy
* to find the id (e.g. spotify:user:<here_is_the_id>). If not provided, the id of the user that granted
* the permissions will be used.
* @param {Object} options A JSON object with options that can be passed
Expand All @@ -461,8 +476,8 @@ declare namespace SpotifyWebApi {
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
*/
getUserPlaylists(
userId?: string,
options?: Record<PropertyKey, any>,
userId: string,
options?: Object,
callback?: ResultsCallback<SpotifyApi.ListOfUsersPlaylistsResponse>
): Promise<SpotifyApi.ListOfUsersPlaylistsResponse>;

Expand Down

0 comments on commit 4b6992e

Please sign in to comment.