@types/node 16.0.0 → 16.0.1
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/README.md +1 -1
- node/assert.d.ts +5 -5
- node/async_hooks.d.ts +2 -2
- node/buffer.d.ts +2 -2
- node/child_process.d.ts +49 -49
- node/cluster.d.ts +10 -10
- node/console.d.ts +4 -4
- node/crypto.d.ts +61 -61
- node/dgram.d.ts +9 -9
- node/dns.d.ts +11 -11
- node/events.d.ts +3 -3
- node/fs/promises.d.ts +21 -17
- node/fs.d.ts +64 -60
- node/globals.d.ts +8 -8
- node/http.d.ts +97 -97
- node/http2.d.ts +65 -65
- node/https.d.ts +4 -4
- node/inspector.d.ts +148 -148
- node/net.d.ts +30 -30
- node/package.json +2 -2
- node/path.d.ts +5 -5
- node/perf_hooks.d.ts +14 -14
- node/process.d.ts +13 -13
- node/querystring.d.ts +3 -3
- node/readline.d.ts +15 -15
- node/repl.d.ts +14 -14
- node/stream.d.ts +17 -17
- node/timers.d.ts +1 -1
- node/tls.d.ts +50 -50
- node/url.d.ts +15 -15
- node/util.d.ts +13 -13
- node/vm.d.ts +24 -24
- node/wasi.d.ts +7 -7
- node/worker_threads.d.ts +15 -15
- node/zlib.d.ts +16 -16
node/globals.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface ErrorConstructor {
|
|
|
8
8
|
*
|
|
9
9
|
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
10
10
|
*/
|
|
11
|
-
prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any;
|
|
11
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
12
12
|
|
|
13
13
|
stackTraceLimit: number;
|
|
14
14
|
}
|
|
@@ -170,11 +170,11 @@ declare namespace NodeJS {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
interface ErrnoException extends Error {
|
|
173
|
-
errno?: number;
|
|
174
|
-
code?: string;
|
|
175
|
-
path?: string;
|
|
176
|
-
syscall?: string;
|
|
177
|
-
stack?: string;
|
|
173
|
+
errno?: number | undefined;
|
|
174
|
+
code?: string | undefined;
|
|
175
|
+
path?: string | undefined;
|
|
176
|
+
syscall?: string | undefined;
|
|
177
|
+
stack?: string | undefined;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
interface ReadableStream extends EventEmitter {
|
|
@@ -184,7 +184,7 @@ declare namespace NodeJS {
|
|
|
184
184
|
pause(): this;
|
|
185
185
|
resume(): this;
|
|
186
186
|
isPaused(): boolean;
|
|
187
|
-
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
|
|
187
|
+
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
|
|
188
188
|
unpipe(destination?: WritableStream): this;
|
|
189
189
|
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
190
190
|
wrap(oldStream: ReadableStream): this;
|
|
@@ -233,7 +233,7 @@ declare namespace NodeJS {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
interface RequireResolve {
|
|
236
|
-
(id: string, options?: { paths?: string[]; }): string;
|
|
236
|
+
(id: string, options?: { paths?: string[] | undefined; }): string;
|
|
237
237
|
paths(request: string): string[] | null;
|
|
238
238
|
}
|
|
239
239
|
|
node/http.d.ts
CHANGED
|
@@ -5,69 +5,69 @@ declare module 'http' {
|
|
|
5
5
|
|
|
6
6
|
// incoming headers will never contain number
|
|
7
7
|
interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
|
|
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
|
-
'access-control-request-headers'?: string;
|
|
19
|
-
'access-control-request-method'?: string;
|
|
20
|
-
'age'?: string;
|
|
21
|
-
'allow'?: string;
|
|
22
|
-
'alt-svc'?: string;
|
|
23
|
-
'authorization'?: string;
|
|
24
|
-
'cache-control'?: string;
|
|
25
|
-
'connection'?: string;
|
|
26
|
-
'content-disposition'?: string;
|
|
27
|
-
'content-encoding'?: string;
|
|
28
|
-
'content-language'?: string;
|
|
29
|
-
'content-length'?: string;
|
|
30
|
-
'content-location'?: string;
|
|
31
|
-
'content-range'?: string;
|
|
32
|
-
'content-type'?: string;
|
|
33
|
-
'cookie'?: string;
|
|
34
|
-
'date'?: string;
|
|
35
|
-
'etag'?: string;
|
|
36
|
-
'expect'?: string;
|
|
37
|
-
'expires'?: string;
|
|
38
|
-
'forwarded'?: string;
|
|
39
|
-
'from'?: string;
|
|
40
|
-
'host'?: string;
|
|
41
|
-
'if-match'?: string;
|
|
42
|
-
'if-modified-since'?: string;
|
|
43
|
-
'if-none-match'?: string;
|
|
44
|
-
'if-unmodified-since'?: string;
|
|
45
|
-
'last-modified'?: string;
|
|
46
|
-
'location'?: string;
|
|
47
|
-
'origin'?: string;
|
|
48
|
-
'pragma'?: string;
|
|
49
|
-
'proxy-authenticate'?: string;
|
|
50
|
-
'proxy-authorization'?: string;
|
|
51
|
-
'public-key-pins'?: string;
|
|
52
|
-
'range'?: string;
|
|
53
|
-
'referer'?: string;
|
|
54
|
-
'retry-after'?: string;
|
|
55
|
-
'sec-websocket-accept'?: string;
|
|
56
|
-
'sec-websocket-extensions'?: string;
|
|
57
|
-
'sec-websocket-key'?: string;
|
|
58
|
-
'sec-websocket-protocol'?: string;
|
|
59
|
-
'sec-websocket-version'?: string;
|
|
60
|
-
'set-cookie'?: string[];
|
|
61
|
-
'strict-transport-security'?: string;
|
|
62
|
-
'tk'?: string;
|
|
63
|
-
'trailer'?: string;
|
|
64
|
-
'transfer-encoding'?: string;
|
|
65
|
-
'upgrade'?: string;
|
|
66
|
-
'user-agent'?: string;
|
|
67
|
-
'vary'?: string;
|
|
68
|
-
'via'?: string;
|
|
69
|
-
'warning'?: string;
|
|
70
|
-
'www-authenticate'?: string;
|
|
8
|
+
'accept'?: string | undefined;
|
|
9
|
+
'accept-language'?: string | undefined;
|
|
10
|
+
'accept-patch'?: string | undefined;
|
|
11
|
+
'accept-ranges'?: string | undefined;
|
|
12
|
+
'access-control-allow-credentials'?: string | undefined;
|
|
13
|
+
'access-control-allow-headers'?: string | undefined;
|
|
14
|
+
'access-control-allow-methods'?: string | undefined;
|
|
15
|
+
'access-control-allow-origin'?: string | undefined;
|
|
16
|
+
'access-control-expose-headers'?: string | undefined;
|
|
17
|
+
'access-control-max-age'?: string | undefined;
|
|
18
|
+
'access-control-request-headers'?: string | undefined;
|
|
19
|
+
'access-control-request-method'?: string | undefined;
|
|
20
|
+
'age'?: string | undefined;
|
|
21
|
+
'allow'?: string | undefined;
|
|
22
|
+
'alt-svc'?: string | undefined;
|
|
23
|
+
'authorization'?: string | undefined;
|
|
24
|
+
'cache-control'?: string | undefined;
|
|
25
|
+
'connection'?: string | undefined;
|
|
26
|
+
'content-disposition'?: string | undefined;
|
|
27
|
+
'content-encoding'?: string | undefined;
|
|
28
|
+
'content-language'?: string | undefined;
|
|
29
|
+
'content-length'?: string | undefined;
|
|
30
|
+
'content-location'?: string | undefined;
|
|
31
|
+
'content-range'?: string | undefined;
|
|
32
|
+
'content-type'?: string | undefined;
|
|
33
|
+
'cookie'?: string | undefined;
|
|
34
|
+
'date'?: string | undefined;
|
|
35
|
+
'etag'?: string | undefined;
|
|
36
|
+
'expect'?: string | undefined;
|
|
37
|
+
'expires'?: string | undefined;
|
|
38
|
+
'forwarded'?: string | undefined;
|
|
39
|
+
'from'?: string | undefined;
|
|
40
|
+
'host'?: string | undefined;
|
|
41
|
+
'if-match'?: string | undefined;
|
|
42
|
+
'if-modified-since'?: string | undefined;
|
|
43
|
+
'if-none-match'?: string | undefined;
|
|
44
|
+
'if-unmodified-since'?: string | undefined;
|
|
45
|
+
'last-modified'?: string | undefined;
|
|
46
|
+
'location'?: string | undefined;
|
|
47
|
+
'origin'?: string | undefined;
|
|
48
|
+
'pragma'?: string | undefined;
|
|
49
|
+
'proxy-authenticate'?: string | undefined;
|
|
50
|
+
'proxy-authorization'?: string | undefined;
|
|
51
|
+
'public-key-pins'?: string | undefined;
|
|
52
|
+
'range'?: string | undefined;
|
|
53
|
+
'referer'?: string | undefined;
|
|
54
|
+
'retry-after'?: string | undefined;
|
|
55
|
+
'sec-websocket-accept'?: string | undefined;
|
|
56
|
+
'sec-websocket-extensions'?: string | undefined;
|
|
57
|
+
'sec-websocket-key'?: string | undefined;
|
|
58
|
+
'sec-websocket-protocol'?: string | undefined;
|
|
59
|
+
'sec-websocket-version'?: string | undefined;
|
|
60
|
+
'set-cookie'?: string[] | undefined;
|
|
61
|
+
'strict-transport-security'?: string | undefined;
|
|
62
|
+
'tk'?: string | undefined;
|
|
63
|
+
'trailer'?: string | undefined;
|
|
64
|
+
'transfer-encoding'?: string | undefined;
|
|
65
|
+
'upgrade'?: string | undefined;
|
|
66
|
+
'user-agent'?: string | undefined;
|
|
67
|
+
'vary'?: string | undefined;
|
|
68
|
+
'via'?: string | undefined;
|
|
69
|
+
'warning'?: string | undefined;
|
|
70
|
+
'www-authenticate'?: string | undefined;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// outgoing headers allows numbers (as they are converted internally to strings)
|
|
@@ -77,48 +77,48 @@ declare module 'http' {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
interface ClientRequestArgs {
|
|
80
|
-
abort?: AbortSignal;
|
|
81
|
-
protocol?: string | null;
|
|
82
|
-
host?: string | null;
|
|
83
|
-
hostname?: string | null;
|
|
84
|
-
family?: number;
|
|
85
|
-
port?: number | string | null;
|
|
86
|
-
defaultPort?: number | string;
|
|
87
|
-
localAddress?: string;
|
|
88
|
-
socketPath?: string;
|
|
80
|
+
abort?: AbortSignal | undefined;
|
|
81
|
+
protocol?: string | null | undefined;
|
|
82
|
+
host?: string | null | undefined;
|
|
83
|
+
hostname?: string | null | undefined;
|
|
84
|
+
family?: number | undefined;
|
|
85
|
+
port?: number | string | null | undefined;
|
|
86
|
+
defaultPort?: number | string | undefined;
|
|
87
|
+
localAddress?: string | undefined;
|
|
88
|
+
socketPath?: string | undefined;
|
|
89
89
|
/**
|
|
90
90
|
* @default 8192
|
|
91
91
|
*/
|
|
92
|
-
maxHeaderSize?: number;
|
|
93
|
-
method?: string;
|
|
94
|
-
path?: string | null;
|
|
95
|
-
headers?: OutgoingHttpHeaders;
|
|
96
|
-
auth?: string | null;
|
|
97
|
-
agent?: Agent | boolean;
|
|
98
|
-
_defaultAgent?: Agent;
|
|
99
|
-
timeout?: number;
|
|
100
|
-
setHost?: boolean;
|
|
92
|
+
maxHeaderSize?: number | undefined;
|
|
93
|
+
method?: string | undefined;
|
|
94
|
+
path?: string | null | undefined;
|
|
95
|
+
headers?: OutgoingHttpHeaders | undefined;
|
|
96
|
+
auth?: string | null | undefined;
|
|
97
|
+
agent?: Agent | boolean | undefined;
|
|
98
|
+
_defaultAgent?: Agent | undefined;
|
|
99
|
+
timeout?: number | undefined;
|
|
100
|
+
setHost?: boolean | undefined;
|
|
101
101
|
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
|
|
102
|
-
createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket;
|
|
102
|
+
createConnection?: ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) | undefined;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
interface ServerOptions {
|
|
106
|
-
IncomingMessage?: typeof IncomingMessage;
|
|
107
|
-
ServerResponse?: typeof ServerResponse;
|
|
106
|
+
IncomingMessage?: typeof IncomingMessage | undefined;
|
|
107
|
+
ServerResponse?: typeof ServerResponse | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* Optionally overrides the value of
|
|
110
110
|
* `--max-http-header-size` for requests received by this server, i.e.
|
|
111
111
|
* the maximum length of request headers in bytes.
|
|
112
112
|
* @default 8192
|
|
113
113
|
*/
|
|
114
|
-
maxHeaderSize?: number;
|
|
114
|
+
maxHeaderSize?: number | undefined;
|
|
115
115
|
/**
|
|
116
116
|
* Use an insecure HTTP parser that accepts invalid HTTP headers when true.
|
|
117
117
|
* Using the insecure parser should be avoided.
|
|
118
118
|
* See --insecure-http-parser for more information.
|
|
119
119
|
* @default false
|
|
120
120
|
*/
|
|
121
|
-
insecureHTTPParser?: boolean;
|
|
121
|
+
insecureHTTPParser?: boolean | undefined;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
|
|
@@ -337,19 +337,19 @@ declare module 'http' {
|
|
|
337
337
|
/**
|
|
338
338
|
* Only valid for request obtained from http.Server.
|
|
339
339
|
*/
|
|
340
|
-
method?: string;
|
|
340
|
+
method?: string | undefined;
|
|
341
341
|
/**
|
|
342
342
|
* Only valid for request obtained from http.Server.
|
|
343
343
|
*/
|
|
344
|
-
url?: string;
|
|
344
|
+
url?: string | undefined;
|
|
345
345
|
/**
|
|
346
346
|
* Only valid for response obtained from http.ClientRequest.
|
|
347
347
|
*/
|
|
348
|
-
statusCode?: number;
|
|
348
|
+
statusCode?: number | undefined;
|
|
349
349
|
/**
|
|
350
350
|
* Only valid for response obtained from http.ClientRequest.
|
|
351
351
|
*/
|
|
352
|
-
statusMessage?: string;
|
|
352
|
+
statusMessage?: string | undefined;
|
|
353
353
|
destroy(error?: Error): void;
|
|
354
354
|
}
|
|
355
355
|
|
|
@@ -357,33 +357,33 @@ declare module 'http' {
|
|
|
357
357
|
/**
|
|
358
358
|
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
|
359
359
|
*/
|
|
360
|
-
keepAlive?: boolean;
|
|
360
|
+
keepAlive?: boolean | undefined;
|
|
361
361
|
/**
|
|
362
362
|
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
|
|
363
363
|
* Only relevant if keepAlive is set to true.
|
|
364
364
|
*/
|
|
365
|
-
keepAliveMsecs?: number;
|
|
365
|
+
keepAliveMsecs?: number | undefined;
|
|
366
366
|
/**
|
|
367
367
|
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
|
368
368
|
*/
|
|
369
|
-
maxSockets?: number;
|
|
369
|
+
maxSockets?: number | undefined;
|
|
370
370
|
/**
|
|
371
371
|
* Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
|
|
372
372
|
*/
|
|
373
|
-
maxTotalSockets?: number;
|
|
373
|
+
maxTotalSockets?: number | undefined;
|
|
374
374
|
/**
|
|
375
375
|
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
|
|
376
376
|
*/
|
|
377
|
-
maxFreeSockets?: number;
|
|
377
|
+
maxFreeSockets?: number | undefined;
|
|
378
378
|
/**
|
|
379
379
|
* Socket timeout in milliseconds. This will set the timeout after the socket is connected.
|
|
380
380
|
*/
|
|
381
|
-
timeout?: number;
|
|
381
|
+
timeout?: number | undefined;
|
|
382
382
|
/**
|
|
383
383
|
* Scheduling strategy to apply when picking the next free socket to use.
|
|
384
384
|
* @default `lifo`
|
|
385
385
|
*/
|
|
386
|
-
scheduling?: 'fifo' | 'lifo';
|
|
386
|
+
scheduling?: 'fifo' | 'lifo' | undefined;
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
class Agent {
|
node/http2.d.ts
CHANGED
|
@@ -15,37 +15,37 @@ declare module 'http2' {
|
|
|
15
15
|
export { OutgoingHttpHeaders } from 'http';
|
|
16
16
|
|
|
17
17
|
export interface IncomingHttpStatusHeader {
|
|
18
|
-
":status"?: number;
|
|
18
|
+
":status"?: number | undefined;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
|
|
22
|
-
":path"?: string;
|
|
23
|
-
":method"?: string;
|
|
24
|
-
":authority"?: string;
|
|
25
|
-
":scheme"?: string;
|
|
22
|
+
":path"?: string | undefined;
|
|
23
|
+
":method"?: string | undefined;
|
|
24
|
+
":authority"?: string | undefined;
|
|
25
|
+
":scheme"?: string | undefined;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// Http2Stream
|
|
29
29
|
|
|
30
30
|
export interface StreamPriorityOptions {
|
|
31
|
-
exclusive?: boolean;
|
|
32
|
-
parent?: number;
|
|
33
|
-
weight?: number;
|
|
34
|
-
silent?: boolean;
|
|
31
|
+
exclusive?: boolean | undefined;
|
|
32
|
+
parent?: number | undefined;
|
|
33
|
+
weight?: number | undefined;
|
|
34
|
+
silent?: boolean | undefined;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export interface StreamState {
|
|
38
|
-
localWindowSize?: number;
|
|
39
|
-
state?: number;
|
|
40
|
-
localClose?: number;
|
|
41
|
-
remoteClose?: number;
|
|
42
|
-
sumDependencyWeight?: number;
|
|
43
|
-
weight?: number;
|
|
38
|
+
localWindowSize?: number | undefined;
|
|
39
|
+
state?: number | undefined;
|
|
40
|
+
localClose?: number | undefined;
|
|
41
|
+
remoteClose?: number | undefined;
|
|
42
|
+
sumDependencyWeight?: number | undefined;
|
|
43
|
+
weight?: number | undefined;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export interface ServerStreamResponseOptions {
|
|
47
|
-
endStream?: boolean;
|
|
48
|
-
waitForTrailers?: boolean;
|
|
47
|
+
endStream?: boolean | undefined;
|
|
48
|
+
waitForTrailers?: boolean | undefined;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export interface StatOptions {
|
|
@@ -55,9 +55,9 @@ declare module 'http2' {
|
|
|
55
55
|
|
|
56
56
|
export interface ServerStreamFileResponseOptions {
|
|
57
57
|
statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean;
|
|
58
|
-
waitForTrailers?: boolean;
|
|
59
|
-
offset?: number;
|
|
60
|
-
length?: number;
|
|
58
|
+
waitForTrailers?: boolean | undefined;
|
|
59
|
+
offset?: number | undefined;
|
|
60
|
+
length?: number | undefined;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
|
|
@@ -74,12 +74,12 @@ declare module 'http2' {
|
|
|
74
74
|
* indicating that no additional data should be received and the readable side of the Http2Stream will be closed.
|
|
75
75
|
*/
|
|
76
76
|
readonly endAfterHeaders: boolean;
|
|
77
|
-
readonly id?: number;
|
|
77
|
+
readonly id?: number | undefined;
|
|
78
78
|
readonly pending: boolean;
|
|
79
79
|
readonly rstCode: number;
|
|
80
80
|
readonly sentHeaders: OutgoingHttpHeaders;
|
|
81
|
-
readonly sentInfoHeaders?: OutgoingHttpHeaders[];
|
|
82
|
-
readonly sentTrailers?: OutgoingHttpHeaders;
|
|
81
|
+
readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined;
|
|
82
|
+
readonly sentTrailers?: OutgoingHttpHeaders | undefined;
|
|
83
83
|
readonly session: Http2Session;
|
|
84
84
|
readonly state: StreamState;
|
|
85
85
|
|
|
@@ -237,43 +237,43 @@ declare module 'http2' {
|
|
|
237
237
|
// Http2Session
|
|
238
238
|
|
|
239
239
|
export interface Settings {
|
|
240
|
-
headerTableSize?: number;
|
|
241
|
-
enablePush?: boolean;
|
|
242
|
-
initialWindowSize?: number;
|
|
243
|
-
maxFrameSize?: number;
|
|
244
|
-
maxConcurrentStreams?: number;
|
|
245
|
-
maxHeaderListSize?: number;
|
|
246
|
-
enableConnectProtocol?: boolean;
|
|
240
|
+
headerTableSize?: number | undefined;
|
|
241
|
+
enablePush?: boolean | undefined;
|
|
242
|
+
initialWindowSize?: number | undefined;
|
|
243
|
+
maxFrameSize?: number | undefined;
|
|
244
|
+
maxConcurrentStreams?: number | undefined;
|
|
245
|
+
maxHeaderListSize?: number | undefined;
|
|
246
|
+
enableConnectProtocol?: boolean | undefined;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
export interface ClientSessionRequestOptions {
|
|
250
|
-
endStream?: boolean;
|
|
251
|
-
exclusive?: boolean;
|
|
252
|
-
parent?: number;
|
|
253
|
-
weight?: number;
|
|
254
|
-
waitForTrailers?: boolean;
|
|
250
|
+
endStream?: boolean | undefined;
|
|
251
|
+
exclusive?: boolean | undefined;
|
|
252
|
+
parent?: number | undefined;
|
|
253
|
+
weight?: number | undefined;
|
|
254
|
+
waitForTrailers?: boolean | undefined;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
export interface SessionState {
|
|
258
|
-
effectiveLocalWindowSize?: number;
|
|
259
|
-
effectiveRecvDataLength?: number;
|
|
260
|
-
nextStreamID?: number;
|
|
261
|
-
localWindowSize?: number;
|
|
262
|
-
lastProcStreamID?: number;
|
|
263
|
-
remoteWindowSize?: number;
|
|
264
|
-
outboundQueueSize?: number;
|
|
265
|
-
deflateDynamicTableSize?: number;
|
|
266
|
-
inflateDynamicTableSize?: number;
|
|
258
|
+
effectiveLocalWindowSize?: number | undefined;
|
|
259
|
+
effectiveRecvDataLength?: number | undefined;
|
|
260
|
+
nextStreamID?: number | undefined;
|
|
261
|
+
localWindowSize?: number | undefined;
|
|
262
|
+
lastProcStreamID?: number | undefined;
|
|
263
|
+
remoteWindowSize?: number | undefined;
|
|
264
|
+
outboundQueueSize?: number | undefined;
|
|
265
|
+
deflateDynamicTableSize?: number | undefined;
|
|
266
|
+
inflateDynamicTableSize?: number | undefined;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
export interface Http2Session extends EventEmitter {
|
|
270
|
-
readonly alpnProtocol?: string;
|
|
270
|
+
readonly alpnProtocol?: string | undefined;
|
|
271
271
|
readonly closed: boolean;
|
|
272
272
|
readonly connecting: boolean;
|
|
273
273
|
readonly destroyed: boolean;
|
|
274
|
-
readonly encrypted?: boolean;
|
|
274
|
+
readonly encrypted?: boolean | undefined;
|
|
275
275
|
readonly localSettings: Settings;
|
|
276
|
-
readonly originSet?: string[];
|
|
276
|
+
readonly originSet?: string[] | undefined;
|
|
277
277
|
readonly pendingSettingsAck: boolean;
|
|
278
278
|
readonly remoteSettings: Settings;
|
|
279
279
|
readonly socket: net.Socket | tls.TLSSocket;
|
|
@@ -430,37 +430,37 @@ declare module 'http2' {
|
|
|
430
430
|
// Http2Server
|
|
431
431
|
|
|
432
432
|
export interface SessionOptions {
|
|
433
|
-
maxDeflateDynamicTableSize?: number;
|
|
434
|
-
maxSessionMemory?: number;
|
|
435
|
-
maxHeaderListPairs?: number;
|
|
436
|
-
maxOutstandingPings?: number;
|
|
437
|
-
maxSendHeaderBlockLength?: number;
|
|
438
|
-
paddingStrategy?: number;
|
|
439
|
-
peerMaxConcurrentStreams?: number;
|
|
440
|
-
settings?: Settings;
|
|
433
|
+
maxDeflateDynamicTableSize?: number | undefined;
|
|
434
|
+
maxSessionMemory?: number | undefined;
|
|
435
|
+
maxHeaderListPairs?: number | undefined;
|
|
436
|
+
maxOutstandingPings?: number | undefined;
|
|
437
|
+
maxSendHeaderBlockLength?: number | undefined;
|
|
438
|
+
paddingStrategy?: number | undefined;
|
|
439
|
+
peerMaxConcurrentStreams?: number | undefined;
|
|
440
|
+
settings?: Settings | undefined;
|
|
441
441
|
/**
|
|
442
442
|
* Specifies a timeout in milliseconds that
|
|
443
443
|
* a server should wait when an [`'unknownProtocol'`][] is emitted. If the
|
|
444
444
|
* socket has not been destroyed by that time the server will destroy it.
|
|
445
445
|
* @default 100000
|
|
446
446
|
*/
|
|
447
|
-
unknownProtocolTimeout?: number;
|
|
447
|
+
unknownProtocolTimeout?: number | undefined;
|
|
448
448
|
|
|
449
449
|
selectPadding?(frameLen: number, maxFrameLen: number): number;
|
|
450
450
|
createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex;
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
export interface ClientSessionOptions extends SessionOptions {
|
|
454
|
-
maxReservedRemoteStreams?: number;
|
|
455
|
-
createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex;
|
|
456
|
-
protocol?: 'http:' | 'https:';
|
|
454
|
+
maxReservedRemoteStreams?: number | undefined;
|
|
455
|
+
createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined;
|
|
456
|
+
protocol?: 'http:' | 'https:' | undefined;
|
|
457
457
|
}
|
|
458
458
|
|
|
459
459
|
export interface ServerSessionOptions extends SessionOptions {
|
|
460
|
-
Http1IncomingMessage?: typeof IncomingMessage;
|
|
461
|
-
Http1ServerResponse?: typeof ServerResponse;
|
|
462
|
-
Http2ServerRequest?: typeof Http2ServerRequest;
|
|
463
|
-
Http2ServerResponse?: typeof Http2ServerResponse;
|
|
460
|
+
Http1IncomingMessage?: typeof IncomingMessage | undefined;
|
|
461
|
+
Http1ServerResponse?: typeof ServerResponse | undefined;
|
|
462
|
+
Http2ServerRequest?: typeof Http2ServerRequest | undefined;
|
|
463
|
+
Http2ServerResponse?: typeof Http2ServerResponse | undefined;
|
|
464
464
|
}
|
|
465
465
|
|
|
466
466
|
export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { }
|
|
@@ -469,8 +469,8 @@ declare module 'http2' {
|
|
|
469
469
|
export interface ServerOptions extends ServerSessionOptions { }
|
|
470
470
|
|
|
471
471
|
export interface SecureServerOptions extends SecureServerSessionOptions {
|
|
472
|
-
allowHTTP1?: boolean;
|
|
473
|
-
origins?: string[];
|
|
472
|
+
allowHTTP1?: boolean | undefined;
|
|
473
|
+
origins?: string[] | undefined;
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
interface HTTP2ServerCommon {
|
node/https.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ declare module 'https' {
|
|
|
6
6
|
type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
|
|
7
7
|
|
|
8
8
|
type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
|
|
9
|
-
rejectUnauthorized?: boolean; // Defaults to true
|
|
10
|
-
servername?: string; // SNI TLS Extension
|
|
9
|
+
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
10
|
+
servername?: string | undefined; // SNI TLS Extension
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
|
14
|
-
rejectUnauthorized?: boolean;
|
|
15
|
-
maxCachedSessions?: number;
|
|
14
|
+
rejectUnauthorized?: boolean | undefined;
|
|
15
|
+
maxCachedSessions?: number | undefined;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
class Agent extends http.Agent {
|