Skip to content

Commit 7d1216f

Browse files
saschanazsandersn
authored andcommitted
Update WebRTC types (#763)
1 parent af75df4 commit 7d1216f

File tree

5 files changed

+495
-528
lines changed

5 files changed

+495
-528
lines changed

baselines/dom.generated.d.ts

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,16 @@ interface RTCDtlsParameters {
11771177
}
11781178

11791179
interface RTCErrorEventInit extends EventInit {
1180-
error?: RTCError | null;
1180+
error: RTCError;
1181+
}
1182+
1183+
interface RTCErrorInit {
1184+
errorDetail: RTCErrorDetailType;
1185+
httpRequestStatusCode?: number;
1186+
receivedAlert?: number;
1187+
sctpCauseCode?: number;
1188+
sdpLineNumber?: number;
1189+
sentAlert?: number;
11811190
}
11821191

11831192
interface RTCIceCandidateAttributes extends RTCStats {
@@ -1209,7 +1218,7 @@ interface RTCIceCandidateInit {
12091218
candidate?: string;
12101219
sdpMLineIndex?: number | null;
12111220
sdpMid?: string | null;
1212-
usernameFragment?: string;
1221+
usernameFragment?: string | null;
12131222
}
12141223

12151224
interface RTCIceCandidatePair {
@@ -1365,6 +1374,7 @@ interface RTCRtpCodingParameters {
13651374

13661375
interface RTCRtpContributingSource {
13671376
audioLevel?: number;
1377+
rtpTimestamp: number;
13681378
source: number;
13691379
timestamp: number;
13701380
}
@@ -1378,7 +1388,6 @@ interface RTCRtpEncodingParameters extends RTCRtpCodingParameters {
13781388
dtx?: RTCDtxStatus;
13791389
maxBitrate?: number;
13801390
maxFramerate?: number;
1381-
priority?: RTCPriorityType;
13821391
ptime?: number;
13831392
scaleResolutionDownBy?: number;
13841393
}
@@ -1422,6 +1431,7 @@ interface RTCRtpRtxParameters {
14221431
interface RTCRtpSendParameters extends RTCRtpParameters {
14231432
degradationPreference?: RTCDegradationPreference;
14241433
encodings: RTCRtpEncodingParameters[];
1434+
priority?: RTCPriorityType;
14251435
transactionId: string;
14261436
}
14271437

@@ -1443,7 +1453,7 @@ interface RTCRtpUnhandled {
14431453

14441454
interface RTCSessionDescriptionInit {
14451455
sdp?: string;
1446-
type: RTCSdpType;
1456+
type?: RTCSdpType;
14471457
}
14481458

14491459
interface RTCSrtpKeyParam {
@@ -12159,10 +12169,10 @@ interface RTCDtlsTransportEventMap {
1215912169
}
1216012170

1216112171
interface RTCDtlsTransport extends EventTarget {
12172+
readonly iceTransport: RTCIceTransport;
1216212173
onerror: ((this: RTCDtlsTransport, ev: RTCErrorEvent) => any) | null;
1216312174
onstatechange: ((this: RTCDtlsTransport, ev: Event) => any) | null;
1216412175
readonly state: RTCDtlsTransportState;
12165-
readonly transport: RTCIceTransport;
1216612176
getRemoteCertificates(): ArrayBuffer[];
1216712177
addEventListener<K extends keyof RTCDtlsTransportEventMap>(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1216812178
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12207,24 +12217,22 @@ declare var RTCDtmfSender: {
1220712217
new(sender: RTCRtpSender): RTCDtmfSender;
1220812218
};
1220912219

12210-
interface RTCError extends Error {
12211-
errorDetail: string;
12212-
httpRequestStatusCode: number;
12213-
message: string;
12214-
name: string;
12215-
receivedAlert: number | null;
12216-
sctpCauseCode: number;
12217-
sdpLineNumber: number;
12218-
sentAlert: number | null;
12220+
interface RTCError extends DOMException {
12221+
readonly errorDetail: RTCErrorDetailType;
12222+
readonly httpRequestStatusCode: number | null;
12223+
readonly receivedAlert: number | null;
12224+
readonly sctpCauseCode: number | null;
12225+
readonly sdpLineNumber: number | null;
12226+
readonly sentAlert: number | null;
1221912227
}
1222012228

1222112229
declare var RTCError: {
1222212230
prototype: RTCError;
12223-
new(errorDetail?: string, message?: string): RTCError;
12231+
new(init: RTCErrorInit, message?: string): RTCError;
1222412232
};
1222512233

1222612234
interface RTCErrorEvent extends Event {
12227-
readonly error: RTCError | null;
12235+
readonly error: RTCError;
1222812236
}
1222912237

1223012238
declare var RTCErrorEvent: {
@@ -12237,7 +12245,6 @@ interface RTCIceCandidate {
1223712245
readonly candidate: string;
1223812246
readonly component: RTCIceComponent | null;
1223912247
readonly foundation: string | null;
12240-
readonly ip: string | null;
1224112248
readonly port: number | null;
1224212249
readonly priority: number | null;
1224312250
readonly protocol: RTCIceProtocol | null;
@@ -12483,7 +12490,6 @@ interface RTCRtpTransceiver {
1248312490
readonly mid: string | null;
1248412491
readonly receiver: RTCRtpReceiver;
1248512492
readonly sender: RTCRtpSender;
12486-
readonly stopped: boolean;
1248712493
setCodecPreferences(codecs: RTCRtpCodecCapability[]): void;
1248812494
stop(): void;
1248912495
}
@@ -12497,7 +12503,7 @@ interface RTCSctpTransportEventMap {
1249712503
"statechange": Event;
1249812504
}
1249912505

12500-
interface RTCSctpTransport {
12506+
interface RTCSctpTransport extends EventTarget {
1250112507
readonly maxChannels: number | null;
1250212508
readonly maxMessageSize: number;
1250312509
onstatechange: ((this: RTCSctpTransport, ev: Event) => any) | null;
@@ -12523,7 +12529,7 @@ interface RTCSessionDescription {
1252312529

1252412530
declare var RTCSessionDescription: {
1252512531
prototype: RTCSessionDescription;
12526-
new(descriptionInitDict: RTCSessionDescriptionInit): RTCSessionDescription;
12532+
new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;
1252712533
};
1252812534

1252912535
interface RTCSrtpSdesTransportEventMap {
@@ -20113,14 +20119,14 @@ type RTCIceGatherPolicy = "all" | "nohost" | "relay";
2011320119
type RTCIceGathererState = "complete" | "gathering" | "new";
2011420120
type RTCIceGatheringState = "complete" | "gathering" | "new";
2011520121
type RTCIceProtocol = "tcp" | "udp";
20116-
type RTCIceRole = "controlled" | "controlling";
20122+
type RTCIceRole = "controlled" | "controlling" | "unknown";
2011720123
type RTCIceTcpCandidateType = "active" | "passive" | "so";
2011820124
type RTCIceTransportPolicy = "all" | "relay";
2011920125
type RTCIceTransportState = "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new";
2012020126
type RTCPeerConnectionState = "closed" | "connected" | "connecting" | "disconnected" | "failed" | "new";
2012120127
type RTCPriorityType = "high" | "low" | "medium" | "very-low";
2012220128
type RTCRtcpMuxPolicy = "negotiate" | "require";
20123-
type RTCRtpTransceiverDirection = "inactive" | "recvonly" | "sendonly" | "sendrecv";
20129+
type RTCRtpTransceiverDirection = "inactive" | "recvonly" | "sendonly" | "sendrecv" | "stopped";
2012420130
type RTCSctpTransportState = "closed" | "connected" | "connecting";
2012520131
type RTCSdpType = "answer" | "offer" | "pranswer" | "rollback";
2012620132
type RTCSignalingState = "closed" | "have-local-offer" | "have-local-pranswer" | "have-remote-offer" | "have-remote-pranswer" | "stable";

inputfiles/addedTypes.json

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -355,114 +355,6 @@
355355
"DeviceMotionEventRotationRate": {
356356
"no-interface-object": 1
357357
},
358-
"RTCError": {
359-
"specs": "webrtc",
360-
"constructor": {
361-
"specs": "webrtc",
362-
"signature": [
363-
{
364-
"param-min-required": 0,
365-
"type-original": "RTCError",
366-
"type": "RTCError",
367-
"param": [
368-
{
369-
"type-original": "DOMString",
370-
"optional": 1,
371-
"name": "errorDetail",
372-
"type": "DOMString"
373-
},
374-
{
375-
"type-original": "DOMString",
376-
"optional": 1,
377-
"name": "message",
378-
"type": "DOMString"
379-
}
380-
]
381-
}
382-
],
383-
"name": "RTCError"
384-
},
385-
"properties": {
386-
"property": {
387-
"errorDetail": {
388-
"type-original": "DOMString",
389-
"nullable": 0,
390-
"default": "\"\"",
391-
"specs": "webrtc",
392-
"name": "errorDetail",
393-
"type": "DOMString"
394-
},
395-
"sdpLineNumber": {
396-
"type-original": "unsigned short",
397-
"nullable": 0,
398-
"default": "0",
399-
"specs": "webrtc",
400-
"name": "sdpLineNumber",
401-
"type": "unsigned short"
402-
},
403-
"httpRequestStatusCode": {
404-
"type-original": "unsigned short",
405-
"nullable": 0,
406-
"default": "0",
407-
"specs": "webrtc",
408-
"name": "httpRequestStatusCode",
409-
"type": "unsigned short"
410-
},
411-
"sctpCauseCode": {
412-
"type-original": "unsigned short",
413-
"nullable": 0,
414-
"default": "0",
415-
"specs": "webrtc",
416-
"name": "sctpCauseCode",
417-
"type": "unsigned short"
418-
},
419-
"receivedAlert": {
420-
"type-original": "unsigned long",
421-
"nullable": 1,
422-
"default": "null",
423-
"specs": "webrtc",
424-
"name": "receivedAlert",
425-
"type": "unsigned long"
426-
},
427-
"sentAlert": {
428-
"type-original": "unsigned long",
429-
"nullable": 1,
430-
"default": "null",
431-
"specs": "webrtc",
432-
"name": "sentAlert",
433-
"type": "unsigned long"
434-
},
435-
"message": {
436-
"type-original": "DOMString",
437-
"nullable": 0,
438-
"default": "\"\"",
439-
"specs": "webrtc",
440-
"name": "message",
441-
"type": "DOMString"
442-
},
443-
"name": {
444-
"type-original": "DOMString",
445-
"nullable": 0,
446-
"default": "RTCError",
447-
"specs": "webrtc",
448-
"name": "name",
449-
"type": "DOMString"
450-
}
451-
}
452-
},
453-
"anonymous-methods": {
454-
"method": []
455-
},
456-
"name": "RTCError",
457-
"constants": {
458-
"constant": {}
459-
},
460-
"methods": {
461-
"method": {}
462-
},
463-
"exposed": "Window",
464-
"extends": "Error"
465-
},
466358
"HTMLImageElement": {
467359
"name": "HTMLImageElement",
468360
"properties": {

0 commit comments

Comments
 (0)