aboutsummaryrefslogtreecommitdiff
path: root/source/packets.ts
blob: ef65ce777d299a5df92cdcb8a51e1afc9057b94c (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
26
27
28
29
30
31
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 SCPacket {
    sender: string,
    data?: CSPacket,
    join?: boolean, // user just joined
    leave?: boolean, // user left
    stable?: boolean // user "joined" because you joined aka. user was already there
}
export interface CSPacket {
    receiver?: string
    ice_candiate?: F_RTCIceCandidateInit
    offer?: F_RTCSessionDescriptionInit
    answer?: F_RTCSessionDescriptionInit
}