14 lines
398 B
TypeScript
14 lines
398 B
TypeScript
import type { WebSocket } from "ws";
|
|
export type WsEvent = {
|
|
type: string;
|
|
data?: unknown;
|
|
};
|
|
export type WsClientChangeCallback = (clients: number) => void;
|
|
export declare class WsService {
|
|
private clients;
|
|
addClient(ws: WebSocket): void;
|
|
removeClient(ws: WebSocket): void;
|
|
broadcast(message: WsEvent): void;
|
|
getClientCount(): number;
|
|
}
|
|
//# sourceMappingURL=ws.d.ts.map
|