summaryrefslogtreecommitdiff
path: root/ext/net/lib.deno_net.d.ts
diff options
context:
space:
mode:
authorJonathan Rezende <jonathan@jode.com.br>2023-08-27 17:55:04 -0300
committerGitHub <noreply@github.com>2023-08-27 20:55:04 +0000
commitd22a6663fa0349acb6a68c53fdcbfac0426555d2 (patch)
tree8caec67733baaeb28ceadc4cfb17df592913652c /ext/net/lib.deno_net.d.ts
parentf826574873282b65aff936e0526b5510b80c53dc (diff)
fix(network): adjust Listener type params (#18642)
Fixes https://github.com/denoland/deno/issues/18635
Diffstat (limited to 'ext/net/lib.deno_net.d.ts')
-rw-r--r--ext/net/lib.deno_net.d.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/net/lib.deno_net.d.ts b/ext/net/lib.deno_net.d.ts
index 214a5f14b..030157d63 100644
--- a/ext/net/lib.deno_net.d.ts
+++ b/ext/net/lib.deno_net.d.ts
@@ -24,9 +24,9 @@ declare namespace Deno {
*
* @category Network
*/
- export interface Listener extends AsyncIterable<Conn> {
+ export interface Listener<T extends Conn = Conn> extends AsyncIterable<T> {
/** Waits for and resolves to the next connection to the `Listener`. */
- accept(): Promise<Conn>;
+ accept(): Promise<T>;
/** Close closes the listener. Any pending accept promises will be rejected
* with errors. */
close(): void;
@@ -36,7 +36,7 @@ declare namespace Deno {
/** Return the rid of the `Listener`. */
readonly rid: number;
- [Symbol.asyncIterator](): AsyncIterableIterator<Conn>;
+ [Symbol.asyncIterator](): AsyncIterableIterator<T>;
/**
* Make the listener block the event loop from finishing.
@@ -54,11 +54,7 @@ declare namespace Deno {
*
* @category Network
*/
- export interface TlsListener extends Listener, AsyncIterable<TlsConn> {
- /** Waits for a TLS client to connect and accepts the connection. */
- accept(): Promise<TlsConn>;
- [Symbol.asyncIterator](): AsyncIterableIterator<TlsConn>;
- }
+ export type TlsListener = Listener<TlsConn>;
/** @category Network */
export interface Conn extends Reader, Writer, Closer {