@types/node 18.16.5 → 20.1.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.
Files changed (111) hide show
  1. node v18.16/README.md → node/README.md +2 -2
  2. node v18.16/ts4.8/assert.d.ts → node/assert.d.ts +71 -75
  3. node v18.16/async_hooks.d.ts → node/async_hooks.d.ts +62 -42
  4. node v18.16/buffer.d.ts → node/buffer.d.ts +127 -99
  5. node v18.16/child_process.d.ts → node/child_process.d.ts +50 -54
  6. node v18.16/ts4.8/cluster.d.ts → node/cluster.d.ts +12 -12
  7. node v18.16/ts4.8/console.d.ts → node/console.d.ts +5 -5
  8. node v18.16/crypto.d.ts → node/crypto.d.ts +209 -220
  9. node v18.16/ts4.8/dgram.d.ts → node/dgram.d.ts +15 -15
  10. node v18.16/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +25 -26
  11. node v18.16/dns/promises.d.ts → node/dns/promises.d.ts +6 -6
  12. node v18.16/ts4.8/dns.d.ts → node/dns.d.ts +24 -16
  13. node v18.16/domain.d.ts → node/domain.d.ts +4 -4
  14. node v18.16/events.d.ts → node/events.d.ts +60 -60
  15. node v18.16/fs/promises.d.ts → node/fs/promises.d.ts +78 -48
  16. node v18.16/fs.d.ts → node/fs.d.ts +117 -81
  17. node v18.16/http.d.ts → node/http.d.ts +155 -145
  18. node v18.16/ts4.8/http2.d.ts → node/http2.d.ts +42 -46
  19. node v18.16/https.d.ts → node/https.d.ts +52 -153
  20. node v18.16/index.d.ts → node/index.d.ts +1 -1
  21. node v18.16/ts4.8/inspector.d.ts → node/inspector.d.ts +10 -3
  22. node v18.16/ts4.8/module.d.ts → node/module.d.ts +5 -4
  23. node v18.16/ts4.8/net.d.ts → node/net.d.ts +24 -21
  24. node v18.16/ts4.8/os.d.ts → node/os.d.ts +22 -18
  25. node v18.16/package.json → node/package.json +2 -2
  26. node v18.16/ts4.8/path.d.ts → node/path.d.ts +4 -4
  27. node v18.16/perf_hooks.d.ts → node/perf_hooks.d.ts +28 -15
  28. node v18.16/process.d.ts → node/process.d.ts +43 -46
  29. node v18.16/ts4.8/punycode.d.ts → node/punycode.d.ts +1 -1
  30. node v18.16/ts4.8/querystring.d.ts → node/querystring.d.ts +5 -5
  31. node v18.16/readline/promises.d.ts → node/readline/promises.d.ts +6 -4
  32. node v18.16/readline.d.ts → node/readline.d.ts +15 -15
  33. node v18.16/repl.d.ts → node/repl.d.ts +9 -9
  34. node v18.16/stream/consumers.d.ts → node/stream/consumers.d.ts +1 -1
  35. node v18.16/stream.d.ts → node/stream.d.ts +88 -136
  36. node v18.16/ts4.8/string_decoder.d.ts → node/string_decoder.d.ts +6 -6
  37. node v18.16/ts4.8/test.d.ts → node/test.d.ts +423 -186
  38. node v18.16/timers/promises.d.ts → node/timers/promises.d.ts +3 -3
  39. node v18.16/timers.d.ts → node/timers.d.ts +2 -2
  40. node v18.16/ts4.8/tls.d.ts → node/tls.d.ts +24 -16
  41. node v18.16/ts4.8/trace_events.d.ts → node/trace_events.d.ts +20 -9
  42. node v18.16/assert.d.ts → node/ts4.8/assert.d.ts +71 -75
  43. node v18.16/ts4.8/async_hooks.d.ts → node/ts4.8/async_hooks.d.ts +62 -42
  44. node v18.16/ts4.8/buffer.d.ts → node/ts4.8/buffer.d.ts +127 -99
  45. node v18.16/ts4.8/child_process.d.ts → node/ts4.8/child_process.d.ts +50 -54
  46. node v18.16/cluster.d.ts → node/ts4.8/cluster.d.ts +12 -12
  47. node v18.16/console.d.ts → node/ts4.8/console.d.ts +5 -5
  48. node v18.16/ts4.8/crypto.d.ts → node/ts4.8/crypto.d.ts +209 -220
  49. node v18.16/dgram.d.ts → node/ts4.8/dgram.d.ts +15 -15
  50. node v18.16/ts4.8/diagnostics_channel.d.ts → node/ts4.8/diagnostics_channel.d.ts +25 -26
  51. node v18.16/ts4.8/dns/promises.d.ts → node/ts4.8/dns/promises.d.ts +6 -6
  52. node v18.16/dns.d.ts → node/ts4.8/dns.d.ts +24 -16
  53. node v18.16/ts4.8/domain.d.ts → node/ts4.8/domain.d.ts +4 -4
  54. node v18.16/ts4.8/events.d.ts → node/ts4.8/events.d.ts +60 -60
  55. node v18.16/ts4.8/fs/promises.d.ts → node/ts4.8/fs/promises.d.ts +96 -45
  56. node v18.16/ts4.8/fs.d.ts → node/ts4.8/fs.d.ts +203 -67
  57. node v18.16/ts4.8/globals.d.ts → node/ts4.8/globals.d.ts +29 -28
  58. node v18.16/ts4.8/http.d.ts → node/ts4.8/http.d.ts +198 -126
  59. node v18.16/http2.d.ts → node/ts4.8/http2.d.ts +42 -46
  60. node v18.16/ts4.8/https.d.ts → node/ts4.8/https.d.ts +52 -153
  61. node v18.16/inspector.d.ts → node/ts4.8/inspector.d.ts +10 -3
  62. node v18.16/module.d.ts → node/ts4.8/module.d.ts +5 -4
  63. node v18.16/net.d.ts → node/ts4.8/net.d.ts +21 -18
  64. node v18.16/os.d.ts → node/ts4.8/os.d.ts +22 -18
  65. node v18.16/path.d.ts → node/ts4.8/path.d.ts +4 -4
  66. node v18.16/ts4.8/perf_hooks.d.ts → node/ts4.8/perf_hooks.d.ts +28 -15
  67. node v18.16/ts4.8/process.d.ts → node/ts4.8/process.d.ts +43 -46
  68. node v18.16/punycode.d.ts → node/ts4.8/punycode.d.ts +1 -1
  69. node v18.16/querystring.d.ts → node/ts4.8/querystring.d.ts +5 -5
  70. node v18.16/ts4.8/readline/promises.d.ts → node/ts4.8/readline/promises.d.ts +6 -4
  71. node v18.16/ts4.8/readline.d.ts → node/ts4.8/readline.d.ts +15 -15
  72. node v18.16/ts4.8/repl.d.ts → node/ts4.8/repl.d.ts +9 -9
  73. node v18.16/ts4.8/stream/consumers.d.ts → node/ts4.8/stream/consumers.d.ts +1 -1
  74. node v18.16/ts4.8/stream.d.ts → node/ts4.8/stream.d.ts +91 -139
  75. node v18.16/string_decoder.d.ts → node/ts4.8/string_decoder.d.ts +6 -6
  76. node v18.16/test.d.ts → node/ts4.8/test.d.ts +423 -186
  77. node v18.16/ts4.8/timers/promises.d.ts → node/ts4.8/timers/promises.d.ts +3 -3
  78. node v18.16/ts4.8/timers.d.ts → node/ts4.8/timers.d.ts +9 -2
  79. node v18.16/tls.d.ts → node/ts4.8/tls.d.ts +24 -16
  80. node v18.16/trace_events.d.ts → node/ts4.8/trace_events.d.ts +20 -9
  81. node v18.16/tty.d.ts → node/ts4.8/tty.d.ts +4 -5
  82. node v18.16/ts4.8/url.d.ts → node/ts4.8/url.d.ts +26 -36
  83. node v18.16/ts4.8/util.d.ts → node/ts4.8/util.d.ts +143 -116
  84. node v18.16/ts4.8/v8.d.ts → node/ts4.8/v8.d.ts +110 -16
  85. node v18.16/vm.d.ts → node/ts4.8/vm.d.ts +292 -42
  86. node v18.16/wasi.d.ts → node/ts4.8/wasi.d.ts +13 -19
  87. node v18.16/ts4.8/worker_threads.d.ts → node/ts4.8/worker_threads.d.ts +32 -34
  88. node v18.16/zlib.d.ts → node/ts4.8/zlib.d.ts +11 -11
  89. node v18.16/ts4.8/tty.d.ts → node/tty.d.ts +4 -5
  90. node v18.16/url.d.ts → node/url.d.ts +26 -36
  91. node v18.16/util.d.ts → node/util.d.ts +146 -111
  92. node v18.16/v8.d.ts → node/v8.d.ts +110 -16
  93. node v18.16/ts4.8/vm.d.ts → node/vm.d.ts +292 -42
  94. node v18.16/ts4.8/wasi.d.ts → node/wasi.d.ts +13 -19
  95. node v18.16/worker_threads.d.ts → node/worker_threads.d.ts +32 -34
  96. node v18.16/ts4.8/zlib.d.ts → node/zlib.d.ts +11 -11
  97. {node v18.16 → node}/LICENSE +0 -0
  98. {node v18.16 → node}/assert/strict.d.ts +0 -0
  99. {node v18.16 → node}/constants.d.ts +0 -0
  100. {node v18.16 → node}/dom-events.d.ts +0 -0
  101. {node v18.16 → node}/globals.d.ts +0 -0
  102. {node v18.16 → node}/globals.global.d.ts +0 -0
  103. {node v18.16 → node}/stream/promises.d.ts +0 -0
  104. {node v18.16 → node}/stream/web.d.ts +0 -0
  105. {node v18.16 → node}/ts4.8/assert/strict.d.ts +0 -0
  106. {node v18.16 → node}/ts4.8/constants.d.ts +0 -0
  107. {node v18.16 → node}/ts4.8/dom-events.d.ts +0 -0
  108. {node v18.16 → node}/ts4.8/globals.global.d.ts +0 -0
  109. {node v18.16 → node}/ts4.8/index.d.ts +0 -0
  110. {node v18.16 → node}/ts4.8/stream/promises.d.ts +0 -0
  111. {node v18.16 → node}/ts4.8/stream/web.d.ts +0 -0
@@ -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/v18.0.0/lib/https.js)
4
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.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
- event: 'newSession',
64
- listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
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
- event: 'newSession',
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> & { req: InstanceType<Request> },
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> & { req: InstanceType<Request> },
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> & { req: InstanceType<Request> },
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
- event: 'newSession',
139
- listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
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
- event: 'newSession',
169
- listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
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
- event: 'newSession',
199
- listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
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
- event: 'newSession',
235
- listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
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-sha25 pinning
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
- options: RequestOptions | string | URL,
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
- options: RequestOptions | string | URL,
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' {
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 18.16
1
+ // Type definitions for non-npm package Node.js 20.1
2
2
  // Project: https://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
@@ -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 inspector.
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
- * const inspector = require('inspector');
17
+ * import * as inspector from 'node:inspector/promises';
17
18
  * ```
18
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/inspector.js)
19
+ *
20
+ * or
21
+ *
22
+ * ```js
23
+ * import * as inspector from 'node:inspector';
24
+ * ```
25
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/inspector.js)
19
26
  */
20
27
  declare module 'inspector' {
21
28
  import EventEmitter = require('node:events');
@@ -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 {
@@ -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/v18.0.0/lib/net.js)
13
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.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
- * and destroy this TCP socket once it is connected. Otherwise, it will call
146
- * `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. If this is not a TCP socket
147
- * (for example, a pipe), calling this method will immediately throw
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
  /**
@@ -269,6 +266,12 @@ declare module 'net' {
269
266
  * @since v6.1.0
270
267
  */
271
268
  readonly connecting: boolean;
269
+ /**
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
273
+ */
274
+ readonly pending: boolean;
272
275
  /**
273
276
  * See `writable.destroyed` for further details.
274
277
  */
@@ -287,18 +290,16 @@ declare module 'net' {
287
290
  readonly localPort?: number;
288
291
  /**
289
292
  * The string representation of the local IP family. `'IPv4'` or `'IPv6'`.
290
- * @since v18.8.0
293
+ * @since v18.8.0, v16.18.0
291
294
  */
292
295
  readonly localFamily?: string;
293
- /**
294
- * This is `true` if the socket is not connected yet, either because `.connect()`
295
- * has not yet been called or because it is still in the process of connecting (see `socket.connecting`).
296
- * @since v10.16.0
297
- */
298
- readonly pending: boolean;
299
296
  /**
300
297
  * This property represents the state of the connection as a string.
301
- * @see {https://nodejs.org/api/net.html#socketreadystate}
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(). It is undefined if a timeout has not been set.
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.log('Address in use, retrying...');
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;
@@ -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/v18.0.0/lib/os.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.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. Always returns a value greater than zero.
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 18.4.0
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, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64.
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
- * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used.
429
- * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
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
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.16.5",
3
+ "version": "20.1.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": "6e1aac9f54a4dcaad3bcb91b3bedf6d21e6dd4be465d458d94364602c52157d3",
235
+ "typesPublisherContentHash": "46c088277e9ada8db2c3c0efb4456e3995588c028063600e77389338cb57861b",
236
236
  "typeScriptVersion": "4.3"
237
237
  }