jkeveren-spotify-api
Version:
Promise based Spotify API wrapper that automatically refreshes access tokens
28 lines (27 loc) • 951 B
TypeScript
/// <reference types="node" />
import { SpotifyUser } from "./SpotifyUser";
import http from "http";
interface SpotifyClientConfig {
authBaseURL: string;
APIBaseURL: string;
clientId: string;
clientSecret: string;
}
export declare class SpotifyClient {
config: SpotifyClientConfig;
_internalMakeRequest: (url: URL, options: any, requestBody: string) => Promise<SpotifyResponse>;
constructor(config: SpotifyClientConfig);
getAuthorizationURL(redirectURL: string, scopes: string[], state: string, showDialog: boolean): URL;
getUser(code: string, redirectURL: string): Promise<SpotifyUser>;
}
export declare class SpotifyRequestError extends Error {
requestURL: string;
response: SpotifyResponse;
constructor(message: string, requestURL: string, response: SpotifyResponse);
}
export interface SpotifyResponse {
statusCode: number;
body: any;
incomingMessage: http.IncomingMessage;
}
export {};