import { MusicfetchLookupResult, ServiceType } from './types'; export type { MusicfetchAlbum, MusicfetchArtist, MusicfetchTrack, MusicfetchLookupResult, MusicfetchLookupArtistResult, MusicfetchLookupAlbumUResult, MusicfetchLookupTrackResult, } from './types'; type BaseLookupParams = { /** * The services/stores to search for results matching the source. */ services: ServiceType[]; /** * The country/territory to provide local store links for. * * @default 'US' */ country?: string; /** * Provide additional parameters to the `fetch()` call. Useful * if your application framework (eg. nextjs) offers caching control. * * @example * * musicfetch.url({ * … * * fetchOptions: { * next: { * revalidate: 3600, * } * } * }) */ fetchOptions?: any; /** * For album lookups optionally fetch all album tracks (when possible). */ withTracks?: boolean; /** * For artist lookups optionally fetch all albums/discography. */ withAlbums?: boolean; /** * For track lookups optionally fetch lyrics (when possible). */ withLyrics?: boolean; }; export declare class Musicfetch { config: { endpoint: string; token: string; fetch: (input: RequestInfo | URL, init?: RequestInit | undefined) => Promise; }; constructor(config: { /** * The api endpoint to use (defaults to RapidAPi). */ endpoint?: string; /** * Your Musicfetch/RapidAPI token. */ token: string; /** * Optionally provide you own fetch implementation. */ fetch?: Musicfetch['config']['fetch']; }); /** * Lookup an artist/album/track from a source store url * (eg. spotify/apple/deezer/tidal/youtube) and return * links and metadata for the given services. * * Only major stores are supported as source urls. */ url({ url, services, ...restParams }: BaseLookupParams & { /** * The source url (eg. spotify, apple, deezer, …) of the * artist/album/track to lookup. */ url: string; }): Promise; isrc({ isrc, services, ...restParams }: BaseLookupParams & { /** * The ISRC of the track to lookup. */ isrc: string; }): Promise; upc({ upc, services, ...restParams }: BaseLookupParams & { /** * The UPC of the album to lookup. */ upc: string; }): Promise; private fetch; }