fix: websocket close logic

This commit is contained in:
2023-08-16 11:47:36 +08:00
parent a0866c1085
commit bdad4136ec
4 changed files with 10 additions and 10 deletions

View File

@@ -89,11 +89,11 @@ export class WebSocket extends EventEmitter {
public onclose: (event: CloseEvent) => void
public onerror: (event: ErrorEvent) => void
public on(eventName: string | symbol, listener: (...args: any[]) => void): this {
public on(eventName: EventType, listener: (...args: any[]) => void): this {
this.client.on(eventName, listener)
return this
}
public emit(eventName: string | symbol, ...args: any[]): boolean {
public emit(eventName: EventType, ...args: any[]): boolean {
return this.client.emit(eventName, ...args)
}