feat(types): Add typings for "http-proxy-agent" package

This commit is contained in:
Denis Malinochkin
2017-11-18 12:20:10 +03:00
parent 35272568c9
commit f24864cbff
4 changed files with 51 additions and 0 deletions

View 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
View 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;

View 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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }