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 };