Skip to content

Commit

Permalink
Add TypeScript type definitions (#66)
Browse files Browse the repository at this point in the history
* Added index.d.ts

Based on: #27 (comment)
(thank you @yonilerner)

* Update package.json
  • Loading branch information
sadasant authored and TooTallNate committed May 21, 2019
1 parent 11bc347 commit c5c4ffc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 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
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -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"
},
Expand Down

0 comments on commit c5c4ffc

Please sign in to comment.