diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 00000000..45218b86 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,22 @@ +declare module 'https-proxy-agent' { + import * as https from 'https' + + namespace HttpsProxyAgent { + interface HttpsProxyAgentOptions { + host: string + port: number + secureProxy?: boolean + headers?: { + [key: string]: string + } + [key: string]: any + } + } + + // HttpsProxyAgent doesnt *actually* extend https.Agent, but for my purposes I want it to pretend that it does + class HttpsProxyAgent extends https.Agent { + constructor(opts: HttpsProxyAgent.HttpsProxyAgentOptions) + } + + export = HttpsProxyAgent +} diff --git a/package.json b/package.json index 704dc46d..dae109f6 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "2.2.1", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", "main": "./index.js", + "types": "./index.d.ts", "scripts": { "test": "mocha --reporter spec" },