* Sends a `message` event to all clients. * * This method mimics the WebSocket.send() method. * * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send * * @example * io.send("hello"); * * // this is equivalent to * io.emit("message", "hello"); * *
(...args: EventParams<EmitEvents, "message">)
| 941 | * @return self |
| 942 | */ |
| 943 | public send(...args: EventParams<EmitEvents, "message">): this { |
| 944 | // This type-cast is needed because EmitEvents likely doesn't have `message` as a key. |
| 945 | // if you specify the EmitEvents, the type of args will be never. |
| 946 | this.sockets.emit("message" as any, ...args); |
| 947 | return this; |
| 948 | } |
| 949 | |
| 950 | /** |
| 951 | * Sends a `message` event to all clients. Alias of {@link send}. |
no test coverage detected