mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[@types/sdp-transform] fix incorrect types (#36891)
* added missing arrays, and made some fields in candidates optional. * fixed "Definitions by"
This commit is contained in:
parent
4fc501737d
commit
6e217d240a
22
types/sdp-transform/index.d.ts
vendored
22
types/sdp-transform/index.d.ts
vendored
@ -1,6 +1,6 @@
|
||||
// Type definitions for sdp-transform 2.4
|
||||
// Project: https://github.com/clux/sdp-transform#readme
|
||||
// Definitions by: @loc <https://github.com/loc>
|
||||
// Definitions by: @loc <https://github.com/loc>, @muenchow <https://github.com/muenchow>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// https://tools.ietf.org/html/rfc4566
|
||||
@ -81,12 +81,12 @@ export interface SharedAttributes {
|
||||
// a=control
|
||||
control?: string;
|
||||
// a=extmap
|
||||
ext?: {
|
||||
ext?: Array<{
|
||||
value: number;
|
||||
direction?: string;
|
||||
uri: string;
|
||||
config?: string;
|
||||
};
|
||||
}>;
|
||||
// a=setup
|
||||
setup?: string;
|
||||
|
||||
@ -134,12 +134,12 @@ export interface SessionAttributes extends SharedAttributes {
|
||||
* https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml#sdp-parameters-9
|
||||
*/
|
||||
export interface MediaAttributes extends SharedAttributes {
|
||||
rtp?: {
|
||||
rtp: Array<{
|
||||
payload: number;
|
||||
codec: string;
|
||||
rate?: number;
|
||||
encoding?: number;
|
||||
};
|
||||
}>;
|
||||
rtcp?: {
|
||||
port: number;
|
||||
netType?: string;
|
||||
@ -158,10 +158,10 @@ export interface MediaAttributes extends SharedAttributes {
|
||||
value: number;
|
||||
};
|
||||
// a=fmtp
|
||||
fmtp?: {
|
||||
fmtp: Array<{
|
||||
payload: number;
|
||||
config: string;
|
||||
};
|
||||
}>;
|
||||
// a=mid
|
||||
mid?: string;
|
||||
// a=msid
|
||||
@ -185,10 +185,10 @@ export interface MediaAttributes extends SharedAttributes {
|
||||
ip: string;
|
||||
port: number;
|
||||
type: string;
|
||||
raddr: string;
|
||||
rport: number;
|
||||
tcptype: string;
|
||||
generation: number;
|
||||
raddr?: string;
|
||||
rport?: number;
|
||||
tcptype?: string;
|
||||
generation?: number;
|
||||
'network-id'?: number;
|
||||
'network-cost'?: number;
|
||||
}>;
|
||||
|
||||
@ -7,4 +7,10 @@ import {
|
||||
const session: SessionDescription = parse('');
|
||||
const mediaType: string = session.media[0].type;
|
||||
session.media[0].type = 'video';
|
||||
const extension: string = session.media[0].ext![0].uri;
|
||||
session.media[0].ext![0].uri = 'urn:ietf:params:rtp-hdrext:ssrc-audio-level';
|
||||
const codec: string = session.media[0].rtp[0].codec;
|
||||
session.media[0].rtp[0].codec = 'opus';
|
||||
const config: string = session.media[0].fmtp[0].config;
|
||||
session.media[0].fmtp[0].config = 'maxplaybackrate=48000;stereo=1;useinbandfec=1';
|
||||
const sdp: string = write(session);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user