@types/node 16.0.0 → 16.3.0
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 +4 -6
- node/buffer.d.ts +2 -2
- node/child_process.d.ts +58 -58
- node/cluster.d.ts +10 -10
- node/console.d.ts +4 -4
- node/crypto.d.ts +69 -67
- node/dgram.d.ts +9 -9
- node/dns.d.ts +11 -11
- node/events.d.ts +3 -3
- node/fs/promises.d.ts +59 -112
- node/fs.d.ts +128 -109
- node/globals.d.ts +8 -8
- node/http.d.ts +97 -104
- node/http2.d.ts +65 -65
- node/https.d.ts +4 -4
- node/index.d.ts +1 -1
- node/inspector.d.ts +148 -148
- node/net.d.ts +30 -30
- node/os.d.ts +3 -1
- node/package.json +2 -2
- node/path.d.ts +5 -5
- node/perf_hooks.d.ts +14 -14
- node/process.d.ts +37 -38
- 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 +10 -1
- node/tls.d.ts +50 -50
- node/ts3.6/base.d.ts +0 -1
- node/url.d.ts +22 -15
- node/util.d.ts +75 -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/util/types.d.ts +0 -57
node/repl.d.ts
CHANGED
|
@@ -8,24 +8,24 @@ declare module 'repl' {
|
|
|
8
8
|
* The input prompt to display.
|
|
9
9
|
* @default "> "
|
|
10
10
|
*/
|
|
11
|
-
prompt?: string;
|
|
11
|
+
prompt?: string | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* The `Readable` stream from which REPL input will be read.
|
|
14
14
|
* @default process.stdin
|
|
15
15
|
*/
|
|
16
|
-
input?: NodeJS.ReadableStream;
|
|
16
|
+
input?: NodeJS.ReadableStream | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* The `Writable` stream to which REPL output will be written.
|
|
19
19
|
* @default process.stdout
|
|
20
20
|
*/
|
|
21
|
-
output?: NodeJS.WritableStream;
|
|
21
|
+
output?: NodeJS.WritableStream | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* If `true`, specifies that the output should be treated as a TTY terminal, and have
|
|
24
24
|
* ANSI/VT100 escape codes written to it.
|
|
25
25
|
* Default: checking the value of the `isTTY` property on the output stream upon
|
|
26
26
|
* instantiation.
|
|
27
27
|
*/
|
|
28
|
-
terminal?: boolean;
|
|
28
|
+
terminal?: boolean | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* The function to be used when evaluating each given line of input.
|
|
31
31
|
* Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
|
@@ -35,45 +35,45 @@ declare module 'repl' {
|
|
|
35
35
|
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
|
|
36
36
|
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
|
|
37
37
|
*/
|
|
38
|
-
eval?: REPLEval;
|
|
38
|
+
eval?: REPLEval | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Defines if the repl prints output previews or not.
|
|
41
41
|
* @default `true` Always `false` in case `terminal` is falsy.
|
|
42
42
|
*/
|
|
43
|
-
preview?: boolean;
|
|
43
|
+
preview?: boolean | undefined;
|
|
44
44
|
/**
|
|
45
45
|
* If `true`, specifies that the default `writer` function should include ANSI color
|
|
46
46
|
* styling to REPL output. If a custom `writer` function is provided then this has no
|
|
47
47
|
* effect.
|
|
48
48
|
* Default: the REPL instance's `terminal` value.
|
|
49
49
|
*/
|
|
50
|
-
useColors?: boolean;
|
|
50
|
+
useColors?: boolean | undefined;
|
|
51
51
|
/**
|
|
52
52
|
* If `true`, specifies that the default evaluation function will use the JavaScript
|
|
53
53
|
* `global` as the context as opposed to creating a new separate context for the REPL
|
|
54
54
|
* instance. The node CLI REPL sets this value to `true`.
|
|
55
55
|
* Default: `false`.
|
|
56
56
|
*/
|
|
57
|
-
useGlobal?: boolean;
|
|
57
|
+
useGlobal?: boolean | undefined;
|
|
58
58
|
/**
|
|
59
59
|
* If `true`, specifies that the default writer will not output the return value of a
|
|
60
60
|
* command if it evaluates to `undefined`.
|
|
61
61
|
* Default: `false`.
|
|
62
62
|
*/
|
|
63
|
-
ignoreUndefined?: boolean;
|
|
63
|
+
ignoreUndefined?: boolean | undefined;
|
|
64
64
|
/**
|
|
65
65
|
* The function to invoke to format the output of each command before writing to `output`.
|
|
66
66
|
* Default: a wrapper for `util.inspect`.
|
|
67
67
|
*
|
|
68
68
|
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
|
|
69
69
|
*/
|
|
70
|
-
writer?: REPLWriter;
|
|
70
|
+
writer?: REPLWriter | undefined;
|
|
71
71
|
/**
|
|
72
72
|
* An optional function used for custom Tab auto completion.
|
|
73
73
|
*
|
|
74
74
|
* @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
|
|
75
75
|
*/
|
|
76
|
-
completer?: Completer | AsyncCompleter;
|
|
76
|
+
completer?: Completer | AsyncCompleter | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* A flag that specifies whether the default evaluator executes all JavaScript commands in
|
|
79
79
|
* strict mode or default (sloppy) mode.
|
|
@@ -82,13 +82,13 @@ declare module 'repl' {
|
|
|
82
82
|
* - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
|
|
83
83
|
* prefacing every repl statement with `'use strict'`.
|
|
84
84
|
*/
|
|
85
|
-
replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
|
|
85
|
+
replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined;
|
|
86
86
|
/**
|
|
87
87
|
* Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
|
|
88
88
|
* pressed. This cannot be used together with a custom `eval` function.
|
|
89
89
|
* Default: `false`.
|
|
90
90
|
*/
|
|
91
|
-
breakEvalOnSigint?: boolean;
|
|
91
|
+
breakEvalOnSigint?: boolean | undefined;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
|
|
@@ -106,7 +106,7 @@ declare module 'repl' {
|
|
|
106
106
|
/**
|
|
107
107
|
* Help text to be displayed when `.help` is entered.
|
|
108
108
|
*/
|
|
109
|
-
help?: string;
|
|
109
|
+
help?: string | undefined;
|
|
110
110
|
/**
|
|
111
111
|
* The function to execute, optionally accepting a single string argument.
|
|
112
112
|
*/
|
node/stream.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare module 'stream' {
|
|
|
3
3
|
import * as streamPromises from "stream/promises";
|
|
4
4
|
|
|
5
5
|
class internal extends EventEmitter {
|
|
6
|
-
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
|
|
6
|
+
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
namespace internal {
|
|
@@ -12,16 +12,16 @@ declare module 'stream' {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface StreamOptions<T extends Stream> extends Abortable {
|
|
15
|
-
emitClose?: boolean;
|
|
16
|
-
highWaterMark?: number;
|
|
17
|
-
objectMode?: boolean;
|
|
15
|
+
emitClose?: boolean | undefined;
|
|
16
|
+
highWaterMark?: number | undefined;
|
|
17
|
+
objectMode?: boolean | undefined;
|
|
18
18
|
construct?(this: T, callback: (error?: Error | null) => void): void;
|
|
19
19
|
destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void;
|
|
20
|
-
autoDestroy?: boolean;
|
|
20
|
+
autoDestroy?: boolean | undefined;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
interface ReadableOptions extends StreamOptions<Readable> {
|
|
24
|
-
encoding?: BufferEncoding;
|
|
24
|
+
encoding?: BufferEncoding | undefined;
|
|
25
25
|
read?(this: Readable, size: number): void;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -132,8 +132,8 @@ declare module 'stream' {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
interface WritableOptions extends StreamOptions<Writable> {
|
|
135
|
-
decodeStrings?: boolean;
|
|
136
|
-
defaultEncoding?: BufferEncoding;
|
|
135
|
+
decodeStrings?: boolean | undefined;
|
|
136
|
+
defaultEncoding?: BufferEncoding | undefined;
|
|
137
137
|
write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
138
138
|
writev?(this: Writable, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
|
|
139
139
|
final?(this: Writable, callback: (error?: Error | null) => void): void;
|
|
@@ -232,12 +232,12 @@ declare module 'stream' {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
interface DuplexOptions extends ReadableOptions, WritableOptions {
|
|
235
|
-
allowHalfOpen?: boolean;
|
|
236
|
-
readableObjectMode?: boolean;
|
|
237
|
-
writableObjectMode?: boolean;
|
|
238
|
-
readableHighWaterMark?: number;
|
|
239
|
-
writableHighWaterMark?: number;
|
|
240
|
-
writableCorked?: number;
|
|
235
|
+
allowHalfOpen?: boolean | undefined;
|
|
236
|
+
readableObjectMode?: boolean | undefined;
|
|
237
|
+
writableObjectMode?: boolean | undefined;
|
|
238
|
+
readableHighWaterMark?: number | undefined;
|
|
239
|
+
writableHighWaterMark?: number | undefined;
|
|
240
|
+
writableCorked?: number | undefined;
|
|
241
241
|
construct?(this: Duplex, callback: (error?: Error | null) => void): void;
|
|
242
242
|
read?(this: Duplex, size: number): void;
|
|
243
243
|
write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
@@ -302,9 +302,9 @@ declare module 'stream' {
|
|
|
302
302
|
function addAbortSignal<T extends Stream>(signal: AbortSignal, stream: T): T;
|
|
303
303
|
|
|
304
304
|
interface FinishedOptions extends Abortable {
|
|
305
|
-
error?: boolean;
|
|
306
|
-
readable?: boolean;
|
|
307
|
-
writable?: boolean;
|
|
305
|
+
error?: boolean | undefined;
|
|
306
|
+
readable?: boolean | undefined;
|
|
307
|
+
writable?: boolean | undefined;
|
|
308
308
|
}
|
|
309
309
|
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
|
|
310
310
|
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
|
node/timers.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare module 'timers' {
|
|
|
8
8
|
* should not require the Node.js event loop to remain active.
|
|
9
9
|
* @default true
|
|
10
10
|
*/
|
|
11
|
-
ref?: boolean;
|
|
11
|
+
ref?: boolean | undefined;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
let setTimeout: typeof global.setTimeout;
|
|
@@ -40,18 +40,27 @@ declare module 'timers' {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout;
|
|
43
|
+
// util.promisify no rest args compability
|
|
44
|
+
// tslint:disable-next-line void-return
|
|
45
|
+
function setTimeout(callback: (args: void) => void): NodeJS.Timeout;
|
|
43
46
|
namespace setTimeout {
|
|
44
47
|
const __promisify__: typeof setTimeoutPromise;
|
|
45
48
|
}
|
|
46
49
|
function clearTimeout(timeoutId: NodeJS.Timeout): void;
|
|
47
50
|
|
|
48
51
|
function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
|
|
52
|
+
// util.promisify no rest args compability
|
|
53
|
+
// tslint:disable-next-line void-return
|
|
54
|
+
function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer;
|
|
49
55
|
namespace setInterval {
|
|
50
56
|
const __promisify__: typeof setIntervalPromise;
|
|
51
57
|
}
|
|
52
58
|
function clearInterval(intervalId: NodeJS.Timeout): void;
|
|
53
59
|
|
|
54
60
|
function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
|
|
61
|
+
// util.promisify no rest args compability
|
|
62
|
+
// tslint:disable-next-line void-return
|
|
63
|
+
function setImmediate(callback: (args: void) => void): NodeJS.Immediate;
|
|
55
64
|
namespace setImmediate {
|
|
56
65
|
const __promisify__: typeof setImmediatePromise;
|
|
57
66
|
}
|
node/tls.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ declare module 'tls' {
|
|
|
76
76
|
/**
|
|
77
77
|
* The name property is available only when type is 'ECDH'.
|
|
78
78
|
*/
|
|
79
|
-
name?: string;
|
|
79
|
+
name?: string | undefined;
|
|
80
80
|
/**
|
|
81
81
|
* The size of parameter of an ephemeral key exchange.
|
|
82
82
|
*/
|
|
@@ -91,7 +91,7 @@ declare module 'tls' {
|
|
|
91
91
|
/**
|
|
92
92
|
* Optional passphrase.
|
|
93
93
|
*/
|
|
94
|
-
passphrase?: string;
|
|
94
|
+
passphrase?: string | undefined;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
interface PxfObject {
|
|
@@ -102,7 +102,7 @@ declare module 'tls' {
|
|
|
102
102
|
/**
|
|
103
103
|
* Optional passphrase.
|
|
104
104
|
*/
|
|
105
|
-
passphrase?: string;
|
|
105
|
+
passphrase?: string | undefined;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
@@ -110,22 +110,22 @@ declare module 'tls' {
|
|
|
110
110
|
* If true the TLS socket will be instantiated in server-mode.
|
|
111
111
|
* Defaults to false.
|
|
112
112
|
*/
|
|
113
|
-
isServer?: boolean;
|
|
113
|
+
isServer?: boolean | undefined;
|
|
114
114
|
/**
|
|
115
115
|
* An optional net.Server instance.
|
|
116
116
|
*/
|
|
117
|
-
server?: net.Server;
|
|
117
|
+
server?: net.Server | undefined;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
120
|
* An optional Buffer instance containing a TLS session.
|
|
121
121
|
*/
|
|
122
|
-
session?: Buffer;
|
|
122
|
+
session?: Buffer | undefined;
|
|
123
123
|
/**
|
|
124
124
|
* If true, specifies that the OCSP status request extension will be
|
|
125
125
|
* added to the client hello and an 'OCSPResponse' event will be
|
|
126
126
|
* emitted on the socket before establishing a secure communication
|
|
127
127
|
*/
|
|
128
|
-
requestOCSP?: boolean;
|
|
128
|
+
requestOCSP?: boolean | undefined;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
class TLSSocket extends net.Socket {
|
|
@@ -153,7 +153,7 @@ declare module 'tls' {
|
|
|
153
153
|
* String containing the selected ALPN protocol.
|
|
154
154
|
* When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false.
|
|
155
155
|
*/
|
|
156
|
-
alpnProtocol?: string;
|
|
156
|
+
alpnProtocol?: string | undefined;
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
159
|
* Returns an object representing the local certificate. The returned
|
|
@@ -265,7 +265,7 @@ declare module 'tls' {
|
|
|
265
265
|
* is successfully completed.
|
|
266
266
|
* @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated.
|
|
267
267
|
*/
|
|
268
|
-
renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean;
|
|
268
|
+
renegotiate(options: { rejectUnauthorized?: boolean | undefined, requestCert?: boolean | undefined }, callback: (err: Error | null) => void): undefined | boolean;
|
|
269
269
|
/**
|
|
270
270
|
* Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
|
|
271
271
|
* Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
|
|
@@ -355,25 +355,25 @@ declare module 'tls' {
|
|
|
355
355
|
/**
|
|
356
356
|
* An optional TLS context object from tls.createSecureContext()
|
|
357
357
|
*/
|
|
358
|
-
secureContext?: SecureContext;
|
|
358
|
+
secureContext?: SecureContext | undefined;
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
361
|
* When enabled, TLS packet trace information is written to `stderr`. This can be
|
|
362
362
|
* used to debug TLS connection problems.
|
|
363
363
|
* @default false
|
|
364
364
|
*/
|
|
365
|
-
enableTrace?: boolean;
|
|
365
|
+
enableTrace?: boolean | undefined;
|
|
366
366
|
/**
|
|
367
367
|
* If true the server will request a certificate from clients that
|
|
368
368
|
* connect and attempt to verify that certificate. Defaults to
|
|
369
369
|
* false.
|
|
370
370
|
*/
|
|
371
|
-
requestCert?: boolean;
|
|
371
|
+
requestCert?: boolean | undefined;
|
|
372
372
|
/**
|
|
373
373
|
* An array of strings or a Buffer naming possible ALPN protocols.
|
|
374
374
|
* (Protocols should be ordered by their priority.)
|
|
375
375
|
*/
|
|
376
|
-
ALPNProtocols?: string[] | Uint8Array[] | Uint8Array;
|
|
376
|
+
ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
|
|
377
377
|
/**
|
|
378
378
|
* SNICallback(servername, cb) <Function> A function that will be
|
|
379
379
|
* called if the client supports SNI TLS extension. Two arguments
|
|
@@ -383,14 +383,14 @@ declare module 'tls' {
|
|
|
383
383
|
* SecureContext.) If SNICallback wasn't provided the default callback
|
|
384
384
|
* with high-level API will be used (see below).
|
|
385
385
|
*/
|
|
386
|
-
SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void;
|
|
386
|
+
SNICallback?: ((servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void) | undefined;
|
|
387
387
|
/**
|
|
388
388
|
* If true the server will reject any connection which is not
|
|
389
389
|
* authorized with the list of supplied CAs. This option only has an
|
|
390
390
|
* effect if requestCert is true.
|
|
391
391
|
* @default true
|
|
392
392
|
*/
|
|
393
|
-
rejectUnauthorized?: boolean;
|
|
393
|
+
rejectUnauthorized?: boolean | undefined;
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
|
|
@@ -400,17 +400,17 @@ declare module 'tls' {
|
|
|
400
400
|
* the tls.Server object whenever a handshake times out. Default:
|
|
401
401
|
* 120000 (120 seconds).
|
|
402
402
|
*/
|
|
403
|
-
handshakeTimeout?: number;
|
|
403
|
+
handshakeTimeout?: number | undefined;
|
|
404
404
|
/**
|
|
405
405
|
* The number of seconds after which a TLS session created by the
|
|
406
406
|
* server will no longer be resumable. See Session Resumption for more
|
|
407
407
|
* information. Default: 300.
|
|
408
408
|
*/
|
|
409
|
-
sessionTimeout?: number;
|
|
409
|
+
sessionTimeout?: number | undefined;
|
|
410
410
|
/**
|
|
411
411
|
* 48-bytes of cryptographically strong pseudo-random data.
|
|
412
412
|
*/
|
|
413
|
-
ticketKeys?: Buffer;
|
|
413
|
+
ticketKeys?: Buffer | undefined;
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
416
|
*
|
|
@@ -439,7 +439,7 @@ declare module 'tls' {
|
|
|
439
439
|
* in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be
|
|
440
440
|
* emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code.
|
|
441
441
|
*/
|
|
442
|
-
pskIdentityHint?: string;
|
|
442
|
+
pskIdentityHint?: string | undefined;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
interface PSKCallbackNegotation {
|
|
@@ -448,16 +448,16 @@ declare module 'tls' {
|
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
451
|
-
host?: string;
|
|
452
|
-
port?: number;
|
|
453
|
-
path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
|
|
454
|
-
socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket
|
|
455
|
-
checkServerIdentity?: typeof checkServerIdentity;
|
|
456
|
-
servername?: string; // SNI TLS Extension
|
|
457
|
-
session?: Buffer;
|
|
458
|
-
minDHSize?: number;
|
|
459
|
-
lookup?: net.LookupFunction;
|
|
460
|
-
timeout?: number;
|
|
451
|
+
host?: string | undefined;
|
|
452
|
+
port?: number | undefined;
|
|
453
|
+
path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
|
|
454
|
+
socket?: net.Socket | undefined; // Establish secure connection on a given socket rather than creating a new socket
|
|
455
|
+
checkServerIdentity?: typeof checkServerIdentity | undefined;
|
|
456
|
+
servername?: string | undefined; // SNI TLS Extension
|
|
457
|
+
session?: Buffer | undefined;
|
|
458
|
+
minDHSize?: number | undefined;
|
|
459
|
+
lookup?: net.LookupFunction | undefined;
|
|
460
|
+
timeout?: number | undefined;
|
|
461
461
|
/**
|
|
462
462
|
* When negotiating TLS-PSK (pre-shared keys), this function is called
|
|
463
463
|
* with optional identity `hint` provided by the server or `null`
|
|
@@ -580,7 +580,7 @@ declare module 'tls' {
|
|
|
580
580
|
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
|
|
581
581
|
* replaced when CAs are explicitly specified using this option.
|
|
582
582
|
*/
|
|
583
|
-
ca?: string | Buffer | Array<string | Buffer
|
|
583
|
+
ca?: string | Buffer | Array<string | Buffer> | undefined;
|
|
584
584
|
/**
|
|
585
585
|
* Cert chains in PEM format. One cert chain should be provided per
|
|
586
586
|
* private key. Each cert chain should consist of the PEM formatted
|
|
@@ -592,29 +592,29 @@ declare module 'tls' {
|
|
|
592
592
|
* intermediate certificates are not provided, the peer will not be
|
|
593
593
|
* able to validate the certificate, and the handshake will fail.
|
|
594
594
|
*/
|
|
595
|
-
cert?: string | Buffer | Array<string | Buffer
|
|
595
|
+
cert?: string | Buffer | Array<string | Buffer> | undefined;
|
|
596
596
|
/**
|
|
597
597
|
* Colon-separated list of supported signature algorithms. The list
|
|
598
598
|
* can contain digest algorithms (SHA256, MD5 etc.), public key
|
|
599
599
|
* algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
|
|
600
600
|
* 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
|
|
601
601
|
*/
|
|
602
|
-
sigalgs?: string;
|
|
602
|
+
sigalgs?: string | undefined;
|
|
603
603
|
/**
|
|
604
604
|
* Cipher suite specification, replacing the default. For more
|
|
605
605
|
* information, see modifying the default cipher suite. Permitted
|
|
606
606
|
* ciphers can be obtained via tls.getCiphers(). Cipher names must be
|
|
607
607
|
* uppercased in order for OpenSSL to accept them.
|
|
608
608
|
*/
|
|
609
|
-
ciphers?: string;
|
|
609
|
+
ciphers?: string | undefined;
|
|
610
610
|
/**
|
|
611
611
|
* Name of an OpenSSL engine which can provide the client certificate.
|
|
612
612
|
*/
|
|
613
|
-
clientCertEngine?: string;
|
|
613
|
+
clientCertEngine?: string | undefined;
|
|
614
614
|
/**
|
|
615
615
|
* PEM formatted CRLs (Certificate Revocation Lists).
|
|
616
616
|
*/
|
|
617
|
-
crl?: string | Buffer | Array<string | Buffer
|
|
617
|
+
crl?: string | Buffer | Array<string | Buffer> | undefined;
|
|
618
618
|
/**
|
|
619
619
|
* Diffie Hellman parameters, required for Perfect Forward Secrecy. Use
|
|
620
620
|
* openssl dhparam to create the parameters. The key length must be
|
|
@@ -623,7 +623,7 @@ declare module 'tls' {
|
|
|
623
623
|
* stronger security. If omitted or invalid, the parameters are
|
|
624
624
|
* silently discarded and DHE ciphers will not be available.
|
|
625
625
|
*/
|
|
626
|
-
dhparam?: string | Buffer;
|
|
626
|
+
dhparam?: string | Buffer | undefined;
|
|
627
627
|
/**
|
|
628
628
|
* A string describing a named curve or a colon separated list of curve
|
|
629
629
|
* NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
|
|
@@ -633,13 +633,13 @@ declare module 'tls' {
|
|
|
633
633
|
* name and description of each available elliptic curve. Default:
|
|
634
634
|
* tls.DEFAULT_ECDH_CURVE.
|
|
635
635
|
*/
|
|
636
|
-
ecdhCurve?: string;
|
|
636
|
+
ecdhCurve?: string | undefined;
|
|
637
637
|
/**
|
|
638
638
|
* Attempt to use the server's cipher suite preferences instead of the
|
|
639
639
|
* client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
|
|
640
640
|
* set in secureOptions
|
|
641
641
|
*/
|
|
642
|
-
honorCipherOrder?: boolean;
|
|
642
|
+
honorCipherOrder?: boolean | undefined;
|
|
643
643
|
/**
|
|
644
644
|
* Private keys in PEM format. PEM allows the option of private keys
|
|
645
645
|
* being encrypted. Encrypted keys will be decrypted with
|
|
@@ -650,18 +650,18 @@ declare module 'tls' {
|
|
|
650
650
|
* object.passphrase is optional. Encrypted keys will be decrypted with
|
|
651
651
|
* object.passphrase if provided, or options.passphrase if it is not.
|
|
652
652
|
*/
|
|
653
|
-
key?: string | Buffer | Array<Buffer | KeyObject
|
|
653
|
+
key?: string | Buffer | Array<Buffer | KeyObject> | undefined;
|
|
654
654
|
/**
|
|
655
655
|
* Name of an OpenSSL engine to get private key from. Should be used
|
|
656
656
|
* together with privateKeyIdentifier.
|
|
657
657
|
*/
|
|
658
|
-
privateKeyEngine?: string;
|
|
658
|
+
privateKeyEngine?: string | undefined;
|
|
659
659
|
/**
|
|
660
660
|
* Identifier of a private key managed by an OpenSSL engine. Should be
|
|
661
661
|
* used together with privateKeyEngine. Should not be set together with
|
|
662
662
|
* key, because both options define a private key in different ways.
|
|
663
663
|
*/
|
|
664
|
-
privateKeyIdentifier?: string;
|
|
664
|
+
privateKeyIdentifier?: string | undefined;
|
|
665
665
|
/**
|
|
666
666
|
* Optionally set the maximum TLS version to allow. One
|
|
667
667
|
* of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
|
|
@@ -670,7 +670,7 @@ declare module 'tls' {
|
|
|
670
670
|
* `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
|
|
671
671
|
* `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
|
|
672
672
|
*/
|
|
673
|
-
maxVersion?: SecureVersion;
|
|
673
|
+
maxVersion?: SecureVersion | undefined;
|
|
674
674
|
/**
|
|
675
675
|
* Optionally set the minimum TLS version to allow. One
|
|
676
676
|
* of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
|
|
@@ -681,11 +681,11 @@ declare module 'tls' {
|
|
|
681
681
|
* `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
|
|
682
682
|
* 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
|
|
683
683
|
*/
|
|
684
|
-
minVersion?: SecureVersion;
|
|
684
|
+
minVersion?: SecureVersion | undefined;
|
|
685
685
|
/**
|
|
686
686
|
* Shared passphrase used for a single private key and/or a PFX.
|
|
687
687
|
*/
|
|
688
|
-
passphrase?: string;
|
|
688
|
+
passphrase?: string | undefined;
|
|
689
689
|
/**
|
|
690
690
|
* PFX or PKCS12 encoded private key and certificate chain. pfx is an
|
|
691
691
|
* alternative to providing key and cert individually. PFX is usually
|
|
@@ -696,13 +696,13 @@ declare module 'tls' {
|
|
|
696
696
|
* object.passphrase is optional. Encrypted PFX will be decrypted with
|
|
697
697
|
* object.passphrase if provided, or options.passphrase if it is not.
|
|
698
698
|
*/
|
|
699
|
-
pfx?: string | Buffer | Array<string | Buffer | PxfObject
|
|
699
|
+
pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;
|
|
700
700
|
/**
|
|
701
701
|
* Optionally affect the OpenSSL protocol behavior, which is not
|
|
702
702
|
* usually necessary. This should be used carefully if at all! Value is
|
|
703
703
|
* a numeric bitmask of the SSL_OP_* options from OpenSSL Options
|
|
704
704
|
*/
|
|
705
|
-
secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options
|
|
705
|
+
secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options
|
|
706
706
|
/**
|
|
707
707
|
* Legacy mechanism to select the TLS protocol version to use, it does
|
|
708
708
|
* not support independent control of the minimum and maximum version,
|
|
@@ -714,23 +714,23 @@ declare module 'tls' {
|
|
|
714
714
|
* TLS versions less than 1.2, but it may be required for
|
|
715
715
|
* interoperability. Default: none, see minVersion.
|
|
716
716
|
*/
|
|
717
|
-
secureProtocol?: string;
|
|
717
|
+
secureProtocol?: string | undefined;
|
|
718
718
|
/**
|
|
719
719
|
* Opaque identifier used by servers to ensure session state is not
|
|
720
720
|
* shared between applications. Unused by clients.
|
|
721
721
|
*/
|
|
722
|
-
sessionIdContext?: string;
|
|
722
|
+
sessionIdContext?: string | undefined;
|
|
723
723
|
/**
|
|
724
724
|
* 48-bytes of cryptographically strong pseudo-random data.
|
|
725
725
|
* See Session Resumption for more information.
|
|
726
726
|
*/
|
|
727
|
-
ticketKeys?: Buffer;
|
|
727
|
+
ticketKeys?: Buffer | undefined;
|
|
728
728
|
/**
|
|
729
729
|
* The number of seconds after which a TLS session created by the
|
|
730
730
|
* server will no longer be resumable. See Session Resumption for more
|
|
731
731
|
* information. Default: 300.
|
|
732
732
|
*/
|
|
733
|
-
sessionTimeout?: number;
|
|
733
|
+
sessionTimeout?: number | undefined;
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
interface SecureContext {
|
node/ts3.6/base.d.ts
CHANGED
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
/// <reference path="../tty.d.ts" />
|
|
56
56
|
/// <reference path="../url.d.ts" />
|
|
57
57
|
/// <reference path="../util.d.ts" />
|
|
58
|
-
/// <reference path="../util/types.d.ts" />
|
|
59
58
|
/// <reference path="../v8.d.ts" />
|
|
60
59
|
/// <reference path="../vm.d.ts" />
|
|
61
60
|
/// <reference path="../worker_threads.d.ts" />
|
node/url.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
declare module 'url' {
|
|
2
|
+
import { ClientRequestArgs } from 'http';
|
|
2
3
|
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
|
|
3
4
|
|
|
4
5
|
// Input to `url.format`
|
|
5
6
|
interface UrlObject {
|
|
6
|
-
auth?: string | null;
|
|
7
|
-
hash?: string | null;
|
|
8
|
-
host?: string | null;
|
|
9
|
-
hostname?: string | null;
|
|
10
|
-
href?: string | null;
|
|
11
|
-
pathname?: string | null;
|
|
12
|
-
protocol?: string | null;
|
|
13
|
-
search?: string | null;
|
|
14
|
-
slashes?: boolean | null;
|
|
15
|
-
port?: string | number | null;
|
|
16
|
-
query?: string | null | ParsedUrlQueryInput;
|
|
7
|
+
auth?: string | null | undefined;
|
|
8
|
+
hash?: string | null | undefined;
|
|
9
|
+
host?: string | null | undefined;
|
|
10
|
+
hostname?: string | null | undefined;
|
|
11
|
+
href?: string | null | undefined;
|
|
12
|
+
pathname?: string | null | undefined;
|
|
13
|
+
protocol?: string | null | undefined;
|
|
14
|
+
search?: string | null | undefined;
|
|
15
|
+
slashes?: boolean | null | undefined;
|
|
16
|
+
port?: string | number | null | undefined;
|
|
17
|
+
query?: string | null | ParsedUrlQueryInput | undefined;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
// Output of `url.parse`
|
|
@@ -72,11 +73,17 @@ declare module 'url' {
|
|
|
72
73
|
*/
|
|
73
74
|
function pathToFileURL(url: string): URL;
|
|
74
75
|
|
|
76
|
+
/**
|
|
77
|
+
* This utility function converts a URL object into an ordinary options object as
|
|
78
|
+
* expected by the `http.request()` and `https.request()` APIs.
|
|
79
|
+
*/
|
|
80
|
+
function urlToHttpOptions(url: URL): ClientRequestArgs;
|
|
81
|
+
|
|
75
82
|
interface URLFormatOptions {
|
|
76
|
-
auth?: boolean;
|
|
77
|
-
fragment?: boolean;
|
|
78
|
-
search?: boolean;
|
|
79
|
-
unicode?: boolean;
|
|
83
|
+
auth?: boolean | undefined;
|
|
84
|
+
fragment?: boolean | undefined;
|
|
85
|
+
search?: boolean | undefined;
|
|
86
|
+
unicode?: boolean | undefined;
|
|
80
87
|
}
|
|
81
88
|
|
|
82
89
|
class URL {
|