UNPKG

genius.ts

Version:

Genius API Wrapper for Node.js

26 lines (25 loc) 951 B
import { Track } from "./Track"; import { ClientOptions, searchTrackOptions, SongResult } from "../typing/types"; export declare class GeniusClient { private token; private baseUrl; constructor(ClientOption: ClientOptions); /** * Method to search a track in Genius API * @param searchTrackOptions * @returns If a result is found it returns all the search hits, else it returns nothing */ searchTrack(searchTrackOptions: searchTrackOptions): Promise<SongResult[] | null>; /** * Method to get a Song by it's name * @returns returns best hit song class * @throws an excpetion when the song is not found */ getSong(searchTrackOptions: searchTrackOptions): Promise<Track | null>; /** * Method to get the song by it's ID * @returns the song class * @throws an expecption if the provided song ID is not valid */ getSongByID(id: number): Promise<Track | null>; }