@@ -220,7 +220,7 @@ that closes when the bucket is full: |
220 | 220 |
|
221 | 221 | * **Pending writes (the hose)** -- writes waiting for slot space. After |
222 | 222 | the consumer drains, pending writes are promoted into the now-empty |
223 | | - slots and their promises resolve. |
| 223 | + slots and their promises settle. |
224 | 224 |
|
225 | 225 | How each policy uses these buffers: |
226 | 226 |
|
@@ -430,7 +430,7 @@ The value is always non-negative. |
430 | 430 | * `options` {Object} |
431 | 431 | * `signal` {AbortSignal} Cancel just this operation. The signal cancels only |
432 | 432 | the pending `end()` call; it does not fail the writer itself. |
433 | | -* Returns: {Promise\<number>} Total bytes written. |
| 433 | +* Returns: {Promise} Fulfills with the total number of bytes written. |
434 | 434 |
|
435 | 435 | Signal that no more data will be written. |
436 | 436 |
|
@@ -463,9 +463,9 @@ transition with no async work to perform. |
463 | 463 | * `options` {Object} |
464 | 464 | * `signal` {AbortSignal} Cancel just this write operation. The signal cancels |
465 | 465 | only the pending `write()` call; it does not fail the writer itself. |
466 | | -* Returns: {Promise\<void>} |
| 466 | +* Returns: {Promise} Fulfills with `undefined` when buffer space is available. |
467 | 467 |
|
468 | | -Write a chunk. The promise resolves when buffer space is available. |
| 468 | +Write a chunk. |
469 | 469 |
|
470 | 470 | #### `writer.writeSync(chunk)` |
471 | 471 |
|
@@ -481,7 +481,7 @@ Synchronous write. Does not block; returns `false` if backpressure is active. |
481 | 481 | * `options` {Object} |
482 | 482 | * `signal` {AbortSignal} Cancel just this write operation. The signal cancels |
483 | 483 | only the pending `writev()` call; it does not fail the writer itself. |
484 | | -* Returns: {Promise\<void>} |
| 484 | +* Returns: {Promise} |
485 | 485 |
|
486 | 486 | Write multiple chunks as a single batch. |
487 | 487 |
|
@@ -603,7 +603,7 @@ added: REPLACEME |
603 | 603 | the source ends. **Default:** `false`. |
604 | 604 | * `preventFail` {boolean} If `true`, do not call `writer.fail()` on |
605 | 605 | error. **Default:** `false`. |
606 | | -* Returns: {Promise\<number>} Total bytes written. |
| 606 | +* Returns: {Promise} Fulfills with the total number of bytes written. |
607 | 607 |
|
608 | 608 | Pipe a source through transforms into a writer. If the writer has a |
609 | 609 | `writev(chunks)` method, entire batches are passed in a single call (enabling |
@@ -903,7 +903,7 @@ added: REPLACEME |
903 | 903 | * `signal` {AbortSignal} |
904 | 904 | * `limit` {number} Maximum number of bytes to consume. If the total bytes |
905 | 905 | collected exceeds limit, an `ERR_OUT_OF_RANGE` error is thrown |
906 | | -* Returns: {Promise\<Uint8Array\[]>} |
| 906 | +* Returns: {Promise} Fulfills with an array of `Uint8Array` objects. |
907 | 907 |
|
908 | 908 | Collect all chunks as an array of `Uint8Array` values (without concatenating). |
909 | 909 |
|
@@ -918,7 +918,7 @@ added: REPLACEME |
918 | 918 | * `signal` {AbortSignal} |
919 | 919 | * `limit` {number} Maximum number of bytes to consume. If the total bytes |
920 | 920 | collected exceeds limit, an `ERR_OUT_OF_RANGE` error is thrown |
921 | | -* Returns: {Promise\<ArrayBuffer>} |
| 921 | +* Returns: {Promise} Fulfills with an `ArrayBuffer` object. |
922 | 922 |
|
923 | 923 | Collect all bytes into an `ArrayBuffer`. |
924 | 924 |
|
@@ -961,7 +961,7 @@ added: REPLACEME |
961 | 961 | * `signal` {AbortSignal} |
962 | 962 | * `limit` {number} Maximum number of bytes to consume. If the total bytes |
963 | 963 | collected exceeds limit, an `ERR_OUT_OF_RANGE` error is thrown |
964 | | -* Returns: {Promise\<Uint8Array>} |
| 964 | +* Returns: {Promise} Fulfills with an `Uint8Array` object. |
965 | 965 |
|
966 | 966 | Collect all bytes from a stream into a single `Uint8Array`. |
967 | 967 |
|
@@ -1009,7 +1009,7 @@ added: REPLACEME |
1009 | 1009 | * `signal` {AbortSignal} |
1010 | 1010 | * `limit` {number} Maximum number of bytes to consume. If the total bytes |
1011 | 1011 | collected exceeds limit, an `ERR_OUT_OF_RANGE` error is thrown |
1012 | | -* Returns: {Promise\<string>} |
| 1012 | +* Returns: {Promise} Fulfills with a `string`. |
1013 | 1013 |
|
1014 | 1014 | Collect all bytes and decode as text. |
1015 | 1015 |
|
@@ -1053,11 +1053,11 @@ added: REPLACEME |
1053 | 1053 | --> |
1054 | 1054 |
|
1055 | 1055 | * `drainable` {Object} An object implementing the drainable protocol. |
1056 | | -* Returns: {Promise\<boolean>|null} |
| 1056 | +* Returns: {Promise|null} |
1057 | 1057 |
|
1058 | | -Wait for a drainable writer's backpressure to clear. Returns a promise that |
1059 | | -resolves to `true` when the writer can accept more data, or `null` if the |
1060 | | -object does not implement the drainable protocol. |
| 1058 | +Wait for a drainable writer's backpressure to clear. Returns `null` if |
| 1059 | +the object does not implement the drainable protocol, or a promise that |
| 1060 | +fulfills with `true` when the writer can accept more data. |
1061 | 1061 |
|
1062 | 1062 | ```mjs |
1063 | 1063 | import { push, ondrain, text } from 'node:stream/iter'; |
@@ -1768,8 +1768,8 @@ text(consumer).then(console.log); // 'hello' |
1768 | 1768 | * Value: `Symbol.for('Stream.drainableProtocol')` |
1769 | 1769 |
|
1770 | 1770 | Implement to make a writer compatible with `ondrain()`. The method should |
1771 | | -return a promise that resolves when backpressure clears, or `null` if no |
1772 | | -backpressure. |
| 1771 | +return `null` if no backpressure, or a promise that fulfills with a truthy value |
| 1772 | +when backpressure clears. |
1773 | 1773 |
|
1774 | 1774 | ```mjs |
1775 | 1775 | import { ondrain } from 'node:stream/iter'; |
@@ -1975,8 +1975,8 @@ console.log(textSync(consumer)); // 'hello' |
1975 | 1975 | The value must be a function that converts the object into a streamable value. |
1976 | 1976 | When the object is encountered anywhere in the streaming pipeline (as a source |
1977 | 1977 | passed to `from()`, or as a value returned from a transform), this method is |
1978 | | -called to produce the actual data. It may return (or resolve to) any streamable |
1979 | | -value: a string, `Uint8Array`, `AsyncIterable`, `Iterable`, or another streamable |
| 1978 | +called to produce the actual data. It may return any value that resolves to: |
| 1979 | +a string, `Uint8Array`, `AsyncIterable`, `Iterable`, or another streamable |
1980 | 1980 | object. |
1981 | 1981 |
|
1982 | 1982 | ```mjs |
|