-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvents.ts
33 lines (23 loc) · 907 Bytes
/
Events.ts
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
32
33
import RTCDataChannel from './RTCDataChannel';
import RTCIceCandidate from './RTCIceCandidate';
export class RTCPeerConnectionIceEvent extends Event implements globalThis.RTCPeerConnectionIceEvent {
#candidate: RTCIceCandidate;
constructor(candidate: RTCIceCandidate) {
super('icecandidate');
this.#candidate = candidate;
}
get candidate(): RTCIceCandidate {
return this.#candidate;
}
}
export class RTCDataChannelEvent extends Event implements globalThis.RTCDataChannelEvent {
#channel: RTCDataChannel;
constructor(type: string, eventInitDict: globalThis.RTCDataChannelEventInit) {
super(type);
if (type && !eventInitDict.channel) throw new TypeError('channel member is required');
this.#channel = eventInitDict?.channel as RTCDataChannel;
}
get channel(): RTCDataChannel {
return this.#channel;
}
}