4
4
5
5
import 'node-domexception' ;
6
6
7
- export default class RTCIceCandidate {
7
+ export default class RTCIceCandidate implements globalThis . RTCIceCandidate {
8
8
#address: string | null ;
9
9
#candidate: string ;
10
- #component: RTCIceComponent | null ;
10
+ #component: globalThis . RTCIceComponent | null ;
11
11
#foundation: string | null ;
12
12
#port: number | null ;
13
13
#priority: number | null ;
14
- #protocol: RTCIceProtocol | null ;
14
+ #protocol: globalThis . RTCIceProtocol | null ;
15
15
#relatedAddress: string | null ;
16
16
#relatedPort: number | null ;
17
17
#sdpMLineIndex: number | null ;
18
18
#sdpMid: string | null ;
19
- #tcpType: RTCIceTcpCandidateType | null ;
20
- #type: RTCIceCandidateType | null ;
19
+ #tcpType: globalThis . RTCIceTcpCandidateType | null ;
20
+ #type: globalThis . RTCIceCandidateType | null ;
21
21
#usernameFragment: string | null ;
22
22
23
- constructor ( { candidate, sdpMLineIndex, sdpMid, usernameFragment } : RTCIceCandidateInit ) {
23
+ constructor ( { candidate, sdpMLineIndex, sdpMid, usernameFragment } : globalThis . RTCIceCandidateInit ) {
24
24
if ( sdpMLineIndex == null && sdpMid == null )
25
25
throw new TypeError ( 'At least one of sdpMLineIndex or sdpMid must be specified' ) ;
26
26
@@ -33,11 +33,11 @@ export default class RTCIceCandidate {
33
33
const fields = candidate . split ( ' ' ) ;
34
34
this . #foundation = fields [ 0 ] . replace ( 'candidate:' , '' ) ; // remove text candidate:
35
35
this . #component = fields [ 1 ] == '1' ? 'rtp' : 'rtcp' ;
36
- this . #protocol = fields [ 2 ] as RTCIceProtocol ;
36
+ this . #protocol = fields [ 2 ] as globalThis . RTCIceProtocol ;
37
37
this . #priority = parseInt ( fields [ 3 ] , 10 ) ;
38
38
this . #address = fields [ 4 ] ;
39
39
this . #port = parseInt ( fields [ 5 ] , 10 ) ;
40
- this . #type = fields [ 7 ] as RTCIceCandidateType ;
40
+ this . #type = fields [ 7 ] as globalThis . RTCIceCandidateType ;
41
41
this . #tcpType = null ;
42
42
this . #relatedAddress = null ;
43
43
this . #relatedPort = null ;
@@ -52,7 +52,7 @@ export default class RTCIceCandidate {
52
52
}
53
53
54
54
if ( this . #protocol === 'tcp' && field === 'tcptype' ) {
55
- this . #tcpType = fields [ i + 1 ] as RTCIceTcpCandidateType ;
55
+ this . #tcpType = fields [ i + 1 ] as globalThis . RTCIceTcpCandidateType ;
56
56
}
57
57
}
58
58
}
@@ -66,7 +66,7 @@ export default class RTCIceCandidate {
66
66
return this . #candidate;
67
67
}
68
68
69
- get component ( ) : RTCIceComponent | null {
69
+ get component ( ) : globalThis . RTCIceComponent | null {
70
70
return this . #component;
71
71
}
72
72
@@ -82,7 +82,7 @@ export default class RTCIceCandidate {
82
82
return this . #priority || null ;
83
83
}
84
84
85
- get protocol ( ) : RTCIceProtocol | null {
85
+ get protocol ( ) : globalThis . RTCIceProtocol | null {
86
86
return this . #protocol || null ;
87
87
}
88
88
@@ -102,19 +102,19 @@ export default class RTCIceCandidate {
102
102
return this . #sdpMid;
103
103
}
104
104
105
- get tcpType ( ) : RTCIceTcpCandidateType | null {
105
+ get tcpType ( ) : globalThis . RTCIceTcpCandidateType | null {
106
106
return this . #tcpType;
107
107
}
108
108
109
- get type ( ) : RTCIceCandidateType | null {
109
+ get type ( ) : globalThis . RTCIceCandidateType | null {
110
110
return this . #type || null ;
111
111
}
112
112
113
113
get usernameFragment ( ) : string | null {
114
114
return this . #usernameFragment;
115
115
}
116
116
117
- toJSON ( ) : RTCIceCandidateInit {
117
+ toJSON ( ) : globalThis . RTCIceCandidateInit {
118
118
return {
119
119
candidate : this . #candidate,
120
120
sdpMLineIndex : this . #sdpMLineIndex,
0 commit comments