@types/node 18.16.2 → 20.0.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 +68 -73
- node/async_hooks.d.ts +62 -42
- node/buffer.d.ts +123 -95
- node/child_process.d.ts +50 -54
- node/cluster.d.ts +12 -12
- node/console.d.ts +5 -5
- node/crypto.d.ts +209 -220
- node/dgram.d.ts +15 -15
- node/diagnostics_channel.d.ts +25 -26
- node/dns/promises.d.ts +6 -6
- node/dns.d.ts +16 -16
- node/domain.d.ts +3 -3
- node/events.d.ts +60 -60
- node/fs/promises.d.ts +74 -48
- node/fs.d.ts +91 -81
- node/http.d.ts +147 -144
- node/http2.d.ts +42 -46
- node/https.d.ts +52 -153
- node/index.d.ts +1 -1
- node/inspector.d.ts +10 -3
- node/module.d.ts +5 -4
- node/net.d.ts +21 -18
- node/os.d.ts +22 -18
- node/package.json +2 -2
- node/path.d.ts +4 -4
- node/perf_hooks.d.ts +28 -15
- node/process.d.ts +43 -46
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +5 -5
- node/readline/promises.d.ts +6 -4
- node/readline.d.ts +15 -15
- node/repl.d.ts +9 -9
- node/stream/consumers.d.ts +1 -1
- node/stream.d.ts +74 -136
- node/string_decoder.d.ts +6 -6
- node/test.d.ts +0 -76
- node/timers/promises.d.ts +3 -3
- node/timers.d.ts +2 -2
- node/tls.d.ts +29 -15
- node/trace_events.d.ts +20 -9
- node/ts4.8/assert.d.ts +68 -73
- node/ts4.8/async_hooks.d.ts +59 -31
- node/ts4.8/buffer.d.ts +123 -95
- node/ts4.8/child_process.d.ts +50 -54
- node/ts4.8/cluster.d.ts +12 -12
- node/ts4.8/console.d.ts +5 -5
- node/ts4.8/crypto.d.ts +209 -220
- node/ts4.8/dgram.d.ts +15 -15
- node/ts4.8/diagnostics_channel.d.ts +25 -26
- node/ts4.8/dns/promises.d.ts +6 -6
- node/ts4.8/dns.d.ts +16 -16
- node/ts4.8/domain.d.ts +3 -3
- node/ts4.8/events.d.ts +60 -60
- node/ts4.8/fs/promises.d.ts +72 -45
- node/ts4.8/fs.d.ts +81 -67
- node/ts4.8/http.d.ts +133 -126
- node/ts4.8/http2.d.ts +42 -46
- node/ts4.8/https.d.ts +52 -153
- node/ts4.8/inspector.d.ts +10 -3
- node/ts4.8/module.d.ts +5 -4
- node/ts4.8/net.d.ts +21 -18
- node/ts4.8/os.d.ts +22 -18
- node/ts4.8/path.d.ts +4 -4
- node/ts4.8/perf_hooks.d.ts +28 -15
- node/ts4.8/process.d.ts +43 -46
- node/ts4.8/punycode.d.ts +1 -1
- node/ts4.8/querystring.d.ts +5 -5
- node/ts4.8/readline/promises.d.ts +6 -4
- node/ts4.8/readline.d.ts +15 -15
- node/ts4.8/repl.d.ts +9 -9
- node/ts4.8/stream/consumers.d.ts +1 -1
- node/ts4.8/stream.d.ts +77 -139
- node/ts4.8/string_decoder.d.ts +6 -6
- node/ts4.8/test.d.ts +0 -75
- node/ts4.8/timers/promises.d.ts +3 -3
- node/ts4.8/timers.d.ts +2 -2
- node/ts4.8/tls.d.ts +29 -15
- node/ts4.8/trace_events.d.ts +20 -9
- node/ts4.8/tty.d.ts +4 -5
- node/ts4.8/url.d.ts +26 -36
- node/ts4.8/util.d.ts +143 -116
- node/ts4.8/v8.d.ts +107 -16
- node/ts4.8/vm.d.ts +292 -42
- node/ts4.8/wasi.d.ts +8 -14
- node/ts4.8/worker_threads.d.ts +32 -34
- node/ts4.8/zlib.d.ts +11 -11
- node/tty.d.ts +4 -5
- node/url.d.ts +26 -36
- node/util.d.ts +146 -111
- node/v8.d.ts +110 -16
- node/vm.d.ts +292 -42
- node/wasi.d.ts +8 -14
- node/worker_threads.d.ts +32 -34
- node/zlib.d.ts +11 -11
node/https.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
|
3
3
|
* separate module.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/https.js)
|
|
5
5
|
*/
|
|
6
6
|
declare module 'https' {
|
|
7
7
|
import { Duplex } from 'node:stream';
|
|
@@ -59,22 +59,9 @@ declare module 'https' {
|
|
|
59
59
|
closeIdleConnections(): void;
|
|
60
60
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
61
61
|
addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
62
|
-
addListener(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
): this;
|
|
66
|
-
addListener(
|
|
67
|
-
event: 'OCSPRequest',
|
|
68
|
-
listener: (
|
|
69
|
-
certificate: Buffer,
|
|
70
|
-
issuer: Buffer,
|
|
71
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
72
|
-
) => void,
|
|
73
|
-
): this;
|
|
74
|
-
addListener(
|
|
75
|
-
event: 'resumeSession',
|
|
76
|
-
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
77
|
-
): this;
|
|
62
|
+
addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
|
63
|
+
addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
|
64
|
+
addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
|
78
65
|
addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
79
66
|
addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
80
67
|
addListener(event: 'close', listener: () => void): this;
|
|
@@ -84,29 +71,13 @@ declare module 'https' {
|
|
|
84
71
|
addListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
|
|
85
72
|
addListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
|
|
86
73
|
addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
|
87
|
-
addListener(
|
|
88
|
-
event: 'connect',
|
|
89
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
90
|
-
): this;
|
|
74
|
+
addListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
91
75
|
addListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
|
|
92
|
-
addListener(
|
|
93
|
-
event: 'upgrade',
|
|
94
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
95
|
-
): this;
|
|
76
|
+
addListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
96
77
|
emit(event: string, ...args: any[]): boolean;
|
|
97
78
|
emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean;
|
|
98
|
-
emit(
|
|
99
|
-
|
|
100
|
-
sessionId: Buffer,
|
|
101
|
-
sessionData: Buffer,
|
|
102
|
-
callback: (err: Error, resp: Buffer) => void,
|
|
103
|
-
): boolean;
|
|
104
|
-
emit(
|
|
105
|
-
event: 'OCSPRequest',
|
|
106
|
-
certificate: Buffer,
|
|
107
|
-
issuer: Buffer,
|
|
108
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
109
|
-
): boolean;
|
|
79
|
+
emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean;
|
|
80
|
+
emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
|
|
110
81
|
emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
|
|
111
82
|
emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean;
|
|
112
83
|
emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean;
|
|
@@ -117,39 +88,32 @@ declare module 'https' {
|
|
|
117
88
|
emit(
|
|
118
89
|
event: 'checkContinue',
|
|
119
90
|
req: InstanceType<Request>,
|
|
120
|
-
res: InstanceType<Response> & {
|
|
91
|
+
res: InstanceType<Response> & {
|
|
92
|
+
req: InstanceType<Request>;
|
|
93
|
+
}
|
|
121
94
|
): boolean;
|
|
122
95
|
emit(
|
|
123
96
|
event: 'checkExpectation',
|
|
124
97
|
req: InstanceType<Request>,
|
|
125
|
-
res: InstanceType<Response> & {
|
|
98
|
+
res: InstanceType<Response> & {
|
|
99
|
+
req: InstanceType<Request>;
|
|
100
|
+
}
|
|
126
101
|
): boolean;
|
|
127
102
|
emit(event: 'clientError', err: Error, socket: Duplex): boolean;
|
|
128
103
|
emit(event: 'connect', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
|
129
104
|
emit(
|
|
130
105
|
event: 'request',
|
|
131
106
|
req: InstanceType<Request>,
|
|
132
|
-
res: InstanceType<Response> & {
|
|
107
|
+
res: InstanceType<Response> & {
|
|
108
|
+
req: InstanceType<Request>;
|
|
109
|
+
}
|
|
133
110
|
): boolean;
|
|
134
111
|
emit(event: 'upgrade', req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
|
135
112
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
136
113
|
on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
137
|
-
on(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
): this;
|
|
141
|
-
on(
|
|
142
|
-
event: 'OCSPRequest',
|
|
143
|
-
listener: (
|
|
144
|
-
certificate: Buffer,
|
|
145
|
-
issuer: Buffer,
|
|
146
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
147
|
-
) => void,
|
|
148
|
-
): this;
|
|
149
|
-
on(
|
|
150
|
-
event: 'resumeSession',
|
|
151
|
-
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
152
|
-
): this;
|
|
114
|
+
on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
|
115
|
+
on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
|
116
|
+
on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
|
153
117
|
on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
154
118
|
on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
155
119
|
on(event: 'close', listener: () => void): this;
|
|
@@ -164,22 +128,9 @@ declare module 'https' {
|
|
|
164
128
|
on(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
165
129
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
166
130
|
once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
167
|
-
once(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
): this;
|
|
171
|
-
once(
|
|
172
|
-
event: 'OCSPRequest',
|
|
173
|
-
listener: (
|
|
174
|
-
certificate: Buffer,
|
|
175
|
-
issuer: Buffer,
|
|
176
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
177
|
-
) => void,
|
|
178
|
-
): this;
|
|
179
|
-
once(
|
|
180
|
-
event: 'resumeSession',
|
|
181
|
-
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
182
|
-
): this;
|
|
131
|
+
once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
|
132
|
+
once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
|
133
|
+
once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
|
183
134
|
once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
184
135
|
once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
185
136
|
once(event: 'close', listener: () => void): this;
|
|
@@ -194,22 +145,9 @@ declare module 'https' {
|
|
|
194
145
|
once(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
195
146
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
196
147
|
prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
197
|
-
prependListener(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
): this;
|
|
201
|
-
prependListener(
|
|
202
|
-
event: 'OCSPRequest',
|
|
203
|
-
listener: (
|
|
204
|
-
certificate: Buffer,
|
|
205
|
-
issuer: Buffer,
|
|
206
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
207
|
-
) => void,
|
|
208
|
-
): this;
|
|
209
|
-
prependListener(
|
|
210
|
-
event: 'resumeSession',
|
|
211
|
-
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
212
|
-
): this;
|
|
148
|
+
prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
|
149
|
+
prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
|
150
|
+
prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
|
213
151
|
prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
214
152
|
prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
215
153
|
prependListener(event: 'close', listener: () => void): this;
|
|
@@ -219,33 +157,14 @@ declare module 'https' {
|
|
|
219
157
|
prependListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
|
|
220
158
|
prependListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
|
|
221
159
|
prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
|
222
|
-
prependListener(
|
|
223
|
-
event: 'connect',
|
|
224
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
225
|
-
): this;
|
|
160
|
+
prependListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
226
161
|
prependListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
|
|
227
|
-
prependListener(
|
|
228
|
-
event: 'upgrade',
|
|
229
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
230
|
-
): this;
|
|
162
|
+
prependListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
231
163
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
232
164
|
prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
233
|
-
prependOnceListener(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
): this;
|
|
237
|
-
prependOnceListener(
|
|
238
|
-
event: 'OCSPRequest',
|
|
239
|
-
listener: (
|
|
240
|
-
certificate: Buffer,
|
|
241
|
-
issuer: Buffer,
|
|
242
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
243
|
-
) => void,
|
|
244
|
-
): this;
|
|
245
|
-
prependOnceListener(
|
|
246
|
-
event: 'resumeSession',
|
|
247
|
-
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
|
248
|
-
): this;
|
|
165
|
+
prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
|
|
166
|
+
prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
|
|
167
|
+
prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
|
|
249
168
|
prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
250
169
|
prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
251
170
|
prependOnceListener(event: 'close', listener: () => void): this;
|
|
@@ -255,25 +174,19 @@ declare module 'https' {
|
|
|
255
174
|
prependOnceListener(event: 'checkContinue', listener: http.RequestListener<Request, Response>): this;
|
|
256
175
|
prependOnceListener(event: 'checkExpectation', listener: http.RequestListener<Request, Response>): this;
|
|
257
176
|
prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this;
|
|
258
|
-
prependOnceListener(
|
|
259
|
-
event: 'connect',
|
|
260
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
261
|
-
): this;
|
|
177
|
+
prependOnceListener(event: 'connect', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
262
178
|
prependOnceListener(event: 'request', listener: http.RequestListener<Request, Response>): this;
|
|
263
|
-
prependOnceListener(
|
|
264
|
-
event: 'upgrade',
|
|
265
|
-
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
|
266
|
-
): this;
|
|
179
|
+
prependOnceListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
|
267
180
|
}
|
|
268
181
|
/**
|
|
269
182
|
* ```js
|
|
270
183
|
* // curl -k https://localhost:8000/
|
|
271
|
-
* const https = require('https');
|
|
272
|
-
* const fs = require('fs');
|
|
184
|
+
* const https = require('node:https');
|
|
185
|
+
* const fs = require('node:fs');
|
|
273
186
|
*
|
|
274
187
|
* const options = {
|
|
275
188
|
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
276
|
-
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
|
|
189
|
+
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
|
277
190
|
* };
|
|
278
191
|
*
|
|
279
192
|
* https.createServer(options, (req, res) => {
|
|
@@ -285,12 +198,12 @@ declare module 'https' {
|
|
|
285
198
|
* Or
|
|
286
199
|
*
|
|
287
200
|
* ```js
|
|
288
|
-
* const https = require('https');
|
|
289
|
-
* const fs = require('fs');
|
|
201
|
+
* const https = require('node:https');
|
|
202
|
+
* const fs = require('node:fs');
|
|
290
203
|
*
|
|
291
204
|
* const options = {
|
|
292
205
|
* pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
|
|
293
|
-
* passphrase: 'sample'
|
|
206
|
+
* passphrase: 'sample',
|
|
294
207
|
* };
|
|
295
208
|
*
|
|
296
209
|
* https.createServer(options, (req, res) => {
|
|
@@ -326,13 +239,13 @@ declare module 'https' {
|
|
|
326
239
|
* upload a file with a POST request, then write to the `ClientRequest` object.
|
|
327
240
|
*
|
|
328
241
|
* ```js
|
|
329
|
-
* const https = require('https');
|
|
242
|
+
* const https = require('node:https');
|
|
330
243
|
*
|
|
331
244
|
* const options = {
|
|
332
245
|
* hostname: 'encrypted.google.com',
|
|
333
246
|
* port: 443,
|
|
334
247
|
* path: '/',
|
|
335
|
-
* method: 'GET'
|
|
248
|
+
* method: 'GET',
|
|
336
249
|
* };
|
|
337
250
|
*
|
|
338
251
|
* const req = https.request(options, (res) => {
|
|
@@ -359,7 +272,7 @@ declare module 'https' {
|
|
|
359
272
|
* path: '/',
|
|
360
273
|
* method: 'GET',
|
|
361
274
|
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
362
|
-
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
|
|
275
|
+
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
|
363
276
|
* };
|
|
364
277
|
* options.agent = new https.Agent(options);
|
|
365
278
|
*
|
|
@@ -378,7 +291,7 @@ declare module 'https' {
|
|
|
378
291
|
* method: 'GET',
|
|
379
292
|
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
380
293
|
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
|
381
|
-
* agent: false
|
|
294
|
+
* agent: false,
|
|
382
295
|
* };
|
|
383
296
|
*
|
|
384
297
|
* const req = https.request(options, (res) => {
|
|
@@ -399,9 +312,9 @@ declare module 'https' {
|
|
|
399
312
|
* Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
|
|
400
313
|
*
|
|
401
314
|
* ```js
|
|
402
|
-
* const tls = require('tls');
|
|
403
|
-
* const https = require('https');
|
|
404
|
-
* const crypto = require('crypto');
|
|
315
|
+
* const tls = require('node:tls');
|
|
316
|
+
* const https = require('node:https');
|
|
317
|
+
* const crypto = require('node:crypto');
|
|
405
318
|
*
|
|
406
319
|
* function sha256(s) {
|
|
407
320
|
* return crypto.createHash('sha256').update(s).digest('base64');
|
|
@@ -418,7 +331,7 @@ declare module 'https' {
|
|
|
418
331
|
* return err;
|
|
419
332
|
* }
|
|
420
333
|
*
|
|
421
|
-
* // Pin the public key, similar to HPKP pin-
|
|
334
|
+
* // Pin the public key, similar to HPKP pin-sha256 pinning
|
|
422
335
|
* const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';
|
|
423
336
|
* if (sha256(cert.pubkey) !== pubkey256) {
|
|
424
337
|
* const msg = 'Certificate verification error: ' +
|
|
@@ -493,15 +406,8 @@ declare module 'https' {
|
|
|
493
406
|
* @since v0.3.6
|
|
494
407
|
* @param options Accepts all `options` from `request`, with some differences in default values:
|
|
495
408
|
*/
|
|
496
|
-
function request(
|
|
497
|
-
|
|
498
|
-
callback?: (res: http.IncomingMessage) => void,
|
|
499
|
-
): http.ClientRequest;
|
|
500
|
-
function request(
|
|
501
|
-
url: string | URL,
|
|
502
|
-
options: RequestOptions,
|
|
503
|
-
callback?: (res: http.IncomingMessage) => void,
|
|
504
|
-
): http.ClientRequest;
|
|
409
|
+
function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
410
|
+
function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
505
411
|
/**
|
|
506
412
|
* Like `http.get()` but for HTTPS.
|
|
507
413
|
*
|
|
@@ -509,7 +415,7 @@ declare module 'https' {
|
|
|
509
415
|
* string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
|
|
510
416
|
*
|
|
511
417
|
* ```js
|
|
512
|
-
* const https = require('https');
|
|
418
|
+
* const https = require('node:https');
|
|
513
419
|
*
|
|
514
420
|
* https.get('https://encrypted.google.com/', (res) => {
|
|
515
421
|
* console.log('statusCode:', res.statusCode);
|
|
@@ -526,15 +432,8 @@ declare module 'https' {
|
|
|
526
432
|
* @since v0.3.6
|
|
527
433
|
* @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`.
|
|
528
434
|
*/
|
|
529
|
-
function get(
|
|
530
|
-
|
|
531
|
-
callback?: (res: http.IncomingMessage) => void,
|
|
532
|
-
): http.ClientRequest;
|
|
533
|
-
function get(
|
|
534
|
-
url: string | URL,
|
|
535
|
-
options: RequestOptions,
|
|
536
|
-
callback?: (res: http.IncomingMessage) => void,
|
|
537
|
-
): http.ClientRequest;
|
|
435
|
+
function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
436
|
+
function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
538
437
|
let globalAgent: Agent;
|
|
539
438
|
}
|
|
540
439
|
declare module 'node:https' {
|
node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for non-npm package Node.js
|
|
1
|
+
// Type definitions for non-npm package Node.js 20.0
|
|
2
2
|
// Project: https://nodejs.org/
|
|
3
3
|
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
|
4
4
|
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
node/inspector.d.ts
CHANGED
|
@@ -8,14 +8,21 @@
|
|
|
8
8
|
// tslint:disable:max-line-length
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The `inspector` module provides an API for interacting with the V8
|
|
11
|
+
* The `node:inspector` module provides an API for interacting with the V8
|
|
12
|
+
* inspector.
|
|
12
13
|
*
|
|
13
14
|
* It can be accessed using:
|
|
14
15
|
*
|
|
15
16
|
* ```js
|
|
16
|
-
*
|
|
17
|
+
* import * as inspector from 'node:inspector/promises';
|
|
17
18
|
* ```
|
|
18
|
-
*
|
|
19
|
+
*
|
|
20
|
+
* or
|
|
21
|
+
*
|
|
22
|
+
* ```js
|
|
23
|
+
* import * as inspector from 'node:inspector';
|
|
24
|
+
* ```
|
|
25
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/inspector.js)
|
|
19
26
|
*/
|
|
20
27
|
declare module 'inspector' {
|
|
21
28
|
import EventEmitter = require('node:events');
|
node/module.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ declare module 'module' {
|
|
|
10
10
|
* does not add or remove exported names from the `ES Modules`.
|
|
11
11
|
*
|
|
12
12
|
* ```js
|
|
13
|
-
* const fs = require('fs');
|
|
14
|
-
* const assert = require('assert');
|
|
15
|
-
* const { syncBuiltinESMExports } = require('module');
|
|
13
|
+
* const fs = require('node:fs');
|
|
14
|
+
* const assert = require('node:assert');
|
|
15
|
+
* const { syncBuiltinESMExports } = require('node:module');
|
|
16
16
|
*
|
|
17
17
|
* fs.readFile = newAPI;
|
|
18
18
|
*
|
|
@@ -26,7 +26,7 @@ declare module 'module' {
|
|
|
26
26
|
*
|
|
27
27
|
* syncBuiltinESMExports();
|
|
28
28
|
*
|
|
29
|
-
* import('fs').then((esmFS) => {
|
|
29
|
+
* import('node:fs').then((esmFS) => {
|
|
30
30
|
* // It syncs the existing readFile property with the new value
|
|
31
31
|
* assert.strictEqual(esmFS.readFile, newAPI);
|
|
32
32
|
* // readFileSync has been deleted from the required fs
|
|
@@ -44,6 +44,7 @@ declare module 'module' {
|
|
|
44
44
|
* `path` is the resolved path for the file for which a corresponding source map
|
|
45
45
|
* should be fetched.
|
|
46
46
|
* @since v13.7.0, v12.17.0
|
|
47
|
+
* @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise.
|
|
47
48
|
*/
|
|
48
49
|
function findSourceMap(path: string, error?: Error): SourceMap;
|
|
49
50
|
interface SourceMapPayload {
|
node/net.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* > Stability: 2 - Stable
|
|
3
3
|
*
|
|
4
|
-
* The `net` module provides an asynchronous network API for creating stream-based
|
|
4
|
+
* The `node:net` module provides an asynchronous network API for creating stream-based
|
|
5
5
|
* TCP or `IPC` servers ({@link createServer}) and clients
|
|
6
6
|
* ({@link createConnection}).
|
|
7
7
|
*
|
|
8
8
|
* It can be accessed using:
|
|
9
9
|
*
|
|
10
10
|
* ```js
|
|
11
|
-
* const net = require('net');
|
|
11
|
+
* const net = require('node:net');
|
|
12
12
|
* ```
|
|
13
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
13
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/net.js)
|
|
14
14
|
*/
|
|
15
15
|
declare module 'net' {
|
|
16
16
|
import * as stream from 'node:stream';
|
|
@@ -141,13 +141,10 @@ declare module 'net' {
|
|
|
141
141
|
pause(): this;
|
|
142
142
|
/**
|
|
143
143
|
* Close the TCP connection by sending an RST packet and destroy the stream.
|
|
144
|
-
* If this TCP socket is in connecting status, it will send an RST packet
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* an `ERR_INVALID_HANDLE_TYPE` Error.
|
|
149
|
-
* @since v18.3.0
|
|
150
|
-
* @return The socket itself.
|
|
144
|
+
* If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected.
|
|
145
|
+
* Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error.
|
|
146
|
+
* If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error.
|
|
147
|
+
* @since v18.3.0, v16.17.0
|
|
151
148
|
*/
|
|
152
149
|
resetAndDestroy(): this;
|
|
153
150
|
/**
|
|
@@ -270,9 +267,9 @@ declare module 'net' {
|
|
|
270
267
|
*/
|
|
271
268
|
readonly connecting: boolean;
|
|
272
269
|
/**
|
|
273
|
-
* This is `true` if the socket is not connected yet, either because `.connect()`
|
|
274
|
-
*
|
|
275
|
-
* @since v10.16.0
|
|
270
|
+
* This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting
|
|
271
|
+
* (see `socket.connecting`).
|
|
272
|
+
* @since v11.2.0, v10.16.0
|
|
276
273
|
*/
|
|
277
274
|
readonly pending: boolean;
|
|
278
275
|
/**
|
|
@@ -293,12 +290,16 @@ declare module 'net' {
|
|
|
293
290
|
readonly localPort?: number;
|
|
294
291
|
/**
|
|
295
292
|
* The string representation of the local IP family. `'IPv4'` or `'IPv6'`.
|
|
296
|
-
* @since v18.8.0
|
|
293
|
+
* @since v18.8.0, v16.18.0
|
|
297
294
|
*/
|
|
298
295
|
readonly localFamily?: string;
|
|
299
296
|
/**
|
|
300
297
|
* This property represents the state of the connection as a string.
|
|
301
|
-
*
|
|
298
|
+
*
|
|
299
|
+
* * If the stream is connecting `socket.readyState` is `opening`.
|
|
300
|
+
* * If the stream is readable and writable, it is `open`.
|
|
301
|
+
* * If the stream is readable and not writable, it is `readOnly`.
|
|
302
|
+
* * If the stream is not readable and writable, it is `writeOnly`.
|
|
302
303
|
* @since v0.5.0
|
|
303
304
|
*/
|
|
304
305
|
readonly readyState: SocketReadyState;
|
|
@@ -319,7 +320,8 @@ declare module 'net' {
|
|
|
319
320
|
*/
|
|
320
321
|
readonly remotePort?: number | undefined;
|
|
321
322
|
/**
|
|
322
|
-
* The socket timeout in milliseconds as set by socket.setTimeout()
|
|
323
|
+
* The socket timeout in milliseconds as set by `socket.setTimeout()`.
|
|
324
|
+
* It is `undefined` if a timeout has not been set.
|
|
323
325
|
* @since v10.7.0
|
|
324
326
|
*/
|
|
325
327
|
readonly timeout?: number | undefined;
|
|
@@ -500,7 +502,7 @@ declare module 'net' {
|
|
|
500
502
|
* ```js
|
|
501
503
|
* server.on('error', (e) => {
|
|
502
504
|
* if (e.code === 'EADDRINUSE') {
|
|
503
|
-
* console.
|
|
505
|
+
* console.error('Address in use, retrying...');
|
|
504
506
|
* setTimeout(() => {
|
|
505
507
|
* server.close();
|
|
506
508
|
* server.listen(PORT, HOST);
|
|
@@ -722,7 +724,7 @@ declare module 'net' {
|
|
|
722
724
|
* on port 8124:
|
|
723
725
|
*
|
|
724
726
|
* ```js
|
|
725
|
-
* const net = require('net');
|
|
727
|
+
* const net = require('node:net');
|
|
726
728
|
* const server = net.createServer((c) => {
|
|
727
729
|
* // 'connection' listener.
|
|
728
730
|
* console.log('client connected');
|
|
@@ -860,6 +862,7 @@ declare module 'net' {
|
|
|
860
862
|
class SocketAddress {
|
|
861
863
|
constructor(options: SocketAddressInitOptions);
|
|
862
864
|
/**
|
|
865
|
+
* Either \`'ipv4'\` or \`'ipv6'\`.
|
|
863
866
|
* @since v15.14.0, v14.18.0
|
|
864
867
|
*/
|
|
865
868
|
readonly address: string;
|
node/os.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `os` module provides operating system-related utility methods and
|
|
2
|
+
* The `node:os` module provides operating system-related utility methods and
|
|
3
3
|
* properties. It can be accessed using:
|
|
4
4
|
*
|
|
5
5
|
* ```js
|
|
6
|
-
* const os = require('os');
|
|
6
|
+
* const os = require('node:os');
|
|
7
7
|
* ```
|
|
8
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/os.js)
|
|
9
9
|
*/
|
|
10
10
|
declare module 'os' {
|
|
11
11
|
interface CpuInfo {
|
|
@@ -75,6 +75,7 @@ declare module 'os' {
|
|
|
75
75
|
function totalmem(): number;
|
|
76
76
|
/**
|
|
77
77
|
* Returns an array of objects containing information about each logical CPU core.
|
|
78
|
+
* The array will be empty if no CPU information is available, such as if the`/proc` file system is unavailable.
|
|
78
79
|
*
|
|
79
80
|
* The properties included on each object include:
|
|
80
81
|
*
|
|
@@ -88,8 +89,8 @@ declare module 'os' {
|
|
|
88
89
|
* nice: 0,
|
|
89
90
|
* sys: 30340,
|
|
90
91
|
* idle: 1070356870,
|
|
91
|
-
* irq: 0
|
|
92
|
-
* }
|
|
92
|
+
* irq: 0,
|
|
93
|
+
* },
|
|
93
94
|
* },
|
|
94
95
|
* {
|
|
95
96
|
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
|
@@ -99,8 +100,8 @@ declare module 'os' {
|
|
|
99
100
|
* nice: 0,
|
|
100
101
|
* sys: 26980,
|
|
101
102
|
* idle: 1071569080,
|
|
102
|
-
* irq: 0
|
|
103
|
-
* }
|
|
103
|
+
* irq: 0,
|
|
104
|
+
* },
|
|
104
105
|
* },
|
|
105
106
|
* {
|
|
106
107
|
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
|
@@ -110,8 +111,8 @@ declare module 'os' {
|
|
|
110
111
|
* nice: 0,
|
|
111
112
|
* sys: 21750,
|
|
112
113
|
* idle: 1070919370,
|
|
113
|
-
* irq: 0
|
|
114
|
-
* }
|
|
114
|
+
* irq: 0,
|
|
115
|
+
* },
|
|
115
116
|
* },
|
|
116
117
|
* {
|
|
117
118
|
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
|
@@ -121,22 +122,26 @@ declare module 'os' {
|
|
|
121
122
|
* nice: 0,
|
|
122
123
|
* sys: 19430,
|
|
123
124
|
* idle: 1070905480,
|
|
124
|
-
* irq: 20
|
|
125
|
-
* }
|
|
125
|
+
* irq: 20,
|
|
126
|
+
* },
|
|
126
127
|
* },
|
|
127
128
|
* ]
|
|
128
129
|
* ```
|
|
129
130
|
*
|
|
130
131
|
* `nice` values are POSIX-only. On Windows, the `nice` values of all processors
|
|
131
132
|
* are always 0.
|
|
133
|
+
*
|
|
134
|
+
* `os.cpus().length` should not be used to calculate the amount of parallelism
|
|
135
|
+
* available to an application. Use {@link availableParallelism} for this purpose.
|
|
132
136
|
* @since v0.3.3
|
|
133
137
|
*/
|
|
134
138
|
function cpus(): CpuInfo[];
|
|
135
139
|
/**
|
|
136
|
-
* Returns an estimate of the default amount of parallelism a program should use.
|
|
140
|
+
* Returns an estimate of the default amount of parallelism a program should use.
|
|
141
|
+
* Always returns a value greater than zero.
|
|
137
142
|
*
|
|
138
143
|
* This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism).
|
|
139
|
-
* @since
|
|
144
|
+
* @since v19.4.0, v18.14.0
|
|
140
145
|
*/
|
|
141
146
|
function availableParallelism(): number;
|
|
142
147
|
/**
|
|
@@ -422,12 +427,11 @@ declare module 'os' {
|
|
|
422
427
|
*/
|
|
423
428
|
function platform(): NodeJS.Platform;
|
|
424
429
|
/**
|
|
425
|
-
* Returns the machine type as a string, such as arm
|
|
430
|
+
* Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`.
|
|
426
431
|
*
|
|
427
|
-
* On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname).
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
* @since v18.9.0
|
|
432
|
+
* On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
|
|
433
|
+
* available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
|
434
|
+
* @since v18.9.0, v16.18.0
|
|
431
435
|
*/
|
|
432
436
|
function machine(): string;
|
|
433
437
|
/**
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -232,6 +232,6 @@
|
|
|
232
232
|
},
|
|
233
233
|
"scripts": {},
|
|
234
234
|
"dependencies": {},
|
|
235
|
-
"typesPublisherContentHash": "
|
|
235
|
+
"typesPublisherContentHash": "5401a32b866e277b497fdc027d0aefa53bfa554c5ab72913d68a91eea49d0bc8",
|
|
236
236
|
"typeScriptVersion": "4.3"
|
|
237
237
|
}
|