From efb69d5382e5fb2599de733dcefba54885c6a205 Mon Sep 17 00:00:00 2001 From: Robert Pintilii Date: Tue, 6 Sep 2022 20:32:20 +0300 Subject: [PATCH] ref: Improve TS files (#12130) Remove unnecessary ts-ignores Change any to actual types Fix eslint rule --- react/.eslintrc.js | 4 +- react/features/av-moderation/constants.ts | 2 +- react/features/av-moderation/reducer.ts | 5 +- react/features/base/buttons/CopyButton.tsx | 2 +- .../participants-pane-list/ListItem.tsx | 13 +++-- react/features/base/conference/reducer.ts | 47 +++++++++--------- react/features/base/config/configType.ts | 4 +- react/features/base/config/reducer.ts | 4 +- .../dialog/components/web/ModalHeader.tsx | 5 +- .../features/base/environment/environment.ts | 3 +- .../base/i18n/configLanguageDetector.ts | 3 +- .../base/i18n/customNavigatorDetector.ts | 3 +- react/features/base/i18n/i18next.ts | 3 +- .../base/i18n/languageDetector.web.ts | 3 +- react/features/base/icons/components/Icon.tsx | 3 +- .../base/label/components/AbstractLabel.tsx | 4 +- .../base/label/components/web/Label.tsx | 6 +-- react/features/base/lastn/reducer.ts | 2 +- .../logging/JitsiMeetInMemoryLogStorage.ts | 2 +- react/features/base/logging/middleware.ts | 13 ++--- react/features/base/logging/reducer.ts | 6 ++- react/features/base/media/constants.ts | 2 +- react/features/base/media/middleware.web.ts | 9 ++-- react/features/base/media/reducer.ts | 2 +- react/features/base/participants/actions.ts | 5 +- react/features/base/participants/constants.ts | 2 +- react/features/base/participants/functions.ts | 2 +- react/features/base/participants/reducer.ts | 49 ++----------------- react/features/base/participants/types.ts | 38 ++++++++++++++ .../components/web/ActionButton.tsx | 2 +- .../components/web/ConnectionStatus.tsx | 12 +++-- .../premeeting/{constants.js => constants.ts} | 2 - .../react/components/native/IconButton.tsx | 1 - .../base/redux/PersistenceRegistry.ts | 6 +-- .../base/redux/StateListenerRegistry.ts | 3 -- .../base/redux/{logger.js => logger.ts} | 2 - .../components/native/SettingsButton.tsx | 3 +- .../base/ui/components/native/Input.tsx | 2 - .../base/ui/components/native/buttonStyles.ts | 1 - .../base/ui/components/native/inputStyles.ts | 1 - .../components/{variables.js => variables.ts} | 0 .../base/ui/components/web/Checkbox.tsx | 2 - .../features/base/ui/components/web/Input.tsx | 2 +- .../base/user-interaction/middleware.ts | 2 +- react/features/base/util/loadScript.web.ts | 3 +- react/features/base/util/uri.ts | 4 +- .../chat/components/web/ChatInput.tsx | 2 +- .../chat/components/web/MessageContainer.tsx | 1 - .../chat/components/web/NewMessagesButton.tsx | 2 +- .../chat/{constants.js => constants.ts} | 0 react/features/chat/reducer.ts | 2 +- .../components/native/carmode/AudioIcon.tsx | 3 +- .../native/carmode/EndMeetingIcon.tsx | 4 +- .../native/carmode/MicrophoneButton.tsx | 2 +- .../components/native/carmode/TitleBar.tsx | 2 +- .../components/web/RaisedHandsCountLabel.tsx | 5 +- .../components/native/DisplayNameLabel.tsx | 6 +-- .../web/StageParticipantNameLabel.tsx | 2 +- .../native/BrandingImageBackground.tsx | 6 +-- react/features/dynamic-branding/reducer.ts | 2 +- .../filmstrip/components/web/Filmstrip.tsx | 10 ++-- .../components/web/PinnedIndicator.tsx | 4 +- .../components/web/RaisedHandIndicator.tsx | 4 +- .../filmstrip/components/web/Thumbnail.tsx | 2 +- .../components/ScreenSharePlaceholder.web.tsx | 6 +-- react/features/lobby/reducer.ts | 2 +- react/features/noise-suppression/actions.ts | 4 +- .../components/NoiseSuppressionButton.tsx | 2 +- react/features/noise-suppression/functions.ts | 3 +- react/features/noise-suppression/logger.ts | 1 - react/features/overlay/reducer.ts | 6 +-- .../components/web/CollapsibleRoom.tsx | 11 ++--- .../components/web/RoomActionEllipsis.tsx | 2 +- .../web/RoomParticipantContextMenu.tsx | 8 +-- .../native/ParticipantsPaneFooter.tsx | 2 +- .../components/web/FooterContextMenu.tsx | 8 +-- .../components/web/InviteButton.tsx | 2 +- .../components/web/LobbyParticipantItem.tsx | 10 ++-- .../components/web/LobbyParticipants.tsx | 2 +- .../components/web/MeetingParticipants.tsx | 2 +- .../web/ParticipantActionEllipsis.tsx | 2 +- .../components/web/ParticipantItem.tsx | 20 +++----- .../components/web/ParticipantQuickAction.tsx | 1 - .../components/web/ParticipantsPane.tsx | 6 +-- .../components/web/RaisedHandIndicator.tsx | 2 +- .../features/participants-pane/constants.tsx | 2 +- .../polls/components/web/PollAnswer.tsx | 5 +- .../polls/components/web/PollCreate.tsx | 3 +- .../polls/components/web/PollsPane.tsx | 1 - .../prejoin/components/Prejoin.native.tsx | 2 +- .../components/dialogs/CallingDialog.tsx | 2 +- .../components/dialogs/DialInDialog.tsx | 2 +- .../components/dialogs/DialOutDialog.tsx | 2 +- react/features/prejoin/reducer.ts | 2 +- .../components/web/ReactionsMenu.tsx | 14 ++---- .../components/web/ReactionsMenuButton.tsx | 2 +- react/features/reactions/logger.ts | 1 - react/features/reactions/middleware.ts | 9 +--- .../Recording/LocalRecordingManager.web.ts | 10 +--- .../Recording/web/HighlightButton.tsx | 7 ++- .../components/web/RecordingLabel.tsx | 3 +- .../components/web/SalesforceLinkDialog.tsx | 2 +- .../security-dialog/web/PasswordSection.tsx | 1 - .../settings/components/web/MoreTab.tsx | 9 ++-- .../settings/components/web/ProfileTab.tsx | 3 +- .../components/web/SpeakerStatsSearch.tsx | 2 +- .../NoiseSuppressionEffect.ts | 3 +- .../noise-suppression/logger.ts | 1 - .../subtitles/components/LanguageListItem.tsx | 11 ++--- .../components/native/HangupMenuButton.tsx | 3 +- .../components/native/OpenCarmodeButton.tsx | 2 +- .../components/web/HangupMenuButton.tsx | 15 ++---- .../toolbox/components/web/Toolbox.tsx | 12 ++--- .../web/LocalVideoMenuTriggerButton.tsx | 2 +- .../components/web/ParticipantContextMenu.tsx | 6 +-- .../web/RemoteVideoMenuTriggerButton.tsx | 4 +- .../components/web/VolumeSlider.tsx | 2 +- .../components/UploadImageButton.tsx | 2 +- .../components/VirtualBackgroundDialog.tsx | 2 +- .../components/VirtualBackgroundPreview.tsx | 3 +- 120 files changed, 262 insertions(+), 345 deletions(-) create mode 100644 react/features/base/participants/types.ts rename react/features/base/premeeting/{constants.js => constants.ts} (92%) rename react/features/base/redux/{logger.js => logger.ts} (90%) rename react/features/base/ui/components/{variables.js => variables.ts} (100%) rename react/features/chat/{constants.js => constants.ts} (100%) diff --git a/react/.eslintrc.js b/react/.eslintrc.js index e5b7466f5..6d053587c 100644 --- a/react/.eslintrc.js +++ b/react/.eslintrc.js @@ -21,7 +21,9 @@ module.exports = { 'no-shadow': 'off', '@typescript-eslint/no-shadow': [ 'error' ], 'typescript-sort-keys/interface': 'error', - 'typescript-sort-keys/string-enum': 'error' + 'typescript-sort-keys/string-enum': 'error', + 'object-curly-spacing': 'off', + '@typescript-eslint/object-curly-spacing': [ 'error', 'always' ] }, 'plugins': [ '@typescript-eslint', 'typescript-sort-keys' ], 'extends': [ diff --git a/react/features/av-moderation/constants.ts b/react/features/av-moderation/constants.ts index 84134a664..f0da9e938 100644 --- a/react/features/av-moderation/constants.ts +++ b/react/features/av-moderation/constants.ts @@ -11,7 +11,7 @@ export const MEDIA_TYPE_TO_WHITELIST_STORE_KEY: { [key: string]: string } = { /** * Mapping between a media type and the pending reducer key. */ -export const MEDIA_TYPE_TO_PENDING_STORE_KEY: {[key: string]: string} = { +export const MEDIA_TYPE_TO_PENDING_STORE_KEY: { [key: string]: 'pendingAudio' | 'pendingVideo' } = { [MEDIA_TYPE.AUDIO]: 'pendingAudio', [MEDIA_TYPE.VIDEO]: 'pendingVideo' }; diff --git a/react/features/av-moderation/reducer.ts b/react/features/av-moderation/reducer.ts index f5d573e7c..111df2d2a 100644 --- a/react/features/av-moderation/reducer.ts +++ b/react/features/av-moderation/reducer.ts @@ -4,6 +4,7 @@ import { PARTICIPANT_LEFT, PARTICIPANT_UPDATED } from '../base/participants/actionTypes'; +import { Participant } from '../base/participants/types'; import ReducerRegistry from '../base/redux/ReducerRegistry'; import { @@ -47,11 +48,11 @@ export interface IAVModerationState { * @private * @returns {boolean} - Whether state instance was modified. */ -function _updatePendingParticipant(mediaType: MediaType, participant: any, state: any = {}) { +function _updatePendingParticipant(mediaType: MediaType, participant: Participant, state: IAVModerationState) { let arrayItemChanged = false; const storeKey = MEDIA_TYPE_TO_PENDING_STORE_KEY[mediaType]; const arr = state[storeKey]; - const newArr = arr.map((pending: { id: string}) => { + const newArr = arr.map((pending: { id: string }) => { if (pending.id === participant.id) { arrayItemChanged = true; diff --git a/react/features/base/buttons/CopyButton.tsx b/react/features/base/buttons/CopyButton.tsx index c67d4748b..4a96923cf 100644 --- a/react/features/base/buttons/CopyButton.tsx +++ b/react/features/base/buttons/CopyButton.tsx @@ -4,7 +4,7 @@ import clsx from 'clsx'; import React, { useEffect, useState } from 'react'; import Icon from '../icons/components/Icon'; -import { IconCheck, IconCopy } from '../icons/svg/index'; +import { IconCheck, IconCopy } from '../icons/svg'; import { withPixelLineHeight } from '../styles/functions.web'; import { Theme } from '../ui/types'; import { copyText } from '../util/helpers'; diff --git a/react/features/base/components/participants-pane-list/ListItem.tsx b/react/features/base/components/participants-pane-list/ListItem.tsx index 71fffc060..2378852d7 100644 --- a/react/features/base/components/participants-pane-list/ListItem.tsx +++ b/react/features/base/components/participants-pane-list/ListItem.tsx @@ -2,7 +2,6 @@ import { makeStyles } from '@material-ui/styles'; import clsx from 'clsx'; import React, { ReactNode } from 'react'; -// @ts-ignore import { ACTION_TRIGGER } from '../../../participants-pane/constants'; import { isMobileBrowser } from '../../environment/utils'; import participantsPaneTheme from '../themes/participantsPaneTheme.json'; @@ -17,7 +16,7 @@ type Props = { /** * List item container class name. */ - className: string, + className?: string, /** * Whether or not the actions should be hidden. @@ -32,7 +31,7 @@ type Props = { /** * Id of the container. */ - id: string, + id?: string, /** * Indicators to be displayed on the list item. @@ -47,17 +46,17 @@ type Props = { /** * Click handler. */ - onClick: (e?: React.MouseEvent) => void, + onClick?: (e?: React.MouseEvent) => void, /** * Long press handler. */ - onLongPress: (e?: EventTarget) => void, + onLongPress?: (e?: EventTarget) => void, /** * Mouse leave handler. */ - onMouseLeave: (e?: React.MouseEvent) => void, + onMouseLeave?: (e?: React.MouseEvent) => void, /** * Data test id. @@ -204,7 +203,7 @@ const ListItem = ({ function _onTouchStart(e: React.TouchEvent) { const target = e.touches[0].target; - timeoutHandler = window.setTimeout(() => onLongPress(target), 600); + timeoutHandler = window.setTimeout(() => onLongPress?.(target), 600); } /** diff --git a/react/features/base/conference/reducer.ts b/react/features/base/conference/reducer.ts index 422b67d88..2b289a727 100644 --- a/react/features/base/conference/reducer.ts +++ b/react/features/base/conference/reducer.ts @@ -41,23 +41,24 @@ const DEFAULT_STATE = { }; export interface IConferenceState { - authEnabled?: boolean|undefined; - authLogin?: string|undefined; + authEnabled?: boolean; + authLogin?: string; authRequired?: Object; - conference: any|undefined; + conference?: any; conferenceTimestamp?: number; - e2eeSupported: boolean|undefined; + e2eeSupported?: boolean; + error?: Error; followMeEnabled?: boolean; - joining: Object|undefined; - leaving: Object|undefined; + joining?: Object; + leaving?: Object; localSubject?: string; - locked: string|undefined; - membersOnly: boolean|undefined; + locked?: string; + membersOnly?: Object; obfuscatedRoom?: string; obfuscatedRoomSource?: string; p2p?: Object; - password: string|undefined; - passwordRequired: boolean|undefined; + password?: string; + passwordRequired?: Object; pendingSubjectChange?: string; room?: Object; startAudioMutedPolicy?: boolean; @@ -152,7 +153,8 @@ ReducerRegistry.register('features/base/conference', * @returns {Object} The new state of the feature base/conference after the * reduction of the specified action. */ -function _authStatusChanged(state: any, { authEnabled, authLogin }: {authEnabled: boolean, authLogin: string}) { +function _authStatusChanged(state: IConferenceState, + { authEnabled, authLogin }: { authEnabled: boolean, authLogin: string }) { return assign(state, { authEnabled, authLogin @@ -169,7 +171,7 @@ function _authStatusChanged(state: any, { authEnabled, authLogin }: {authEnabled * @returns {Object} The new state of the feature base/conference after the * reduction of the specified action. */ -function _conferenceFailed(state: any, { conference, error }: {conference: Object, error: any}) { +function _conferenceFailed(state: IConferenceState, { conference, error }: { conference: Object, error: Error }) { // The current (similar to getCurrentConference in // base/conference/functions.any.js) conference which is joining or joined: const conference_ = state.conference || state.joining; @@ -235,7 +237,7 @@ function _conferenceFailed(state: any, { conference, error }: {conference: Objec * @returns {Object} The new state of the feature base/conference after the * reduction of the specified action. */ -function _conferenceJoined(state: any, { conference }: {conference: any}) { +function _conferenceJoined(state: IConferenceState, { conference }: { conference: any }) { // FIXME The indicator which determines whether a JitsiConference is locked // i.e. password-protected is private to lib-jitsi-meet. However, the // library does not fire LOCK_STATE_CHANGED upon joining a JitsiConference @@ -281,7 +283,8 @@ function _conferenceJoined(state: any, { conference }: {conference: any}) { * @returns {Object} The next/new state of the feature base/conference after the * reduction of the specified action. */ -function _conferenceLeftOrWillLeave(state: any, { conference, type }: {conference: Object, type: string}) { +function _conferenceLeftOrWillLeave(state: IConferenceState, { conference, type }: + { conference: Object, type: string }) { const nextState = { ...state }; // The redux action CONFERENCE_LEFT is the last time that we should be @@ -293,8 +296,8 @@ function _conferenceLeftOrWillLeave(state: any, { conference, type }: {conferenc // due clean-up like leaving the associated room, but the instance is no // longer the focus of the attention of the user and, consequently, the app. for (const p in state) { - if (state[p] === conference) { - nextState[p] = undefined; + if (state[p as keyof IConferenceState] === conference) { + nextState[p as keyof IConferenceState] = undefined; switch (p) { case 'conference': @@ -335,7 +338,7 @@ function _conferenceLeftOrWillLeave(state: any, { conference, type }: {conferenc * @returns {Object} The new state of the feature base/conference after the * reduction of the specified action. */ -function _conferenceWillJoin(state: any, { conference }: {conference: Object}) { +function _conferenceWillJoin(state: IConferenceState, { conference }: { conference: Object }) { return assign(state, { error: undefined, joining: conference @@ -352,7 +355,7 @@ function _conferenceWillJoin(state: any, { conference }: {conference: Object}) { * @returns {Object} The new state of the feature base/conference after the * reduction of the specified action. */ -function _lockStateChanged(state: any, { conference, locked }: {conference: Object, locked: boolean}) { +function _lockStateChanged(state: IConferenceState, { conference, locked }: { conference: Object, locked: boolean }) { if (state.conference !== conference) { return state; } @@ -373,7 +376,7 @@ function _lockStateChanged(state: any, { conference, locked }: {conference: Obje * @returns {Object} The new state of the feature base/conference after the * reduction of the specified action. */ -function _p2pStatusChanged(state: any, action: any) { +function _p2pStatusChanged(state: IConferenceState, action: any) { return set(state, 'p2p', action.p2p); } @@ -386,8 +389,8 @@ function _p2pStatusChanged(state: any, action: any) { * @returns {Object} The new state of the feature base/conference after the * reduction of the specified action. */ -function _setPassword(state: any, { conference, method, password } - : {conference: any, method: Object, password: string}) { +function _setPassword(state: IConferenceState, { conference, method, password } + : { conference: any, method: Object, password: string }) { switch (method) { case conference.join: return assign(state, { @@ -434,7 +437,7 @@ function _setPassword(state: any, { conference, method, password } * @returns {Object} The new state of the feature base/conference after the * reduction of the specified action. */ -function _setRoom(state: any, action: any) { +function _setRoom(state: IConferenceState, action: any) { let { room } = action; if (!isRoomValid(room)) { diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts index e2e47961a..dd7675504 100644 --- a/react/features/base/config/configType.ts +++ b/react/features/base/config/configType.ts @@ -144,7 +144,7 @@ export interface IConfig { callStatsSecret?: string; channelLastN?: number; chromeExtensionBanner?: { - chromeExtensionsInfo?: Array<{id: string; path: string}>; + chromeExtensionsInfo?: Array<{ id: string; path: string }>; edgeUrl?: string; url?: string; }; @@ -373,7 +373,7 @@ export interface IConfig { iceTransportPolicy?: string; preferH264?: boolean; preferredCodec?: string; - stunServers?: Array<{urls: string}>; + stunServers?: Array<{ urls: string }>; }; participantsPane?: { hideModeratorSettingsTab?: boolean; diff --git a/react/features/base/config/reducer.ts b/react/features/base/config/reducer.ts index 55b15ac09..7c785e8ff 100644 --- a/react/features/base/config/reducer.ts +++ b/react/features/base/config/reducer.ts @@ -150,7 +150,7 @@ function _getInitialState() { * @private * @returns {Object} The new state after the reduction of the specified action. */ -function _setConfig(state: IConfig, { config }: {config: IConfig}) { +function _setConfig(state: IConfig, { config }: { config: IConfig }) { // eslint-disable-next-line no-param-reassign config = _translateLegacyConfig(config); @@ -457,7 +457,7 @@ function _translateLegacyConfig(oldValue: IConfig) { * @private * @returns {Object} The new state after the reduction of the specified action. */ -function _updateConfig(state: IConfig, { config }: {config: IConfig}) { +function _updateConfig(state: IConfig, { config }: { config: IConfig }) { const newState = _.merge({}, state, config); _cleanupConfig(newState); diff --git a/react/features/base/dialog/components/web/ModalHeader.tsx b/react/features/base/dialog/components/web/ModalHeader.tsx index 085153258..e4670c887 100644 --- a/react/features/base/dialog/components/web/ModalHeader.tsx +++ b/react/features/base/dialog/components/web/ModalHeader.tsx @@ -14,9 +14,8 @@ import React from 'react'; import { WithTranslation } from 'react-i18next'; import { translate } from '../../../i18n/functions'; -import { IconClose } from '../../../icons/svg/index'; -// @ts-ignore -import { withPixelLineHeight } from '../../../styles/functions'; +import { IconClose } from '../../../icons/svg'; +import { withPixelLineHeight } from '../../../styles/functions.web'; import Button from '../../../ui/components/web/Button'; import { BUTTON_TYPES } from '../../../ui/constants'; diff --git a/react/features/base/environment/environment.ts b/react/features/base/environment/environment.ts index c1bc09287..bf3090346 100644 --- a/react/features/base/environment/environment.ts +++ b/react/features/base/environment/environment.ts @@ -26,8 +26,7 @@ const browserNameToCheck = { safari: browser.isSafari.bind(browser) }; -// eslint-disable-next-line no-var -declare var interfaceConfig: any; +declare let interfaceConfig: any; /** * Returns whether or not jitsi is optimized and targeted for the provided diff --git a/react/features/base/i18n/configLanguageDetector.ts b/react/features/base/i18n/configLanguageDetector.ts index 0d61c17f8..0a62ecd0f 100644 --- a/react/features/base/i18n/configLanguageDetector.ts +++ b/react/features/base/i18n/configLanguageDetector.ts @@ -1,6 +1,5 @@ -// eslint-disable-next-line no-var -declare var config: any; +declare let config: any; /** * Custom language detection, just returns the config property if any. diff --git a/react/features/base/i18n/customNavigatorDetector.ts b/react/features/base/i18n/customNavigatorDetector.ts index af24c29eb..264339009 100644 --- a/react/features/base/i18n/customNavigatorDetector.ts +++ b/react/features/base/i18n/customNavigatorDetector.ts @@ -1,6 +1,5 @@ -// eslint-disable-next-line no-var -declare var navigator: any; +declare let navigator: any; /** * Custom language detection, just returns the config property if any. diff --git a/react/features/base/i18n/i18next.ts b/react/features/base/i18n/i18next.ts index 701f2fc56..983c14b71 100644 --- a/react/features/base/i18n/i18next.ts +++ b/react/features/base/i18n/i18next.ts @@ -1,5 +1,4 @@ -// eslint-disable-next-line no-var -declare var APP: any; +declare let APP: any; import COUNTRIES_RESOURCES from 'i18n-iso-countries/langs/en.json'; import i18next from 'i18next'; diff --git a/react/features/base/i18n/languageDetector.web.ts b/react/features/base/i18n/languageDetector.web.ts index cd01e4c95..6be8289ba 100644 --- a/react/features/base/i18n/languageDetector.web.ts +++ b/react/features/base/i18n/languageDetector.web.ts @@ -3,8 +3,7 @@ import BrowserLanguageDetector from 'i18next-browser-languagedetector'; import configLanguageDetector from './configLanguageDetector'; import customNavigatorDetector from './customNavigatorDetector'; -// eslint-disable-next-line no-var -declare var interfaceConfig: any; +declare let interfaceConfig: any; /** * The ordered list (by name) of language detectors to be utilized as backends diff --git a/react/features/base/icons/components/Icon.tsx b/react/features/base/icons/components/Icon.tsx index 07c76589f..77a1115b8 100644 --- a/react/features/base/icons/components/Icon.tsx +++ b/react/features/base/icons/components/Icon.tsx @@ -1,9 +1,8 @@ -/* eslint-disable import/order */ +/* eslint-disable lines-around-comment */ import React, { useCallback } from 'react'; // @ts-ignore import { Container } from '../../react/base'; - // @ts-ignore import { styleTypeToObject } from '../../styles'; diff --git a/react/features/base/label/components/AbstractLabel.tsx b/react/features/base/label/components/AbstractLabel.tsx index aa04a868f..817ccad7f 100644 --- a/react/features/base/label/components/AbstractLabel.tsx +++ b/react/features/base/label/components/AbstractLabel.tsx @@ -5,12 +5,12 @@ export type Props = { /** * An SVG icon to be rendered as the content of the label. */ - icon: Function, + icon?: Function, /** * String or component that will be rendered as the label itself. */ - text: string + text?: string }; /** diff --git a/react/features/base/label/components/web/Label.tsx b/react/features/base/label/components/web/Label.tsx index a2f44b1eb..611e64e7c 100644 --- a/react/features/base/label/components/web/Label.tsx +++ b/react/features/base/label/components/web/Label.tsx @@ -14,7 +14,7 @@ type Props = AbstractProps & { /** * Own CSS class name. */ - className: string, + className?: string, /** * An object containing the CSS classes. @@ -24,7 +24,7 @@ type Props = AbstractProps & { /** * The color of the label. */ - color: string, + color?: string, /** @@ -35,7 +35,7 @@ type Props = AbstractProps & { /** * HTML ID attribute to add to the root of {@code Label}. */ - id: string, + id?: string, /** * Click handler if any. diff --git a/react/features/base/lastn/reducer.ts b/react/features/base/lastn/reducer.ts index f39d55389..e1980c264 100644 --- a/react/features/base/lastn/reducer.ts +++ b/react/features/base/lastn/reducer.ts @@ -42,6 +42,6 @@ ReducerRegistry.register('features/base/lastn', (state = {}, action * @private * @returns {Object} The new state after the reduction of the specified action. */ -function _setConfig(state: ILastNState, { config }: {config: IConfig}) { +function _setConfig(state: ILastNState, { config }: { config: IConfig }) { return set(state, 'lastNLimits', validateLastNLimits(config.lastNLimits)); } diff --git a/react/features/base/logging/JitsiMeetInMemoryLogStorage.ts b/react/features/base/logging/JitsiMeetInMemoryLogStorage.ts index a083b2aac..91c035233 100644 --- a/react/features/base/logging/JitsiMeetInMemoryLogStorage.ts +++ b/react/features/base/logging/JitsiMeetInMemoryLogStorage.ts @@ -35,7 +35,7 @@ export default class JitsiMeetInMemoryLogStorage { * representing log lines or aggregated lines objects. * @returns {void} */ - storeLogs(logEntries: (string|{text: string})[]) { + storeLogs(logEntries: (string|{ text: string })[]) { for (let i = 0, len = logEntries.length; i < len; i++) { const logEntry = logEntries[i]; diff --git a/react/features/base/logging/middleware.ts b/react/features/base/logging/middleware.ts index e176eeb10..bebc54f49 100644 --- a/react/features/base/logging/middleware.ts +++ b/react/features/base/logging/middleware.ts @@ -2,6 +2,7 @@ // @ts-ignore import Logger from '@jitsi/logger'; +import { IStore } from '../../app/types'; import { APP_WILL_MOUNT } from '../app/actionTypes'; // @ts-ignore import { CONFERENCE_JOINED, getCurrentConference } from '../conference'; @@ -64,7 +65,7 @@ MiddlewareRegistry.register(store => next => action => { * @returns {Object} The new state that is the result of the reduction of the * specified {@code action}. */ -function _appWillMount({ getState }: {getState: Function}, next: Function, action: any) { +function _appWillMount({ getState }: IStore, next: Function, action: any) { const { config } = getState()['features/base/logging']; _setLogLevels(Logger, config); @@ -90,7 +91,7 @@ function _appWillMount({ getState }: {getState: Function}, next: Function, actio * @private * @returns {*} */ -function _conferenceJoined({ getState }: { getState: Function }, next: Function, action: any) { +function _conferenceJoined({ getState }: IStore, next: Function, action: any) { // Wait until the joined event is processed, so that the JitsiMeetLogStorage // will be ready. @@ -137,7 +138,7 @@ function _conferenceJoined({ getState }: { getState: Function }, next: Function, * @private * @returns {void} */ -function _initLogging({ dispatch, getState }: {dispatch: Function, getState: Function}, +function _initLogging({ dispatch, getState }: IStore, loggingConfig: any, isTestingEnabled: boolean) { const { logCollector } = getState()['features/base/logging']; @@ -194,7 +195,7 @@ function _initLogging({ dispatch, getState }: {dispatch: Function, getState: Fun * @returns {Object} The new state that is the result of the reduction of the * specified {@code action}. */ -function _libWillInit({ getState }: { getState: Function }, next: Function, action: any) { +function _libWillInit({ getState }: IStore, next: Function, action: any) { // Adding the if in order to preserve the logic for web after enabling // LIB_WILL_INIT action for web in initLib action. if (typeof APP === 'undefined') { @@ -218,7 +219,7 @@ function _libWillInit({ getState }: { getState: Function }, next: Function, acti * @returns {Object} The new state that is the result of the reduction of the * specified action. */ -function _setConfig({ dispatch }: { dispatch: Function }, next: Function, action: any) { +function _setConfig({ dispatch }: IStore, next: Function, action: any) { const result = next(action); dispatch(setLoggingConfig(action.config?.logging)); @@ -240,7 +241,7 @@ function _setConfig({ dispatch }: { dispatch: Function }, next: Function, action * @returns {Object} The new state that is the result of the reduction of the * specified {@code action}. */ -function _setLoggingConfig({ dispatch, getState }: { dispatch: Function, getState: Function }, +function _setLoggingConfig({ dispatch, getState }: IStore, next: Function, action: any) { const result = next(action); const newValue = getState()['features/base/logging'].config; diff --git a/react/features/base/logging/reducer.ts b/react/features/base/logging/reducer.ts index acb89e5e0..ed9f7cf18 100644 --- a/react/features/base/logging/reducer.ts +++ b/react/features/base/logging/reducer.ts @@ -62,7 +62,11 @@ export interface ILoggingState { [key: string]: LogLevel; } }; - logCollector?: Object; + logCollector?: { + flush: () => void; + start: () => void; + stop: () => void; + }; } ReducerRegistry.register( diff --git a/react/features/base/media/constants.ts b/react/features/base/media/constants.ts index 80967d1c6..7c6516378 100644 --- a/react/features/base/media/constants.ts +++ b/react/features/base/media/constants.ts @@ -15,7 +15,7 @@ export type MediaType = 'audio' | 'video' | 'presenter' | 'screenshare'; * * @enum {string} */ -export const MEDIA_TYPE: {[key: string]: MediaType} = { +export const MEDIA_TYPE: { [key: string]: MediaType } = { AUDIO: 'audio', PRESENTER: 'presenter', SCREENSHARE: 'screenshare', diff --git a/react/features/base/media/middleware.web.ts b/react/features/base/media/middleware.web.ts index 4d3b15cb8..674bd0a0b 100644 --- a/react/features/base/media/middleware.web.ts +++ b/react/features/base/media/middleware.web.ts @@ -1,18 +1,15 @@ -/* eslint-disable import/order */ +/* eslint-disable lines-around-comment */ import './middleware.any.js'; import { IStore } from '../../app/types'; - // @ts-ignore -import { NOTIFICATION_TIMEOUT_TYPE, showNotification } from '../../notifications'; +import { showNotification } from '../../notifications/actions'; +import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants'; import LocalRecordingManager from '../../recording/components/Recording/LocalRecordingManager.web'; - // @ts-ignore import StopRecordingDialog from '../../recording/components/Recording/web/StopRecordingDialog'; - // @ts-ignore import { openDialog } from '../dialog'; - import MiddlewareRegistry from '../redux/MiddlewareRegistry'; import { SET_VIDEO_MUTED } from './actionTypes'; diff --git a/react/features/base/media/reducer.ts b/react/features/base/media/reducer.ts index 5a11373c0..499a1e79e 100644 --- a/react/features/base/media/reducer.ts +++ b/react/features/base/media/reducer.ts @@ -299,7 +299,7 @@ function _storeVideoTransform(state: IVideoState, { streamId, transform }: { str * @private * @returns {Object} */ -function _trackRemoved(state: IVideoState, { track: { jitsiTrack } } : {track: {jitsiTrack: any}}) { +function _trackRemoved(state: IVideoState, { track: { jitsiTrack } } : { track: { jitsiTrack: any } }) { if (jitsiTrack) { const streamId = jitsiTrack.getStreamId(); diff --git a/react/features/base/participants/actions.ts b/react/features/base/participants/actions.ts index affdda518..f3cce87ee 100644 --- a/react/features/base/participants/actions.ts +++ b/react/features/base/participants/actions.ts @@ -1,7 +1,8 @@ import { Dispatch } from 'redux'; // @ts-ignore -import { NOTIFICATION_TIMEOUT_TYPE, showNotification } from '../../notifications'; +import { showNotification } from '../../notifications/actions'; +import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants'; import { set } from '../redux/functions'; import { @@ -37,7 +38,7 @@ import { getParticipantById } from './functions'; import logger from './logger'; -import { Participant } from './reducer'; +import { Participant } from './types'; /** * Create an action for when dominant speaker changes. diff --git a/react/features/base/participants/constants.ts b/react/features/base/participants/constants.ts index d50a93143..8bd3481cb 100644 --- a/react/features/base/participants/constants.ts +++ b/react/features/base/participants/constants.ts @@ -1,4 +1,4 @@ -import { IconPhone } from '../icons/svg/index'; +import { IconPhone } from '../icons/svg'; /** * The relative path to the default/stock avatar (image) file used on both diff --git a/react/features/base/participants/functions.ts b/react/features/base/participants/functions.ts index 08d230733..f211864f2 100644 --- a/react/features/base/participants/functions.ts +++ b/react/features/base/participants/functions.ts @@ -22,7 +22,7 @@ import { createDeferred } from '../util/helpers'; import { JIGASI_PARTICIPANT_ICON, MAX_DISPLAY_NAME_LENGTH, PARTICIPANT_ROLE } from './constants'; // @ts-ignore import { preloadImage } from './preloadImage'; -import { Participant } from './reducer'; +import { Participant } from './types'; /** * Temp structures for avatar urls to be checked/preloaded. diff --git a/react/features/base/participants/reducer.ts b/react/features/base/participants/reducer.ts index 51453a304..12852dc39 100644 --- a/react/features/base/participants/reducer.ts +++ b/react/features/base/participants/reducer.ts @@ -18,8 +18,8 @@ import { SET_LOADABLE_AVATAR_URL } from './actionTypes'; import { LOCAL_PARTICIPANT_DEFAULT_ID, PARTICIPANT_ROLE } from './constants'; -// @ts-ignore import { isParticipantModerator } from './functions'; +import { LocalParticipant, Participant } from './types'; /** * Participant object. @@ -38,45 +38,6 @@ import { isParticipantModerator } from './functions'; * @property {string} email - Participant email. */ -export interface Participant { - avatarURL?: string; - botType?: string; - conference?: Object; - connectionStatus?: string; - dominantSpeaker?: boolean; - e2eeSupported?: boolean; - email?: string; - features?: { - 'screen-sharing'?: boolean; - }; - id: string; - isFakeParticipant?: boolean; - isJigasi?: boolean; - isLocalScreenShare?: boolean; - isReplacing?: number; - isVirtualScreenshareParticipant?: boolean; - loadableAvatarUrl?: string; - loadableAvatarUrlUseCORS?: boolean; - local?: boolean; - name?: string; - pinned?: boolean; - presence?: string; - raisedHandTimestamp?: number; - remoteControlSessionStatus?: boolean; - role?: string; - supportsRemoteControl?: boolean; -} - -export interface LocalParticipant extends Participant { - audioOutputDeviceId?: string; - cameraDeviceId?: string; - micDeviceId?: string; - startWithAudioMuted?: boolean; - startWithVideoMuted?: boolean; - userSelectedMicDeviceId?: string; - userSelectedMicDeviceLabel?: string; -} - /** * The participant properties which cannot be updated through * {@link PARTICIPANT_UPDATED}. They either identify the participant or can only @@ -121,7 +82,7 @@ export interface IParticipantsState { localScreenShare?: Participant; overwrittenNameList: Object; pinnedParticipant?: string; - raisedHandsQueue: Array<{ id: string; raisedHandTimestamp: number;}>; + raisedHandsQueue: Array<{ id: string; raisedHandTimestamp: number; }>; remote: Map; sortedRemoteParticipants: Map; sortedRemoteScreenshares: Map; @@ -505,9 +466,7 @@ function _isEveryoneModerator(state: IParticipantsState) { * @private * @returns {Participant} */ -function _participant(state: Participant|LocalParticipant = { - id: '', - name: '' }, action: any): Participant|LocalParticipant { +function _participant(state: Participant|LocalParticipant = { id: '' }, action: any): Participant|LocalParticipant { switch (action.type) { case SET_LOADABLE_AVATAR_URL: case PARTICIPANT_UPDATED: { @@ -543,7 +502,7 @@ function _participant(state: Participant|LocalParticipant = { * base/participants after the reduction of the specified * {@code action}. */ -function _participantJoined({ participant }: {participant: Participant}) { +function _participantJoined({ participant }: { participant: Participant }) { const { avatarURL, botType, diff --git a/react/features/base/participants/types.ts b/react/features/base/participants/types.ts new file mode 100644 index 000000000..7343b823d --- /dev/null +++ b/react/features/base/participants/types.ts @@ -0,0 +1,38 @@ +export interface Participant { + avatarURL?: string; + botType?: string; + conference?: Object; + connectionStatus?: string; + dominantSpeaker?: boolean; + e2eeSupported?: boolean; + email?: string; + features?: { + 'screen-sharing'?: boolean; + }; + id: string; + isFakeParticipant?: boolean; + isJigasi?: boolean; + isLocalScreenShare?: boolean; + isReplacing?: number; + isVirtualScreenshareParticipant?: boolean; + loadableAvatarUrl?: string; + loadableAvatarUrlUseCORS?: boolean; + local?: boolean; + name?: string; + pinned?: boolean; + presence?: string; + raisedHandTimestamp?: number; + remoteControlSessionStatus?: boolean; + role?: string; + supportsRemoteControl?: boolean; +} + +export interface LocalParticipant extends Participant { + audioOutputDeviceId?: string; + cameraDeviceId?: string; + micDeviceId?: string; + startWithAudioMuted?: boolean; + startWithVideoMuted?: boolean; + userSelectedMicDeviceId?: string; + userSelectedMicDeviceLabel?: string; +} diff --git a/react/features/base/premeeting/components/web/ActionButton.tsx b/react/features/base/premeeting/components/web/ActionButton.tsx index 49c6654c3..8dda268b8 100644 --- a/react/features/base/premeeting/components/web/ActionButton.tsx +++ b/react/features/base/premeeting/components/web/ActionButton.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx'; import React, { ReactNode, useCallback } from 'react'; import Icon from '../../../icons/components/Icon'; -import { IconArrowDown } from '../../../icons/svg/index'; +import { IconArrowDown } from '../../../icons/svg'; import { withPixelLineHeight } from '../../../styles/functions.web'; type Props = { diff --git a/react/features/base/premeeting/components/web/ConnectionStatus.tsx b/react/features/base/premeeting/components/web/ConnectionStatus.tsx index fefbbb7d1..38abfeb07 100644 --- a/react/features/base/premeeting/components/web/ConnectionStatus.tsx +++ b/react/features/base/premeeting/components/web/ConnectionStatus.tsx @@ -6,11 +6,9 @@ import { WithTranslation } from 'react-i18next'; import { IState } from '../../../../app/types'; import { translate } from '../../../i18n/functions'; import Icon from '../../../icons/components/Icon'; -import { IconArrowDownSmall, IconWifi1Bar, IconWifi2Bars, IconWifi3Bars } from '../../../icons/svg/index'; +import { IconArrowDownSmall, IconWifi1Bar, IconWifi2Bars, IconWifi3Bars } from '../../../icons/svg'; import { connect } from '../../../redux/functions'; -// @ts-ignore import { PREJOIN_DEFAULT_CONTENT_WIDTH } from '../../../ui/components/variables'; -// @ts-ignore import { CONNECTION_TYPE } from '../../constants'; // @ts-ignore import { getConnectionData } from '../../functions'; @@ -121,7 +119,13 @@ const useStyles = makeStyles((theme: any) => { }; }); -const CONNECTION_TYPE_MAP: any = { +const CONNECTION_TYPE_MAP: { + [key: string]: { + connectionClass: string; + connectionText: string; + icon: Function; + } +} = { [CONNECTION_TYPE.POOR]: { connectionClass: 'con-status--poor', icon: IconWifi1Bar, diff --git a/react/features/base/premeeting/constants.js b/react/features/base/premeeting/constants.ts similarity index 92% rename from react/features/base/premeeting/constants.js rename to react/features/base/premeeting/constants.ts index b7fe397fc..f9f7c9b92 100644 --- a/react/features/base/premeeting/constants.js +++ b/react/features/base/premeeting/constants.ts @@ -1,5 +1,3 @@ -// @flow - export const CONNECTION_TYPE = { GOOD: 'good', NON_OPTIMAL: 'nonOptimal', diff --git a/react/features/base/react/components/native/IconButton.tsx b/react/features/base/react/components/native/IconButton.tsx index 3905364cf..660b4443a 100644 --- a/react/features/base/react/components/native/IconButton.tsx +++ b/react/features/base/react/components/native/IconButton.tsx @@ -3,7 +3,6 @@ import React from 'react'; import { TouchableRipple } from 'react-native-paper'; import Icon from '../../../icons/components/Icon'; -// @ts-ignore import BaseTheme from '../../../ui/components/BaseTheme.native'; import { BUTTON_TYPES } from '../../../ui/constants'; import { IconButtonProps } from '../../types'; diff --git a/react/features/base/redux/PersistenceRegistry.ts b/react/features/base/redux/PersistenceRegistry.ts index 2eef59ed3..16a359a13 100644 --- a/react/features/base/redux/PersistenceRegistry.ts +++ b/react/features/base/redux/PersistenceRegistry.ts @@ -1,12 +1,10 @@ -/* eslint-disable import/order */ // @ts-ignore import Bourne from '@hapi/bourne'; - +// eslint-disable-next-line lines-around-comment // @ts-ignore import { jitsiLocalStorage } from '@jitsi/js-utils'; import md5 from 'js-md5'; -// @ts-ignore import logger from './logger'; declare let __DEV__: any; @@ -29,7 +27,7 @@ declare type PersistencyConfigMap = { [name: string]: ElementConfig }; */ class PersistenceRegistry { _checksum = ''; - _defaultStates: { [name: string ]: Object|undefined} = {}; + _defaultStates: { [name: string ]: Object|undefined } = {}; _elements: PersistencyConfigMap = {}; /** diff --git a/react/features/base/redux/StateListenerRegistry.ts b/react/features/base/redux/StateListenerRegistry.ts index f3f475de8..83357f448 100644 --- a/react/features/base/redux/StateListenerRegistry.ts +++ b/react/features/base/redux/StateListenerRegistry.ts @@ -1,9 +1,6 @@ -/* eslint-disable import/order */ import { Store } from 'redux'; import { equals } from './functions'; - -// @ts-ignore import logger from './logger'; /** diff --git a/react/features/base/redux/logger.js b/react/features/base/redux/logger.ts similarity index 90% rename from react/features/base/redux/logger.js rename to react/features/base/redux/logger.ts index d6d6482ba..d55bbd106 100644 --- a/react/features/base/redux/logger.js +++ b/react/features/base/redux/logger.ts @@ -1,5 +1,3 @@ -// @flow - import { getLogger } from '../logging/functions'; export default getLogger('features/base/redux'); diff --git a/react/features/base/settings/components/native/SettingsButton.tsx b/react/features/base/settings/components/native/SettingsButton.tsx index 56f3cfe80..6baa85db6 100644 --- a/react/features/base/settings/components/native/SettingsButton.tsx +++ b/react/features/base/settings/components/native/SettingsButton.tsx @@ -1,7 +1,6 @@ /* eslint-disable lines-around-comment */ import { translate } from '../../../../base/i18n/functions'; -// @ts-ignore -import { IconSettings } from '../../../../base/icons'; +import { IconSettings } from '../../../../base/icons/svg'; // @ts-ignore import { AbstractButton, type AbstractButtonProps } from '../../../../base/toolbox/components'; // @ts-ignore diff --git a/react/features/base/ui/components/native/Input.tsx b/react/features/base/ui/components/native/Input.tsx index daa39c400..d73cb9736 100644 --- a/react/features/base/ui/components/native/Input.tsx +++ b/react/features/base/ui/components/native/Input.tsx @@ -12,8 +12,6 @@ import { import Icon from '../../../icons/components/Icon'; import { IconCloseCircle } from '../../../icons/svg'; -// eslint-disable-next-line lines-around-comment -// @ts-ignore import BaseTheme from '../../../ui/components/BaseTheme.native'; import { InputProps } from '../types'; diff --git a/react/features/base/ui/components/native/buttonStyles.ts b/react/features/base/ui/components/native/buttonStyles.ts index 18a3e6eb6..69f0b799e 100644 --- a/react/features/base/ui/components/native/buttonStyles.ts +++ b/react/features/base/ui/components/native/buttonStyles.ts @@ -1,4 +1,3 @@ -// @ts-ignore import BaseTheme from '../../../ui/components/BaseTheme.native'; const BUTTON_HEIGHT = BaseTheme.spacing[7]; diff --git a/react/features/base/ui/components/native/inputStyles.ts b/react/features/base/ui/components/native/inputStyles.ts index 3d3a4ac3d..21358031f 100644 --- a/react/features/base/ui/components/native/inputStyles.ts +++ b/react/features/base/ui/components/native/inputStyles.ts @@ -1,4 +1,3 @@ -// @ts-ignore import BaseTheme from '../../../ui/components/BaseTheme.native'; export default { diff --git a/react/features/base/ui/components/variables.js b/react/features/base/ui/components/variables.ts similarity index 100% rename from react/features/base/ui/components/variables.js rename to react/features/base/ui/components/variables.ts diff --git a/react/features/base/ui/components/web/Checkbox.tsx b/react/features/base/ui/components/web/Checkbox.tsx index 3f39796ab..98dfb7a7e 100644 --- a/react/features/base/ui/components/web/Checkbox.tsx +++ b/react/features/base/ui/components/web/Checkbox.tsx @@ -6,8 +6,6 @@ import { isMobileBrowser } from '../../../environment/utils'; import Icon from '../../../icons/components/Icon'; import { IconCheckMark } from '../../../icons/svg'; import { withPixelLineHeight } from '../../../styles/functions.web'; -// eslint-disable-next-line lines-around-comment -// @ts-ignore import BaseTheme from '../BaseTheme.web'; interface CheckboxProps { diff --git a/react/features/base/ui/components/web/Input.tsx b/react/features/base/ui/components/web/Input.tsx index 98f34c856..9f328cd68 100644 --- a/react/features/base/ui/components/web/Input.tsx +++ b/react/features/base/ui/components/web/Input.tsx @@ -5,7 +5,7 @@ import TextareaAutosize from 'react-textarea-autosize'; import { isMobileBrowser } from '../../../environment/utils'; import Icon from '../../../icons/components/Icon'; -import { IconCloseCircle } from '../../../icons/svg/index'; +import { IconCloseCircle } from '../../../icons/svg'; import { withPixelLineHeight } from '../../../styles/functions.web'; import { Theme } from '../../../ui/types'; import { InputProps } from '../types'; diff --git a/react/features/base/user-interaction/middleware.ts b/react/features/base/user-interaction/middleware.ts index 3124b8652..f0d48670f 100644 --- a/react/features/base/user-interaction/middleware.ts +++ b/react/features/base/user-interaction/middleware.ts @@ -56,7 +56,7 @@ function _onUserInteractionReceived(dispatch: Function, event: any) { * @private * @returns {void} */ -function _startListeningForUserInteraction({ dispatch }: {dispatch: Function}) { +function _startListeningForUserInteraction({ dispatch }: { dispatch: Function }) { _stopListeningForUserInteraction(); userInteractionListener = _onUserInteractionReceived.bind(null, dispatch); diff --git a/react/features/base/util/loadScript.web.ts b/react/features/base/util/loadScript.web.ts index 2f5f92e25..807b0cfdc 100644 --- a/react/features/base/util/loadScript.web.ts +++ b/react/features/base/util/loadScript.web.ts @@ -1,5 +1,4 @@ -// eslint-disable-next-line no-var -declare var JitsiMeetJS: any; +declare let JitsiMeetJS: any; /** * Loads a script from a specific URL. The script will be interpreted upon load. diff --git a/react/features/base/util/uri.ts b/react/features/base/util/uri.ts index be1d71982..7a3e0eb44 100644 --- a/react/features/base/util/uri.ts +++ b/react/features/base/util/uri.ts @@ -221,7 +221,7 @@ function _objectToURLParamsArray(obj = {}) { export function parseStandardURIString(str: string) { /* eslint-disable no-param-reassign */ - const obj: {[key: string]: any} = { + const obj: { [key: string]: any } = { toString: _standardURIToString }; @@ -452,7 +452,7 @@ export function toURLString(obj?: (Object | string)): string|undefined|null { * @returns {string} - A {@code String} representation of the specified * {@code Object}. */ -export function urlObjectToString(o: {[key: string]: any}): string|undefined { +export function urlObjectToString(o: { [key: string]: any }): string|undefined { // First normalize the given url. It come as o.url or split into o.serverURL // and o.room. let tmp; diff --git a/react/features/chat/components/web/ChatInput.tsx b/react/features/chat/components/web/ChatInput.tsx index 8e2baa5e1..d2bf6e14b 100644 --- a/react/features/chat/components/web/ChatInput.tsx +++ b/react/features/chat/components/web/ChatInput.tsx @@ -6,7 +6,7 @@ import type { Dispatch } from 'redux'; import { IState } from '../../../app/types'; import { isMobileBrowser } from '../../../base/environment/utils'; import { translate } from '../../../base/i18n/functions'; -import { IconPlane, IconSmile } from '../../../base/icons/svg/index'; +import { IconPlane, IconSmile } from '../../../base/icons/svg'; import { connect } from '../../../base/redux/functions'; import Button from '../../../base/ui/components/web/Button'; import Input from '../../../base/ui/components/web/Input'; diff --git a/react/features/chat/components/web/MessageContainer.tsx b/react/features/chat/components/web/MessageContainer.tsx index 9e3349592..4480dd1ba 100644 --- a/react/features/chat/components/web/MessageContainer.tsx +++ b/react/features/chat/components/web/MessageContainer.tsx @@ -3,7 +3,6 @@ import throttle from 'lodash/throttle'; import React, { RefObject } from 'react'; import { scrollIntoView } from 'seamless-scroll-polyfill'; -// @ts-ignore import { MESSAGE_TYPE_REMOTE } from '../../constants'; import AbstractMessageContainer, { Props } from '../AbstractMessageContainer'; diff --git a/react/features/chat/components/web/NewMessagesButton.tsx b/react/features/chat/components/web/NewMessagesButton.tsx index 5f6c56db7..a85888661 100644 --- a/react/features/chat/components/web/NewMessagesButton.tsx +++ b/react/features/chat/components/web/NewMessagesButton.tsx @@ -4,7 +4,7 @@ import { WithTranslation } from 'react-i18next'; import { translate } from '../../../base/i18n/functions'; import Icon from '../../../base/icons/components/Icon'; -import { IconArrowDown } from '../../../base/icons/svg/index'; +import { IconArrowDown } from '../../../base/icons/svg'; import { withPixelLineHeight } from '../../../base/styles/functions.web'; export interface INewMessagesButtonProps extends WithTranslation { diff --git a/react/features/chat/constants.js b/react/features/chat/constants.ts similarity index 100% rename from react/features/chat/constants.js rename to react/features/chat/constants.ts diff --git a/react/features/chat/reducer.ts b/react/features/chat/reducer.ts index a6e3b2d21..364d1aaea 100644 --- a/react/features/chat/reducer.ts +++ b/react/features/chat/reducer.ts @@ -1,6 +1,6 @@ import { v4 as uuidv4 } from 'uuid'; -import { LocalParticipant, Participant } from '../base/participants/reducer'; +import { LocalParticipant, Participant } from '../base/participants/types'; import ReducerRegistry from '../base/redux/ReducerRegistry'; import { diff --git a/react/features/conference/components/native/carmode/AudioIcon.tsx b/react/features/conference/components/native/carmode/AudioIcon.tsx index a60e256c6..b4c780aab 100644 --- a/react/features/conference/components/native/carmode/AudioIcon.tsx +++ b/react/features/conference/components/native/carmode/AudioIcon.tsx @@ -2,8 +2,7 @@ import React from 'react'; import Icon from '../../../../base/icons/components/Icon'; -import { IconVolumeEmpty } from '../../../../base/icons/svg/index'; -// @ts-ignore +import { IconVolumeEmpty } from '../../../../base/icons/svg'; import BaseTheme from '../../../../base/ui/components/BaseTheme.native'; /** diff --git a/react/features/conference/components/native/carmode/EndMeetingIcon.tsx b/react/features/conference/components/native/carmode/EndMeetingIcon.tsx index 86fbe8dea..7a7aae798 100644 --- a/react/features/conference/components/native/carmode/EndMeetingIcon.tsx +++ b/react/features/conference/components/native/carmode/EndMeetingIcon.tsx @@ -1,9 +1,7 @@ -/* eslint-disable lines-around-comment */ import React from 'react'; import Icon from '../../../../base/icons/components/Icon'; -import { IconHangup } from '../../../../base/icons/svg/index'; -// @ts-ignore +import { IconHangup } from '../../../../base/icons/svg'; import BaseTheme from '../../../../base/ui/components/BaseTheme.native'; /** diff --git a/react/features/conference/components/native/carmode/MicrophoneButton.tsx b/react/features/conference/components/native/carmode/MicrophoneButton.tsx index 85b30f557..dbc4486c2 100644 --- a/react/features/conference/components/native/carmode/MicrophoneButton.tsx +++ b/react/features/conference/components/native/carmode/MicrophoneButton.tsx @@ -14,7 +14,7 @@ import { IState } from '../../../../app/types'; // @ts-ignore import { getFeatureFlag, AUDIO_MUTE_BUTTON_ENABLED } from '../../../../base/flags'; import Icon from '../../../../base/icons/components/Icon'; -import { IconMicrophone, IconMicrophoneEmptySlash } from '../../../../base/icons/svg/index'; +import { IconMicrophone, IconMicrophoneEmptySlash } from '../../../../base/icons/svg'; import { MEDIA_TYPE } from '../../../../base/media/constants'; // @ts-ignore import { isLocalTrackMuted } from '../../../../base/tracks'; diff --git a/react/features/conference/components/native/carmode/TitleBar.tsx b/react/features/conference/components/native/carmode/TitleBar.tsx index f9bbb8eeb..e1eefa2ef 100644 --- a/react/features/conference/components/native/carmode/TitleBar.tsx +++ b/react/features/conference/components/native/carmode/TitleBar.tsx @@ -45,7 +45,7 @@ type Props = { * @returns {JSX.Element} */ const TitleBar = (props: Props) : JSX.Element => { - const localParticipant: any = useSelector(getLocalParticipant); + const localParticipant = useSelector(getLocalParticipant); const localParticipantId = localParticipant?.id; return (<> diff --git a/react/features/conference/components/web/RaisedHandsCountLabel.tsx b/react/features/conference/components/web/RaisedHandsCountLabel.tsx index 6fe05bcaf..fb69b040a 100644 --- a/react/features/conference/components/web/RaisedHandsCountLabel.tsx +++ b/react/features/conference/components/web/RaisedHandsCountLabel.tsx @@ -5,9 +5,8 @@ import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; import { IState } from '../../../app/types'; -import { IconRaisedHand } from '../../../base/icons/svg/index'; -// @ts-ignore -import { Label } from '../../../base/label'; +import { IconRaisedHand } from '../../../base/icons/svg'; +import Label from '../../../base/label/components/web/Label'; // @ts-ignore import { Tooltip } from '../../../base/tooltip'; import BaseTheme from '../../../base/ui/components/BaseTheme.web'; diff --git a/react/features/display-name/components/native/DisplayNameLabel.tsx b/react/features/display-name/components/native/DisplayNameLabel.tsx index b3588ccb4..c1e0df272 100644 --- a/react/features/display-name/components/native/DisplayNameLabel.tsx +++ b/react/features/display-name/components/native/DisplayNameLabel.tsx @@ -67,11 +67,11 @@ class DisplayNameLabel extends React.Component { * @param {Props} ownProps - The own props of the component. * @returns {Props} */ -function _mapStateToProps(state: IState, ownProps: any) { - const participant = getParticipantById(state, ownProps.participantId); +function _mapStateToProps(state: IState, ownProps: Partial) { + const participant = getParticipantById(state, ownProps.participantId ?? ''); return { - _participantName: getParticipantDisplayName(state, ownProps.participantId), + _participantName: getParticipantDisplayName(state, ownProps.participantId ?? ''), _render: participant && (!participant?.local || ownProps.contained) && !participant?.isFakeParticipant }; } diff --git a/react/features/display-name/components/web/StageParticipantNameLabel.tsx b/react/features/display-name/components/web/StageParticipantNameLabel.tsx index 02ff03eb5..4b5253103 100644 --- a/react/features/display-name/components/web/StageParticipantNameLabel.tsx +++ b/react/features/display-name/components/web/StageParticipantNameLabel.tsx @@ -8,7 +8,7 @@ import { IState } from '../../../app/types'; // @ts-ignore import { isDisplayNameVisible } from '../../../base/config/functions.any'; import { getLocalParticipant, getParticipantDisplayName } from '../../../base/participants/functions'; -import { Participant } from '../../../base/participants/reducer'; +import { Participant } from '../../../base/participants/types'; import { withPixelLineHeight } from '../../../base/styles/functions.web'; // @ts-ignore import { getLargeVideoParticipant } from '../../../large-video/functions'; diff --git a/react/features/dynamic-branding/components/native/BrandingImageBackground.tsx b/react/features/dynamic-branding/components/native/BrandingImageBackground.tsx index 79214fb53..05a84e7eb 100644 --- a/react/features/dynamic-branding/components/native/BrandingImageBackground.tsx +++ b/react/features/dynamic-branding/components/native/BrandingImageBackground.tsx @@ -9,7 +9,7 @@ import styles from './styles'; interface Props { - uri?: any; + uri?: string; } /** @@ -18,7 +18,7 @@ interface Props { * @param {Props} props - The props of the component. * @returns {ReactElement} */ -const BrandingImageBackground: React.FC = ({ uri }:Props) => { +const BrandingImageBackground: React.FC = ({ uri }: Props) => { const imageType = uri?.substr(uri.lastIndexOf('/') + 1); const imgSrc = uri ? uri : undefined; @@ -41,7 +41,7 @@ const BrandingImageBackground: React.FC = ({ uri }:Props) => { // with the smallest Y value of the viewport. preserveAspectRatio = 'xMinYMin' style = { styles.brandingImageBackgroundSvg as StyleProp } - uri = { imgSrc } + uri = { imgSrc ?? null } viewBox = '0 0 400 650' width = '100%' /> ); diff --git a/react/features/dynamic-branding/reducer.ts b/react/features/dynamic-branding/reducer.ts index 894d09c56..30fcef1f8 100644 --- a/react/features/dynamic-branding/reducer.ts +++ b/react/features/dynamic-branding/reducer.ts @@ -228,7 +228,7 @@ ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STA * @private * @returns {{Props}} */ -function formatImages(images: Array | Array<{src: string; tooltip?: string}>): Array { +function formatImages(images: Array | Array<{ src: string; tooltip?: string }>): Array { return images.map((img, i) => { let src; let tooltip; diff --git a/react/features/filmstrip/components/web/Filmstrip.tsx b/react/features/filmstrip/components/web/Filmstrip.tsx index 46695e1d2..9dd2d99d0 100644 --- a/react/features/filmstrip/components/web/Filmstrip.tsx +++ b/react/features/filmstrip/components/web/Filmstrip.tsx @@ -19,8 +19,8 @@ import { getSourceNameSignalingFeatureFlag, getToolbarButtons } from '../../../b import { isMobileBrowser } from '../../../base/environment/utils'; import { translate } from '../../../base/i18n/functions'; import Icon from '../../../base/icons/components/Icon'; -import { IconMenuDown, IconMenuUp } from '../../../base/icons/svg/index'; -import { Participant } from '../../../base/participants/reducer'; +import { IconMenuDown, IconMenuUp } from '../../../base/icons/svg'; +import { Participant } from '../../../base/participants/types'; import { connect } from '../../../base/redux/functions'; // @ts-ignore import { shouldHideSelfView } from '../../../base/settings/functions.any'; @@ -611,7 +611,7 @@ class Filmstrip extends PureComponent { * @param {Object} data - An object with the indexes identifying the ThumbnailWrapper instance. * @returns {string} - The key. */ - _gridItemKey({ columnIndex, rowIndex }: {columnIndex: number, rowIndex: number}) { + _gridItemKey({ columnIndex, rowIndex }: { columnIndex: number, rowIndex: number }) { const { _disableSelfView, _columns, @@ -887,7 +887,7 @@ class Filmstrip extends PureComponent { * @private * @returns {Props} */ -function _mapStateToProps(state: IState, ownProps: any) { +function _mapStateToProps(state: IState, ownProps: Partial) { const { _hasScroll = false, filmstripType, _topPanelFilmstrip, _remoteParticipants } = ownProps; const toolbarButtons = getToolbarButtons(state); const { testing = {}, iAmRecorder } = state['features/base/config']; @@ -935,7 +935,7 @@ function _mapStateToProps(state: IState, ownProps: any) { _mainFilmstripVisible: visible, _maxFilmstripWidth: clientWidth - MIN_STAGE_VIEW_WIDTH, _maxTopPanelHeight: clientHeight - MIN_STAGE_VIEW_HEIGHT, - _remoteParticipantsLength: _remoteParticipants.length, + _remoteParticipantsLength: _remoteParticipants?.length, _thumbnailsReordered: enableThumbnailReordering, _topPanelHeight: topPanelHeight.current, _topPanelMaxHeight: topPanelHeight.current || TOP_FILMSTRIP_HEIGHT, diff --git a/react/features/filmstrip/components/web/PinnedIndicator.tsx b/react/features/filmstrip/components/web/PinnedIndicator.tsx index 4bb4e7e2d..feb881b67 100644 --- a/react/features/filmstrip/components/web/PinnedIndicator.tsx +++ b/react/features/filmstrip/components/web/PinnedIndicator.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { useSelector } from 'react-redux'; import { IState } from '../../../app/types'; -import { IconPinParticipant } from '../../../base/icons/svg/index'; +import { IconPinParticipant } from '../../../base/icons/svg'; import { getParticipantById } from '../../../base/participants/functions'; import BaseIndicator from '../../../base/react/components/web/BaseIndicator'; // eslint-disable-next-line lines-around-comment @@ -57,7 +57,7 @@ const PinnedIndicator = ({ }: Props) => { const stageFilmstrip = useSelector(isStageFilmstripAvailable); const pinned = useSelector((state: IState) => getParticipantById(state, participantId))?.pinned; - const activePinnedParticipants: Array<{participantId: string; pinned: boolean}> + const activePinnedParticipants: Array<{ participantId: string; pinned: boolean }> = useSelector(getPinnedActiveParticipants); const isPinned = activePinnedParticipants.find(p => p.participantId === participantId); const styles = useStyles(); diff --git a/react/features/filmstrip/components/web/RaisedHandIndicator.tsx b/react/features/filmstrip/components/web/RaisedHandIndicator.tsx index b38092f6d..f950f0409 100644 --- a/react/features/filmstrip/components/web/RaisedHandIndicator.tsx +++ b/react/features/filmstrip/components/web/RaisedHandIndicator.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { useSelector } from 'react-redux'; import { IState } from '../../../app/types'; -import { IconRaisedHand } from '../../../base/icons/svg/index'; +import { IconRaisedHand } from '../../../base/icons/svg'; import { getParticipantById, hasRaisedHand } from '../../../base/participants/functions'; -import { Participant } from '../../../base/participants/reducer'; +import { Participant } from '../../../base/participants/types'; import BaseIndicator from '../../../base/react/components/web/BaseIndicator'; import BaseTheme from '../../../base/ui/components/BaseTheme.web'; diff --git a/react/features/filmstrip/components/web/Thumbnail.tsx b/react/features/filmstrip/components/web/Thumbnail.tsx index c48e79b82..5686bc4af 100644 --- a/react/features/filmstrip/components/web/Thumbnail.tsx +++ b/react/features/filmstrip/components/web/Thumbnail.tsx @@ -22,7 +22,7 @@ import { getParticipantByIdOrUndefined, hasRaisedHand } from '../../../base/participants/functions'; -import { Participant } from '../../../base/participants/reducer'; +import { Participant } from '../../../base/participants/types'; import { connect } from '../../../base/redux/functions'; import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants'; // @ts-ignore diff --git a/react/features/large-video/components/ScreenSharePlaceholder.web.tsx b/react/features/large-video/components/ScreenSharePlaceholder.web.tsx index 82150a848..b132dc901 100644 --- a/react/features/large-video/components/ScreenSharePlaceholder.web.tsx +++ b/react/features/large-video/components/ScreenSharePlaceholder.web.tsx @@ -1,10 +1,10 @@ /* eslint-disable lines-around-comment */ import { makeStyles, createStyles } from '@material-ui/core'; import React, { useCallback } from 'react'; +import { WithTranslation } from 'react-i18next'; import { useStore } from 'react-redux'; -// @ts-ignore -import { translate } from '../../base/i18n'; +import { translate } from '../../base/i18n/functions'; import { Theme } from '../../base/ui/types'; // @ts-ignore import { setSeeWhatIsBeingShared } from '../actions.web'; @@ -72,7 +72,7 @@ const useStyles = makeStyles((theme: Theme) => createStyles({ * * @returns {ReactElement} */ -const ScreenSharePlaceholder: React.FC<{ t: Function }> = ({ t }) => { +const ScreenSharePlaceholder: React.FC = ({ t }) => { const classes = useStyles(); const store = useStore(); diff --git a/react/features/lobby/reducer.ts b/react/features/lobby/reducer.ts index b9af2974d..009ffb154 100644 --- a/react/features/lobby/reducer.ts +++ b/react/features/lobby/reducer.ts @@ -1,6 +1,6 @@ // @ts-ignore import { CONFERENCE_JOINED, CONFERENCE_LEFT, SET_PASSWORD } from '../base/conference'; -import { Participant } from '../base/participants/reducer'; +import { Participant } from '../base/participants/types'; import ReducerRegistry from '../base/redux/ReducerRegistry'; import { diff --git a/react/features/noise-suppression/actions.ts b/react/features/noise-suppression/actions.ts index 613c49204..2c70b0cef 100644 --- a/react/features/noise-suppression/actions.ts +++ b/react/features/noise-suppression/actions.ts @@ -4,8 +4,8 @@ import { Dispatch } from 'redux'; // @ts-ignore import { getLocalJitsiAudioTrack } from '../base/tracks'; // @ts-ignore -import { NOTIFICATION_TIMEOUT_TYPE, showErrorNotification } from '../notifications'; -// @ts-ignore +import { showErrorNotification } from '../notifications'; +import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants'; import { NoiseSuppressionEffect } from '../stream-effects/noise-suppression/NoiseSuppressionEffect'; import { SET_NOISE_SUPPRESSION_ENABLED } from './actionTypes'; diff --git a/react/features/noise-suppression/components/NoiseSuppressionButton.tsx b/react/features/noise-suppression/components/NoiseSuppressionButton.tsx index e76645c49..fbd37af68 100644 --- a/react/features/noise-suppression/components/NoiseSuppressionButton.tsx +++ b/react/features/noise-suppression/components/NoiseSuppressionButton.tsx @@ -4,7 +4,7 @@ import { translate } from '../../base/i18n/functions'; import { IconNoiseSuppressionOn, IconNoiseSuppressionOff -} from '../../base/icons/svg/index'; +} from '../../base/icons/svg'; import { connect } from '../../base/redux/functions'; import { AbstractButton, diff --git a/react/features/noise-suppression/functions.ts b/react/features/noise-suppression/functions.ts index 0ddaa4195..aa225ebfa 100644 --- a/react/features/noise-suppression/functions.ts +++ b/react/features/noise-suppression/functions.ts @@ -1,7 +1,8 @@ /* eslint-disable lines-around-comment */ import { IState } from '../app/types'; // @ts-ignore -import { NOTIFICATION_TIMEOUT_TYPE, showWarningNotification } from '../notifications'; +import { showWarningNotification } from '../notifications'; +import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants'; // @ts-ignore import { isScreenAudioShared } from '../screen-share'; diff --git a/react/features/noise-suppression/logger.ts b/react/features/noise-suppression/logger.ts index 4df944f41..d40de4ae2 100644 --- a/react/features/noise-suppression/logger.ts +++ b/react/features/noise-suppression/logger.ts @@ -1,4 +1,3 @@ -// @ts-ignore import { getLogger } from '../base/logging/functions'; export default getLogger('features/noise-suppression'); diff --git a/react/features/overlay/reducer.ts b/react/features/overlay/reducer.ts index 5aefa9cf7..42cad5145 100644 --- a/react/features/overlay/reducer.ts +++ b/react/features/overlay/reducer.ts @@ -55,7 +55,7 @@ ReducerRegistry.register('features/overlay', (state = {}, action) */ function _mediaPermissionPromptVisibilityChanged( state: IOverlayState, - { browser, isVisible }: {browser?: string, isVisible?: boolean}) { + { browser, isVisible }: { browser?: string, isVisible?: boolean }) { return assign(state, { browser, isMediaPermissionPromptVisible: isVisible @@ -74,7 +74,7 @@ function _mediaPermissionPromptVisibilityChanged( */ function _toggleSlowGUMOverlay( state: IOverlayState, - { isVisible }: {isVisible?: boolean}) { + { isVisible }: { isVisible?: boolean }) { return assign(state, { isSlowGUMOverlayVisible: isVisible }); @@ -102,6 +102,6 @@ function _setShowLoadConfigOverlay(state: IOverlayState, show?: boolean) { * @returns {Object} * @private */ -function _setFatalError(state: IOverlayState, { fatalError }: {fatalError?: Error}) { +function _setFatalError(state: IOverlayState, { fatalError }: { fatalError?: Error }) { return set(state, 'fatalError', fatalError); } diff --git a/react/features/participants-pane/components/breakout-rooms/components/web/CollapsibleRoom.tsx b/react/features/participants-pane/components/breakout-rooms/components/web/CollapsibleRoom.tsx index ac0ad6a58..d0991bcc5 100644 --- a/react/features/participants-pane/components/breakout-rooms/components/web/CollapsibleRoom.tsx +++ b/react/features/participants-pane/components/breakout-rooms/components/web/CollapsibleRoom.tsx @@ -6,19 +6,16 @@ import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import { IState } from '../../../../../app/types'; -// @ts-ignore -import { ListItem } from '../../../../../base/components'; +import ListItem from '../../../../../base/components/participants-pane-list/ListItem'; import Icon from '../../../../../base/icons/components/Icon'; -import { IconArrowDown, IconArrowUp } from '../../../../../base/icons/svg/index'; +import { IconArrowDown, IconArrowUp } from '../../../../../base/icons/svg'; import { isLocalParticipantModerator } from '../../../../../base/participants/functions'; // @ts-ignore import { showOverflowDrawer } from '../../../../../toolbox/functions.web'; -// @ts-ignore import { ACTION_TRIGGER } from '../../../../constants'; // @ts-ignore import { participantMatchesSearch } from '../../../../functions'; import ParticipantActionEllipsis from '../../../web/ParticipantActionEllipsis'; -// @ts-ignore import ParticipantItem from '../../../web/ParticipantItem'; type Props = { @@ -41,7 +38,7 @@ type Props = { /** * Callback for when the mouse leaves this component. */ - onLeave?: Function, + onLeave?: (e?: React.MouseEvent) => void, /** * Callback to raise menu. Used to raise menu on mobile long press. @@ -135,7 +132,7 @@ export const CollapsibleRoom = ({ onRaiseMenu(target); }, [ onRaiseMenu ]); const { defaultRemoteDisplayName } = useSelector((state: IState) => state['features/base/config']); - const overflowDrawer = useSelector(showOverflowDrawer); + const overflowDrawer: boolean = useSelector(showOverflowDrawer); const moderator = useSelector(isLocalParticipantModerator); const arrow = (
diff --git a/react/features/participants-pane/components/breakout-rooms/components/web/RoomActionEllipsis.tsx b/react/features/participants-pane/components/breakout-rooms/components/web/RoomActionEllipsis.tsx index f736d09aa..017483be8 100644 --- a/react/features/participants-pane/components/breakout-rooms/components/web/RoomActionEllipsis.tsx +++ b/react/features/participants-pane/components/breakout-rooms/components/web/RoomActionEllipsis.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import { IconHorizontalPoints } from '../../../../../base/icons/svg/index'; +import { IconHorizontalPoints } from '../../../../../base/icons/svg'; import Button from '../../../../../base/ui/components/web/Button'; type Props = { diff --git a/react/features/participants-pane/components/breakout-rooms/components/web/RoomParticipantContextMenu.tsx b/react/features/participants-pane/components/breakout-rooms/components/web/RoomParticipantContextMenu.tsx index b188d9e49..6dc6d743e 100644 --- a/react/features/participants-pane/components/breakout-rooms/components/web/RoomParticipantContextMenu.tsx +++ b/react/features/participants-pane/components/breakout-rooms/components/web/RoomParticipantContextMenu.tsx @@ -1,4 +1,4 @@ -/* eslint-disable import/order */ +/* eslint-disable lines-around-comment */ import { makeStyles } from '@material-ui/core'; import React, { useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -6,22 +6,16 @@ import { useSelector } from 'react-redux'; // @ts-ignore import { Avatar } from '../../../../../base/avatar'; - // @ts-ignore import { ContextMenu, ContextMenuItemGroup } from '../../../../../base/components'; import { isLocalParticipantModerator } from '../../../../../base/participants/functions'; import { Theme } from '../../../../../base/ui/types'; - // @ts-ignore import { getBreakoutRooms } from '../../../../../breakout-rooms/functions'; - // @ts-ignore import { showOverflowDrawer } from '../../../../../toolbox/functions.web'; - // @ts-ignore import SendToRoomButton from '../../../../../video-menu/components/web/SendToRoomButton'; - -// @ts-ignore import { AVATAR_SIZE } from '../../../../constants'; type Props = { diff --git a/react/features/participants-pane/components/native/ParticipantsPaneFooter.tsx b/react/features/participants-pane/components/native/ParticipantsPaneFooter.tsx index b8c4787cb..5829e4e8b 100644 --- a/react/features/participants-pane/components/native/ParticipantsPaneFooter.tsx +++ b/react/features/participants-pane/components/native/ParticipantsPaneFooter.tsx @@ -5,7 +5,7 @@ import { useDispatch, useSelector } from 'react-redux'; // @ts-ignore import { openDialog, openSheet } from '../../../base/dialog'; -import { IconHorizontalPoints } from '../../../base/icons/svg/index'; +import { IconHorizontalPoints } from '../../../base/icons/svg'; import IconButton from '../../../base/react/components/native/IconButton'; import Button from '../../../base/ui/components/native/Button'; import { BUTTON_TYPES } from '../../../base/ui/constants'; diff --git a/react/features/participants-pane/components/web/FooterContextMenu.tsx b/react/features/participants-pane/components/web/FooterContextMenu.tsx index df14d45fe..076e3911c 100644 --- a/react/features/participants-pane/components/web/FooterContextMenu.tsx +++ b/react/features/participants-pane/components/web/FooterContextMenu.tsx @@ -16,8 +16,8 @@ import { isSupported as isAvModerationSupported // @ts-ignore } from '../../../av-moderation/functions'; -// @ts-ignore -import { ContextMenu, ContextMenuItemGroup } from '../../../base/components'; +import ContextMenu from '../../../base/components/context-menu/ContextMenu'; +import ContextMenuItemGroup from '../../../base/components/context-menu/ContextMenuItemGroup'; // @ts-ignore import { openDialog } from '../../../base/dialog'; import { @@ -80,12 +80,12 @@ type Props = { /** * Drawer close callback. */ - onDrawerClose: Function, + onDrawerClose: (e?: React.MouseEvent) => void, /** * Callback for the mouse leaving this item. */ - onMouseLeave?: Function + onMouseLeave?: (e?: React.MouseEvent) => void }; export const FooterContextMenu = ({ isOpen, onDrawerClose, onMouseLeave }: Props) => { diff --git a/react/features/participants-pane/components/web/InviteButton.tsx b/react/features/participants-pane/components/web/InviteButton.tsx index 6344ab813..ffb978ec1 100644 --- a/react/features/participants-pane/components/web/InviteButton.tsx +++ b/react/features/participants-pane/components/web/InviteButton.tsx @@ -5,7 +5,7 @@ import { useDispatch } from 'react-redux'; // @ts-ignore import { createToolbarEvent, sendAnalytics } from '../../../analytics'; -import { IconInviteMore } from '../../../base/icons/svg/index'; +import { IconInviteMore } from '../../../base/icons/svg'; import Button from '../../../base/ui/components/web/Button'; import { BUTTON_TYPES } from '../../../base/ui/constants'; // @ts-ignore diff --git a/react/features/participants-pane/components/web/LobbyParticipantItem.tsx b/react/features/participants-pane/components/web/LobbyParticipantItem.tsx index b732148f4..9ac6117b2 100644 --- a/react/features/participants-pane/components/web/LobbyParticipantItem.tsx +++ b/react/features/participants-pane/components/web/LobbyParticipantItem.tsx @@ -4,21 +4,19 @@ import React, { useCallback, useState, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -// @ts-ignore -import { ContextMenu, ContextMenuItemGroup } from '../../../base/components'; -import { IconChat, IconCloseCircle, IconHorizontalPoints } from '../../../base/icons/svg/index'; +import ContextMenu from '../../../base/components/context-menu/ContextMenu'; +import ContextMenuItemGroup from '../../../base/components/context-menu/ContextMenuItemGroup'; +import { IconChat, IconCloseCircle, IconHorizontalPoints } from '../../../base/icons/svg'; import { hasRaisedHand } from '../../../base/participants/functions'; -import { Participant } from '../../../base/participants/reducer'; +import { Participant } from '../../../base/participants/types'; import Button from '../../../base/ui/components/web/Button'; import { BUTTON_TYPES } from '../../../base/ui/constants'; // @ts-ignore import { showLobbyChatButton } from '../../../lobby/functions'; -// @ts-ignore import { ACTION_TRIGGER, MEDIA_STATE } from '../../constants'; // @ts-ignore import { useLobbyActions } from '../../hooks'; -// @ts-ignore import ParticipantItem from './ParticipantItem'; type Props = { diff --git a/react/features/participants-pane/components/web/LobbyParticipants.tsx b/react/features/participants-pane/components/web/LobbyParticipants.tsx index 9df19a2e2..e28b11a1d 100644 --- a/react/features/participants-pane/components/web/LobbyParticipants.tsx +++ b/react/features/participants-pane/components/web/LobbyParticipants.tsx @@ -7,7 +7,7 @@ import { useSelector, useDispatch } from 'react-redux'; // @ts-ignore import { Avatar } from '../../../base/avatar'; import Icon from '../../../base/icons/components/Icon'; -import { IconCheck, IconClose } from '../../../base/icons/svg/index'; +import { IconCheck, IconClose } from '../../../base/icons/svg'; import { withPixelLineHeight } from '../../../base/styles/functions.web'; // @ts-ignore import { admitMultiple } from '../../../lobby/actions.web'; diff --git a/react/features/participants-pane/components/web/MeetingParticipants.tsx b/react/features/participants-pane/components/web/MeetingParticipants.tsx index 3bbfd52df..b6beed41f 100644 --- a/react/features/participants-pane/components/web/MeetingParticipants.tsx +++ b/react/features/participants-pane/components/web/MeetingParticipants.tsx @@ -58,7 +58,7 @@ const useStyles = makeStyles((theme: any) => { }); type Props = { - currentRoom?: {name: string}, + currentRoom?: { name: string }, overflowDrawer?: boolean, participantsCount?: number, searchString: string, diff --git a/react/features/participants-pane/components/web/ParticipantActionEllipsis.tsx b/react/features/participants-pane/components/web/ParticipantActionEllipsis.tsx index 4772411c7..d63594b95 100644 --- a/react/features/participants-pane/components/web/ParticipantActionEllipsis.tsx +++ b/react/features/participants-pane/components/web/ParticipantActionEllipsis.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { IconHorizontalPoints } from '../../../base/icons/svg/index'; +import { IconHorizontalPoints } from '../../../base/icons/svg'; import Button from '../../../base/ui/components/web/Button'; type Props = { diff --git a/react/features/participants-pane/components/web/ParticipantItem.tsx b/react/features/participants-pane/components/web/ParticipantItem.tsx index aba17f0b0..bd2dc11e5 100644 --- a/react/features/participants-pane/components/web/ParticipantItem.tsx +++ b/react/features/participants-pane/components/web/ParticipantItem.tsx @@ -5,10 +5,8 @@ import { WithTranslation } from 'react-i18next'; // @ts-ignore import { Avatar } from '../../../base/avatar'; -// @ts-ignore -import { ListItem } from '../../../base/components'; -// @ts-ignore -import { translate } from '../../../base/i18n'; +import ListItem from '../../../base/components/participants-pane-list/ListItem'; +import { translate } from '../../../base/i18n/functions'; import { ACTION_TRIGGER, AudioStateIcons, @@ -16,10 +14,8 @@ import { type ActionTrigger, type MediaState, VideoStateIcons - // @ts-ignore } from '../../constants'; -// @ts-ignore import { RaisedHandIndicator } from './RaisedHandIndicator'; interface Props extends WithTranslation { @@ -37,17 +33,17 @@ interface Props extends WithTranslation { /** * React children. */ - children?: ReactElement, + children?: ReactElement|boolean, /** * Whether or not to disable the moderator indicator. */ - disableModeratorIndicator: boolean, + disableModeratorIndicator?: boolean, /** * The name of the participant. Used for showing lobby names. */ - displayName: string, + displayName?: string, /** * Is this item highlighted/raised. @@ -57,17 +53,17 @@ interface Props extends WithTranslation { /** * Whether or not the participant is a moderator. */ - isModerator: boolean, + isModerator?: boolean, /** * True if the participant is local. */ - local: boolean, + local?: boolean, /** * Callback for when the mouse leaves this component. */ - onLeave?: Function, + onLeave?: (e?: React.MouseEvent) => void, /** * Opens a drawer with participant actions. diff --git a/react/features/participants-pane/components/web/ParticipantQuickAction.tsx b/react/features/participants-pane/components/web/ParticipantQuickAction.tsx index 51784b8b2..70f113859 100644 --- a/react/features/participants-pane/components/web/ParticipantQuickAction.tsx +++ b/react/features/participants-pane/components/web/ParticipantQuickAction.tsx @@ -8,7 +8,6 @@ import { useDispatch } from 'react-redux'; import { approveParticipant } from '../../../av-moderation/actions'; import Button from '../../../base/ui/components/web/Button'; import { Theme } from '../../../base/ui/types'; -// @ts-ignore import { QUICK_ACTION_BUTTON } from '../../constants'; type Props = { diff --git a/react/features/participants-pane/components/web/ParticipantsPane.tsx b/react/features/participants-pane/components/web/ParticipantsPane.tsx index 0861b8b1a..21ff5b886 100644 --- a/react/features/participants-pane/components/web/ParticipantsPane.tsx +++ b/react/features/participants-pane/components/web/ParticipantsPane.tsx @@ -8,7 +8,7 @@ import participantsPaneTheme from '../../../base/components/themes/participantsP // @ts-ignore import { openDialog } from '../../../base/dialog'; import { translate } from '../../../base/i18n/functions'; -import { IconClose, IconHorizontalPoints } from '../../../base/icons/svg/index'; +import { IconClose, IconHorizontalPoints } from '../../../base/icons/svg'; // @ts-ignore import { isLocalParticipantModerator } from '../../../base/participants/functions'; import { connect } from '../../../base/redux/functions'; @@ -29,16 +29,12 @@ import { isMuteAllVisible // @ts-ignore } from '../../functions'; -// @ts-ignore import { AddBreakoutRoomButton } from '../breakout-rooms/components/web/AddBreakoutRoomButton'; // @ts-ignore import { RoomList } from '../breakout-rooms/components/web/RoomList'; -// @ts-ignore import { FooterContextMenu } from './FooterContextMenu'; -// @ts-ignore import LobbyParticipants from './LobbyParticipants'; -// @ts-ignore import MeetingParticipants from './MeetingParticipants'; /** diff --git a/react/features/participants-pane/components/web/RaisedHandIndicator.tsx b/react/features/participants-pane/components/web/RaisedHandIndicator.tsx index bb99a536d..89113bb97 100644 --- a/react/features/participants-pane/components/web/RaisedHandIndicator.tsx +++ b/react/features/participants-pane/components/web/RaisedHandIndicator.tsx @@ -2,7 +2,7 @@ import { makeStyles } from '@material-ui/styles'; import React from 'react'; import Icon from '../../../base/icons/components/Icon'; -import { IconRaisedHandHollow } from '../../../base/icons/svg/index'; +import { IconRaisedHandHollow } from '../../../base/icons/svg'; import BaseTheme from '../../../base/ui/components/BaseTheme.web'; const useStyles = makeStyles((theme: any) => { diff --git a/react/features/participants-pane/constants.tsx b/react/features/participants-pane/constants.tsx index 59ba2439c..1218df2b4 100644 --- a/react/features/participants-pane/constants.tsx +++ b/react/features/participants-pane/constants.tsx @@ -18,7 +18,7 @@ export type ActionTrigger = 'Hover' | 'Permanent' /** * Enum of possible participant action triggers. */ -export const ACTION_TRIGGER: {HOVER: ActionTrigger, PERMANENT: ActionTrigger} = { +export const ACTION_TRIGGER: { HOVER: ActionTrigger, PERMANENT: ActionTrigger } = { HOVER: 'Hover', PERMANENT: 'Permanent' }; diff --git a/react/features/polls/components/web/PollAnswer.tsx b/react/features/polls/components/web/PollAnswer.tsx index bab97eb75..92d9e8135 100644 --- a/react/features/polls/components/web/PollAnswer.tsx +++ b/react/features/polls/components/web/PollAnswer.tsx @@ -8,10 +8,7 @@ import { BUTTON_TYPES } from '../../../base/ui/constants'; import { Theme } from '../../../base/ui/types'; // @ts-ignore import { isSubmitAnswerDisabled } from '../../functions'; -// @ts-ignore -import AbstractPollAnswer from '../AbstractPollAnswer'; -// @ts-ignore -import type { AbstractProps } from '../AbstractPollAnswer'; +import AbstractPollAnswer, { AbstractProps } from '../AbstractPollAnswer'; const useStyles = makeStyles((theme: Theme) => { return { diff --git a/react/features/polls/components/web/PollCreate.tsx b/react/features/polls/components/web/PollCreate.tsx index e7b04a24d..cc9dfddb3 100644 --- a/react/features/polls/components/web/PollCreate.tsx +++ b/react/features/polls/components/web/PollCreate.tsx @@ -3,13 +3,12 @@ import { makeStyles } from '@material-ui/core'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import Icon from '../../../base/icons/components/Icon'; -import { IconMenu } from '../../../base/icons/svg/index'; +import { IconMenu } from '../../../base/icons/svg'; // @ts-ignore import { Tooltip } from '../../../base/tooltip'; import Button from '../../../base/ui/components/web/Button'; import { BUTTON_TYPES } from '../../../base/ui/constants'; import { Theme } from '../../../base/ui/types'; -// @ts-ignore import { ANSWERS_LIMIT, CHAR_LIMIT } from '../../constants'; // @ts-ignore import AbstractPollCreate from '../AbstractPollCreate'; diff --git a/react/features/polls/components/web/PollsPane.tsx b/react/features/polls/components/web/PollsPane.tsx index 295368df7..7f58bcc20 100644 --- a/react/features/polls/components/web/PollsPane.tsx +++ b/react/features/polls/components/web/PollsPane.tsx @@ -7,7 +7,6 @@ import AbstractPollsPane from '../AbstractPollsPane'; // @ts-ignore import type { AbstractProps } from '../AbstractPollsPane'; -// @ts-ignore import PollCreate from './PollCreate'; // @ts-ignore import PollsList from './PollsList'; diff --git a/react/features/prejoin/components/Prejoin.native.tsx b/react/features/prejoin/components/Prejoin.native.tsx index 4970ec67e..900a5330f 100644 --- a/react/features/prejoin/components/Prejoin.native.tsx +++ b/react/features/prejoin/components/Prejoin.native.tsx @@ -23,7 +23,7 @@ import { setAudioOnly } from '../../base/audio-only/actions'; import { getConferenceName } from '../../base/conference/functions'; // @ts-ignore import { connect } from '../../base/connection/actions.native'; -import { IconClose } from '../../base/icons/svg/index'; +import { IconClose } from '../../base/icons/svg'; // @ts-ignore import JitsiScreen from '../../base/modal/components/JitsiScreen'; import { getLocalParticipant } from '../../base/participants/functions'; diff --git a/react/features/prejoin/components/dialogs/CallingDialog.tsx b/react/features/prejoin/components/dialogs/CallingDialog.tsx index d2f023dd2..197dd659c 100644 --- a/react/features/prejoin/components/dialogs/CallingDialog.tsx +++ b/react/features/prejoin/components/dialogs/CallingDialog.tsx @@ -7,7 +7,7 @@ import { WithTranslation } from 'react-i18next'; import { Avatar } from '../../../base/avatar'; import { translate } from '../../../base/i18n/functions'; import Icon from '../../../base/icons/components/Icon'; -import { IconClose } from '../../../base/icons/svg/index'; +import { IconClose } from '../../../base/icons/svg'; // @ts-ignore import Label from '../Label'; diff --git a/react/features/prejoin/components/dialogs/DialInDialog.tsx b/react/features/prejoin/components/dialogs/DialInDialog.tsx index a64e6e140..3a2b6db2a 100644 --- a/react/features/prejoin/components/dialogs/DialInDialog.tsx +++ b/react/features/prejoin/components/dialogs/DialInDialog.tsx @@ -5,7 +5,7 @@ import { WithTranslation } from 'react-i18next'; import { translate } from '../../../base/i18n/functions'; import Icon from '../../../base/icons/components/Icon'; -import { IconArrowLeft } from '../../../base/icons/svg/index'; +import { IconArrowLeft } from '../../../base/icons/svg'; // @ts-ignore import { ActionButton } from '../../../base/premeeting'; // @ts-ignore diff --git a/react/features/prejoin/components/dialogs/DialOutDialog.tsx b/react/features/prejoin/components/dialogs/DialOutDialog.tsx index 71fdc03ca..b9ab9f4f4 100644 --- a/react/features/prejoin/components/dialogs/DialOutDialog.tsx +++ b/react/features/prejoin/components/dialogs/DialOutDialog.tsx @@ -5,7 +5,7 @@ import { WithTranslation } from 'react-i18next'; import { translate } from '../../../base/i18n/functions'; import Icon from '../../../base/icons/components/Icon'; -import { IconClose } from '../../../base/icons/svg/index'; +import { IconClose } from '../../../base/icons/svg'; // @ts-ignore import { ActionButton } from '../../../base/premeeting'; // @ts-ignore diff --git a/react/features/prejoin/reducer.ts b/react/features/prejoin/reducer.ts index b59fe303c..1992d6105 100644 --- a/react/features/prejoin/reducer.ts +++ b/react/features/prejoin/reducer.ts @@ -159,7 +159,7 @@ ReducerRegistry.register( * @returns {Object} */ function getStatusFromErrors(errors: { - audioAndVideoError?: {message: string}, + audioAndVideoError?: { message: string }, audioOnlyError?: { message: string }, videoOnlyError?: Object } ) { diff --git a/react/features/reactions/components/web/ReactionsMenu.tsx b/react/features/reactions/components/web/ReactionsMenu.tsx index ca7f47126..9ecb43f79 100644 --- a/react/features/reactions/components/web/ReactionsMenu.tsx +++ b/react/features/reactions/components/web/ReactionsMenu.tsx @@ -1,4 +1,4 @@ -/* eslint-disable import/order */ +/* eslint-disable lines-around-comment */ import { withStyles } from '@material-ui/styles'; import clsx from 'clsx'; import React, { Component } from 'react'; @@ -9,24 +9,20 @@ import { createReactionMenuEvent, createToolbarEvent, sendAnalytics - // @ts-ignore } from '../../../analytics'; import { IState, IStore } from '../../../app/types'; import { isMobileBrowser } from '../../../base/environment/utils'; -import { getLocalParticipant, hasRaisedHand } from '../../../base/participants/functions'; -import { raiseHand } from '../../../base/participants/actions'; import { translate } from '../../../base/i18n/functions'; - +import { raiseHand } from '../../../base/participants/actions'; +import { getLocalParticipant, hasRaisedHand } from '../../../base/participants/functions'; import { connect } from '../../../base/redux/functions'; import { Theme } from '../../../base/ui/types'; - +import GifsMenu from '../../../gifs/components/web/GifsMenu'; // @ts-ignore -import { GifsMenu, GifsMenuButton } from '../../../gifs/components'; - +import GifsMenuButton from '../../../gifs/components/web/GifsMenuButton'; // @ts-ignore import { isGifEnabled, isGifsMenuOpen } from '../../../gifs/functions'; - // @ts-ignore import { dockToolbox } from '../../../toolbox/actions.web'; import { addReactionToBuffer } from '../../actions.any'; diff --git a/react/features/reactions/components/web/ReactionsMenuButton.tsx b/react/features/reactions/components/web/ReactionsMenuButton.tsx index 219e662c6..56a615fd1 100644 --- a/react/features/reactions/components/web/ReactionsMenuButton.tsx +++ b/react/features/reactions/components/web/ReactionsMenuButton.tsx @@ -6,7 +6,7 @@ import { useSelector } from 'react-redux'; import { IState } from '../../../app/types'; import { isMobileBrowser } from '../../../base/environment/utils'; import { translate } from '../../../base/i18n/functions'; -import { IconArrowUp } from '../../../base/icons/svg/index'; +import { IconArrowUp } from '../../../base/icons/svg'; import { connect } from '../../../base/redux/functions'; // @ts-ignore import ToolboxButtonWithIconPopup from '../../../base/toolbox/components/web/ToolboxButtonWithIconPopup'; diff --git a/react/features/reactions/logger.ts b/react/features/reactions/logger.ts index 2a99850c0..b874d20fb 100644 --- a/react/features/reactions/logger.ts +++ b/react/features/reactions/logger.ts @@ -1,4 +1,3 @@ -// @ts-ignore import { getLogger } from '../base/logging/functions'; export default getLogger('features/base/reactions'); diff --git a/react/features/reactions/middleware.ts b/react/features/reactions/middleware.ts index 042cfda12..a472077ae 100644 --- a/react/features/reactions/middleware.ts +++ b/react/features/reactions/middleware.ts @@ -1,16 +1,14 @@ -/* eslint-disable import/order */ +/* eslint-disable lines-around-comment */ import { batch } from 'react-redux'; // @ts-ignore import { createReactionSoundsDisabledEvent, sendAnalytics } from '../analytics'; - import { IStore } from '../app/types'; import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app/actionTypes'; import { CONFERENCE_JOIN_IN_PROGRESS, SET_START_REACTIONS_MUTED, setStartReactionsMuted - // @ts-ignore } from '../base/conference'; import { @@ -18,19 +16,14 @@ import { getParticipantCount, isLocalParticipantModerator } from '../base/participants/functions'; - import MiddlewareRegistry from '../base/redux/MiddlewareRegistry'; import { SETTINGS_UPDATED } from '../base/settings/actionTypes'; - // @ts-ignore import { updateSettings } from '../base/settings/actions'; - // @ts-ignore import { playSound, registerSound, unregisterSound } from '../base/sounds'; - // @ts-ignore import { getDisabledSounds } from '../base/sounds/functions.any'; - // @ts-ignore import { NOTIFICATION_TIMEOUT_TYPE, showNotification } from '../notifications'; diff --git a/react/features/recording/components/Recording/LocalRecordingManager.web.ts b/react/features/recording/components/Recording/LocalRecordingManager.web.ts index a1cde6acd..f12b33d2f 100644 --- a/react/features/recording/components/Recording/LocalRecordingManager.web.ts +++ b/react/features/recording/components/Recording/LocalRecordingManager.web.ts @@ -1,20 +1,14 @@ -/* eslint-disable import/order */ - +/* eslint-disable lines-around-comment */ import { v4 as uuidV4 } from 'uuid'; import fixWebmDuration from 'webm-duration-fix'; import { IStore } from '../../../app/types'; - // @ts-ignore import { getRoomName } from '../../../base/conference'; - -// @ts-ignore -import { MEDIA_TYPE } from '../../../base/media'; - +import { MEDIA_TYPE } from '../../../base/media/constants'; // @ts-ignore import { getTrackState, getLocalTrack } from '../../../base/tracks'; import { inIframe } from '../../../base/util/iframeUtils'; - // @ts-ignore import { stopLocalVideoRecording } from '../../actions.any'; diff --git a/react/features/recording/components/Recording/web/HighlightButton.tsx b/react/features/recording/components/Recording/web/HighlightButton.tsx index 2ac1e7d41..fea995ab4 100644 --- a/react/features/recording/components/Recording/web/HighlightButton.tsx +++ b/react/features/recording/components/Recording/web/HighlightButton.tsx @@ -8,8 +8,7 @@ import { StartRecordingDialog } from '../..'; import { openDialog } from '../../../../base/dialog'; import { translate } from '../../../../base/i18n/functions'; import { IconHighlight } from '../../../../base/icons/svg'; -// @ts-ignore -import { Label } from '../../../../base/label'; +import Label from '../../../../base/label/components/web/Label'; import { connect } from '../../../../base/redux/functions'; // @ts-ignore import { Tooltip } from '../../../../base/tooltip'; @@ -154,8 +153,8 @@ export class HighlightButton extends AbstractHighlightButton { * @param {Event} e - The click event. * @returns {void} */ - _onClick(e: React.MouseEvent) { - e.stopPropagation(); + _onClick(e?: React.MouseEvent) { + e?.stopPropagation(); // @ts-ignore const { _disabled } = this.props; diff --git a/react/features/recording/components/web/RecordingLabel.tsx b/react/features/recording/components/web/RecordingLabel.tsx index 4f22fa66f..dba10383e 100644 --- a/react/features/recording/components/web/RecordingLabel.tsx +++ b/react/features/recording/components/web/RecordingLabel.tsx @@ -3,8 +3,7 @@ import { withStyles } from '@material-ui/core/styles'; import React from 'react'; import { translate } from '../../../base/i18n/functions'; -// @ts-ignore -import { Label } from '../../../base/label'; +import Label from '../../../base/label/components/web/Label'; import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet'; import { connect } from '../../../base/redux/functions'; import AbstractRecordingLabel, { diff --git a/react/features/salesforce/components/web/SalesforceLinkDialog.tsx b/react/features/salesforce/components/web/SalesforceLinkDialog.tsx index 8ffe8efef..543859ce8 100644 --- a/react/features/salesforce/components/web/SalesforceLinkDialog.tsx +++ b/react/features/salesforce/components/web/SalesforceLinkDialog.tsx @@ -8,7 +8,7 @@ import { useDispatch } from 'react-redux'; // @ts-ignore import { Dialog, hideDialog } from '../../../base/dialog'; import Icon from '../../../base/icons/components/Icon'; -import { IconSearch } from '../../../base/icons/svg/index'; +import { IconSearch } from '../../../base/icons/svg'; // @ts-ignore import { getFieldValue } from '../../../base/react'; import BaseTheme from '../../../base/ui/components/BaseTheme.web'; diff --git a/react/features/security/components/security-dialog/web/PasswordSection.tsx b/react/features/security/components/security-dialog/web/PasswordSection.tsx index 422961f97..29df61757 100644 --- a/react/features/security/components/security-dialog/web/PasswordSection.tsx +++ b/react/features/security/components/security-dialog/web/PasswordSection.tsx @@ -6,7 +6,6 @@ import { translate } from '../../../../base/i18n/functions'; import { copyText } from '../../../../base/util/helpers'; import { NOTIFY_CLICK_MODE } from '../../../../toolbox/constants'; -// @ts-ignore import PasswordForm from './PasswordForm'; import { NotifyClick } from './SecurityDialog'; diff --git a/react/features/settings/components/web/MoreTab.tsx b/react/features/settings/components/web/MoreTab.tsx index e80edb5bd..2ddfcaf0e 100644 --- a/react/features/settings/components/web/MoreTab.tsx +++ b/react/features/settings/components/web/MoreTab.tsx @@ -16,8 +16,7 @@ import { translate } from '../../../base/i18n/functions'; import Checkbox from '../../../base/ui/components/web/Checkbox'; // @ts-ignore import TouchmoveHack from '../../../chat/components/web/TouchmoveHack'; -// @ts-ignore -import { MAX_ACTIVE_PARTICIPANTS } from '../../../filmstrip'; +import { MAX_ACTIVE_PARTICIPANTS } from '../../../filmstrip/constants'; // @ts-ignore import { SS_DEFAULT_FRAME_RATE } from '../../constants'; @@ -178,7 +177,7 @@ class MoreTab extends AbstractDialogTab { * @private * @returns {void} */ - _onFramerateDropdownOpenChange({ isOpen }: {isOpen: boolean}) { + _onFramerateDropdownOpenChange({ isOpen }: { isOpen: boolean }) { // @ts-ignore this.setState({ isFramerateSelectOpen: isOpen }); } @@ -203,7 +202,7 @@ class MoreTab extends AbstractDialogTab { * @private * @returns {void} */ - _onLanguageDropdownOpenChange({ isOpen }: {isOpen: boolean}) { + _onLanguageDropdownOpenChange({ isOpen }: { isOpen: boolean }) { // @ts-ignore this.setState({ isLanguageSelectOpen: isOpen }); } @@ -283,7 +282,7 @@ class MoreTab extends AbstractDialogTab { * @private * @returns {void} */ - _onMaxStageParticipantsOpenChange({ isOpen }: {isOpen: boolean}) { + _onMaxStageParticipantsOpenChange({ isOpen }: { isOpen: boolean }) { // @ts-ignore this.setState({ isMaxStageParticipantsOpen: isOpen }); } diff --git a/react/features/settings/components/web/ProfileTab.tsx b/react/features/settings/components/web/ProfileTab.tsx index 2822545c9..ce77ca0da 100644 --- a/react/features/settings/components/web/ProfileTab.tsx +++ b/react/features/settings/components/web/ProfileTab.tsx @@ -19,8 +19,7 @@ import Input from '../../../base/ui/components/web/Input'; // @ts-ignore import { openLogoutDialog } from '../../actions'; -// eslint-disable-next-line no-var -declare var APP: any; +declare let APP: any; /** * The type of the React {@code Component} props of {@link ProfileTab}. diff --git a/react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx b/react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx index d835b55f9..1e5d2876c 100644 --- a/react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx +++ b/react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import Icon from '../../../base/icons/components/Icon'; -import { IconSearch } from '../../../base/icons/svg/index'; +import { IconSearch } from '../../../base/icons/svg'; // @ts-ignore import { getFieldValue } from '../../../base/react'; import BaseTheme from '../../../base/ui/components/BaseTheme.web'; diff --git a/react/features/stream-effects/noise-suppression/NoiseSuppressionEffect.ts b/react/features/stream-effects/noise-suppression/NoiseSuppressionEffect.ts index 3b4526a3f..94d90459b 100644 --- a/react/features/stream-effects/noise-suppression/NoiseSuppressionEffect.ts +++ b/react/features/stream-effects/noise-suppression/NoiseSuppressionEffect.ts @@ -1,5 +1,4 @@ -// @ts-ignore -import { getBaseUrl } from '../../base/util'; +import { getBaseUrl } from '../../base/util/helpers'; import logger from './logger'; diff --git a/react/features/stream-effects/noise-suppression/logger.ts b/react/features/stream-effects/noise-suppression/logger.ts index 99e9e8fc5..9a04cf907 100644 --- a/react/features/stream-effects/noise-suppression/logger.ts +++ b/react/features/stream-effects/noise-suppression/logger.ts @@ -1,4 +1,3 @@ -// @ts-ignore import { getLogger } from '../../base/logging/functions'; export default getLogger('features/stream-effects/noise-suppression'); diff --git a/react/features/subtitles/components/LanguageListItem.tsx b/react/features/subtitles/components/LanguageListItem.tsx index cebb8b7a7..50fab55f8 100644 --- a/react/features/subtitles/components/LanguageListItem.tsx +++ b/react/features/subtitles/components/LanguageListItem.tsx @@ -1,15 +1,10 @@ -// @ts-ignore import { makeStyles } from '@material-ui/styles'; import React, { useCallback } from 'react'; import { WithTranslation } from 'react-i18next'; -// @ts-ignore -// eslint-disable-next-line import/order -import { translate } from '../../base/i18n'; - -// @ts-ignore -import { Icon } from '../../base/icons/components'; -import { IconCheck } from '../../base/icons/svg/index'; +import { translate } from '../../base/i18n/functions'; +import Icon from '../../base/icons/components/Icon'; +import { IconCheck } from '../../base/icons/svg'; import { Theme } from '../../base/ui/types'; interface ILanguageListItemProps extends WithTranslation { diff --git a/react/features/toolbox/components/native/HangupMenuButton.tsx b/react/features/toolbox/components/native/HangupMenuButton.tsx index 707703e93..e33aa92c7 100644 --- a/react/features/toolbox/components/native/HangupMenuButton.tsx +++ b/react/features/toolbox/components/native/HangupMenuButton.tsx @@ -4,8 +4,7 @@ import { useDispatch } from 'react-redux'; // @ts-ignore import { openSheet } from '../../../base/dialog'; -// @ts-ignore -import { IconHangup } from '../../../base/icons'; +import { IconHangup } from '../../../base/icons/svg'; import IconButton from '../../../base/react/components/native/IconButton'; import { BUTTON_TYPES } from '../../../base/ui/constants'; diff --git a/react/features/toolbox/components/native/OpenCarmodeButton.tsx b/react/features/toolbox/components/native/OpenCarmodeButton.tsx index ffe7e40d6..0887027f0 100644 --- a/react/features/toolbox/components/native/OpenCarmodeButton.tsx +++ b/react/features/toolbox/components/native/OpenCarmodeButton.tsx @@ -2,7 +2,7 @@ // @ts-ignore import { CAR_MODE_ENABLED, getFeatureFlag } from '../../../base/flags'; import { translate } from '../../../base/i18n/functions'; -import { IconCar } from '../../../base/icons/svg/index'; +import { IconCar } from '../../../base/icons/svg'; import { connect } from '../../../base/redux/functions'; // @ts-ignore import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components'; diff --git a/react/features/toolbox/components/web/HangupMenuButton.tsx b/react/features/toolbox/components/web/HangupMenuButton.tsx index e527adba5..3794a7efd 100644 --- a/react/features/toolbox/components/web/HangupMenuButton.tsx +++ b/react/features/toolbox/components/web/HangupMenuButton.tsx @@ -1,18 +1,18 @@ /* eslint-disable lines-around-comment */ import InlineDialog from '@atlaskit/inline-dialog'; import React, { Component } from 'react'; +import { WithTranslation } from 'react-i18next'; // @ts-ignore import { createToolbarEvent, sendAnalytics } from '../../../analytics'; -// @ts-ignore -import { translate } from '../../../base/i18n'; +import { translate } from '../../../base/i18n/functions'; import HangupToggleButton from './HangupToggleButton'; /** * The type of the React {@code Component} props of {@link HangupMenuButton}. */ -type Props = { +interface Props extends WithTranslation { /** * ID of the menu that is controlled by this button. @@ -32,13 +32,8 @@ type Props = { /** * Callback to change the visibility of the hangup menu. */ - onVisibilityChange: Function, - - /** - * Invoked to obtain translated strings. - */ - t: Function, -}; + onVisibilityChange: Function +} /** * A React {@code Component} for opening or closing the {@code HangupMenu}. diff --git a/react/features/toolbox/components/web/Toolbox.tsx b/react/features/toolbox/components/web/Toolbox.tsx index c0daaaf0b..362f5f20b 100644 --- a/react/features/toolbox/components/web/Toolbox.tsx +++ b/react/features/toolbox/components/web/Toolbox.tsx @@ -14,8 +14,8 @@ import { // @ts-ignore } from '../../../analytics'; import { IState } from '../../../app/types'; -// @ts-ignore -import { ContextMenu, ContextMenuItemGroup } from '../../../base/components'; +import ContextMenu from '../../../base/components/context-menu/ContextMenu'; +import ContextMenuItemGroup from '../../../base/components/context-menu/ContextMenuItemGroup'; // @ts-ignore import { getMultipleVideoSendingSupportFeatureFlag, getToolbarButtons } from '../../../base/config'; // @ts-ignore @@ -234,7 +234,7 @@ interface Props extends WithTranslation { */ _hasSalesforce: boolean, - /** + /** * Whether or not the app is running in an ios mobile browser. */ _isIosMobile: boolean, @@ -571,9 +571,9 @@ class Toolbox extends Component { * @param {KeyboardEvent} e - Esc key click to close the popup. * @returns {void} */ - _onEscKey(e: React.KeyboardEvent) { - if (e.key === 'Escape') { - e.stopPropagation(); + _onEscKey(e?: React.KeyboardEvent) { + if (e?.key === 'Escape') { + e?.stopPropagation(); this._closeHangupMenuIfOpen(); this._closeOverflowMenuIfOpen(); } diff --git a/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx b/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx index 0394c69ce..f9935d0b0 100644 --- a/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx +++ b/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx @@ -10,7 +10,7 @@ import ContextMenuItemGroup from '../../../base/components/context-menu/ContextM import { isMobileBrowser } from '../../../base/environment/utils'; // @ts-ignore import { translate } from '../../../base/i18n'; -import { IconHorizontalPoints } from '../../../base/icons/svg/index'; +import { IconHorizontalPoints } from '../../../base/icons/svg'; import { getLocalParticipant } from '../../../base/participants/functions'; // @ts-ignore import { Popover } from '../../../base/popover'; diff --git a/react/features/video-menu/components/web/ParticipantContextMenu.tsx b/react/features/video-menu/components/web/ParticipantContextMenu.tsx index 41419aa38..fe8c25f41 100644 --- a/react/features/video-menu/components/web/ParticipantContextMenu.tsx +++ b/react/features/video-menu/components/web/ParticipantContextMenu.tsx @@ -12,11 +12,11 @@ import { Avatar } from '../../../base/avatar'; import ContextMenu from '../../../base/components/context-menu/ContextMenu'; import ContextMenuItemGroup from '../../../base/components/context-menu/ContextMenuItemGroup'; import { isIosMobileBrowser, isMobileBrowser } from '../../../base/environment/utils'; -import { IconShareVideo } from '../../../base/icons/svg/index'; +import { IconShareVideo } from '../../../base/icons/svg'; import { MEDIA_TYPE } from '../../../base/media/constants'; import { PARTICIPANT_ROLE } from '../../../base/participants/constants'; import { getLocalParticipant } from '../../../base/participants/functions'; -import { Participant } from '../../../base/participants/reducer'; +import { Participant } from '../../../base/participants/types'; // @ts-ignore import { isParticipantAudioMuted } from '../../../base/tracks'; // @ts-ignore @@ -167,7 +167,7 @@ const ParticipantContextMenu = ({ const stageFilmstrip = useSelector(isStageFilmstripAvailable); const _currentRoomId = useSelector(getCurrentRoomId); - const _rooms: Array<{id: string}> = Object.values(useSelector(getBreakoutRooms)); + const _rooms: Array<{ id: string }> = Object.values(useSelector(getBreakoutRooms)); const _onVolumeChange = useCallback(value => { dispatch(setVolume(participant.id, value)); diff --git a/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx b/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx index ed77fabff..7d237c474 100644 --- a/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx +++ b/react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.tsx @@ -8,9 +8,9 @@ import { IState } from '../../../app/types'; import { isMobileBrowser } from '../../../base/environment/utils'; // @ts-ignore import { translate } from '../../../base/i18n'; -import { IconHorizontalPoints } from '../../../base/icons/svg/index'; +import { IconHorizontalPoints } from '../../../base/icons/svg'; import { getParticipantById } from '../../../base/participants/functions'; -import { Participant } from '../../../base/participants/reducer'; +import { Participant } from '../../../base/participants/types'; // @ts-ignore import { Popover } from '../../../base/popover'; // @ts-ignore diff --git a/react/features/video-menu/components/web/VolumeSlider.tsx b/react/features/video-menu/components/web/VolumeSlider.tsx index b32d8a793..990fe2e16 100644 --- a/react/features/video-menu/components/web/VolumeSlider.tsx +++ b/react/features/video-menu/components/web/VolumeSlider.tsx @@ -6,7 +6,7 @@ import { WithTranslation } from 'react-i18next'; import { translate } from '../../../base/i18n/functions'; import Icon from '../../../base/icons/components/Icon'; -import { IconVolume } from '../../../base/icons/svg/index'; +import { IconVolume } from '../../../base/icons/svg'; // @ts-ignore import { VOLUME_SLIDER_SCALE } from '../../constants'; diff --git a/react/features/virtual-background/components/UploadImageButton.tsx b/react/features/virtual-background/components/UploadImageButton.tsx index bbbae5d32..50163d90d 100644 --- a/react/features/virtual-background/components/UploadImageButton.tsx +++ b/react/features/virtual-background/components/UploadImageButton.tsx @@ -6,7 +6,7 @@ import { v4 as uuidv4 } from 'uuid'; import { translate } from '../../base/i18n/functions'; import Icon from '../../base/icons/components/Icon'; -import { IconPlusCircle } from '../../base/icons/svg/index'; +import { IconPlusCircle } from '../../base/icons/svg'; import { VIRTUAL_BACKGROUND_TYPE, type Image } from '../constants'; // @ts-ignore import { resizeImage } from '../functions'; diff --git a/react/features/virtual-background/components/VirtualBackgroundDialog.tsx b/react/features/virtual-background/components/VirtualBackgroundDialog.tsx index c52a55afc..1854e48fb 100644 --- a/react/features/virtual-background/components/VirtualBackgroundDialog.tsx +++ b/react/features/virtual-background/components/VirtualBackgroundDialog.tsx @@ -17,7 +17,7 @@ import { getMultipleVideoSendingSupportFeatureFlag } from '../../base/config'; import { Dialog, hideDialog, openDialog } from '../../base/dialog'; import { translate } from '../../base/i18n/functions'; import Icon from '../../base/icons/components/Icon'; -import { IconCloseSmall, IconShareDesktop } from '../../base/icons/svg/index'; +import { IconCloseSmall, IconShareDesktop } from '../../base/icons/svg'; import { browser, JitsiTrackErrors } from '../../base/lib-jitsi-meet'; // @ts-ignore import { createLocalTrack } from '../../base/lib-jitsi-meet/functions'; diff --git a/react/features/virtual-background/components/VirtualBackgroundPreview.tsx b/react/features/virtual-background/components/VirtualBackgroundPreview.tsx index 443742a63..8cabb5dc6 100644 --- a/react/features/virtual-background/components/VirtualBackgroundPreview.tsx +++ b/react/features/virtual-background/components/VirtualBackgroundPreview.tsx @@ -18,9 +18,8 @@ import { getCurrentCameraDeviceId } from '../../base/settings'; // @ts-ignore import { createLocalTracksF } from '../../base/tracks/functions'; // @ts-ignore -import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications'; -// @ts-ignore import { showWarningNotification } from '../../notifications/actions'; +import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants'; // @ts-ignore import { toggleBackgroundEffect } from '../actions'; import { VIRTUAL_BACKGROUND_TYPE } from '../constants';