diff --git a/types/http-proxy-agent/http-proxy-agent-tests.ts b/types/http-proxy-agent/http-proxy-agent-tests.ts new file mode 100644 index 0000000000..f730cd1bde --- /dev/null +++ b/types/http-proxy-agent/http-proxy-agent-tests.ts @@ -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 }); diff --git a/types/http-proxy-agent/index.d.ts b/types/http-proxy-agent/index.d.ts new file mode 100644 index 0000000000..015508b5d1 --- /dev/null +++ b/types/http-proxy-agent/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for http-proxy-agent 2.0 +// Project: https://github.com/TooTallNate/node-http-proxy-agent +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Agent } from 'http'; +import { Url } from 'url'; + +declare class HttpProxyAgent extends Agent { + constructor(options: string | Url); +} + +export = HttpProxyAgent; diff --git a/types/http-proxy-agent/tsconfig.json b/types/http-proxy-agent/tsconfig.json new file mode 100644 index 0000000000..626d4eaa4c --- /dev/null +++ b/types/http-proxy-agent/tsconfig.json @@ -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" + ] +} diff --git a/types/http-proxy-agent/tslint.json b/types/http-proxy-agent/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/http-proxy-agent/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }