mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-13 08:57:59 -05:00
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
```
13 lines
195 B
JSON
13 lines
195 B
JSON
{
|
|
"compilerOptions": {
|
|
"outDir": "./dist",
|
|
"target": "es2017",
|
|
"module": "commonjs",
|
|
"declaration": true,
|
|
"esModuleInterop": true
|
|
},
|
|
"include": [
|
|
"./lib/**/*"
|
|
]
|
|
}
|