From ed2143706e899515b18d7841fd470ba1572449b5 Mon Sep 17 00:00:00 2001 From: Dave Dunkin Date: Tue, 27 Jun 2017 07:59:11 -0700 Subject: [PATCH] Add type definitions. --- index.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 index.d.ts 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; +