Skip to content

Commit c5c4ffc

Browse files
sadasantTooTallNate
authored andcommitted
Add TypeScript type definitions (#66)
* Added index.d.ts Based on: #27 (comment) (thank you @yonilerner) * Update package.json
1 parent 11bc347 commit c5c4ffc

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

index.d.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
declare module 'https-proxy-agent' {
2+
import * as https from 'https'
3+
4+
namespace HttpsProxyAgent {
5+
interface HttpsProxyAgentOptions {
6+
host: string
7+
port: number
8+
secureProxy?: boolean
9+
headers?: {
10+
[key: string]: string
11+
}
12+
[key: string]: any
13+
}
14+
}
15+
16+
// HttpsProxyAgent doesnt *actually* extend https.Agent, but for my purposes I want it to pretend that it does
17+
class HttpsProxyAgent extends https.Agent {
18+
constructor(opts: HttpsProxyAgent.HttpsProxyAgentOptions)
19+
}
20+
21+
export = HttpsProxyAgent
22+
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.2.1",
44
"description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS",
55
"main": "./index.js",
6+
"types": "./index.d.ts",
67
"scripts": {
78
"test": "mocha --reporter spec"
89
},

0 commit comments

Comments
 (0)