@nekolab/hanime
Version:
Fast and efficient hanime.tv API wrapper written in TypeScript.
36 lines • 1.12 kB
TypeScript
import { RequestContext } from '../types/client';
import { LoggingClient } from './logging';
/**
* Requests client
*/
export declare class RequestsClient {
/**
* Headers compiler function to use on each request
*/
headersCompiler: (context: RequestContext) => {
[key: string]: string;
};
/**
* Logging client
*/
private loggingClient;
/**
* Create a new instance of the RequestsClient
* @param baseUrl Base URL for the requests
* @param headersCompiler Headers compiler function to use on each request
* @param loggingClient Logging client
* @returns RequestsClient instance
*/
constructor(headersCompiler: (context: RequestContext) => {
[key: string]: any;
}, loggingClient: LoggingClient);
/**
* Make a request to the API
* @param path Path to request
* @param body Body to send
* @param method Method to use
* @returns Response from the API
*/
request(baseUrl: string, path: string, body?: any | null, method?: 'POST' | 'GET'): Promise<any>;
}
//# sourceMappingURL=requests.d.ts.map