diff options
author | Nayeem Rahman <muhammed.9939@gmail.com> | 2020-03-10 19:14:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 15:14:22 -0400 |
commit | 55119aaee2e5fec8074373ef51b56d5095da1faf (patch) | |
tree | c1ad9bc7526ffa0941df4c552e0ddf113beac9df /cli/js/lib.deno.ns.d.ts | |
parent | 8078d976d29aa12819e3f5a781c846d67868b0d6 (diff) |
refactor(cli/js/net): Cleanup iterable APIs (#4236)
Listener and UDPConn are AsyncIterables instead of AsyncIterators.
The [Symbol.asyncIterator]()s are defined as generators and the
next() methods are gone.
"Listener/Socket has been closed" errors are now BadResource.
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 6950d9050..43e28b05b 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -1522,7 +1522,7 @@ declare namespace Deno { /** **UNSTABLE**: new API, yet to be vetted. * * A generic transport listener for message-oriented protocols. */ - export interface UDPConn extends AsyncIterator<[Uint8Array, Addr]> { + export interface UDPConn extends AsyncIterable<[Uint8Array, Addr]> { /** **UNSTABLE**: new API, yet to be vetted. * * Waits for and resolves to the next message to the `UDPConn`. */ @@ -1542,7 +1542,7 @@ declare namespace Deno { } /** A generic network listener for stream-oriented protocols. */ - export interface Listener extends AsyncIterator<Conn> { + export interface Listener extends AsyncIterable<Conn> { /** Waits for and resolves to the next connection to the `Listener`. */ accept(): Promise<Conn>; /** Close closes the listener. Any pending accept promises will be rejected |