forked from teamious/react-conf-webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom.d.ts
36 lines (31 loc) · 882 Bytes
/
custom.d.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
34
35
36
declare var detectrtc: any;
declare module 'detectrtc' {
export = detectrtc;
}
declare var hark: any;
declare module 'hark' {
export = hark;
}
interface RTCDataChannelInit {
ordered: boolean;
maxPacketLifeTime: number;
maxRetransmits: number;
protocol: string;
negotiated: boolean;
id: number;
}
interface RTCDataChannel {
close(): void;
send(data: any): void;
onmessage: (event: MessageEvent) => void;
onopen: (event: RTCDataChannelEvent) => void;
onclose: (event: RTCDataChannelEvent) => void;
readyState: 'connecting' | 'open' | 'closing' | 'closed';
}
interface RTCPeerConnection extends EventTarget {
createDataChannel(label: string, options?: RTCDataChannelInit): RTCDataChannel;
ondatachannel: (event: RTCDataChannelEvent) => void;
}
interface RTCDataChannelEvent {
readonly channel: RTCDataChannel;
}