publicClient: add FIXME and ignore the type mismatch

The publicClient interface is utterly horrific.
It allows any client to inject arbitrary events into the socket.io
event stream.
This should get wrapped into a "plugin" event so that it can get properly
typed, better yet, this should get removed completely.
This commit is contained in:
Reto Brunner 2024-04-07 14:57:22 +02:00
parent 1c4ce5d4a5
commit c20cd6bda1

View file

@ -36,8 +36,11 @@ export default class PublicClient {
* @param {String} event - Name of the event, must be something the browser will recognise
* @param {Object} data - Body of the event, can be anything, but will need to be properly interpreted by the client
*/
// FIXME: this is utterly bonkers
// This needs to get wrapped into its own, typed plugin event
// Plus it is completely insane to let a plugin inject arbitrary events like that
sendToBrowser(event: string, data) {
this.client.emit(event, data);
this.client.emit(event as any, data as any);
}
/**