-
Notifications
You must be signed in to change notification settings - Fork 113
Fix incorrect typings for Server class #152
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
base: master
Are you sure you want to change the base?
Conversation
ping? |
on(event: 'headers', cb: (this: WebSocket.Server, headers: string[], request: http.IncomingMessage) => void): this; | ||
on(event: 'listening', cb: (this: WebSocket.Server) => void): this; | ||
on(event: 'stream', cb: (this: WebSocket.Server, stream: WebSocketDuplex, request: http.IncomingMessage) => void): this; | ||
on(event: string | symbol, listener: (this: WebSocket.Server, ...args: any[]) => void): this; | ||
} | ||
|
||
function createServer(opts?: WebSocket.ServerOptions, callback?: () => void): Server; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function createServer(opts?: WebSocket.ServerOptions, callback?: () => void): Server; | |
function createServer(opts?: WebSocket.ServerOptions, callback?: (...args: any[]) => void): Server; |
I don't mind raising this as a separate PR, but this callback can take parameters,
if you look whats passed into the callback you can see that this is passed into this.on('stream', cb)
in server.js
which is a method on its super class WebSocketServer which is part of the ws
package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my brother in christ, this has been open for 4 years now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah actually there is another ticket raised about this here #158 - don't worry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look Good!
No description provided.