Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions types/sdp-transform/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface MediaAttributes extends SharedAttributes {
// a=mid:foo
mid?: string;
// a=msid:0c8b064d-d807-43b4-b434-f92a889d8587 98178685-d409-46e0-8e16-7ef0db0db64a
msid?: string;
msid?: { id: string; appdata?: string }[];
// a=ptime:20
ptime?: number;
// a=maxptime:60
Expand Down Expand Up @@ -304,7 +304,7 @@ export interface SharedAttributes {
}

export interface ParamMap {
[paramName: string]: number | string;
[paramName: string]: number | string | undefined;
}

export function write(description: SessionDescription): string;
Expand Down
2 changes: 1 addition & 1 deletion types/sdp-transform/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/sdp-transform",
"version": "2.15.9999",
"version": "3.0.9999",
"projects": [
"https://github.com/clux/sdp-transform#readme"
],
Expand Down
16 changes: 16 additions & 0 deletions types/sdp-transform/sdp-transform-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,19 @@ function test_datachannel_media_description() {
const port = parsed.media[0].port;
port; // $ExpectType number
}

function test_msid_attribute() {
const session: SessionDescription = parse("");
session.media[0].msid = [
{ id: "0c8b064d-d807-43b4-b434-f92a889d8587" },
{ id: "98178685-d409-46e0-8e16-7ef0db0db64a", appdata: "my-track-id" },
];

const sdp: string = write(session);
const parsed = parse(sdp);
const msid = parsed.media[0].msid!;
msid[0].id; // $ExpectType string
msid[0].appdata; // $ExpectType string | undefined
msid[1].id; // $ExpectType string
msid[1].appdata; // $ExpectType string | undefined
}