Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): update to TS 5.3.3 and fix types #2419

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
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
34 changes: 19 additions & 15 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ JitsiConference.prototype._registerRtcListeners = function(rtc) {
* Sends the 'VideoTypeMessage' to the bridge on the bridge channel so that the bridge can make bitrate allocation
* decisions based on the video type of the local source.
*
* @param {JitsiLocalTrack} localtrack - The track associated with the local source signaled to the bridge.
* @param {JitsiLocalTrack} localtrack - The track associated with the local
* source signaled to the bridge.
* @returns {void}
* @private
*/
Expand Down Expand Up @@ -1223,7 +1224,7 @@ JitsiConference.prototype._getInitialLocalTracks = function() {

/**
* Clear JitsiLocalTrack properties and listeners.
* @param track the JitsiLocalTrack object.
* @param {JitsiLocalTrack} track the JitsiLocalTrack object.
*/
JitsiConference.prototype.onLocalTrackRemoved = function(track) {
track.setConference(null);
Expand Down Expand Up @@ -1436,7 +1437,8 @@ JitsiConference.prototype._setTrackMuteStatus = function(mediaType, localTrack,
};

/**
* Method called by the {@link JitsiLocalTrack} in order to add the underlying MediaStream to the RTCPeerConnection.
* Method called by the {@link JitsiLocalTrack} in order to add the underlying
* MediaStream to the RTCPeerConnection.
*
* @param {JitsiLocalTrack} track the local track that will be added to the pc.
* @return {Promise} resolved when the process is done or rejected with a string which describes the error.
Expand All @@ -1460,7 +1462,8 @@ JitsiConference.prototype._addLocalTrackToPc = function(track) {
};

/**
* Method called by the {@link JitsiLocalTrack} in order to remove the underlying MediaStream from the
* Method called by the {@link JitsiLocalTrack} in order to remove the underlying
* MediaStream from the
* RTCPeerConnection.
*
* @param {JitsiLocalTrack} track the local track that will be removed.
Expand Down Expand Up @@ -1985,7 +1988,8 @@ JitsiConference.prototype.onDisplayNameChanged = function(jid, displayName) {
/**
* Notifies this JitsiConference that a JitsiRemoteTrack was added to the conference.
*
* @param {JitsiRemoteTrack} track the JitsiRemoteTrack which was added to this JitsiConference.
* @param {JitsiRemoteTrack} track the JitsiRemoteTrack which was added to this
* JitsiConference.
*/
JitsiConference.prototype.onRemoteTrackAdded = function(track) {
if (track.isP2P && !this.isP2PActive()) {
Expand Down Expand Up @@ -2031,7 +2035,7 @@ JitsiConference.prototype.onRemoteTrackAdded = function(track) {
* Callback called by the Jingle plugin when 'session-answer' is received.
* @param {JingleSessionPC} session the Jingle session for which an answer was
* received.
* @param {jQuery} answer a jQuery selector pointing to 'jingle' IQ element
* @param {JQuery} answer a jQuery selector pointing to 'jingle' IQ element
*/
// eslint-disable-next-line no-unused-vars
JitsiConference.prototype.onCallAccepted = function(session, answer) {
Expand All @@ -2047,7 +2051,7 @@ JitsiConference.prototype.onCallAccepted = function(session, answer) {
* Callback called by the Jingle plugin when 'transport-info' is received.
* @param {JingleSessionPC} session the Jingle session for which the IQ was
* received
* @param {jQuery} transportInfo a jQuery selector pointing to 'jingle' IQ
* @param {JQuery} transportInfo a jQuery selector pointing to 'jingle' IQ
* element
*/
// eslint-disable-next-line no-unused-vars
Expand Down Expand Up @@ -2240,11 +2244,11 @@ JitsiConference.prototype._acceptJvbIncomingCall = function(jingleSession, jingl
/**
* Sets the BridgeChannel.
*
* @param {jQuery} offerIq a jQuery selector pointing to the jingle element of
* @param {JQuery} offerIq a jQuery selector pointing to the jingle element of
* the offer IQ which may carry the WebSocket URL for the 'websocket'
* BridgeChannel mode.
* @param {TraceablePeerConnection} pc the peer connection which will be used
* to listen for new WebRTC Data Channels (in the 'datachannel' mode).
* @param {TraceablePeerConnection} pc the peer connection which will be
* used to listen for new WebRTC Data Channels (in the 'datachannel' mode).
*/
JitsiConference.prototype._setBridgeChannel = function(offerIq, pc) {
const ignoreDomain = this.connection?.options?.bridgeChannel?.ignoreDomain;
Expand Down Expand Up @@ -2875,7 +2879,7 @@ JitsiConference.prototype._onIceConnectionRestored = function(session) {
/**
* Accept incoming P2P Jingle call.
* @param {JingleSessionPC} jingleSession the session instance
* @param {jQuery} jingleOffer a jQuery selector pointing to 'jingle' IQ element
* @param {JQuery} jingleOffer a jQuery selector pointing to 'jingle' IQ element
* @private
*/
JitsiConference.prototype._acceptP2PIncomingCall = function(jingleSession, jingleOffer) {
Expand Down Expand Up @@ -3444,8 +3448,8 @@ JitsiConference.prototype._stopP2PSession = function(options = {}) {

/**
* Updates room presence if needed and send the packet in case of a modification.
* @param {JingleSessionPC} jingleSession the session firing the event, contains the peer connection which
* tracks we will check.
* @param {JingleSessionPC} jingleSession the session firing the event, contains
* the peer connection which tracks we will check.
* @param {Object|null} ctx a context object we can distinguish multiple calls of the same pass of updating tracks.
*/
JitsiConference.prototype._updateRoomPresence = function(jingleSession, ctx) {
Expand Down Expand Up @@ -3634,8 +3638,8 @@ JitsiConference.prototype.setSenderVideoConstraint = function(maxFrameHeight) {
*
* @param {string} sipAddress - The sip address to be used.
* @param {string} displayName - The display name to be used for this session.
* @returns {JitsiVideoSIPGWSession|Error} Returns null if conference is not
* initialised and there is no room.
* @returns {JitsiVideoSIPGWSession|Error} Returns null if
* conference is not initialised and there is no room.
*/
JitsiConference.prototype.createVideoSIPGWSession = function(sipAddress, displayName) {
if (!this.room) {
Expand Down
18 changes: 9 additions & 9 deletions JitsiParticipant.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default class JitsiParticipant {
*
* @constructor
* @param jid the conference XMPP jid
* @param conference
* @param displayName
* @param {Boolean} hidden - True if the new JitsiParticipant instance is to
* @param {JitsiConference} conference
* @param {string} displayName
* @param {boolean} hidden - True if the new JitsiParticipant instance is to
* represent a hidden participant; otherwise, false.
* @param {string} statsID - optional participant statsID
* @param {string} status - the initial status if any.
Expand Down Expand Up @@ -64,7 +64,7 @@ export default class JitsiParticipant {
*
* @param {MediaType} mediaType - The MediaType of the JitsiTracks to be checked.
* @private
* @returns {Boolean} True if all JitsiTracks which are of the specified mediaType and which belong to this
* @returns {boolean} True if all JitsiTracks which are of the specified mediaType and which belong to this
* JitsiParticipant are muted; otherwise, false.
*/
_isMediaTypeMuted(mediaType) {
Expand Down Expand Up @@ -202,7 +202,7 @@ export default class JitsiParticipant {
}

/**
* @returns {Array.<JitsiTrack>} The list of media tracks for this
* @returns {Array<JitsiTrack>} The list of media tracks for this
* participant.
*/
getTracks() {
Expand All @@ -211,7 +211,7 @@ export default class JitsiParticipant {

/**
* @param {MediaType} mediaType
* @returns {Array.<JitsiTrack>} an array of media tracks for this
* @returns {Array<JitsiTrack>} an array of media tracks for this
* participant, for given media type.
*/
getTracksByMediaType(mediaType) {
Expand Down Expand Up @@ -326,8 +326,8 @@ export default class JitsiParticipant {
/**
* Sets the value of a property of this participant, and fires an event if
* the value has changed.
* @name the name of the property.
* @value the value to set.
* @param name the name of the property.
* @param value the value to set.
*/
setProperty(name, value) {
const oldValue = this._properties[name];
Expand All @@ -352,7 +352,7 @@ export default class JitsiParticipant {
}

/**
*
* @returns {boolean} returns 'true' if supports DTMF, 'false' otherwise
*/
supportsDTMF() {
return this._supportsDTMF;
Expand Down
10 changes: 6 additions & 4 deletions modules/RTC/BridgeChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ export default class BridgeChannel {
* instance, or creates a WebSocket connection with the videobridge.
* At least one of both, peerconnection or wsUrl parameters, must be
* given.
* @param {RTCPeerConnection} [peerconnection] WebRTC peer connection
* @param {RTCPeerConnection|null} peerconnection WebRTC peer connection
* instance.
* @param {string} [wsUrl] WebSocket URL.
* @param {EventEmitter} emitter the EventEmitter instance to use for event emission.
* @param {string|null} wsUrl WebSocket URL.
* @param {EventEmitter} emitter the EventEmitter instance to use for
* event emission.
* @param {JitsiConference} conference the conference instance.
*/
constructor(peerconnection, wsUrl, emitter, conference) {
Expand Down Expand Up @@ -239,7 +240,8 @@ export default class BridgeChannel {
/**
* Sends a 'ReceiverVideoConstraints' message via the bridge channel.
*
* @param {ReceiverVideoConstraints} constraints video constraints.
* @param {ReceiverVideoConstraints} constraints video
* constraints.
*/
sendReceiverVideoConstraintsMessage(constraints) {
logger.log(`Sending ReceiverVideoConstraints with ${JSON.stringify(constraints)}`);
Expand Down
5 changes: 3 additions & 2 deletions modules/RTC/CodecSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class CodecSelection {
* Creates a new instance for a given conference.
*
* @param {JitsiConference} conference the conference instance
* @param {*} options
* @param {Object} options
* @param {string} options.jvb settings (codec list, preferred and disabled) for the jvb connection.
* @param {string} options.p2p settings (codec list, preferred and disabled) for the p2p connection.
*/
Expand Down Expand Up @@ -131,7 +131,8 @@ export class CodecSelection {
* Sets the codec on the media session based on the codec preference order configured in config.js and the supported
* codecs published by the remote participants in their presence.
*
* @param {JingleSessionPC} mediaSession session for which the codec selection has to be made.
* @param {JingleSessionPC} mediaSession session for which the codec
* selection has to be made.
*/
_selectPreferredCodec(mediaSession) {
const session = mediaSession ? mediaSession : this.conference.jvbJingleSession;
Expand Down
13 changes: 7 additions & 6 deletions modules/RTC/JitsiLocalTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export default class JitsiLocalTrack extends JitsiTrack {
* @constructor
* @param {Object} trackInfo
* @param {number} trackInfo.rtcId - The ID assigned by the RTC module.
* @param {Object} trackInfo.stream - The WebRTC MediaStream, parent of the track.
* @param {Object} trackInfo.track - The underlying WebRTC MediaStreamTrack for new JitsiLocalTrack.
* @param {string} trackInfo.mediaType - The MediaType of the JitsiLocalTrack.
* @param {string} trackInfo.videoType - The VideoType of the JitsiLocalTrack.
* @param {MediaStream} trackInfo.stream - The WebRTC MediaStream, parent of the track.
* @param {MediaStreamTrack} trackInfo.track - The underlying WebRTC MediaStreamTrack for new JitsiLocalTrack.
* @param {MediaType} trackInfo.mediaType - The MediaType of the JitsiLocalTrack.
* @param {VideoType} trackInfo.videoType - The VideoType of the JitsiLocalTrack.
* @param {Array<Object>} trackInfo.effects - The effects to be applied to the JitsiLocalTrack.
* @param {number} trackInfo.resolution - The the video resolution if it's a video track
* @param {string} trackInfo.deviceId - The ID of the local device for this track.
Expand Down Expand Up @@ -783,7 +783,8 @@ export default class JitsiLocalTrack extends JitsiTrack {
/**
* Handles bytes sent statistics. NOTE: used only for audio tracks to detect audio issues.
*
* @param {TraceablePeerConnection} tpc - The peerconnection that is reporting the bytes sent stat.
* @param {TraceablePeerConnection} tpc - The peerconnection
* that is reporting the bytes sent stat.
* @param {number} bytesSent - The new value.
* @returns {void}
*/
Expand All @@ -809,7 +810,7 @@ export default class JitsiLocalTrack extends JitsiTrack {
/**
* Sets the JitsiConference object associated with the track. This is temp solution.
*
* @param conference - JitsiConference object.
* @param {JitsiConference} conference - JitsiConference object.
* @returns {void}
*/
setConference(conference) {
Expand Down
8 changes: 4 additions & 4 deletions modules/RTC/JitsiRemoteTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default class JitsiRemoteTrack extends JitsiTrack {

/**
* Sets current muted status and fires an events for the change.
* @param value the muted status.
* @param {boolean} value the muted status.
*/
setMute(value) {
if (this.muted === value) {
Expand All @@ -229,7 +229,7 @@ export default class JitsiRemoteTrack extends JitsiTrack {

/**
* Returns the current muted status of the track.
* @returns {boolean|*|JitsiRemoteTrack.muted} <tt>true</tt> if the track is
* @returns {boolean} <tt>true</tt> if the track is
* muted and <tt>false</tt> otherwise.
*/
isMuted() {
Expand Down Expand Up @@ -350,7 +350,7 @@ export default class JitsiRemoteTrack extends JitsiTrack {
/**
* Attach time to first media tracker only if there is conference and only
* for the first element.
* @param container the HTML container which can be 'video' or 'audio'
* @param {HTMLElement} container the HTML container which can be 'video' or 'audio'
* element.
* @private
*/
Expand Down Expand Up @@ -462,7 +462,7 @@ export default class JitsiRemoteTrack extends JitsiTrack {
/**
* Updates track's streaming status.
*
* @param {string} state the current track streaming state. {@link TrackStreamingStatus}.
* @param {string} status the current track streaming state. {@link TrackStreamingStatus}.
*/
_setTrackStreamingStatus(status) {
this._trackStreamingStatus = status;
Expand Down
25 changes: 15 additions & 10 deletions modules/RTC/JitsiTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export default class JitsiTrack extends EventEmitter {
/**
* Represents a single media track (either audio or video).
* @constructor
* @param conference the rtc instance
* @param stream the WebRTC MediaStream instance
* @param track the WebRTC MediaStreamTrack instance, must be part of
* @param {JitsiConference} conference the rtc instance
* @param {MediaStream} stream the WebRTC MediaStream instance
* @param {MediaStreamTrack} track the WebRTC MediaStreamTrack instance, must be part of
* the given <tt>stream</tt>.
* @param streamInactiveHandler the function that will handle
* @param {function} streamInactiveHandler the function that will handle
* onended/oninactive events of the stream.
* @param trackMediaType the media type of the JitsiTrack
* @param videoType the VideoType for this track if any
* @param {MediaType} trackMediaType the media type of the JitsiTrack
* @param {VideoType} videoType the VideoType for this track if any
*/
constructor(
conference,
Expand Down Expand Up @@ -206,7 +206,7 @@ export default class JitsiTrack extends EventEmitter {
* Adds the container to the list of containers that are displaying the
* track.
*
* @param container the HTML container which can be 'video' or 'audio'
* @param {HTMLElement} container the HTML container which can be 'video' or 'audio'
* element.
*
* @returns {void}
Expand All @@ -227,7 +227,7 @@ export default class JitsiTrack extends EventEmitter {
/**
* Removes this JitsiTrack from the passed HTML container.
*
* @param container the HTML container to detach from this JitsiTrack. If
* @param {HTMLElement} container the HTML container to detach from this JitsiTrack. If
* <tt>null</tt> or <tt>undefined</tt>, all containers are removed. A
* container can be a 'video', 'audio' or 'object' HTML element instance to
* which this JitsiTrack is currently attached.
Expand Down Expand Up @@ -356,20 +356,23 @@ export default class JitsiTrack extends EventEmitter {

/**
* Returns the video type (camera or desktop) of this track.
* @returns {VideoType|null} the type of video
*/
getVideoType() {
return this.videoType;
}

/**
* Returns the height of the track in normalized landscape format.
* @returns {number} height of track
*/
getHeight() {
return Math.min(this.track.getSettings().height, this.track.getSettings().width);
}

/**
* Returns the width of the track in normalized landscape format.
* @returns {number} width of track
*/
getWidth() {
return Math.max(this.track.getSettings().height, this.track.getSettings().width);
Expand All @@ -391,6 +394,7 @@ export default class JitsiTrack extends EventEmitter {

/**
* Check if this is an audio track.
* @return {boolean} is an audio track
*/
isAudioTrack() {
return this.getType() === MediaType.AUDIO;
Expand All @@ -416,6 +420,7 @@ export default class JitsiTrack extends EventEmitter {

/**
* Check if this is a video track.
* @return {boolean} 'true' if a video track or 'false' otherwise
*/
isVideoTrack() {
return this.getType() === MediaType.VIDEO;
Expand All @@ -434,8 +439,8 @@ export default class JitsiTrack extends EventEmitter {
/**
* Sets the audio level for the stream
* @param {number} audioLevel value between 0 and 1
* @param {TraceablePeerConnection} [tpc] the peerconnection instance which
* is source for the audio level. It can be <tt>undefined</tt> for
* @param {TraceablePeerConnection} [tpc] the peerconnection
* instance which is source for the audio level. It can be <tt>undefined</tt> for
* a local track if the audio level was measured outside of the
* peerconnection (see /modules/statistics/LocalStatsCollector.js).
*/
Expand Down
7 changes: 4 additions & 3 deletions modules/RTC/RTC.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,15 @@ export default class RTC extends Listenable {

/**
* Creates new <tt>TraceablePeerConnection</tt>
* @param {SignalingLayer} signaling The signaling layer that will provide information about the media or
* participants which is not carried over SDP.
* @param {SignalingLayer} signaling The signaling layer that will provide
* information about the media or participants which is not carried over SDP.
* @param {object} pcConfig The {@code RTCConfiguration} to use for the WebRTC peer connection.
* @param {boolean} isP2P Indicates whether or not the new TPC will be used in a peer to peer type of session.
* @param {object} options The config options.
* @param {Object} options.audioQuality - Quality settings to applied on the outbound audio stream.
* @param {boolean} options.capScreenshareBitrate if set to true, lower layers will be disabled for screenshare.
* @param {Array<CodecMimeType>} options.codecSettings - codec settings to be applied for video streams.
* @param {Array<CodecMimeType>} options.codecSettings - codec settings to be
* applied for video streams.
* @param {boolean} options.disableSimulcast if set to 'true' will disable the simulcast.
* @param {boolean} options.disableRtx if set to 'true' will disable the RTX.
* @param {boolean} options.enableInsertableStreams set to true when the insertable streams constraints is to be
Expand Down
Loading