UNPKG

@intuitionrobotics/thunderstorm

Version:
21 lines (20 loc) 1.6 kB
import { ApiTypeBinder, HttpMethod, QueryParams } from "../../../shared/types"; import { BaseHttpRequest } from "../../../shared/BaseHttpRequest"; import { BaseHttpModule_Class, HttpConfig } from "../../../shared/BaseHttpModule"; import { Axios_RequestConfig } from "./types"; export declare class AxiosHttpModule_Class extends BaseHttpModule_Class { private requestOption; constructor(name?: string); init(): void; createRequest<Binder extends ApiTypeBinder<U, R, B, P, E>, U extends string = Binder["url"], R = Binder["response"], B = Binder["body"], P extends QueryParams = Binder["queryParams"], E extends void | object = Binder["error"]>(method: HttpMethod, key: string, data?: string): BaseHttpRequest<Binder>; setRequestOption(requestOption: Axios_RequestConfig): this; downloadFile(url: string, outputFile: string, key?: string): Promise<string>; } export type DeriveRealBinder<Binder> = Binder extends ApiTypeBinder<infer U, infer R, infer B, infer P> ? ApiTypeBinder<U, R, B, P> : void; export declare const AxiosHttpModule: AxiosHttpModule_Class; export declare class AxiosHttpClient extends BaseHttpModule_Class { private requestOption; constructor(name: string, config: HttpConfig); createRequest<Binder extends ApiTypeBinder<U, R, B, P, E>, U extends string = Binder["url"], R = Binder["response"], B = Binder["body"], P extends QueryParams = Binder["queryParams"], E extends void | object = Binder["error"]>(method: HttpMethod, key: string, data?: string): BaseHttpRequest<Binder>; setRequestOption(requestOption: Axios_RequestConfig): this; }