@intuitionrobotics/thunderstorm
Version:
28 lines (27 loc) • 1.56 kB
TypeScript
import { Module } from "@intuitionrobotics/ts-common";
import { ApiWithBody, ApiWithQuery, QueryParams } from "../../../shared/types";
import { AxiosResponse } from "axios";
export type RemoteServerConfig = {
secretHeaderName: string;
proxyHeaderName: string;
proxyId: string;
secret: string;
url: string;
};
export declare abstract class RemoteProxyCaller<Config extends RemoteServerConfig> extends Module<Config> {
constructor(name: string);
protected init(): void;
protected executeGetRequest: <Binder extends ApiWithQuery<U, R, P>, U extends string = Binder["url"], R = Binder["response"], P extends QueryParams = Binder["queryParams"]>(url: U, _params: P, _headers?: {
[key: string]: string;
}) => Promise<R>;
protected executeGetRequestImpl: <Binder extends ApiWithQuery<U, R, P>, U extends string = Binder["url"], R = Binder["response"], P extends QueryParams = Binder["queryParams"]>(url: U, _params: P, _headers?: {
[key: string]: string;
}) => Promise<AxiosResponse<R>>;
protected executePostRequest: <Binder extends ApiWithBody<U, B, R>, U extends string = Binder["url"], R = Binder["response"], B = Binder["body"]>(url: U, body: B, _headers?: {
[key: string]: string;
}) => Promise<R>;
protected executePostRequestImpl: <Binder extends ApiWithBody<U, B, R>, U extends string = Binder["url"], R = Binder["response"], B = Binder["body"]>(url: U, body: B, _headers?: {
[key: string]: string;
}) => Promise<AxiosResponse<R>>;
private executeRequest;
}