import { IIndentity } from "../../global/inteface"; export interface IServerSocket { getId(): string; getAuthInfo(): IIndentity | undefined; /** * Send back data to client * @param data The data to send, will be serialized using JSON.stringify */ send(data: any, channel?: string): Promise; /** * Disconnect the socket and optionally provide the error which cause the disconnection. * The client socket will treat this error as intended reason for socket termination. * @param err The error which cause the disconnection */ disconnect(err?: any): Promise; }