fix(request): add maxSockets params at pool option (#40892)

* fix(request): add maxSockets params at pool option

* fix pool options type
This commit is contained in:
Saimon Shaplygin
2019-12-17 16:25:31 +03:00
committed by Orta
parent f4051cda0e
commit 5d3a116aaf

View File

@@ -149,7 +149,7 @@ declare namespace request {
maxRedirects?: number;
removeRefererHeader?: boolean;
encoding?: string | null;
pool?: any;
pool?: PoolOptions;
timeout?: number;
localAddress?: string;
proxy?: any;
@@ -197,6 +197,12 @@ declare namespace request {
};
}
interface ExtraPoolOptions {
maxSockets?: number;
}
type PoolOptions = false | { [key: string]: http.Agent | https.Agent } & ExtraPoolOptions | ExtraPoolOptions;
interface NameValuePair {
name: string;
value: string;
@@ -280,7 +286,7 @@ declare namespace request {
// set in `Request.prototype.init`
headers: Headers;
method: string;
pool: false | { [key: string]: http.Agent | https.Agent };
pool: PoolOptions;
dests: stream.Readable[];
callback?: RequestCallback;
uri: Url & { href: string, pathname: string };