export type GetApiMusixmatchTracksIdLyricsArgs = {id: string}; export type GetApiMusixmatchTracksIdLyricsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get LRC lyrics * * GET /musixmatch/tracks/{id}/lyrics */ export const getApiMusixmatchTracksIdLyrics = async (args: GetApiMusixmatchTracksIdLyricsArgs, options?: GetApiMusixmatchTracksIdLyricsOptions) => { const {baseUrl = "https://api.paxsenix.org", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/musixmatch/tracks/${encodeURIComponent(String(args.id))}/lyrics${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };