a373626e24
To do this, I used generic-type-guard package which generates both an interface AND a valid type guard from code. With this, we are 100% sure that the messages we receive are validated at runtime! The client cannot pass us an object that is invalid! \o/
15 lines
436 B
TypeScript
15 lines
436 B
TypeScript
import {Socket} from "socket.io";
|
|
import {PointInterface} from "./PointInterface";
|
|
import {Identificable} from "./Identificable";
|
|
import {TokenInterface} from "../../Controller/AuthenticateController";
|
|
|
|
export interface ExSocketInterface extends Socket, Identificable {
|
|
token: TokenInterface;
|
|
roomId: string;
|
|
webRtcRoomId: string;
|
|
userId: string;
|
|
name: string;
|
|
character: string;
|
|
position: PointInterface;
|
|
}
|