mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 03:53:08 +00:00
client: properly type Socket in window
This commit is contained in:
parent
74563effa7
commit
45c2fc87ee
1 changed files with 4 additions and 2 deletions
|
@ -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<ServerToClientEvents, ClientToServerEvents> = io({
|
||||
type Socket = rawSocket<ServerToClientEvents, ClientToServerEvents>;
|
||||
|
||||
const socket: Socket = io({
|
||||
transports: JSON.parse(document.body.dataset.transports || "['polling', 'websocket']"),
|
||||
path: window.location.pathname + "socket.io/",
|
||||
autoConnect: false,
|
||||
|
|
Loading…
Reference in a new issue