Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion types/http-proxy-agent/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
// Definitions by: mrmlnc <https://github.com/mrmlnc>
// steprescott <https://github.com/steprescott>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type of change should be reviewed by owner of http-proxy-agent


/// <reference types="node"/>

import { Agent } from 'http';
import { Url } from 'url';

declare class HttpProxyAgent extends Agent {
constructor(options: string | Url);
constructor(options: string | Partial<Url>);

proxy: Url;
secureProxy: boolean;
Expand Down
3 changes: 2 additions & 1 deletion types/http-proxy/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Daniel Schmidt <https://github.com/DanielMSchmidt>
// Jordan Abreu <https://github.com/jabreu610>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠this type of change should be reviewed by owner of http-proxy
@SomaticIT, @Raigen, @DanielMSchmidt, @jabreu610, could you review this pull?


/// <reference types="node" />

Expand All @@ -15,7 +16,7 @@ import * as events from "events";
import * as url from "url";
import * as stream from "stream";

type ProxyTargetUrl = string | url.Url;
type ProxyTargetUrl = string | Partial<url.Url>;

type ErrorCallback = (
err: Error,
Expand Down
43 changes: 25 additions & 18 deletions types/node/url.d.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
declare module "url" {
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';

interface UrlObjectCommon {
auth?: string;
hash?: string;
host?: string;
hostname?: string;
href?: string;
path?: string;
pathname?: string;
protocol?: string;
search?: string;
slashes?: boolean;
}

// Input to `url.format`
interface UrlObject extends UrlObjectCommon {
port?: string | number;
interface UrlObject {
auth?: string | null;
hash?: string | null;
host?: string | null;
hostname?: string | null;
href?: string | null;
path?: string | null;
pathname?: string | null;
protocol?: string | null;
search?: string | null;
slashes?: boolean | null;
port?: string | number | null;
query?: string | null | ParsedUrlQueryInput;
}

// Output of `url.parse`
interface Url extends UrlObjectCommon {
port?: string;
query?: string | null | ParsedUrlQuery;
interface Url {
auth: string | null;
hash: string | null;
host: string | null;
hostname: string | null;
href: string;
path: string | null;
pathname: string | null;
protocol: string | null;
search: string | null;
slashes: boolean | null;
port: string | null;
query: string | null | ParsedUrlQuery;
}

interface UrlWithParsedQuery extends Url {
Expand Down