I am trying to implement multiplayer scrabble and to handle socket (client side). I implemented a module but II dont know how to resolve this issue :
import * as io from 'socket.io-client';
export module SocketHandler {
let activeSocket: SocketIOClient.Socket;
export function requestSocket(server: string): any {
if (activeSocket === undefined) {
activeSocket = io.connect(server);
}
return activeSocket;
}
export function disconnectSocket(): void {
activeSocket.disconnect();
activeSocket = undefined;
}
}
Error: export 'connect' (imported as 'io') was not found in 'socket.io-client' (possible exports: Manager, Socket, default, io) error TS2503: Cannot find namespace 'SocketIOClient'.
Can you please help me?