import { io } from "@/server"
import type { WsEvents } from "ttm-shared"

export function wsEmit<K extends keyof WsEvents>(
    room: string,
    event: K,
    payload: WsEvents[K]
) {
    io.to(room).emit(event, payload)
}