Skip to content

Commit cbb4e4b

Browse files
authored
🤖 Merge PR DefinitelyTyped#75086 [sdp-transform] v3.0 by @Anidetrix
1 parent ca65e20 commit cbb4e4b

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

types/sdp-transform/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export interface MediaAttributes extends SharedAttributes {
110110
// a=mid:foo
111111
mid?: string;
112112
// a=msid:0c8b064d-d807-43b4-b434-f92a889d8587 98178685-d409-46e0-8e16-7ef0db0db64a
113-
msid?: string;
113+
msid?: { id: string; appdata?: string }[];
114114
// a=ptime:20
115115
ptime?: number;
116116
// a=maxptime:60
@@ -304,7 +304,7 @@ export interface SharedAttributes {
304304
}
305305

306306
export interface ParamMap {
307-
[paramName: string]: number | string;
307+
[paramName: string]: number | string | undefined;
308308
}
309309

310310
export function write(description: SessionDescription): string;

types/sdp-transform/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/sdp-transform",
4-
"version": "2.15.9999",
4+
"version": "3.0.9999",
55
"projects": [
66
"https://github.com/clux/sdp-transform#readme"
77
],

types/sdp-transform/sdp-transform-tests.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,19 @@ function test_datachannel_media_description() {
121121
const port = parsed.media[0].port;
122122
port; // $ExpectType number
123123
}
124+
125+
function test_msid_attribute() {
126+
const session: SessionDescription = parse("");
127+
session.media[0].msid = [
128+
{ id: "0c8b064d-d807-43b4-b434-f92a889d8587" },
129+
{ id: "98178685-d409-46e0-8e16-7ef0db0db64a", appdata: "my-track-id" },
130+
];
131+
132+
const sdp: string = write(session);
133+
const parsed = parse(sdp);
134+
const msid = parsed.media[0].msid!;
135+
msid[0].id; // $ExpectType string
136+
msid[0].appdata; // $ExpectType string | undefined
137+
msid[1].id; // $ExpectType string
138+
msid[1].appdata; // $ExpectType string | undefined
139+
}

0 commit comments

Comments
 (0)