DefinitelyTyped/types/proxy-from-env/index.d.ts
F.P 8d98dc86af
proxy-from-env: Add missing URL type for input parameter (#42447)
* Add missing type for input parameter

Allow `URL` objects as parameter (see https://github.com/Rob--W/proxy-from-env/blob/master/index.js#L24 )

* Update types and tests

* Add missing reference type
2020-02-19 11:20:34 -08:00

19 lines
633 B
TypeScript

// 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>
// FloPes <https://github.com/flopes89>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Url } from "url";
/**
* 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|Url): string;