mirror of
https://github.com/denoland/deno.git
synced 2024-12-26 17:19:06 -05:00
Add comments in Reader/SyncReader about iter/iterSync (#4852)
This commit is contained in:
parent
68d287eed5
commit
e26c2cd7c8
1 changed files with 4 additions and 1 deletions
5
cli/js/lib.deno.ns.d.ts
vendored
5
cli/js/lib.deno.ns.d.ts
vendored
|
@ -446,7 +446,6 @@ declare namespace Deno {
|
|||
SEEK_END = 2,
|
||||
}
|
||||
|
||||
/** **UNSTABLE**: might make `Reader` into iterator of some sort. */
|
||||
export interface Reader {
|
||||
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of
|
||||
* bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error
|
||||
|
@ -465,6 +464,8 @@ declare namespace Deno {
|
|||
* after reading some bytes and also both of the allowed EOF behaviors.
|
||||
*
|
||||
* Implementations should not retain a reference to `p`.
|
||||
*
|
||||
* Use Deno.iter() to turn a Reader into an AsyncIterator.
|
||||
*/
|
||||
read(p: Uint8Array): Promise<number | EOF>;
|
||||
}
|
||||
|
@ -487,6 +488,8 @@ declare namespace Deno {
|
|||
* after reading some bytes and also both of the allowed EOF behaviors.
|
||||
*
|
||||
* Implementations should not retain a reference to `p`.
|
||||
*
|
||||
* Use Deno.iterSync() to turn a SyncReader into an Iterator.
|
||||
*/
|
||||
readSync(p: Uint8Array): number | EOF;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue