mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Node: URL: correct format/parse parameter types (#40118)
* Node: URL: correct format/parse parameter types * Fix dependencies * Fix dependencies * Revert href change * Update types/node/url.d.ts Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
This commit is contained in:
parent
862d091f93
commit
a3ef14ec54
3
types/http-proxy-agent/index.d.ts
vendored
3
types/http-proxy-agent/index.d.ts
vendored
@ -3,6 +3,7 @@
|
||||
// Definitions by: mrmlnc <https://github.com/mrmlnc>
|
||||
// steprescott <https://github.com/steprescott>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
@ -10,7 +11,7 @@ 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;
|
||||
|
||||
3
types/http-proxy/index.d.ts
vendored
3
types/http-proxy/index.d.ts
vendored
@ -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
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@ -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,
|
||||
|
||||
43
types/node/url.d.ts
vendored
43
types/node/url.d.ts
vendored
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user