@skyway-sdk/common
Version:
The official Next Generation JavaScript SDK for SkyWay
27 lines • 1.17 kB
TypeScript
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
/**@internal */
export declare class HttpClient {
api: AxiosInstance;
constructor(baseURL: string);
/**@throws {@link HttpResponse} */
get<T extends unknown>(url: string, config?: (AxiosRequestConfig<any> & {
retry?: (err: HttpResponse) => Promise<boolean>;
}) | undefined): Promise<T>;
/**@throws {@link HttpResponse} */
post<T extends unknown>(url: string, data?: any, config?: (AxiosRequestConfig<any> & {
retry?: (err: HttpResponse) => Promise<boolean>;
}) | undefined): Promise<T>;
/**@throws {@link HttpResponse} */
put<T extends unknown>(url: string, data?: any, config?: (AxiosRequestConfig<any> & {
retry?: (err: HttpResponse) => Promise<boolean>;
}) | undefined): Promise<T>;
/**@throws {@link HttpResponse} */
delete<T extends unknown>(url: string, config?: (AxiosRequestConfig<any> & {
retry?: (err: HttpResponse) => Promise<boolean>;
}) | undefined): Promise<T>;
}
/**@internal */
export declare type HttpResponse = AxiosResponse & {
message: string;
};
//# sourceMappingURL=http.d.ts.map