@types/node 12.20.41 → 13.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node v12.20/LICENSE → node/LICENSE +21 -21
- node/README.md +16 -0
- node/assert.d.ts +50 -0
- node/async_hooks.d.ts +132 -0
- node/base.d.ts +41 -0
- node v12.20/buffer.d.ts → node/buffer.d.ts +1 -1
- node v12.20/child_process.d.ts → node/child_process.d.ts +111 -113
- node v12.20/cluster.d.ts → node/cluster.d.ts +25 -19
- node/console.d.ts +3 -0
- node/constants.d.ts +8 -0
- node/crypto.d.ts +615 -0
- node v12.20/dgram.d.ts → node/dgram.d.ts +48 -25
- node v12.20/dns.d.ts → node/dns.d.ts +6 -12
- node v12.20/domain.d.ts → node/domain.d.ts +2 -2
- node/events.d.ts +40 -0
- node v12.20/fs.d.ts → node/fs.d.ts +162 -262
- node v12.20/globals.d.ts → node/globals.d.ts +104 -260
- node v12.20/http.d.ts → node/http.d.ts +102 -177
- node v12.20/http2.d.ts → node/http2.d.ts +82 -87
- node/https.d.ts +53 -0
- node/index.d.ts +83 -0
- node v12.20/inspector.d.ts → node/inspector.d.ts +153 -159
- node/module.d.ts +20 -0
- node v12.20/net.d.ts → node/net.d.ts +37 -47
- node/os.d.ts +231 -0
- node v12.20/package.json → node/package.json +45 -9
- node/path.d.ts +153 -0
- node v12.20/perf_hooks.d.ts → node/perf_hooks.d.ts +76 -31
- node v12.20/process.d.ts → node/process.d.ts +2 -2
- node/punycode.d.ts +12 -0
- node v12.20/querystring.d.ts → node/querystring.d.ts +5 -5
- node v12.20/readline.d.ts → node/readline.d.ts +16 -17
- node v12.20/repl.d.ts → node/repl.d.ts +24 -32
- node v12.20/stream.d.ts → node/stream.d.ts +33 -43
- node v12.20/string_decoder.d.ts → node/string_decoder.d.ts +1 -1
- node v12.20/timers.d.ts → node/timers.d.ts +1 -1
- node v12.20/tls.d.ts → node/tls.d.ts +54 -65
- node v12.20/trace_events.d.ts → node/trace_events.d.ts +1 -1
- node/ts3.2/fs.d.ts +33 -0
- node/ts3.2/globals.d.ts +19 -0
- node/ts3.2/index.d.ts +16 -0
- node/ts3.2/util.d.ts +9 -0
- node v12.20/tty.d.ts → node/tty.d.ts +3 -3
- node v12.20/url.d.ts → node/url.d.ts +17 -24
- node v12.20/util.d.ts → node/util.d.ts +22 -37
- node v12.20/v8.d.ts → node/v8.d.ts +2 -12
- node v12.20/vm.d.ts → node/vm.d.ts +22 -24
- node v12.20/worker_threads.d.ts → node/worker_threads.d.ts +39 -85
- node v12.20/zlib.d.ts → node/zlib.d.ts +134 -138
- node v12.20/README.md +0 -16
- node v12.20/assert.d.ts +0 -117
- node v12.20/async_hooks.d.ts +0 -246
- node v12.20/console.d.ts +0 -3
- node v12.20/constants.d.ts +0 -448
- node v12.20/crypto.d.ts +0 -1159
- node v12.20/events.d.ts +0 -47
- node v12.20/globals.global.d.ts +0 -1
- node v12.20/https.d.ts +0 -156
- node v12.20/index.d.ts +0 -91
- node v12.20/module.d.ts +0 -3
- node v12.20/os.d.ts +0 -263
- node v12.20/path.d.ts +0 -159
- node v12.20/punycode.d.ts +0 -75
- node v12.20/wasi.d.ts +0 -55
|
@@ -1,68 +1,65 @@
|
|
|
1
|
-
declare module
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
declare module "http" {
|
|
2
|
+
import * as events from "events";
|
|
3
|
+
import * as stream from "stream";
|
|
4
|
+
import { URL } from "url";
|
|
5
|
+
import { Socket, Server as NetServer } from "net";
|
|
5
6
|
|
|
6
7
|
// incoming headers will never contain number
|
|
7
8
|
interface IncomingHttpHeaders {
|
|
8
|
-
'accept'?: string
|
|
9
|
-
'accept-language'?: string
|
|
10
|
-
'accept-patch'?: string
|
|
11
|
-
'accept-ranges'?: string
|
|
12
|
-
'access-control-allow-credentials'?: string
|
|
13
|
-
'access-control-allow-headers'?: string
|
|
14
|
-
'access-control-allow-methods'?: string
|
|
15
|
-
'access-control-allow-origin'?: string
|
|
16
|
-
'access-control-expose-headers'?: string
|
|
17
|
-
'access-control-max-age'?: string
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'content-
|
|
27
|
-
'content-
|
|
28
|
-
'content-
|
|
29
|
-
'content-
|
|
30
|
-
'content-
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'if-
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'vary'?: string | undefined;
|
|
63
|
-
'via'?: string | undefined;
|
|
64
|
-
'warning'?: string | undefined;
|
|
65
|
-
'www-authenticate'?: string | undefined;
|
|
9
|
+
'accept'?: string;
|
|
10
|
+
'accept-language'?: string;
|
|
11
|
+
'accept-patch'?: string;
|
|
12
|
+
'accept-ranges'?: string;
|
|
13
|
+
'access-control-allow-credentials'?: string;
|
|
14
|
+
'access-control-allow-headers'?: string;
|
|
15
|
+
'access-control-allow-methods'?: string;
|
|
16
|
+
'access-control-allow-origin'?: string;
|
|
17
|
+
'access-control-expose-headers'?: string;
|
|
18
|
+
'access-control-max-age'?: string;
|
|
19
|
+
'age'?: string;
|
|
20
|
+
'allow'?: string;
|
|
21
|
+
'alt-svc'?: string;
|
|
22
|
+
'authorization'?: string;
|
|
23
|
+
'cache-control'?: string;
|
|
24
|
+
'connection'?: string;
|
|
25
|
+
'content-disposition'?: string;
|
|
26
|
+
'content-encoding'?: string;
|
|
27
|
+
'content-language'?: string;
|
|
28
|
+
'content-length'?: string;
|
|
29
|
+
'content-location'?: string;
|
|
30
|
+
'content-range'?: string;
|
|
31
|
+
'content-type'?: string;
|
|
32
|
+
'cookie'?: string;
|
|
33
|
+
'date'?: string;
|
|
34
|
+
'expect'?: string;
|
|
35
|
+
'expires'?: string;
|
|
36
|
+
'forwarded'?: string;
|
|
37
|
+
'from'?: string;
|
|
38
|
+
'host'?: string;
|
|
39
|
+
'if-match'?: string;
|
|
40
|
+
'if-modified-since'?: string;
|
|
41
|
+
'if-none-match'?: string;
|
|
42
|
+
'if-unmodified-since'?: string;
|
|
43
|
+
'last-modified'?: string;
|
|
44
|
+
'location'?: string;
|
|
45
|
+
'pragma'?: string;
|
|
46
|
+
'proxy-authenticate'?: string;
|
|
47
|
+
'proxy-authorization'?: string;
|
|
48
|
+
'public-key-pins'?: string;
|
|
49
|
+
'range'?: string;
|
|
50
|
+
'referer'?: string;
|
|
51
|
+
'retry-after'?: string;
|
|
52
|
+
'set-cookie'?: string[];
|
|
53
|
+
'strict-transport-security'?: string;
|
|
54
|
+
'tk'?: string;
|
|
55
|
+
'trailer'?: string;
|
|
56
|
+
'transfer-encoding'?: string;
|
|
57
|
+
'upgrade'?: string;
|
|
58
|
+
'user-agent'?: string;
|
|
59
|
+
'vary'?: string;
|
|
60
|
+
'via'?: string;
|
|
61
|
+
'warning'?: string;
|
|
62
|
+
'www-authenticate'?: string;
|
|
66
63
|
[header: string]: string | string[] | undefined;
|
|
67
64
|
}
|
|
68
65
|
|
|
@@ -72,30 +69,29 @@ declare module 'http' {
|
|
|
72
69
|
}
|
|
73
70
|
|
|
74
71
|
interface ClientRequestArgs {
|
|
75
|
-
protocol?: string | null
|
|
76
|
-
host?: string | null
|
|
77
|
-
hostname?: string | null
|
|
78
|
-
family?: number
|
|
79
|
-
port?: number | string | null
|
|
80
|
-
defaultPort?: number | string
|
|
81
|
-
localAddress?: string
|
|
82
|
-
socketPath?: string
|
|
83
|
-
method?: string
|
|
84
|
-
path?: string | null
|
|
85
|
-
headers?: OutgoingHttpHeaders
|
|
86
|
-
auth?: string | null
|
|
87
|
-
agent?: Agent | boolean
|
|
88
|
-
_defaultAgent?: Agent
|
|
89
|
-
timeout?: number
|
|
90
|
-
setHost?: boolean
|
|
72
|
+
protocol?: string | null;
|
|
73
|
+
host?: string | null;
|
|
74
|
+
hostname?: string | null;
|
|
75
|
+
family?: number;
|
|
76
|
+
port?: number | string | null;
|
|
77
|
+
defaultPort?: number | string;
|
|
78
|
+
localAddress?: string;
|
|
79
|
+
socketPath?: string;
|
|
80
|
+
method?: string;
|
|
81
|
+
path?: string | null;
|
|
82
|
+
headers?: OutgoingHttpHeaders;
|
|
83
|
+
auth?: string | null;
|
|
84
|
+
agent?: Agent | boolean;
|
|
85
|
+
_defaultAgent?: Agent;
|
|
86
|
+
timeout?: number;
|
|
87
|
+
setHost?: boolean;
|
|
91
88
|
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
|
|
92
|
-
createConnection?: (
|
|
93
|
-
lookup?: LookupFunction | undefined;
|
|
89
|
+
createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket;
|
|
94
90
|
}
|
|
95
91
|
|
|
96
92
|
interface ServerOptions {
|
|
97
|
-
IncomingMessage?: typeof IncomingMessage
|
|
98
|
-
ServerResponse?: typeof ServerResponse
|
|
93
|
+
IncomingMessage?: typeof IncomingMessage;
|
|
94
|
+
ServerResponse?: typeof ServerResponse;
|
|
99
95
|
}
|
|
100
96
|
|
|
101
97
|
type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
|
|
@@ -120,72 +116,6 @@ declare module 'http' {
|
|
|
120
116
|
*/
|
|
121
117
|
headersTimeout: number;
|
|
122
118
|
keepAliveTimeout: number;
|
|
123
|
-
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
124
|
-
addListener(event: 'close', listener: () => void): this;
|
|
125
|
-
addListener(event: 'connection', listener: (socket: Socket) => void): this;
|
|
126
|
-
addListener(event: 'error', listener: (err: Error) => void): this;
|
|
127
|
-
addListener(event: 'listening', listener: () => void): this;
|
|
128
|
-
addListener(event: 'checkContinue', listener: RequestListener): this;
|
|
129
|
-
addListener(event: 'checkExpectation', listener: RequestListener): this;
|
|
130
|
-
addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
131
|
-
addListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
132
|
-
addListener(event: 'request', listener: RequestListener): this;
|
|
133
|
-
addListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
134
|
-
emit(event: string, ...args: any[]): boolean;
|
|
135
|
-
emit(event: 'close'): boolean;
|
|
136
|
-
emit(event: 'connection', socket: Socket): boolean;
|
|
137
|
-
emit(event: 'error', err: Error): boolean;
|
|
138
|
-
emit(event: 'listening'): boolean;
|
|
139
|
-
emit(event: 'checkContinue', req: IncomingMessage, res: ServerResponse): boolean;
|
|
140
|
-
emit(event: 'checkExpectation', req: IncomingMessage, res: ServerResponse): boolean;
|
|
141
|
-
emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean;
|
|
142
|
-
emit(event: 'connect', req: IncomingMessage, socket: stream.Duplex, head: Buffer): boolean;
|
|
143
|
-
emit(event: 'request', req: IncomingMessage, res: ServerResponse): boolean;
|
|
144
|
-
emit(event: 'upgrade', req: IncomingMessage, socket: stream.Duplex, head: Buffer): boolean;
|
|
145
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
146
|
-
on(event: 'close', listener: () => void): this;
|
|
147
|
-
on(event: 'connection', listener: (socket: Socket) => void): this;
|
|
148
|
-
on(event: 'error', listener: (err: Error) => void): this;
|
|
149
|
-
on(event: 'listening', listener: () => void): this;
|
|
150
|
-
on(event: 'checkContinue', listener: RequestListener): this;
|
|
151
|
-
on(event: 'checkExpectation', listener: RequestListener): this;
|
|
152
|
-
on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
153
|
-
on(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
154
|
-
on(event: 'request', listener: RequestListener): this;
|
|
155
|
-
on(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
156
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
157
|
-
once(event: 'close', listener: () => void): this;
|
|
158
|
-
once(event: 'connection', listener: (socket: Socket) => void): this;
|
|
159
|
-
once(event: 'error', listener: (err: Error) => void): this;
|
|
160
|
-
once(event: 'listening', listener: () => void): this;
|
|
161
|
-
once(event: 'checkContinue', listener: RequestListener): this;
|
|
162
|
-
once(event: 'checkExpectation', listener: RequestListener): this;
|
|
163
|
-
once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
164
|
-
once(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
165
|
-
once(event: 'request', listener: RequestListener): this;
|
|
166
|
-
once(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
167
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
168
|
-
prependListener(event: 'close', listener: () => void): this;
|
|
169
|
-
prependListener(event: 'connection', listener: (socket: Socket) => void): this;
|
|
170
|
-
prependListener(event: 'error', listener: (err: Error) => void): this;
|
|
171
|
-
prependListener(event: 'listening', listener: () => void): this;
|
|
172
|
-
prependListener(event: 'checkContinue', listener: RequestListener): this;
|
|
173
|
-
prependListener(event: 'checkExpectation', listener: RequestListener): this;
|
|
174
|
-
prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
175
|
-
prependListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
176
|
-
prependListener(event: 'request', listener: RequestListener): this;
|
|
177
|
-
prependListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
178
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
179
|
-
prependOnceListener(event: 'close', listener: () => void): this;
|
|
180
|
-
prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this;
|
|
181
|
-
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
|
182
|
-
prependOnceListener(event: 'listening', listener: () => void): this;
|
|
183
|
-
prependOnceListener(event: 'checkContinue', listener: RequestListener): this;
|
|
184
|
-
prependOnceListener(event: 'checkExpectation', listener: RequestListener): this;
|
|
185
|
-
prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
186
|
-
prependOnceListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
187
|
-
prependOnceListener(event: 'request', listener: RequestListener): this;
|
|
188
|
-
prependOnceListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
|
|
189
119
|
}
|
|
190
120
|
|
|
191
121
|
// https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js
|
|
@@ -197,18 +127,22 @@ declare module 'http' {
|
|
|
197
127
|
sendDate: boolean;
|
|
198
128
|
finished: boolean;
|
|
199
129
|
headersSent: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* @deprecate Use `socket` instead.
|
|
132
|
+
*/
|
|
200
133
|
connection: Socket;
|
|
134
|
+
socket: Socket;
|
|
201
135
|
|
|
202
136
|
constructor();
|
|
203
137
|
|
|
204
138
|
setTimeout(msecs: number, callback?: () => void): this;
|
|
205
|
-
setHeader(name: string, value: number | string |
|
|
139
|
+
setHeader(name: string, value: number | string | string[]): void;
|
|
206
140
|
getHeader(name: string): number | string | string[] | undefined;
|
|
207
141
|
getHeaders(): OutgoingHttpHeaders;
|
|
208
142
|
getHeaderNames(): string[];
|
|
209
143
|
hasHeader(name: string): boolean;
|
|
210
144
|
removeHeader(name: string): void;
|
|
211
|
-
addTrailers(headers: OutgoingHttpHeaders |
|
|
145
|
+
addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void;
|
|
212
146
|
flushHeaders(): void;
|
|
213
147
|
}
|
|
214
148
|
|
|
@@ -225,7 +159,7 @@ declare module 'http' {
|
|
|
225
159
|
// https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
|
|
226
160
|
// no args in writeContinue callback
|
|
227
161
|
writeContinue(callback?: () => void): void;
|
|
228
|
-
writeHead(statusCode: number,
|
|
162
|
+
writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this;
|
|
229
163
|
writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
|
|
230
164
|
writeProcessing(): void;
|
|
231
165
|
}
|
|
@@ -240,18 +174,16 @@ declare module 'http' {
|
|
|
240
174
|
rawHeaders: string[];
|
|
241
175
|
}
|
|
242
176
|
|
|
243
|
-
// https://github.com/nodejs/node/blob/
|
|
177
|
+
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
|
|
244
178
|
class ClientRequest extends OutgoingMessage {
|
|
245
179
|
connection: Socket;
|
|
246
180
|
socket: Socket;
|
|
247
|
-
aborted:
|
|
248
|
-
host: string;
|
|
249
|
-
protocol: string;
|
|
181
|
+
aborted: number;
|
|
250
182
|
|
|
251
183
|
constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
|
252
184
|
|
|
253
185
|
method: string;
|
|
254
|
-
|
|
186
|
+
path: string;
|
|
255
187
|
abort(): void;
|
|
256
188
|
onSocket(socket: Socket): void;
|
|
257
189
|
setTimeout(timeout: number, callback?: () => void): this;
|
|
@@ -342,12 +274,15 @@ declare module 'http' {
|
|
|
342
274
|
class IncomingMessage extends stream.Readable {
|
|
343
275
|
constructor(socket: Socket);
|
|
344
276
|
|
|
345
|
-
aborted: boolean;
|
|
346
277
|
httpVersion: string;
|
|
347
278
|
httpVersionMajor: number;
|
|
348
279
|
httpVersionMinor: number;
|
|
349
280
|
complete: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* @deprecate Use `socket` instead.
|
|
283
|
+
*/
|
|
350
284
|
connection: Socket;
|
|
285
|
+
socket: Socket;
|
|
351
286
|
headers: IncomingHttpHeaders;
|
|
352
287
|
rawHeaders: string[];
|
|
353
288
|
trailers: { [key: string]: string | undefined };
|
|
@@ -356,59 +291,49 @@ declare module 'http' {
|
|
|
356
291
|
/**
|
|
357
292
|
* Only valid for request obtained from http.Server.
|
|
358
293
|
*/
|
|
359
|
-
method?: string
|
|
294
|
+
method?: string;
|
|
360
295
|
/**
|
|
361
296
|
* Only valid for request obtained from http.Server.
|
|
362
297
|
*/
|
|
363
|
-
url?: string
|
|
298
|
+
url?: string;
|
|
364
299
|
/**
|
|
365
300
|
* Only valid for response obtained from http.ClientRequest.
|
|
366
301
|
*/
|
|
367
|
-
statusCode?: number
|
|
302
|
+
statusCode?: number;
|
|
368
303
|
/**
|
|
369
304
|
* Only valid for response obtained from http.ClientRequest.
|
|
370
305
|
*/
|
|
371
|
-
statusMessage?: string
|
|
372
|
-
|
|
373
|
-
destroy(error?: Error): this;
|
|
306
|
+
statusMessage?: string;
|
|
307
|
+
destroy(error?: Error): void;
|
|
374
308
|
}
|
|
375
309
|
|
|
376
310
|
interface AgentOptions {
|
|
377
311
|
/**
|
|
378
312
|
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
|
379
313
|
*/
|
|
380
|
-
keepAlive?: boolean
|
|
314
|
+
keepAlive?: boolean;
|
|
381
315
|
/**
|
|
382
316
|
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
|
|
383
317
|
* Only relevant if keepAlive is set to true.
|
|
384
318
|
*/
|
|
385
|
-
keepAliveMsecs?: number
|
|
319
|
+
keepAliveMsecs?: number;
|
|
386
320
|
/**
|
|
387
321
|
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
|
388
322
|
*/
|
|
389
|
-
maxSockets?: number
|
|
390
|
-
/**
|
|
391
|
-
* Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
|
|
392
|
-
*/
|
|
393
|
-
maxTotalSockets?: number | undefined;
|
|
323
|
+
maxSockets?: number;
|
|
394
324
|
/**
|
|
395
325
|
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
|
|
396
326
|
*/
|
|
397
|
-
maxFreeSockets?: number
|
|
327
|
+
maxFreeSockets?: number;
|
|
398
328
|
/**
|
|
399
329
|
* Socket timeout in milliseconds. This will set the timeout after the socket is connected.
|
|
400
330
|
*/
|
|
401
|
-
timeout?: number
|
|
402
|
-
/**
|
|
403
|
-
* Scheduling strategy to apply when picking the next free socket to use. Default: 'fifo'.
|
|
404
|
-
*/
|
|
405
|
-
scheduling?: 'fifo' | 'lifo' | undefined;
|
|
331
|
+
timeout?: number;
|
|
406
332
|
}
|
|
407
333
|
|
|
408
334
|
class Agent {
|
|
409
335
|
maxFreeSockets: number;
|
|
410
336
|
maxSockets: number;
|
|
411
|
-
maxTotalSockets: number;
|
|
412
337
|
readonly sockets: {
|
|
413
338
|
readonly [key: string]: Socket[];
|
|
414
339
|
};
|