Skip to content

Commit f10d2d8

Browse files
authored
Update typings to support a null access token (#154)
Currently getAccessToken can return null, so the return type of the method should be `string | null`, and the typings should probably allow calling `setAccessToken(null)` as well.
1 parent 923ffb1 commit f10d2d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ declare namespace SpotifyWebApi {
10731073
*
10741074
* @return {string} accessToken The access token
10751075
*/
1076-
getAccessToken() : string;
1076+
getAccessToken() : string | null;
10771077

10781078
/**
10791079
* Sets the access token to be used.
@@ -1083,7 +1083,7 @@ declare namespace SpotifyWebApi {
10831083
* @param {string} accessToken The access token
10841084
* @return {void}
10851085
*/
1086-
setAccessToken(accessToken: string) : void;
1086+
setAccessToken(accessToken: string | null) : void;
10871087

10881088
/**
10891089
* Sets an implementation of Promises/A+ to be used. E.g. Q, when.

0 commit comments

Comments
 (0)