diff --git a/types/proxy-from-env/index.d.ts b/types/proxy-from-env/index.d.ts new file mode 100644 index 0000000000..25746c2246 --- /dev/null +++ b/types/proxy-from-env/index.d.ts @@ -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 +// 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; diff --git a/types/proxy-from-env/proxy-from-env-tests.ts b/types/proxy-from-env/proxy-from-env-tests.ts new file mode 100644 index 0000000000..774f0d862a --- /dev/null +++ b/types/proxy-from-env/proxy-from-env-tests.ts @@ -0,0 +1,4 @@ +import { getProxyForUrl } from "proxy-from-env"; + +// $ExpectType string +getProxyForUrl("http://microsoft.github.io/TypeSearch/"); diff --git a/types/proxy-from-env/tsconfig.json b/types/proxy-from-env/tsconfig.json new file mode 100644 index 0000000000..7516540969 --- /dev/null +++ b/types/proxy-from-env/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", + "proxy-from-env-tests.ts" + ] +} diff --git a/types/proxy-from-env/tslint.json b/types/proxy-from-env/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/proxy-from-env/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }