/
spotify-web-api-node.d.ts
60 lines (44 loc) · 2.33 KB
/
spotify-web-api-node.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { UserObjectPrivateNodeResponse, PagingRequestObject, UsersSavedAlbumsNodeResponse, MultipleAlbumsNodeResponse, VoidResponse, CheckUserSavedAlbumsNodeResponse, CheckUserSavedTracksNodeResponse, AlbumSearchNodeResponse, ArtistSearchNodeResponse } from "spotify-web-api-node-typings";
declare module "spotify-web-api-node" {
export default class SpotifyWebApi {
// lib docs: https://github.com/thelinmichael/spotify-web-api-node
// api docs: https://developer.spotify.com/documentation/web-api/reference/
// models docs: https://developer.spotify.com/documentation/web-api/reference/object-model/
constructor(params: {
clientId: string,
clientSecret: string,
});
setAccessToken(accessToken: String): void;
setRefreshToken(refreshToken: String): void;
getAccessToken(): String;
getRefreshToken(): String;
refreshAccessToken(): Promise<any>;
getMe(): Promise<UserObjectPrivateNodeResponse>;
getMySavedAlbums(options: PagingRequestObject): Promise<UsersSavedAlbumsNodeResponse>;
/**
* Get Spotify catalog information for multiple albums identified by their Spotify IDs.
* @param ids A list of the Spotify IDs for the albums. Maximum: 20 IDs.
*/
getAlbums(ids: string[]): Promise<MultipleAlbumsNodeResponse>;
/**
* Save one or more albums to the current user’s ‘Your Music’ library.
* @param ids A list of the Spotify IDs. Maximum: 50 IDs.
*/
addToMySavedAlbums(ids: string[]): Promise<VoidResponse>;
/**
* Remove one or more albums from the current user’s ‘Your Music’ library.
* @param ids A list of the Spotify IDs. Maximum: 50 IDs.
*/
removeFromMySavedAlbums(ids: string[]): Promise<VoidResponse>;
/**
* Check if one or more albums is already saved in the current Spotify user’s ‘Your Music’ library.
*/
containsMySavedAlbums(ids: string[]): Promise<CheckUserSavedAlbumsNodeResponse>;
/**
* Check if one or more tracks is already saved in the current Spotify user’s ‘Your Music’ library.
*/
containsMySavedTracks(ids: string[]): Promise<CheckUserSavedTracksNodeResponse>;
searchAlbums(keywords: string, options: PagingRequestObject): Promise<AlbumSearchNodeResponse>;
searchArtists(keywords: string, options: PagingRequestObject): Promise<ArtistSearchNodeResponse>;
}
}