Added type definitions for proxy-from-env 1.0 (#35881)

This commit is contained in:
Kwok Chi Leong 2019-06-06 07:01:57 +08:00 committed by Andrew Casey
parent d38d5b4a42
commit 26bc39581d
4 changed files with 41 additions and 0 deletions

13
types/proxy-from-env/index.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for proxy-from-env 1.0
// Project: https://github.com/Rob--W/proxy-from-env#readme
// Definitions by: JasonHK <https://github.com/JasonHK>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Takes an input URL and returns the desired proxy URL. If no proxy is set, an
* empty string is returned.
* @param url The URL
* @returns The URL of the proxy that should handle the request to the given
* URL.
*/
export function getProxyForUrl(url: string): string;

View File

@ -0,0 +1,4 @@
import { getProxyForUrl } from "proxy-from-env";
// $ExpectType string
getProxyForUrl("http://microsoft.github.io/TypeSearch/");

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",
"proxy-from-env-tests.ts"
]
}

View File

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