From 55119aaee2e5fec8074373ef51b56d5095da1faf Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 10 Mar 2020 19:14:22 +0000 Subject: 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. --- cli/js/lib.deno.ns.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/js/lib.deno.ns.d.ts') 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 { + export interface Listener extends AsyncIterable { /** Waits for and resolves to the next connection to the `Listener`. */ accept(): Promise; /** Close closes the listener. Any pending accept promises will be rejected -- cgit v1.2.3