mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-12 22:36:10 +08:00
feat(types): Add typings for "http-proxy-agent" package
This commit is contained in:
12
types/http-proxy-agent/http-proxy-agent-tests.ts
Normal file
12
types/http-proxy-agent/http-proxy-agent-tests.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import Agent = require('http-proxy-agent');
|
||||
|
||||
// $ExpectType HttpProxyAgent
|
||||
new Agent('url');
|
||||
new Agent({});
|
||||
new Agent({ host: 'url' });
|
||||
|
||||
// $ExpectError
|
||||
new Agent();
|
||||
|
||||
// $ExpectError
|
||||
new Agent({ a: 1 });
|
||||
15
types/http-proxy-agent/index.d.ts
vendored
Normal file
15
types/http-proxy-agent/index.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// Type definitions for http-proxy-agent 2.0
|
||||
// Project: https://github.com/TooTallNate/node-http-proxy-agent
|
||||
// Definitions by: mrmlnc <https://github.com/mrmlnc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
import { Agent } from 'http';
|
||||
import { Url } from 'url';
|
||||
|
||||
declare class HttpProxyAgent extends Agent {
|
||||
constructor(options: string | Url);
|
||||
}
|
||||
|
||||
export = HttpProxyAgent;
|
||||
23
types/http-proxy-agent/tsconfig.json
Normal file
23
types/http-proxy-agent/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"http-proxy-agent-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/http-proxy-agent/tslint.json
Normal file
1
types/http-proxy-agent/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user