Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli/dts): stricter typings for Listener & Conn #10012

Merged
merged 3 commits into from
Apr 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add default
  • Loading branch information
crowlKats committed Apr 4, 2021
commit 60e723a0d1b5e1e770dcd3f287be2ff17c5a1851
5 changes: 3 additions & 2 deletions cli/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ declare namespace Deno {
export type Addr = NetAddr | UnixAddr;

/** A generic network listener for stream-oriented protocols. */
export interface Listener<Address extends Addr>
export interface Listener<Address extends Addr = Addr>
extends AsyncIterable<Conn<Address>> {
/** Waits for and resolves to the next connection to the `Listener`. */
accept(): Promise<Conn<Address>>;
Expand All @@ -1729,7 +1729,8 @@ declare namespace Deno {
[Symbol.asyncIterator](): AsyncIterableIterator<Conn<Address>>;
}

export interface Conn<Address extends Addr> extends Reader, Writer, Closer {
export interface Conn<Address extends Addr = Addr>
extends Reader, Writer, Closer {
/** The local address of the connection. */
readonly localAddr: Address;
/** The remote address of the connection. */
Expand Down