diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 550b6cffc7..0ec27dbce5 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -1877,7 +1877,7 @@ declare namespace Deno { close(): void; /** Return the address of the `UDPConn`. */ readonly addr: Addr; - [Symbol.asyncIterator](): AsyncIterator<[Uint8Array, Addr]>; + [Symbol.asyncIterator](): AsyncIterableIterator<[Uint8Array, Addr]>; } /** A generic network listener for stream-oriented protocols. */ @@ -1890,7 +1890,7 @@ declare namespace Deno { /** Return the address of the `Listener`. */ readonly addr: Addr; - [Symbol.asyncIterator](): AsyncIterator; + [Symbol.asyncIterator](): AsyncIterableIterator; } export interface Conn extends Reader, Writer, Closer { diff --git a/cli/js/net.ts b/cli/js/net.ts index 7c0edf1f30..92fdfe3aca 100644 --- a/cli/js/net.ts +++ b/cli/js/net.ts @@ -16,7 +16,7 @@ export interface DatagramConn extends AsyncIterable<[Uint8Array, Addr]> { addr: Addr; - [Symbol.asyncIterator](): AsyncIterator<[Uint8Array, Addr]>; + [Symbol.asyncIterator](): AsyncIterableIterator<[Uint8Array, Addr]>; } export interface Listener extends AsyncIterable { @@ -26,7 +26,7 @@ export interface Listener extends AsyncIterable { addr: Addr; - [Symbol.asyncIterator](): AsyncIterator; + [Symbol.asyncIterator](): AsyncIterableIterator; } export class ConnImpl implements Conn { @@ -69,7 +69,7 @@ export class ListenerImpl implements Listener { close(this.rid); } - async *[Symbol.asyncIterator](): AsyncIterator { + async *[Symbol.asyncIterator](): AsyncIterableIterator { while (true) { try { yield await this.accept(); @@ -112,7 +112,7 @@ export class DatagramImpl implements DatagramConn { close(this.rid); } - async *[Symbol.asyncIterator](): AsyncIterator<[Uint8Array, Addr]> { + async *[Symbol.asyncIterator](): AsyncIterableIterator<[Uint8Array, Addr]> { while (true) { try { yield await this.receive();