trade360-nodejs-sdk
Version:
LSports Trade360 SDK for Node.js
22 lines (21 loc) • 1.01 kB
TypeScript
import { AxiosResponse } from 'axios';
import { BaseEntity } from '../../../entities/core-entities/index.js';
import { IHttpService } from '../interfaces';
/**
* Axios service instance for different API endpoints with
* varying request and response types. class with a generic
* type TRequest for the request body:
* a generic type TRequest which represents the type of the
* request body. and a response type TResponse and return
* a promise of that response type TResponse.
* @param TRequest Type of the request body
* @param TResponse Type of the response body
* @returns Promise with object of TResponse structure
*/
export declare class AxiosService<TRequest extends BaseEntity> implements IHttpService<TRequest> {
private axiosInstance;
private configRequest;
constructor(baseURL: string);
get<TResponse extends BaseEntity>(url: string): Promise<AxiosResponse<TResponse>>;
post<TResponse extends BaseEntity>(url: string, body: TRequest): Promise<AxiosResponse<TResponse>>;
}