From 5d3a116aaf609182b87586eeeaca7ad777ddae93 Mon Sep 17 00:00:00 2001 From: Saimon Shaplygin Date: Tue, 17 Dec 2019 16:25:31 +0300 Subject: [PATCH] fix(request): add maxSockets params at pool option (#40892) * fix(request): add maxSockets params at pool option * fix pool options type --- types/request/index.d.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/types/request/index.d.ts b/types/request/index.d.ts index 951eff12e3..9dbbd19563 100644 --- a/types/request/index.d.ts +++ b/types/request/index.d.ts @@ -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 };