Skip to content

Commit

Permalink
Update TypeScript signature of createOffer (#3232)
Browse files Browse the repository at this point in the history
  • Loading branch information
moretti committed Jun 13, 2023
1 parent e522c32 commit f9da1d1
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions npm/janus.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ declare namespace JanusJS {
}

interface OfferParams {
tracks?: TrackOptions[];
trickle?: boolean;
iceRestart?: boolean;
success?: (jsep: JSEP) => void;
error?: (error: Error) => void;
customizeSdp?: (jsep: JSEP) => void;

/** @deprecated use tracks instead */
media?: {
audioSend?: boolean;
audioRecv?: boolean;
Expand All @@ -187,10 +195,6 @@ declare namespace JanusJS {
failIfNoVideo?: boolean;
screenshareFrameRate?: number;
};
trickle?: boolean;
stream?: MediaStream;
success: Function;
error: (error: any) => void;
}

interface PluginMessage {
Expand Down Expand Up @@ -267,27 +271,27 @@ declare namespace JanusJS {
}

type TrackOption = {
add: boolean;
replace: boolean;
remove: boolean;
add?: boolean;
replace?: boolean;
remove?: boolean;
type: 'video' | 'screen' | 'audio' | 'data';
mid: string;
mid?: string;
capture: boolean | MediaStreamTrack;
recv: boolean;
group: 'default' | string;
gumGroup: TrackOption['group'];
simulcast: boolean;
svc: string;
simulcastMaxBitrates: {
low: number,
medium: number,
high: number,
recv?: boolean;
group?: 'default' | string;
gumGroup?: TrackOption['group'];
simulcast?: boolean;
svc?: string;
simulcastMaxBitrates?: {
low: number;
medium: number;
high: number;
};
sendEncodings: RTCRtpEncodingParameters;
framerate: number;
bitrate: number;
dontStop: boolean;
transforms: {
sendEncodings?: RTCRtpEncodingParameters;
framerate?: number;
bitrate?: number;
dontStop?: boolean;
transforms?: {
sender: ReadableWritablePair;
receiver: ReadableWritablePair;
};
Expand Down

0 comments on commit f9da1d1

Please sign in to comment.