import { S as ServiceTypes, M as MusicfetchItemOptions, a as ServiceType, b as MusicfetchLookupArtistResult, c as MusicfetchLookupAlbumUResult, d as MusicfetchLookupTrackResult, C as CustomReducedTrackOptions, e as CustomReducedAlbumOptions, G as GetOpenUrlResult } from './types.d-DTKmr1Fk.js'; export { g as MusicfetchAlbum, h as MusicfetchArtist, k as MusicfetchItem, j as MusicfetchLookupResult, f as MusicfetchOpenItem, i as MusicfetchTrack } from './types.d-DTKmr1Fk.js'; import 'valibot'; /** * A list of services that support lookups by url. * * Services are not in this because either: * - A. We haven't implemented lookup behaviour for yet * - B. We are unable to derive an id from the url (eg. bandcamp or pandora). */ declare const SERVICES_WITH_URL_LOOKUP: ServiceTypes[]; /** * A list of services that support search by query. */ declare const SERVICES_WITH_SEARCH: ServiceTypes[]; type PublicFetchOptions = Pick & { next?: { revalidate?: number; }; }; 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?: PublicFetchOptions; /** * 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; /** * Expose all the links, not just the link for the requested `country` */ withAllLinks?: boolean; }; 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, fetchOptions, withServiceLevel, ...restParams }: BaseLookupParams & { /** * The source url (eg. spotify, apple, deezer, …) of the * artist/album/track to lookup. */ url: string; /** * Whether to fetch track credits/contributors. * * @default false */ withCredits?: boolean; /** * Request additional service fields */ withServiceLevel?: TOptions['withServiceLevel']; } & TOptions): Promise | MusicfetchLookupAlbumUResult | MusicfetchLookupTrackResult>; /** * Lookup a track by ISRC. */ isrc({ isrc, services, fetchOptions, ...restParams }: BaseLookupParams & { /** * The ISRC of the track to lookup. */ isrc: string; /** * Whether to fetch track credits/contributors. * * @default false */ withCredits?: boolean; } & TOptions): Promise>; upc({ upc, services, fetchOptions, ...restParams }: BaseLookupParams & { /** * The UPC of the album to lookup. */ upc: string; /** * Make extra calls to fetch album tracks when possible. */ withTracks?: boolean; } & TOptions): Promise>; open({ url, services, fetchOptions, ...restParams }: { url: string; services: ServiceType[]; fetchOptions?: PublicFetchOptions; country?: string; }): Promise; private fetch; } export { GetOpenUrlResult, Musicfetch, MusicfetchItemOptions, MusicfetchLookupAlbumUResult, MusicfetchLookupArtistResult, MusicfetchLookupTrackResult, ServiceType as MusicfetchServiceType, SERVICES_WITH_SEARCH, SERVICES_WITH_URL_LOOKUP };