Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Coding style: consistency, jsdocs

Lyubo Marinovd1e5e6b93ba9
diff --git a/react/features/base/jwt/components/CallOverlay.js b/react/features/base/jwt/components/CallOverlay.js
index fe0cfab96b..d601d5bd95 100644
--- a/react/features/base/jwt/components/CallOverlay.js
+++ b/react/features/base/jwt/components/CallOverlay.js
@@ -1,4 +1,4 @@
-/* @flow */
+// @flow
import PropTypes from 'prop-types';
import React, { Component } from 'react';
@@ -22,6 +22,27 @@ declare var interfaceConfig: Object;
* @extends Component
*/
class CallOverlay extends Component<*, *> {
+ /**
+ * {@code CallOverlay} component's property types.
+ *
+ * @static
+ */
+ static propTypes = {
+ _callee: PropTypes.object
+ };
+
+ /**
+ * Determines whether this overlay needs to be rendered (according to a
+ * specific redux state). Called by {@link OverlayContainer}.
+ *
+ * @param {Object} state - The redux state.
+ * @returns {boolean} - If this overlay needs to be rendered, {@code true};
+ * {@code false}, otherwise.
+ */
+ static needsRender(state) {
+ return state['features/base/jwt'].callOverlayVisible;
+ }
+
/**
* The (reference to the) {@link Audio} which plays/renders the audio
* depicting the ringing phase of the call establishment represented by this
@@ -68,27 +89,6 @@ class CallOverlay extends Component<*, *> {
ringing: boolean
}
- /**
- * {@code CallOverlay} component's property types.
- *
- * @static
- */
- static propTypes = {
- _callee: PropTypes.object
- };
-
- /**
- * Check if this overlay needs to be rendered. This function will be called
- * by the {@code OverlayContainer}.
- *
- * @param {Object} state - The redux state.
- * @returns {boolean} - True if this overlay needs to be rendered, false
- * otherwise.
- */
- static needsRender(state) {
- return state['features/base/jwt'].callOverlayVisible;
- }
-
/**
* Initializes a new {@code CallOverlay} instance.
*
diff --git a/react/features/base/lib-jitsi-meet/functions.js b/react/features/base/lib-jitsi-meet/functions.js
index 4facaffda2..e6be16e183 100644
--- a/react/features/base/lib-jitsi-meet/functions.js
+++ b/react/features/base/lib-jitsi-meet/functions.js
@@ -1,8 +1,8 @@
-/* @flow */
+// @flow
-import { setConfigFromURLParams } from '../../base/config';
-import { toState } from '../../base/redux';
-import { loadScript } from '../../base/util';
+import { setConfigFromURLParams } from '../config';
+import { toState } from '../redux';
+import { loadScript } from '../util';
import JitsiMeetJS from './_';
@@ -54,17 +54,18 @@ export function isAnalyticsEnabled(stateful: Function | Object) {
}
/**
- * Determines whether a specific JitsiConferenceErrors instance indicates a
- * fatal JitsiConference error.
+ * Determines whether a specific {@link JitsiConferenceErrors} instance
+ * indicates a fatal {@link JitsiConference} error.
*
* FIXME Figure out the category of errors defined by the function and describe
* that category. I've currently named the category fatal because it appears to
* be used in the cases of unrecoverable errors that necessitate a reload.
*
- * @param {Object|string} error - The JitsiConferenceErrors instance to
- * categorize/classify or an Error-like object.
- * @returns {boolean} True if the specified JitsiConferenceErrors instance
- * indicates a fatal JitsiConference error; otherwise, false.
+ * @param {Object|string} error - The {@code JitsiConferenceErrors} instance to
+ * categorize/classify or an {@link Error}-like object.
+ * @returns {boolean} If the specified {@code JitsiConferenceErrors} instance
+ * indicates a fatal {@code JitsiConference} error, {@code true}; otherwise,
+ * {@code false}.
*/
export function isFatalJitsiConferenceError(error: Object | string) {
if (typeof error !== 'string') {
@@ -78,17 +79,18 @@ export function isFatalJitsiConferenceError(error: Object | string) {
}
/**
- * Determines whether a specific JitsiConnectionErrors instance indicates a
- * fatal JitsiConnection error.
+ * Determines whether a specific {@link JitsiConnectionErrors} instance
+ * indicates a fatal {@link JitsiConnection} error.
*
* FIXME Figure out the category of errors defined by the function and describe
* that category. I've currently named the category fatal because it appears to
* be used in the cases of unrecoverable errors that necessitate a reload.
*
- * @param {Object|string} error - The JitsiConnectionErrors instance to
- * categorize/classify or an Error-like object.
- * @returns {boolean} True if the specified JitsiConnectionErrors instance
- * indicates a fatal JitsiConnection error; otherwise, false.
+ * @param {Object|string} error - The {@code JitsiConnectionErrors} instance to
+ * categorize/classify or an {@link Error}-like object.
+ * @returns {boolean} If the specified {@code JitsiConnectionErrors} instance
+ * indicates a fatal {@code JitsiConnection} error, {@code true}; otherwise,
+ * {@code false}.
*/
export function isFatalJitsiConnectionError(error: Object | string) {
if (typeof error !== 'string') {
diff --git a/react/features/overlay/components/AbstractPageReloadOverlay.js b/react/features/overlay/components/AbstractPageReloadOverlay.js
index b8cdc14ffa..97ae75040f 100644
--- a/react/features/overlay/components/AbstractPageReloadOverlay.js
+++ b/react/features/overlay/components/AbstractPageReloadOverlay.js
@@ -1,4 +1,4 @@
-/* @flow */
+// @flow
import PropTypes from 'prop-types';
import React, { Component } from 'react';
@@ -17,11 +17,11 @@ declare var APP: Object;
const logger = require('jitsi-meet-logger').getLogger(__filename);
/**
- * Implements abstract React Component for the page reload overlays.
+ * Implements an abstract React {@link Component} for the page reload overlays.
*/
export default class AbstractPageReloadOverlay extends Component<*, *> {
/**
- * AbstractPageReloadOverlay component's property types.
+ * {@code AbstractPageReloadOverlay} component's property types.
*
* @static
*/
@@ -55,6 +55,25 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
t: PropTypes.func
};
+ /**
+ * Determines whether this overlay needs to be rendered (according to a
+ * specific redux state). Called by {@link OverlayContainer}.
+ *
+ * @param {Object} state - The redux state.
+ * @returns {boolean} - If this overlay needs to be rendered, {@code true};
+ * {@code false}, otherwise.
+ */
+ static needsRender(state) {
+ const conferenceError = state['features/base/conference'].error;
+ const connectionError = state['features/base/connection'].error;
+
+ return (
+ (connectionError && isFatalJitsiConnectionError(connectionError))
+ || (conferenceError
+ && isFatalJitsiConferenceError(conferenceError))
+ );
+ }
+
_interval: ?number
state: {
@@ -89,25 +108,6 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
title: string
}
- /**
- * Check if this overlay needs to be rendered. This function will be called
- * by the {@code OverlayContainer}.
- *
- * @param {Object} state - The redux state.
- * @returns {boolean} - True if this overlay needs to be rendered, false
- * otherwise.
- */
- static needsRender(state) {
- const conferenceError = state['features/base/conference'].error;
- const connectionError = state['features/base/connection'].error;
-
- return (
- (connectionError && isFatalJitsiConnectionError(connectionError))
- || (conferenceError
- && isFatalJitsiConferenceError(conferenceError))
- );
- }
-
/**
* Initializes a new AbstractPageReloadOverlay instance.
*
@@ -220,10 +220,10 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
* @returns {ReactElement}
*/
_renderProgressBar() {
- const { timeoutSeconds, timeLeft } = this.state;
+ const { timeLeft, timeoutSeconds } = this.state;
const timeRemaining = timeoutSeconds - timeLeft;
- const percentageComplete = Math.floor(
- (timeRemaining / timeoutSeconds) * 100);
+ const percentageComplete
+ = Math.floor((timeRemaining / timeoutSeconds) * 100);
return (
<div
@@ -231,9 +231,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
id = 'reloadProgressBar'>
<div
className = 'progress-indicator-fill'
- style = {{
- width: `${percentageComplete}%`
- }} />
+ style = {{ width: `${percentageComplete}%` }} />
</div>
);
}
@@ -243,11 +241,11 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
* Maps (parts of) the redux state to the associated component's props.
*
* @param {Object} state - The redux state.
+ * @protected
* @returns {{
- * isNetworkFailure: boolean,
- * reason: string
+ * isNetworkFailure: boolean,
+ * reason: string
* }}
- * @protected
*/
export function abstractMapStateToProps(state: Object) {
const conferenceError = state['features/base/conference'].error;
diff --git a/react/features/overlay/components/AbstractSuspendedOverlay.js b/react/features/overlay/components/AbstractSuspendedOverlay.js
index 1acb17392e..14f13afac2 100644
--- a/react/features/overlay/components/AbstractSuspendedOverlay.js
+++ b/react/features/overlay/components/AbstractSuspendedOverlay.js
@@ -2,12 +2,12 @@ import PropTypes from 'prop-types';
import { Component } from 'react';
/**
- * Implements a React Component for suspended overlay. Shown when a suspend is
- * detected.
+ * Implements a React {@link Component} for suspended overlay. Shown when a
+ * suspend is detected.
*/
export default class AbstractSuspendedOverlay extends Component {
/**
- * SuspendedOverlay component's property types.
+ * {@code AbstractSuspendedOverlay} component's property types.
*
* @static
*/
@@ -22,24 +22,14 @@ export default class AbstractSuspendedOverlay extends Component {
};
/**
- * Check if this overlay needs to be rendered. This function will be called
- * by the {@code OverlayContainer}.
+ * Determines whether this overlay needs to be rendered (according to a
+ * specific redux state). Called by {@link OverlayContainer}.
*
* @param {Object} state - The redux state.
- * @returns {boolean} - True if this overlay needs to be rendered, false
- * otherwise.
+ * @returns {boolean} - If this overlay needs to be rendered, {@code true};
+ * {@code false}, otherwise.
*/
static needsRender(state) {
return state['features/overlay'].suspendDetected;
}
-
- /**
- * Implements React's {@link Component#render()}.
- *
- * @inheritdoc
- * @returns {ReactElement|null}
- */
- render() {
- return null;
- }
}
diff --git a/react/features/overlay/components/AbstractUserMediaPermissionsOverlay.js b/react/features/overlay/components/AbstractUserMediaPermissionsOverlay.js
index 40177f57bd..2de53e2d00 100644
--- a/react/features/overlay/components/AbstractUserMediaPermissionsOverlay.js
+++ b/react/features/overlay/components/AbstractUserMediaPermissionsOverlay.js
@@ -1,14 +1,13 @@
import PropTypes from 'prop-types';
import { Component } from 'react';
-
/**
- * Implements a React Component for overlay with guidance how to proceed with
- * gUM prompt.
+ * Implements a React {@link Component} for overlay with guidance how to proceed
+ * with gUM prompt.
*/
export default class AbstractUserMediaPermissionsOverlay extends Component {
/**
- * UserMediaPermissionsOverlay component's property types.
+ * {@code AbstractUserMediaPermissionsOverlay} component's property types.
*
* @static
*/
@@ -32,36 +31,26 @@ export default class AbstractUserMediaPermissionsOverlay extends Component {
};
/**
- * Check if this overlay needs to be rendered. This function will be called
- * by the {@code OverlayContainer}.
+ * Determines whether this overlay needs to be rendered (according to a
+ * specific redux state). Called by {@link OverlayContainer}.
*
* @param {Object} state - The redux state.
- * @returns {boolean} - True if this overlay needs to be rendered, false
- * otherwise.
+ * @returns {boolean} - If this overlay needs to be rendered, {@code true};
+ * {@code false}, otherwise.
*/
static needsRender(state) {
return state['features/overlay'].isMediaPermissionPromptVisible;
}
-
- /**
- * Implements React's {@link Component#render()}.
- *
- * @inheritdoc
- * @returns {ReactElement|null}
- */
- render() {
- return null;
- }
}
/**
* Maps (parts of) the redux state to the associated component's props.
*
* @param {Object} state - The redux state.
+ * @protected
* @returns {{
- * browser: string
+ * browser: string
* }}
- * @protected
*/
export function abstractMapStateToProps(state) {
const { browser } = state['features/overlay'];
diff --git a/react/features/overlay/components/FilmstripOnlyOverlayFrame.js b/react/features/overlay/components/FilmstripOnlyOverlayFrame.js
index 9898e35ddf..9e3fbeadc5 100644
--- a/react/features/overlay/components/FilmstripOnlyOverlayFrame.js
+++ b/react/features/overlay/components/FilmstripOnlyOverlayFrame.js
@@ -82,7 +82,7 @@ class FilmstripOnlyOverlayFrame extends Component {
* Implements React's {@link Component#render()}.
*
* @inheritdoc
- * @returns {ReactElement|null}
+ * @returns {ReactElement}
*/
render() {
return (
diff --git a/react/features/overlay/components/OverlayContainer.js b/react/features/overlay/components/OverlayContainer.js
index 44729c8ed1..b1c9da5208 100644
--- a/react/features/overlay/components/OverlayContainer.js
+++ b/react/features/overlay/components/OverlayContainer.js
@@ -51,8 +51,8 @@ function getOverlays() {
}
/**
- * Implements a React Component that will display the correct overlay when
- * needed.
+ * Implements a React {@link Component} that will display the correct overlay
+ * when needed.
*/
class OverlayContainer extends Component {
/**
@@ -71,8 +71,8 @@ class OverlayContainer extends Component {
* Implements React's {@link Component#render()}.
*
* @inheritdoc
- * @returns {ReactElement|null}
* @public
+ * @returns {ReactElement|null}
*/
render() {
const { overlay } = this.props;
@@ -82,13 +82,14 @@ class OverlayContainer extends Component {
}
/**
- * Maps (parts of) the redux state to the associated OverlayContainer's props.
+ * Maps (parts of) the redux state to the associated {@code OverlayContainer}'s
+ * props.
*
* @param {Object} state - The redux state.
+ * @private
* @returns {{
- * overlay: ?Object
+ * overlay: ?Object
* }}
- * @private
*/
function _mapStateToProps(state) {
let overlay;
diff --git a/react/features/overlay/components/OverlayFrame.js b/react/features/overlay/components/OverlayFrame.js
index 03041a4337..5d6d428fb5 100644
--- a/react/features/overlay/components/OverlayFrame.js
+++ b/react/features/overlay/components/OverlayFrame.js
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
/**
- * Implements a React Component for the frame of the overlays.
+ * Implements a React {@link Component} for the frame of the overlays.
*/
export default class OverlayFrame extends Component {
/**
diff --git a/react/features/overlay/components/SuspendedFilmstripOnlyOverlay.js b/react/features/overlay/components/SuspendedFilmstripOnlyOverlay.js
index 0601e4d772..ec0c0a7845 100644
--- a/react/features/overlay/components/SuspendedFilmstripOnlyOverlay.js
+++ b/react/features/overlay/components/SuspendedFilmstripOnlyOverlay.js
@@ -15,8 +15,7 @@ class SuspendedFilmstripOnlyOverlay extends AbstractSuspendedOverlay {
* Implements React's {@link Component#render()}.
*
* @inheritdoc
- * @override
- * @returns {ReactElement|null}
+ * @returns {ReactElement}
*/
render() {
const { t } = this.props;
diff --git a/react/features/overlay/components/SuspendedOverlay.js b/react/features/overlay/components/SuspendedOverlay.js
index 05dcf44220..a236eab8c6 100644
--- a/react/features/overlay/components/SuspendedOverlay.js
+++ b/react/features/overlay/components/SuspendedOverlay.js
@@ -15,8 +15,7 @@ class SuspendedOverlay extends AbstractSuspendedOverlay {
* Implements React's {@link Component#render()}.
*
* @inheritdoc
- * @override
- * @returns {ReactElement|null}
+ * @returns {ReactElement}
*/
render() {
const { t } = this.props;
diff --git a/react/features/overlay/components/UserMediaPermissionsFilmstripOnlyOverlay.js b/react/features/overlay/components/UserMediaPermissionsFilmstripOnlyOverlay.js
index 26f5d28b9a..dcd23394fd 100644
--- a/react/features/overlay/components/UserMediaPermissionsFilmstripOnlyOverlay.js
+++ b/react/features/overlay/components/UserMediaPermissionsFilmstripOnlyOverlay.js
@@ -13,12 +13,12 @@ import FilmstripOnlyOverlayFrame from './FilmstripOnlyOverlayFrame';
*/
class UserMediaPermissionsFilmstripOnlyOverlay
extends AbstractUserMediaPermissionsOverlay {
+
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
- * @override
- * @returns {ReactElement|null}
+ * @returns {ReactElement}
*/
render() {
const { t } = this.props;
diff --git a/react/features/overlay/components/UserMediaPermissionsOverlay.js b/react/features/overlay/components/UserMediaPermissionsOverlay.js
index a0d3fc5a0f..b10171e86a 100644
--- a/react/features/overlay/components/UserMediaPermissionsOverlay.js
+++ b/react/features/overlay/components/UserMediaPermissionsOverlay.js
@@ -38,8 +38,7 @@ class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
* Implements React's {@link Component#render()}.
*
* @inheritdoc
- * @override
- * @returns {ReactElement|null}
+ * @returns {ReactElement}
*/
render() {
const { browser, t } = this.props;
@@ -77,8 +76,8 @@ class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
/**
* Renders the policy logo.
*
- * @returns {ReactElement|null}
* @private
+ * @returns {ReactElement|null}
*/
_renderPolicyLogo() {
const { policyLogoSrc } = this.state;