Skip to content

Commit

Permalink
fix(types): fix last few types (#2417)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMcAssey authored Dec 18, 2023
1 parent 5227ea0 commit 47fc0fb
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion JitsiParticipant.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default class JitsiParticipant {

/**
* Returns a set with the features for the participant.
* @returns {Promise<Set<String>, Error>}
* @returns {Promise<Set<String>>}
*/
getFeatures() {
return Promise.resolve(this._features);
Expand Down
1 change: 1 addition & 0 deletions authenticateAndUpgradeRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import XMPP from './modules/xmpp/xmpp';
* @param {string} options.id - XMPP user's ID to log in. For example,
* user@xmpp-server.com.
* @param {string} options.password - XMPP user's password to log in with.
* @param {Function} [options.onCreateResource]
* @param {Function} [options.onLoginSuccessful] - Callback called when logging
* into the XMPP server was successful. The next step will be to obtain a new
* session ID from Jicofo and join the MUC using it which will effectively
Expand Down
3 changes: 2 additions & 1 deletion modules/RTC/JitsiLocalTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export default class JitsiLocalTrack extends JitsiTrack {
* @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.
* @param {string} trackInfo.facingMode - Thehe camera facing mode used in getUserMedia call (for mobile only).
* @param {sourceId} trackInfo.sourceId - The id of the desktop sharing source, which is the Chrome media source ID,
* @param {string} trackInfo.sourceId - The id of the desktop sharing source, which is the Chrome media source ID,
* returned by Desktop Picker on Electron. NOTE: defined for desktop sharing tracks only.
* @param {string} trackInfo.sourceType - The type of source the track originates from.
*/
constructor({
deviceId,
Expand Down
14 changes: 6 additions & 8 deletions modules/connectivity/TrackStreamingStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import { JitsiConferenceEvents } from '../../JitsiConferenceEvents';
import * as JitsiTrackEvents from '../../JitsiTrackEvents';
import RTCEvents from '../../service/RTC/RTCEvents';
import { createTrackStreamingStatusEvent } from '../../service/statistics/AnalyticsEvents';
import JitsiConference from '../../types/hand-crafted/JitsiConference';
import JitsiRemoteTrack from '../../types/hand-crafted/modules/RTC/JitsiRemoteTrack';
import RTC from '../../types/hand-crafted/modules/RTC/RTC';
import { VideoType } from '../../types/hand-crafted/service/RTC/VideoType';
import browser from '../browser';
import Statistics from '../statistics/statistics';
import JitsiRemoteTrack from '../RTC/JitsiRemoteTrack';
import { VideoType } from '../../service/RTC/VideoType';
import RTC from '../RTC/RTC';

/** Track streaming statuses. */
export enum TrackStreamingStatus {
Expand Down Expand Up @@ -38,7 +37,6 @@ export enum TrackStreamingStatus {
}

type StreamingStatusMap = {
// TODO: Replace this hand crafted VideoType when we convert VideoType.js to Typescript.
videoType?: VideoType,
startedMs?: number,
p2p?: boolean,
Expand Down Expand Up @@ -75,7 +73,7 @@ const DEFAULT_RESTORING_TIMEOUT = 10000;
*/
export class TrackStreamingStatusImpl {
rtc: RTC;
conference: JitsiConference;
conference: any; // TODO: needs JitsiConference type
track: JitsiRemoteTrack;

/** This holds the timeout callback ID scheduled using window.setTimeout. */
Expand Down Expand Up @@ -207,7 +205,7 @@ export class TrackStreamingStatusImpl {
*
* @constructor
* @param rtc - the RTC service instance
* @param conference - parent conference instance
* @param conference - parent conference instance // TODO: Needs JitsiConference Type
* @param {Object} options
* @param {number} [options.p2pRtcMuteTimeout=2500] custom value for
* {@link TrackStreamingStatusImpl.p2pRtcMuteTimeout}.
Expand All @@ -216,7 +214,7 @@ export class TrackStreamingStatusImpl {
* @param {number} [options.outOfForwardedSourcesTimeout=500] custom value for
* {@link TrackStreamingStatusImpl.outOfForwardedSourcesTimeout}.
*/
constructor(rtc: RTC, conference: JitsiConference, track: JitsiRemoteTrack, options: {
constructor(rtc: RTC, conference: any, track: JitsiRemoteTrack, options: {
outOfForwardedSourcesTimeout: number,
p2pRtcMuteTimeout: number,
rtcMuteTimeout: number
Expand Down
3 changes: 1 addition & 2 deletions modules/recording/JibriSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ export default class JibriSession {
/**
* Generates the message to change the status of the recording session.
*
* @param {string} status - The new status to which the recording session
* should transition.
* @param {string} [options.action] - The action to set the IQ
* @param {string} [options.appData] - Data specific to the app/service that
* the result file will be uploaded.
* @param {string} [options.broadcastId] - The broadcast ID of an
Expand Down
3 changes: 2 additions & 1 deletion modules/statistics/AudioOutputProblemDetector.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export default class AudioOutputProblemDetector {
* A listener for audio level data received by a remote participant.
*
* @param {string} userID - The user id of the participant that sent the data.
* @param {number} audioLevel - The average audio level value.
* @param {Object} result - The result object.
* @param {number} [result.avgAudioLevels] - The average audio level value.
* @returns {void}
*/
_onRemoteAudioLevelReceived(userID, { avgAudioLevels }) {
Expand Down
2 changes: 1 addition & 1 deletion modules/xmpp/Caps.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export default class Caps extends Listenable {
* Returns a set with the features for a host.
* @param {String} jid the jid of the host
* @param {int} timeout the timeout in ms for reply from the host.
* @returns {Promise<Set<String>, Error>}
* @returns {Promise<Set<String>>}
*/
getFeaturesAndIdentities(jid, node, timeout = 5000) {
return this._getDiscoInfo(jid, node, timeout);
Expand Down
6 changes: 4 additions & 2 deletions modules/xmpp/XmppConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,10 @@ export default class XmppConnection extends Listenable {
* which would fail immediately if disconnected).
*
* @param {Element} iq - The IQ to send.
* @param {number} timeout - How long to wait for the response. The time when the connection is reconnecting is
* included, which means that the IQ may never be sent and still fail with a timeout.
* @param {Object} options - Options object
* @param {options.timeout} timeout - How long to wait for the response.
* The time when the connection is reconnecting is included, which means that
* the IQ may never be sent and still fail with a timeout.
*/
sendIQ2(iq, { timeout }) {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion modules/xmpp/strophe.ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class PingConnectionPlugin extends ConnectionPlugin {
* @param {Object} options
* @param {Function} options.onPingThresholdExceeded - Callback called when ping fails too many times (controlled
* by the {@link PING_THRESHOLD} constant).
* @param {Function} options._getTimeSinceLastServerResponse - A function to obtain the last seen
* @param {Function} options.getTimeSinceLastServerResponse - A function to obtain the last seen
* response from the server.
* @param {Object} options.pingOptions - The ping options if any.
* @constructor
Expand Down

0 comments on commit 47fc0fb

Please sign in to comment.