import { Album, AlbumCredits, AlbumTracksWithCredits, Contributor } from './types/api/AlbumTypes.js'; import { Artist, ArtistBio, ArtistMix, ArtistTracks } from './types/api/ArtistTypes.js'; import { OrderTypes, OrderDirections, ImageResolutionEnum, OnDupes, searchType } from './types/TidalTypes.js'; import { Video } from './types/api/VideoTypes.js'; import { Track } from './types/api/TrackTypes.js'; import { Playlist, PlaylistTracks, PlaylistFolders } from './types/api/PlaylistTypes.js'; import { Country, ClientOptions, RequestOptions } from './types/ClientTypes.js'; declare class Albums { private client; constructor(tidal: Tidal); /** * It gets the album information from the Tidal API. * @param {number} albumId - The ID of the album you want to get. * @returns {Promise} - A promise that resolves to an album object. * @fulfil {Album} - an album object * @reject {Error} - The error as returned by Tidal. */ getAlbum(albumId: number): Promise; /** * It gets the album credits from the Tidal API. * @param {number} albumId - The ID of the album you want to get. * @returns {Promise} - A promise that resolves to an array of album credits object. * @fulfil {AlbumCredits} - an album credits object * @reject {Error} - The error as returned by Tidal. */ getAlbumCredits(albumId: number): Promise; /** * It gets the tracks of a album from the Tidal API * @param {number} albumId - The ID of the album you want to get the tracks for. * @returns {Promise} - A promise that resolves to an array of track objects. * @fulfil {Track[]} - an array of track objects * @reject {Error} - The error as returned by Tidal. */ getAlbumTracks(albumId: number): Promise; /** * It gets the tracks & the credits of a albums from the Tidal API * @param {number} albumId - The ID of the album you want to get the tracks for. * @returns {Promise} - A promise that resolves to an array of track objects. * @fulfil {Album} - an album object * @reject {Error} - The error as returned by Tidal. */ getAlbumTracksWithCredits(albumId: number): Promise; /** * It gets featured albums on Tidal from the Tidal API * @returns {Promise} - A promise that resolves to an object with featured albums. * @fulfil {Album[]} - an array of album objects * @reject {Error} - The error as returned by Tidal. */ getFeaturedAlbums(): Promise<{ topAlbums: Album[]; newAlbums: Album[]; staffPicks: Album[]; }>; /** * It gets the top 20 albums on Tidal from the Tidal API * @returns {Promise} - A promise that resolves to an array of album objects. * @fulfil {ALbum[]} - an array of album objects * @reject {Error} - The error as returned by Tidal. */ getTopAlbums(): Promise; /** * It gets new albums on Tidal from the Tidal API * @returns {Promise} - A promise that resolves to an array of album objects. * @fulfil {ALbum[]} - an array of album objects * @reject {Error} - The error as returned by Tidal. */ getNewAlbums(): Promise; /** * It gets staff pick albums on Tidal from the Tidal API * @returns {Promise} - A promise that resolves to an array of album objects. * @fulfil {ALbum[]} - an array of album objects * @reject {Error} - The error as returned by Tidal. */ getStaffPickAlbums(): Promise; } declare class Artists { private client; constructor(tidal: Tidal); /** * It gets the artist information from the Tidal API. * @param {number} artistId - The ID of the artist you want to get. * @returns {Promise} - The artist information. * @fulfil {Artist} - The artist. * @reject {Error} - The error as returned by Tidal. * @example * const artist = await tidal.getArtist(3529689); * console.log(artist); * // { * // "id": 3529689, * // "name": "The Notwist", * // "artistTypes": [ * // "ARTIST", * // "CONTRIBUTOR" * // ], * // "url": "http://www.tidal.com/artist/3529689", * // "picture": "2a4abc4a-faf5-4c06-b2a4-bf142459d894", * // "popularity": 36, * // "artistRoles": [ * // { * // "categoryId": -1, * // "category": "Artist" * // }, * // { * // "categoryId": 11, * // "category": "Performer" * // }, * // { * // "categoryId": 1, * // "category": "Producer" * // }, * // { * // "categoryId": 2, * // "category": "Songwriter" * // }, * // { * // "categoryId": 3, * // "category": "Engineer" * // } * // ], * // "mixes": { * // "MASTER_ARTIST_MIX": "0157026712a3687e12af164ecb10ce", * // "ARTIST_MIX": "00008ded8a6682c338c2fbabd6619f" * // } * // } */ getArtist(artistId: number): Promise; /** * It gets the artist bio from the Tidal API. * @param {number} artistId - The ID of the artist you want to get. * @returns {Promise} - A promise that resolves to the artist bio. * @fulfil {ArtistBio} - The artist bio. * @reject {Error} - The error as returned by Tidal. * @example * const artist = await tidal.getArtist(3529689); * console.log(artist); * // { * // "source": "TiVo", * // "lastUpdated": "2020-10-10T05:10:45.967+0000", * // "text": "Formed near Munich as a post-hardcore band, [wimpLink artistId=\"3529689\"]the Notwist[/wimpLink] gradually began to embrace a fusion of classic '80s indie pop songwriting and scruffy electronic backings indebted to [wimpLink artistId=\"3941046\"]Oval[/wimpLink] and [wimpLink artistId=\"3569016\"]Autechre[/wimpLink]. The quartet comprises brothers [wimpLink artistId=\"10371697\"]Markus[/wimpLink] and [wimpLink artistId=\"9172940\"]Micha Acher[/wimpLink] (on vocals/guitar and bass, respectively) plus programmer/keyboard player [wimpLink artistId=\"13474646\"]Martin Gretschmann[/wimpLink] and drummer Martin Messerschmid. Their self-titled 1989 debut and 1992's [wimpLink albumId=\"20253985\"]Nook[/wimpLink] were rough-and-tumble punk LPs. Third album 12 marked the group's first flirtation with electronics, though the chord structures and vocals of [wimpLink artistId=\"10371697\"]Markus Acher[/wimpLink] marked [wimpLink artistId=\"3529689\"]the Notwist[/wimpLink] more as an alternative band. The band then gained an American distribution deal with Zero Hour, and after 12 was reissued, fourth album [wimpLink albumId=\"23341306\"]Shrink[/wimpLink] -- almost entirely abstract electronic in nature -- appeared in 1998. Neon Golden (2002) and [wimpLink albumId=\"77577154\"]The Devil, You + Me[/wimpLink] (2008) were both song-oriented in nature, albeit with electronics continuing to play a significant role in the band's material. In 2013, the band resurfaced with the single \"Close to the Glass.\" The album of the same name, which boasted some of [wimpLink artistId=\"3529689\"]the Notwist[/wimpLink]'s most accessible songwriting and experimental instrumentation, arrived in early 2014. Later that year, the band issued [wimpLink albumId=\"38519994\"]The Messier Objects[/wimpLink], a collection of instrumental tracks written in the years between [wimpLink albumId=\"77577154\"]The Devil, You + Me[/wimpLink] and [wimpLink albumId=\"25934525\"]Close to the Glass[/wimpLink]. The live album [wimpLink albumId=\"64377395\"]Superheroes, Ghostvillains & Stuff[/wimpLink] appeared in 2016, capturing the second of the band's three consecutive sold-out shows in Leipzig, Germany in late 2015. ~ John Bush" * // "summary": "" * // } */ getArtistBio(artistId: number): Promise; /** * It gets the artist mix from the Tidal API. * @param {number} artistId - The ID of the artist you want to get. * @param {number} [limit=50] - The number of results to return. * @param {number} [offset=0] - The offset of the first song to return. * @param {OrderTypes} [order=DATE] - OrderTypes = 'DATE', * @param {OrderDirections} [orderDirection=ASC] - OrderDirections = 'ASC', * @returns {Promise} - A promise that resolves to the artist mix. * @fulfil {ArtistMix} - The artist mix. * @reject {Error} - The error as returned by Tidal. * @example * const artist = await tidal.getArtistMix(3529689); * console.log(artist); * // { * // "id": "00008ded8a6682c338c2fbabd6619f" * // } */ getArtistMix(artistId: number): Promise; /** * It gets the artist top tracks from the Tidal API. * @param {number} artistId - The ID of the artist you want to get. * @param {number} [limit=50] - The number of results to return. * @param {number} [offset=0] - The offset of the first song to return. * @param {OrderTypes} [order=DATE] - OrderTypes = 'DATE', * @param {OrderDirections} [orderDirection=ASC] - OrderDirections = 'ASC', * @returns {Promise} - A promise that resolves to the artist top tracks. * @fulfil {Track[]} - The artist top tracks. * @reject {Error} - The error as returned by Tidal. * @example * const artist = await tidal.getArtistTopTracks(3529689, 1); * console.log(artist); * // { * // [ * // { * // "id": 82448461, * // "title": "Consequence", * // "duration": 313, * // "replayGain": -6.9, * // "peak": 1.0, * // "allowStreaming": true, * // "streamReady": true, * // "streamStartDate": "2017-12-05T00:00:00.000+0000", * // "premiumStreamingOnly": false, * // "trackNumber": 10, * // "volumeNumber": 1, * // "version": null, * // "popularity": 6, * // "copyright": "City Slang/big Store", * // "url": "http://www.tidal.com/track/82448461", * // "isrc": "DED620118410", * // "editable": false, * // "explicit": false, * // "audioQuality": "LOSSLESS", * // "audioModes": [ * // "STEREO" * // ], * // "artist": { * // "id": 3529689, * // "name": "The Notwist", * // "type": "MAIN" * // }, * // "artists": [ * // { * // "id": 3529689, * // "name": "The Notwist", * // "type": "MAIN" * // } * // ], * // "album": { * // "id": 82448449, * // "title": "Neon Golden", * // "cover": "ad3ed5f3-37a2-4b27-9002-b83459ab5a0e", * // "videoCover": null * // }, * // "mixes": { * // "TRACK_MIX": "001981d70c53d5448599714c407079" * // } * // }, * // ] * // } */ getArtistTopTracks(artistId: number, limit?: number, offset?: number, order?: OrderTypes, orderDirection?: OrderDirections): Promise; /** * It gets the artist videos from the Tidal API. * @param {number} artistId - The ID of the artist you want to get. * @param {number} [limit=10] - The number of results to return. * @param {number} [offset=0] - The offset of the first song to return. * @param {OrderTypes} [order=DATE] - OrderTypes = 'DATE', * @param {OrderDirections} [orderDirection=ASC] - OrderDirections = 'ASC', * @returns {Promise} - A promise that resolves to the artist videos. * @fulfil {Video[]} - The artist videos. * @reject {Error} - The error as returned by Tidal. * @example * const artist = await tidal.getArtistVideos(3529689, 1); * console.log(artist); * // { * // [ * // { * // "id": 143147453, * // "title": "Atomised", * // "volumeNumber": 1, * // "trackNumber": 1, * // "releaseDate": "2020-06-16T00:00:00.000+0000", * // "imagePath": null, * // "imageId": "2ef62a00-e310-48ab-afc2-f8cb76757968", * // "duration": 263, * // "quality": "MP4_1080P", * // "streamReady": true, * // "streamStartDate": "2020-06-17T11:00:00.000+0000", * // "allowStreaming": true, * // "explicit": false, * // "popularity": 2, * // "type": "Music Video", * // "adsUrl": null, * // "adsPrePaywallOnly": true, * // "artist": { * // "id": 4764457, * // "name": "GoGo Penguin", * // "type": "MAIN" * // }, * // "artists": [ * // { * // "id": 4764457, * // "name": "GoGo Penguin", * // "type": "MAIN" * // } * // ], * // "album": null * // }, * // ] * // } */ getArtistVideos(artistId: number, limit?: number, offset?: number, order?: OrderTypes, orderDirection?: OrderDirections): Promise; /** * It gets the artist albums from the Tidal API. * @param {number} artistId - The ID of the artist you want to get. * @param {number} [limit=10] - The number of results to return. * @param {number} [offset=0] - The offset of the first song to return. * @param {OrderTypes} [order=DATE] - OrderTypes = 'DATE', * @param {OrderDirections} [orderDirection=ASC] - OrderDirections = 'ASC', * @returns {Promise} - A promise that resolves to the artist albums. * @fulfil {Album[]} - The artist albums. * @reject {Error} - The error as returned by Tidal. * @example * const artist = await tidal.getArtistAlbums(3529689, 1); * console.log(artist); * // { * // [ * // { * // "id": 64377395, * // "title": "Superheroes, Ghost-Villains + Stuff", * // "duration": 5948, * // "streamReady": true, * // "streamStartDate": "2016-10-14T00:00:00.000+0000", * // "allowStreaming": true, * // "premiumStreamingOnly": false, * // "numberOfTracks": 16, * // "numberOfVideos": 0, * // "numberOfVolumes": 1, * // "releaseDate": "2016-10-14", * // "copyright": "Alien Transistor", * // "type": "ALBUM", * // "version": null, * // "url": "http://www.tidal.com/album/64377395", * // "cover": "ba4e14ab-e110-41d9-8943-2efdf3c9367d", * // "videoCover": null, * // "explicit": false, * // "upc": "880918225265", * // "popularity": 14, * // "audioQuality": "LOSSLESS", * // "audioModes": [ * // "STEREO" * // ], * // "artist": { * // "id": 3529689, * // "name": "The Notwist", * // "type": "MAIN" * // }, * // "artists": [ * // { * // "id": 3529689, * // "name": "The Notwist", * // "type": "MAIN" * // } * // ] * // }, * // } * // ] * // } */ getArtistAlbums(artistId: number, limit?: number, offset?: number, order?: OrderTypes, orderDirection?: OrderDirections): Promise; } declare class Playlists { private client; constructor(tidal: Tidal); /** * It gets the playlist information from the Tidal API. * @param {string} playlistId - The ID of the playlist you want to get the information of. * @returns {Promise} - A promise that resolves to the playlist information. * @fulfil {Playlist} - The playlist information. * @reject {Error} - The error as returned by Tidal. */ getPlaylist(playlistId: string): Promise; /** * It gets the songs from a playlist. * @param {string} playlistId - The id of the playlist you want to get the songs from. * @param {number} [limit=50] - The number of results to return. * @param {number} [offset=0] - The offset of the first song to return. * @param {OrderTypes} [order=DATE] - OrderTypes = 'DATE', * @param {OrderDirections} [orderDirection=ASC] - OrderDirections = 'ASC', * @returns {Promise} - A promise that resolves to the playlist tracks information. * @fulfil {PlaylistSongs} - The songs from the playlist. * @reject {Error} - The error as returned by Tidal. */ getPlaylistTracks(playlistId: string, limit?: number, offset?: number, order?: OrderTypes, orderDirection?: OrderDirections): Promise; /** * It gets all the plalist folders and root playlists from the user's account. * @param {string} [folderId='root'] - The id of the folder you want to get the playlists from. * @param {ItemType} [includeOnly='PLAYLIST | FOLDER'] - The type of items you want to get. * @param {number} [limit=50] - The number of results to return. * @param {number} [offset=0] - The offset of the first song to return. * @param {OrderTypes} [order=DATE] - OrderTypes = 'DATE', * @param {OrderDirections} [orderDirection=DESC] - OrderDirections = 'DESC', * @returns {Promise} - A promise that resolves to the playlist folders information. * @fulfil {PlaylistFolders} - The playlist folders and root playlists. * @reject {Error} - The error as returned by Tidal. */ getPlaylistFolders(folderId?: string, includeOnly?: string, offset?: number, limit?: number, order?: OrderTypes, orderDirection?: OrderDirections): Promise; /** * It gets the image url of a playlist by a given playlist.data.squareImage * @param {string} squareImage - The squareImage of the playlist * @param {ImageResolution} [resolution=ImageResolution.Medium] - The resolution of the image * @returns {string} - The image url of the playlist. * @fulfil {string} - The image url of the playlist. * @reject {Error} - The error as returned by Tidal. */ getPlaylistImage(squareImage: string, resolution?: ImageResolutionEnum): string; /** * It creates a playlist in the root folder of the user's collection * @param {string} name - The name of the playlist * @param {string} [description] - The description of the playlist * @returns {Promise} - A promise that resolves to the created playlist information. * @fulfil {Playlist} - The playlist information. * @reject {Error} - The error as returned by Tidal. */ createPlaylist(name: string, description?: string): Promise; /** * It deletes a playlist from the user's account. * @param {string} playlistId - The id of the playlist you want to delete * @returns {Promise} - A promise that resolves to the deleted playlists information. * @fulfil {string} - The status of the operation. * @reject {Error} - The error as returned by Tidal. */ deletePlaylist(playlistId: string): Promise<{ status: string; playlistId: string; playlist: Playlist; }>; /** * It takes a folderId as a parameter, and returns a Deleted object with a status of 'Success' or * 'Failed' and the folderId. * @param {string} folderId - The id of the folder you want to delete * @returns {Promise} - A promise that resolves to the deleted folder. * @fulfil {string} - The status of the operation. * @reject {Error} - The error as returned by Tidal. */ deleteFolder(folderId: string): Promise<{ status: string; folderId: string; }>; /** * It adds a song to a playlist. * @param {string} playlistId - The id of the playlist you want to add the song to. * @param {any} trackIds - The ID of the track you want to add to the playlist. * @param {OnDupes} [onDupes=FAIL] - This is the action to take if the song is already in the * playlist. * @returns {Promise} - A promise that resolves to the added song. * @fulfil {string} - The status of the operation. * @reject {Error} - The error as returned by Tidal. */ addTrackToPlaylist(playlistId: string, trackIds: any, onDupes?: OnDupes): Promise; /** * It deletes a song from a playlist * @param {string} playlistId - The id of the playlist you want to delete a song from * @param {number} index - The index of the song you want to delete * @param {OrderTypes} [order=INDEX] - OrderTypes = 'INDEX' * @param {OrderDirections} [orderDirection=ASC] - OrderDirections = 'ASC' * @returns {Promise} - A promise that resolves to the deleted song. * @fulfil {string} - The status of the operation. * @reject {Error} - The error as returned by Tidal. */ deleteTrackFromPlaylist(playlistId: string, index: number, order?: OrderTypes, orderDirection?: OrderDirections): Promise<{ status: string; playlistId: string; index: number; song: Track; } | { status: string; playlistId: string; index: number; song?: undefined; }>; } declare class Tracks { private client; constructor(tidal: Tidal); /** * It gets the track information from the Tidal API. * @param {number} trackId - The ID of the track you want to get. * @returns {Promise} - A promise that resolves to a track object. * @fulfil {Track} - a track object * @reject {Error} - The error as returned by Tidal. */ getTrack(trackId: number): Promise; /** * It gets the contributors of a track from the Tidal API. * @param {number} trackId - The ID of the track you want to get. * @returns {Promise} - A promise that resolves to an array of contributor objects. * @fulfil {Contributor[]} - an array of contributor objects * @reject {Error} - The error as returned by Tidal. **/ getTrackContributors(trackId: number): Promise; } declare class Tidal { private options; countryCode: Country; albums: Albums; artists: Artists; playlists: Playlists; tracks: Tracks; constructor(options: ClientOptions); /** * It searches for a specific type of content on Tidal. * @param {string} query - The query to search for. * @param {searchType} type - The type of content to search for. * @param {number} [limit=50] - The amount of results to return. * @param {number} [offset=0] - The offset of the results. * @returns The results of the search. * @example * const results = await tidal.search('The Weeknd', 'tracks'); * console.log(results); * // => { totalNumberOfItems: 100, limit: 50, offset: 0, items: [...] } **/ search(query: string, type: searchType, limit?: number, offset?: number, includeContributors?: boolean): Promise; /** * It makes a request to the Tidal API, and if it fails, it will retry the request after a certain * amount of time. * @param {string} url - The url of the request. * @param {RequestOptions} [options] - The options of the request. * @returns The data from the request. */ _request(url: string, options?: RequestOptions): Promise; } export { Albums as A, Playlists as P, Tracks as T, Artists as a, Tidal as b };