llyrics
Version:
A simple package to fetch lyrics from Genius API
66 lines • 1.48 kB
TypeScript
import { version } from '../package.json';
interface searchOptions {
/**
* The song title
*/
song: string;
/**
* The artist
*/
artist?: string;
/**
* Search engine. Only Musixmatch and YouTube are supported
*/
engine?: searchEngineOptions;
/**
* Changes search engine automatically if there are no results
*/
forceSearch?: boolean;
}
interface fetchResponse {
/**
* The artist
*/
artist: string;
/**
* The song title
*/
title: string;
/**
* The Musixmatch song id, or 0 if not from Musixmatch
*/
id: string;
/**
* Used search engine
*/
engine: string;
/**
* Cover URL
*/
artworkURL: string;
/**
* The song lyrics
*/
lyrics: string;
/**
* The response status
*/
status: number;
}
declare const searchEngines: readonly ["youtube", "musixmatch"];
type searchEngineOptions = (typeof searchEngines)[number] | (string & {});
/**
* Finds the lyrics of a song.
* @param {searchOptions} searchOptions Options to refine your search
* @returns Promise<fetchResponse>
* @example
* const { find } = require('llyrics');
* const response = await find({
* song: 'Bohemian Rhapsody',
* engine: 'musixmatch'
* });
* console.log(response.artist);
*/
declare function find(searchOptions: searchOptions): Promise<fetchResponse>;
export { version, find };
//# sourceMappingURL=index.d.ts.map