diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..3cc1f0d --- /dev/null +++ b/index.d.ts @@ -0,0 +1,25 @@ +import { Response, SuperAgentRequest } from 'superagent'; + +declare class ProxyClient { + constructor(options?: ProxyClient.Options); + getUrl(path: string): string; + request(method: string, path: string): SuperAgentRequest; + get(path: string): SuperAgentRequest; + post(path: string): SuperAgentRequest; + put(path: string): SuperAgentRequest; + del(path: string): SuperAgentRequest; + rejectResponse(response: Response): PromiseLike; +} + +declare namespace ProxyClient { + interface Options { + rootUrl?: string; + logger?: any; + agent?: any; + timeout?: number; + headers?: {}; + } +} + +export = ProxyClient; +