|
|
|
@ -63,7 +63,7 @@ export default class WebSocket {
|
|
|
|
|
|
|
|
|
|
static async connect(
|
|
|
|
|
url: string,
|
|
|
|
|
config?: ConnectionConfig
|
|
|
|
|
config?: ConnectionConfig,
|
|
|
|
|
): Promise<WebSocket> {
|
|
|
|
|
const listeners: Array<(arg: Message) => void> = [];
|
|
|
|
|
const handler = (message: Message): void => {
|
|
|
|
@ -95,7 +95,7 @@ export default class WebSocket {
|
|
|
|
|
m = { type: "Binary", data: message };
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(
|
|
|
|
|
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array"
|
|
|
|
|
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array",
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return await invoke("plugin:websocket|send", {
|
|
|
|
|