Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typings): update the signature of the emit method
The previous signature was not compatible with EventEmitter.emit(). The typescript compilation threw: ``` node_modules/socket.io/dist/namespace.d.ts(89,5): error TS2416: Property 'emit' in type 'Namespace' is not assignable to the same property in base type 'EventEmitter'. Type '(ev: string, ...args: any[]) => Namespace' is not assignable to type '(event: string | symbol, ...args: any[]) => boolean'. Type 'Namespace' is not assignable to type 'boolean'. node_modules/socket.io/dist/socket.d.ts(84,5): error TS2416: Property 'emit' in type 'Socket' is not assignable to the same property in base type 'EventEmitter'. Type '(ev: string, ...args: any[]) => this' is not assignable to type '(event: string | symbol, ...args: any[]) => boolean'. Type 'this' is not assignable to type 'boolean'. Type 'Socket' is not assignable to type 'boolean'. ``` Note: the emit calls cannot be chained anymore: ```js socket.emit("hello").emit("world"); // will not work anymore ```
- Loading branch information