blob: 058c2481ab1396267569a995f745609142caf7cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// copy pasted from dom.lib.d.ts because it can not be referenced in the server.
type F_RTCSdpType = "answer" | "offer" | "pranswer" | "rollback";
interface F_RTCSessionDescriptionInit { sdp?: string; type: F_RTCSdpType; }
interface F_RTCIceCandidateInit { candidate?: string; sdpMLineIndex?: number | null; sdpMid?: string | null; usernameFragment?: string | null; }
export interface ClientboundPacket {
init?: { your_id: number, version: string },
client_join?: { id: number },
client_leave?: { id: number },
message?: { sender: number, message: string },
}
export interface ServerboundPacket {
ping?: null,
relay?: { recipient?: number, message: string },
}
export interface RelayMessage {
chat?: { content: string },
identify?: { username: string }
offer?: F_RTCSessionDescriptionInit,
answer?: F_RTCSessionDescriptionInit,
ice_candidate?: F_RTCIceCandidateInit,
}
|