@types/node 20.12.14 → 20.14.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 +1 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +23 -23
- node/child_process.d.ts +34 -32
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +60 -59
- node/dgram.d.ts +2 -2
- node/diagnostics_channel.d.ts +10 -1
- node/dns/promises.d.ts +7 -6
- node/dns.d.ts +23 -12
- node/domain.d.ts +1 -1
- node/events.d.ts +22 -2
- node/fs.d.ts +2 -2
- node/http.d.ts +62 -43
- node/http2.d.ts +1 -1
- node/https.d.ts +3 -3
- node/inspector.d.ts +1 -1
- node/net.d.ts +8 -5
- node/os.d.ts +2 -2
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +306 -46
- node/process.d.ts +12 -5
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline.d.ts +1 -1
- node/repl.d.ts +4 -4
- node/stream.d.ts +15 -15
- node/string_decoder.d.ts +1 -1
- node/test.d.ts +322 -74
- node/timers.d.ts +1 -1
- node/tls.d.ts +1 -1
- node/trace_events.d.ts +1 -1
- node/tty.d.ts +1 -1
- node/url.d.ts +11 -3
- node/util.d.ts +20 -4
- node/v8.d.ts +45 -1
- node/vm.d.ts +9 -6
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
node/stream.d.ts
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
*
|
16
16
|
* The `node:stream` module is useful for creating new types of stream instances.
|
17
17
|
* It is usually not necessary to use the `node:stream` module to consume streams.
|
18
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
18
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/stream.js)
|
19
19
|
*/
|
20
20
|
declare module "stream" {
|
21
21
|
import { Abortable, EventEmitter } from "node:events";
|
@@ -272,14 +272,14 @@ declare module "stream" {
|
|
272
272
|
* });
|
273
273
|
* ```
|
274
274
|
*
|
275
|
-
* The `readable.resume()` method has no effect if there is a `'readable'`event listener.
|
275
|
+
* The `readable.resume()` method has no effect if there is a `'readable'` event listener.
|
276
276
|
* @since v0.9.4
|
277
277
|
*/
|
278
278
|
resume(): this;
|
279
279
|
/**
|
280
|
-
* The `readable.isPaused()` method returns the current operating state of the `Readable`.
|
281
|
-
* used primarily by the mechanism that underlies the `readable.pipe()` method.
|
282
|
-
* there will be no reason to use this method directly.
|
280
|
+
* The `readable.isPaused()` method returns the current operating state of the `Readable`.
|
281
|
+
* This is used primarily by the mechanism that underlies the `readable.pipe()` method.
|
282
|
+
* In most typical cases, there will be no reason to use this method directly.
|
283
283
|
*
|
284
284
|
* ```js
|
285
285
|
* const readable = new stream.Readable();
|
@@ -381,8 +381,8 @@ declare module "stream" {
|
|
381
381
|
* however it is best to simply avoid calling `readable.unshift()` while in the
|
382
382
|
* process of performing a read.
|
383
383
|
* @since v0.9.11
|
384
|
-
* @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must
|
385
|
-
* streams, `chunk` may be any JavaScript value.
|
384
|
+
* @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must
|
385
|
+
* be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value.
|
386
386
|
* @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.
|
387
387
|
*/
|
388
388
|
unshift(chunk: any, encoding?: BufferEncoding): void;
|
@@ -782,8 +782,8 @@ declare module "stream" {
|
|
782
782
|
*
|
783
783
|
* A `Writable` stream in object mode will always ignore the `encoding` argument.
|
784
784
|
* @since v0.9.4
|
785
|
-
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string,
|
786
|
-
* JavaScript value other than `null`.
|
785
|
+
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
|
786
|
+
* {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
|
787
787
|
* @param [encoding='utf8'] The encoding, if `chunk` is a string.
|
788
788
|
* @param callback Callback for when this chunk of data is flushed.
|
789
789
|
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
@@ -813,8 +813,8 @@ declare module "stream" {
|
|
813
813
|
* // Writing more now is not allowed!
|
814
814
|
* ```
|
815
815
|
* @since v0.9.4
|
816
|
-
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string,
|
817
|
-
* JavaScript value other than `null`.
|
816
|
+
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
|
817
|
+
* {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
|
818
818
|
* @param encoding The encoding if `chunk` is a string
|
819
819
|
* @param callback Callback for when the stream is finished.
|
820
820
|
*/
|
@@ -1300,8 +1300,8 @@ declare module "stream" {
|
|
1300
1300
|
* Attaches an AbortSignal to a readable or writeable stream. This lets code
|
1301
1301
|
* control stream destruction using an `AbortController`.
|
1302
1302
|
*
|
1303
|
-
* Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as
|
1304
|
-
*
|
1303
|
+
* Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` on the
|
1304
|
+
* stream, and `controller.error(new AbortError())` for webstreams.
|
1305
1305
|
*
|
1306
1306
|
* ```js
|
1307
1307
|
* const fs = require('node:fs');
|
@@ -1417,7 +1417,7 @@ declare module "stream" {
|
|
1417
1417
|
* Especially useful in error handling scenarios where a stream is destroyed
|
1418
1418
|
* prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`.
|
1419
1419
|
*
|
1420
|
-
* The `finished` API provides [promise version](https://nodejs.org/docs/latest-v20.x/api/stream.html#streamfinishedstream-options).
|
1420
|
+
* The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streamfinishedstream-options).
|
1421
1421
|
*
|
1422
1422
|
* `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been
|
1423
1423
|
* invoked. The reason for this is so that unexpected `'error'` events (due to
|
@@ -1505,7 +1505,7 @@ declare module "stream" {
|
|
1505
1505
|
* );
|
1506
1506
|
* ```
|
1507
1507
|
*
|
1508
|
-
* The `pipeline` API provides a [promise version](https://nodejs.org/docs/latest-v20.x/api/stream.html#streampipelinesource-transforms-destination-options).
|
1508
|
+
* The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streampipelinesource-transforms-destination-options).
|
1509
1509
|
*
|
1510
1510
|
* `stream.pipeline()` will call `stream.destroy(err)` on all streams except:
|
1511
1511
|
*
|
node/string_decoder.d.ts
CHANGED
@@ -36,7 +36,7 @@
|
|
36
36
|
* decoder.write(Buffer.from([0x82]));
|
37
37
|
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
|
38
38
|
* ```
|
39
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
39
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/string_decoder.js)
|
40
40
|
*/
|
41
41
|
declare module "string_decoder" {
|
42
42
|
class StringDecoder {
|