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

Add a type param to Listener interface #18635

Closed
jodinathan opened this issue Apr 7, 2023 · 1 comment · Fixed by #18642
Closed

Add a type param to Listener interface #18635

jodinathan opened this issue Apr 7, 2023 · 1 comment · Fixed by #18642
Labels
bug Something isn't working correctly

Comments

@jodinathan
Copy link
Contributor

Today the TlsListener extends Listener and AsyncIterable<TlsConn>.
The problem is that Listener already extends AsyncIterable<Conn>:

export interface TlsListener extends Listener, AsyncIterable<TlsConn> { }
export interface Listener extends AsyncIterable<Conn> { }

Can we change the Listener so it has a type param so then we can remove the AsyncIterable<TlsConn> from TlsListener?

ie:

export interface Listener<T extends Conn = Conn> extends AsyncIterable<T> {}

export interface TlsListener extends Listener<TlsConn> {}

I would PR this but I couldn't find it in any d.ts file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants