From 45c2fc87ee04af5ddb172b7ec8ebd6a62b178960 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Fri, 10 May 2024 12:26:07 +0200 Subject: [PATCH] client: properly type Socket in window --- client/js/socket.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/js/socket.ts b/client/js/socket.ts index d4752142..a3c0bca3 100644 --- a/client/js/socket.ts +++ b/client/js/socket.ts @@ -1,7 +1,9 @@ -import io, {Socket} from "socket.io-client"; +import io, {Socket as rawSocket} from "socket.io-client"; import type {ServerToClientEvents, ClientToServerEvents} from "../../shared/types/socket-events"; -const socket: Socket = io({ +type Socket = rawSocket; + +const socket: Socket = io({ transports: JSON.parse(document.body.dataset.transports || "['polling', 'websocket']"), path: window.location.pathname + "socket.io/", autoConnect: false,