Skip to content

Commit e8fc476

Browse files
committed
Update method overloading to fix options beign ignored bug
This issue was raised in JMPerez#181 but not yet fixed. This fork fixes this issue
1 parent 7e6922b commit e8fc476

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/typings/spotify-web-api.d.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,22 @@ declare namespace SpotifyWebApi {
452452
* See [Get a List of a User's Playlists](https://developer.spotify.com/web-api/get-list-users-playlists/) on
453453
* the Spotify Developer site for more information about the endpoint.
454454
*
455-
* @param {string} userId An optional id of the user. If you know the Spotify URI it is easy
455+
* @param {Object} options A JSON object with options that can be passed
456+
* @param {function(Object,Object)} callback An optional callback that receives 2 parameters. The first
457+
* one is the error object (null if no error), and the second is the value if the request succeeded.
458+
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
459+
*/
460+
getUserPlaylists(
461+
options?: Object,
462+
callback?: ResultsCallback<SpotifyApi.ListOfUsersPlaylistsResponse>
463+
): Promise<SpotifyApi.ListOfUsersPlaylistsResponse>;
464+
465+
/**
466+
* Fetches a list of the current user's playlists.
467+
* See [Get a List of a User's Playlists](https://developer.spotify.com/web-api/get-list-users-playlists/) on
468+
* the Spotify Developer site for more information about the endpoint.
469+
*
470+
* @param {string} userId An id of the user. If you know the Spotify URI it is easy
456471
* to find the id (e.g. spotify:user:<here_is_the_id>). If not provided, the id of the user that granted
457472
* the permissions will be used.
458473
* @param {Object} options A JSON object with options that can be passed
@@ -461,7 +476,7 @@ declare namespace SpotifyWebApi {
461476
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
462477
*/
463478
getUserPlaylists(
464-
userId?: string,
479+
userId: string,
465480
options?: Object,
466481
callback?: ResultsCallback<SpotifyApi.ListOfUsersPlaylistsResponse>
467482
): Promise<SpotifyApi.ListOfUsersPlaylistsResponse>;

0 commit comments

Comments
 (0)