@aaronlcj/use-last-fm
Version:
Get data from last.fm as a React hook.
27 lines (26 loc) • 742 B
TypeScript
import { TrackImage } from './types';
/**
* Use Last.fm
* @param method The search type and params used to construct the request endpoint
* @param token Your API token
* @param interval Optional, this is the internal between each request
* @param imageSize The size of the image
*/
export default class useLastFM {
private readonly token;
constructor(token: string);
get(method: {
query: {
type: string;
node: string;
};
param: string;
}, interval?: number, imageSize?: TrackImage['size']): {
status: "playing";
song: import("./types").Song;
} | {
status: string;
song: null;
};
}
export * from './types';