Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
ref(TS) Convert some native components to TS (#13281)
Robert Pintilii1ba7765898e1
diff --git a/react/features/base/dialog/components/native/BottomSheet.tsx b/react/features/base/dialog/components/native/BottomSheet.tsxindex e813d54e06..be93461ea3 100644--- a/react/features/base/dialog/components/native/BottomSheet.tsx+++ b/react/features/base/dialog/components/native/BottomSheet.tsx@@ -36,7 +36,7 @@ type Props = {/*** Function to render a bottom sheet footer element, if necessary.*/- renderFooter?: Function;+ renderFooter?: () => React.ReactNode;/*** Function to render a bottom sheet header element, if necessary.diff --git a/react/features/base/dialog/components/native/InputDialog.tsx b/react/features/base/dialog/components/native/InputDialog.tsxindex 71f0de1af4..06d9db8ec6 100644--- a/react/features/base/dialog/components/native/InputDialog.tsx+++ b/react/features/base/dialog/components/native/InputDialog.tsx@@ -18,7 +18,7 @@ interface IProps extends AbstractProps, WithTranslation {/*** The dialog descriptionKey.*/- descriptionKey: string;+ descriptionKey?: string;/*** An optional initial value to initiate the field with.diff --git a/react/features/chat/components/native/Chat.js b/react/features/chat/components/native/Chat.tsxsimilarity index 83%rename from react/features/chat/components/native/Chat.jsrename to react/features/chat/components/native/Chat.tsxindex 1855d14ade..84991a9dbe 100644--- a/react/features/chat/components/native/Chat.js+++ b/react/features/chat/components/native/Chat.tsx@@ -1,6 +1,5 @@/* eslint-disable react/no-multi-comp */--import { useIsFocused } from '@react-navigation/native';+import { Route, useIsFocused } from '@react-navigation/native';import React, { useEffect } from 'react';import { connect } from 'react-redux';@@ -9,7 +8,7 @@ import JitsiScreen from '../../../base/modal/components/JitsiScreen';import { TabBarLabelCounter } from '../../../mobile/navigation/components/TabBarLabelCounter';import { closeChat } from '../../actions.native';import AbstractChat, {- type Props as AbstractProps,+ IProps as AbstractProps,_mapStateToProps} from '../AbstractChat';@@ -18,24 +17,24 @@ import MessageContainer from './MessageContainer';import MessageRecipient from './MessageRecipient';import styles from './styles';-type Props = AbstractProps & {+interface IProps extends AbstractProps {/*** Default prop for navigating between screen components(React Navigation).*/- navigation: Object,+ navigation: any;/*** Default prop for navigating between screen components(React Navigation).*/- route: Object-};+ route: Route<'', { privateMessageRecipient: { name: string; }; }>;+}/*** Implements a React native component that renders the chat window (modal) of* the mobile client.*/-class Chat extends AbstractChat<Props> {+class Chat extends AbstractChat<IProps> {/*** Implements React's {@link Component#render()}.*@@ -51,17 +50,16 @@ class Chat extends AbstractChat<Props> {hasBottomTextInput = { true }hasTabNavigator = { true }style = { styles.chatContainer }>+ {/* @ts-ignore */}<MessageContainer messages = { _messages } /><MessageRecipient privateMessageRecipient = { privateMessageRecipient } /><ChatInputBar onSend = { this._onSendMessage } /></JitsiScreen>);}-- _onSendMessage: (string) => void;}-export default translate(connect(_mapStateToProps)(props => {+export default translate(connect(_mapStateToProps)((props: IProps) => {const { _nbUnreadMessages, dispatch, navigation, t } = props;const unreadMessagesNr = _nbUnreadMessages > 0;@@ -78,7 +76,9 @@ export default translate(connect(_mapStateToProps)(props => {)});- return () => isFocused && dispatch(closeChat());+ return () => {+ isFocused && dispatch(closeChat());+ };}, [ isFocused, _nbUnreadMessages ]);return (diff --git a/react/features/chat/components/native/ChatButton.js b/react/features/chat/components/native/ChatButton.tssimilarity index 88%rename from react/features/chat/components/native/ChatButton.jsrename to react/features/chat/components/native/ChatButton.tsindex 2c6652a47b..361b0e3d63 100644--- a/react/features/chat/components/native/ChatButton.js+++ b/react/features/chat/components/native/ChatButton.ts@@ -1,5 +1,6 @@import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { CHAT_ENABLED } from '../../../base/flags/constants';import { getFeatureFlag } from '../../../base/flags/functions';import { translate } from '../../../base/i18n/functions';@@ -10,23 +11,23 @@ import { screen } from '../../../mobile/navigation/routes';import { getUnreadPollCount } from '../../../polls/functions';import { getUnreadCount } from '../../functions';-type Props = AbstractButtonProps & {+interface IProps extends AbstractButtonProps {/*** True if the polls feature is disabled.*/- _isPollsDisabled: boolean,+ _isPollsDisabled?: boolean;/*** The unread message count.*/- _unreadMessageCount: number-};+ _unreadMessageCount: number;+}/*** Implements an {@link AbstractButton} to open the chat screen on mobile.*/-class ChatButton extends AbstractButton<Props, *> {+class ChatButton extends AbstractButton<IProps> {accessibilityLabel = 'toolbar.accessibilityLabel.chat';icon = IconMessage;label = 'toolbar.chat';@@ -60,9 +61,9 @@ class ChatButton extends AbstractButton<Props, *> {** @param {Object} state - The Redux state.* @param {Object} ownProps - The properties explicitly passed to the component instance.- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state, ownProps) {+function _mapStateToProps(state: IReduxState, ownProps: any) {const enabled = getFeatureFlag(state, CHAT_ENABLED, true);const { disablePolls } = state['features/base/config'];const { visible = enabled } = ownProps;diff --git a/react/features/chat/components/native/ChatPrivacyDialog.js b/react/features/chat/components/native/ChatPrivacyDialog.tsxsimilarity index 92%rename from react/features/chat/components/native/ChatPrivacyDialog.jsrename to react/features/chat/components/native/ChatPrivacyDialog.tsxindex 17e3d2646c..3a1b6c0146 100644--- a/react/features/chat/components/native/ChatPrivacyDialog.js+++ b/react/features/chat/components/native/ChatPrivacyDialog.tsx@@ -25,10 +25,6 @@ class ChatPrivacyDialog extends AbstractChatPrivacyDialog {onSubmit = { this._onSendPrivateMessage } />);}-- _onSendGroupMessage: () => boolean;-- _onSendPrivateMessage: () => boolean;}export default translate(connect(_mapStateToProps, _mapDispatchToProps)(ChatPrivacyDialog));diff --git a/react/features/chat/components/native/MessageRecipient.js b/react/features/chat/components/native/MessageRecipient.tsxsimilarity index 79%rename from react/features/chat/components/native/MessageRecipient.jsrename to react/features/chat/components/native/MessageRecipient.tsxindex 782826c7f1..63457682f4 100644--- a/react/features/chat/components/native/MessageRecipient.js+++ b/react/features/chat/components/native/MessageRecipient.tsx@@ -1,63 +1,65 @@import React from 'react';-import { Text, TouchableHighlight, View } from 'react-native';+import { Text, TouchableHighlight, View, ViewStyle } from 'react-native';import { connect } from 'react-redux';+import { IReduxState, IStore } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import Icon from '../../../base/icons/components/Icon';import { IconCloseLarge } from '../../../base/icons/svg';+import { ILocalParticipant } from '../../../base/participants/types';import {setParams} from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';import { setLobbyChatActiveState, setPrivateMessageRecipient } from '../../actions.any';import AbstractMessageRecipient, {- type Props as AbstractProps+ IProps as AbstractProps} from '../AbstractMessageRecipient';import styles from './styles';--type Props = AbstractProps & {+interface IProps extends AbstractProps {/*** The Redux dispatch function.*/- dispatch: Function,+ dispatch: IStore['dispatch'];/*** Is lobby messaging active.*/- isLobbyChatActive: boolean,+ isLobbyChatActive: boolean;/*** The participant string for lobby chat messaging.*/- lobbyMessageRecipient: Object,+ lobbyMessageRecipient?: {+ id: string;+ name: string;+ } | ILocalParticipant;/*** The participant object set for private messaging.*/- privateMessageRecipient: Object,-};+ privateMessageRecipient: { name: string; };+}/*** Class to implement the displaying of the recipient of the next message.*/-class MessageRecipient extends AbstractMessageRecipient<Props> {+class MessageRecipient extends AbstractMessageRecipient<IProps> {/*** Constructor of the component.*- * @param {Props} props - The props of the component.+ * @param {IProps} props - The props of the component.*/- constructor(props: Props) {+ constructor(props: IProps) {super(props);this._onResetPrivateMessageRecipient = this._onResetPrivateMessageRecipient.bind(this);this._onResetLobbyMessageRecipient = this._onResetLobbyMessageRecipient.bind(this);}- _onResetLobbyMessageRecipient: () => void;-/*** Resets lobby message recipient from state.*@@ -69,8 +71,6 @@ class MessageRecipient extends AbstractMessageRecipient<Props> {dispatch(setLobbyChatActiveState(false));}- _onResetPrivateMessageRecipient: () => void;-/*** Resets private message recipient from state.*@@ -102,10 +102,10 @@ class MessageRecipient extends AbstractMessageRecipient<Props> {if (isLobbyChatActive) {return (- <View style = { styles.lobbyMessageRecipientContainer }>+ <View style = { styles.lobbyMessageRecipientContainer as ViewStyle }><Text style = { styles.messageRecipientText }>{ t('chat.lobbyChatMessageTo', {- recipient: lobbyMessageRecipient.name+ recipient: lobbyMessageRecipient?.name}) }</Text><TouchableHighlight@@ -123,7 +123,7 @@ class MessageRecipient extends AbstractMessageRecipient<Props> {}return (- <View style = { styles.messageRecipientContainer }>+ <View style = { styles.messageRecipientContainer as ViewStyle }><Text style = { styles.messageRecipientText }>{ t('chat.messageTo', {recipient: privateMessageRecipient.name@@ -145,9 +145,10 @@ class MessageRecipient extends AbstractMessageRecipient<Props> {* Maps part of the redux state to the props of this component.** @param {Object} state - The Redux state.- * @returns {Props}+ * @param {any} _ownProps - Component's own props.+ * @returns {IProps}*/-function _mapStateToProps(state) {+function _mapStateToProps(state: IReduxState, _ownProps: any) {const { lobbyMessageRecipient, isLobbyChatActive } = state['features/chat'];return {diff --git a/react/features/recording/components/Recording/native/RecordButton.ts b/react/features/recording/components/Recording/native/RecordButton.tsindex 125a605ab2..2c46dd6c8b 100644--- a/react/features/recording/components/Recording/native/RecordButton.ts+++ b/react/features/recording/components/Recording/native/RecordButton.ts@@ -9,7 +9,7 @@ import { translate } from '../../../../base/i18n/functions';import { navigate }from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';import { screen } from '../../../../mobile/navigation/routes';-import { IProps } from '../../LiveStream/AbstractStartLiveStreamDialog';+import { IProps, _mapStateToProps as abstractMapStateToProps } from '../../LiveStream/AbstractStartLiveStreamDialog';import AbstractRecordButton, {IProps as AbstractProps,_mapStateToProps as _abstractMapStateToProps@@ -58,6 +58,7 @@ export function mapStateToProps(state: IReduxState) {return {...abstractProps,+ ...abstractMapStateToProps(state),visible: enabled && iosEnabled && abstractProps.visible};}diff --git a/react/features/salesforce/components/native/RecordItem.js b/react/features/salesforce/components/native/RecordItem.tsxsimilarity index 64%rename from react/features/salesforce/components/native/RecordItem.jsrename to react/features/salesforce/components/native/RecordItem.tsxindex af4abf4942..57bbcb54de 100644--- a/react/features/salesforce/components/native/RecordItem.js+++ b/react/features/salesforce/components/native/RecordItem.tsx@@ -1,8 +1,6 @@-// @flow-import React from 'react';import { useTranslation } from 'react-i18next';-import { Text, TouchableHighlight, View } from 'react-native';+import { GestureResponderEvent, Text, TextStyle, TouchableHighlight, View, ViewStyle } from 'react-native';import Icon from '../../../base/icons/components/Icon';import { RECORD_TYPE } from '../../constants';@@ -12,69 +10,71 @@ import styles from './styles';/*** The type of the React {@code Component} props of {@link RecordItem}.*/-type Props = {+interface IProps {/*** The id of the record.*/- id: String,+ id?: string;/*** The name of the record.*/- name: String,+ name?: string;/*** The handler for the click event.*/- onClick: Function,+ onClick?: (e?: GestureResponderEvent | React.MouseEvent) => void;/*** The type of the record.*/- type: String+ type?: string;}/*** Component to render Record data.*- * @param {Props} props - The props of the component.+ * @param {IProps} props - The props of the component.* @returns {React$Element<any>}*/export const RecordItem = ({id,name,type,- /* eslint-disable-next-line no-empty-function */+ /* eslint-disable-next-line @typescript-eslint/no-empty-function */onClick = () => {}-}: Props) => {+}: IProps) => {const { t } = useTranslation();- const IconRecord = RECORD_TYPE[type].icon;+ const IconRecord = RECORD_TYPE[type ?? ''].icon;return (<TouchableHighlight onPress = { onClick }><Viewkey = { `record-${id}` }- style = { styles.recordItem }+ style = { styles.recordItem as ViewStyle }++ // @ts-ignoretitle = { name }>- <View style = { styles.recordTypeIcon }>+ <View style = { styles.recordTypeIcon as ViewStyle }>{IconRecord && (<Iconsrc = { IconRecord }style = { styles.recordIcon } />)}</View>- <View style = { styles.recordDetails }>+ <View style = { styles.recordDetails as ViewStyle }><Textkey = { name }numberOfLines = { 1 }- style = { styles.recordName }>+ style = { styles.recordName as TextStyle }>{name}</Text><Textkey = { type }style = { styles.recordType }>- {t(RECORD_TYPE[type].label)}+ {t(RECORD_TYPE[type ?? ''].label)}</Text></View></View>diff --git a/react/features/salesforce/components/native/SalesforceLinkDialog.js b/react/features/salesforce/components/native/SalesforceLinkDialog.tsxsimilarity index 87%rename from react/features/salesforce/components/native/SalesforceLinkDialog.jsrename to react/features/salesforce/components/native/SalesforceLinkDialog.tsxindex 07873eece4..124059c36f 100644--- a/react/features/salesforce/components/native/SalesforceLinkDialog.js+++ b/react/features/salesforce/components/native/SalesforceLinkDialog.tsx@@ -1,8 +1,9 @@import React, { useCallback } from 'react';import { useTranslation } from 'react-i18next';-import { Platform, SafeAreaView, ScrollView, Text, View } from 'react-native';+import { Platform, SafeAreaView, ScrollView, Text, View, ViewStyle } from 'react-native';import { useSelector } from 'react-redux';+import { IReduxState } from '../../../app/types';import { IconSearch } from '../../../base/icons/svg';import JitsiScreen from '../../../base/modal/components/JitsiScreen';import LoadingIndicator from '../../../base/react/components/native/LoadingIndicator';@@ -24,7 +25,7 @@ import styles from './styles';*/const SalesforceLinkDialog = () => {const { t } = useTranslation();- const { clientHeight } = useSelector(state => state['features/base/responsive-ui']);+ const { clientHeight } = useSelector((state: IReduxState) => state['features/base/responsive-ui']);const {hasDetailsErrors,hasRecordsErrors,@@ -48,7 +49,7 @@ const SalesforceLinkDialog = () => {}, [ navigate, linkMeeting ]);const renderSpinner = () => (- <View style = { [ styles.recordsSpinner, { height: clientHeight - CONTENT_HEIGHT_OFFSET } ] }>+ <View style = { [ styles.recordsSpinner, { height: clientHeight - CONTENT_HEIGHT_OFFSET } ] as ViewStyle[] }><LoadingIndicator /></View>);@@ -63,8 +64,8 @@ const SalesforceLinkDialog = () => {<SafeAreaView><ScrollViewbounces = { false }- style = { [ styles.selectedRecord, { height: clientHeight - CONTENT_HEIGHT_OFFSET } ] }>- <View style = { styles.recordInfo }>+ style = { [ styles.selectedRecord, { height: clientHeight - CONTENT_HEIGHT_OFFSET } ] as ViewStyle[] }>+ <View style = { styles.recordInfo as ViewStyle }><RecordItem { ...selectedRecord } />{ selectedRecordOwner && <RecordItem { ...selectedRecordOwner } /> }{ hasDetailsErrors && renderDetailsErrors() }@@ -75,9 +76,9 @@ const SalesforceLinkDialog = () => {<InputcustomStyles = {{ container: styles.notes }}maxLength = { NOTES_MAX_LENGTH }- minHeight = { Platform.OS === 'ios' && NOTES_LINES ? 20 * NOTES_LINES : null }+ minHeight = { Platform.OS === 'ios' && NOTES_LINES ? 20 * NOTES_LINES : undefined }multiline = { true }- numberOfLines = { Platform.OS === 'ios' ? null : NOTES_LINES }+ numberOfLines = { Platform.OS === 'ios' ? undefined : NOTES_LINES }/* eslint-disable-next-line react/jsx-no-bind */onChange = { value => setNotes(value) }placeholder = { t('dialog.addMeetingNote') }@@ -87,14 +88,14 @@ const SalesforceLinkDialog = () => {);const renderRecordsSearch = () => (- <View style = { styles.recordsSearchContainer }>+ <View style = { styles.recordsSearchContainer as ViewStyle }><Inputicon = { IconSearch }maxLength = { NOTES_MAX_LENGTH }/* eslint-disable-next-line react/jsx-no-bind */onChange = { value => setSearchTerm(value) }placeholder = { t('dialog.searchInSalesforce') }- value = { searchTerm } />+ value = { searchTerm ?? '' } />{(!isLoading && !hasRecordsErrors) && (<Text style = { styles.resultLabel }>{showSearchResults@@ -107,7 +108,7 @@ const SalesforceLinkDialog = () => {);const renderNoRecords = () => showNoResults && (- <View style = { [ styles.noRecords, { height: clientHeight - CONTENT_HEIGHT_OFFSET } ] }>+ <View style = { [ styles.noRecords, { height: clientHeight - CONTENT_HEIGHT_OFFSET } ] as ViewStyle[] }><Text style = { styles.noRecordsText }>{t('dialog.searchResultsNotFound')}</Text>@@ -118,7 +119,7 @@ const SalesforceLinkDialog = () => {);const renderRecordsError = () => (- <View style = { [ styles.recordsError, { height: clientHeight - CONTENT_HEIGHT_OFFSET } ] }>+ <View style = { [ styles.recordsError, { height: clientHeight - CONTENT_HEIGHT_OFFSET } ] as ViewStyle[] }><Text style = { styles.recordsErrorText }>{t('dialog.searchResultsError')}</Text>@@ -143,8 +144,8 @@ const SalesforceLinkDialog = () => {<SafeAreaView><ScrollViewbounces = { false }- style = { [ styles.recordList, { height: clientHeight - LIST_HEIGHT_OFFSET } ] }>- {records.map(item => (+ style = { [ styles.recordList, { height: clientHeight - LIST_HEIGHT_OFFSET } ] as ViewStyle[] }>+ {records.map((item: any) => (<RecordItemkey = { `record-${item.id}` }/* eslint-disable-next-line react/jsx-no-bind */@@ -164,7 +165,7 @@ const SalesforceLinkDialog = () => {</View>{selectedRecord- && <View style = { styles.footer }>+ && <View><ButtonlabelKey = 'dialog.Cancel'/* eslint-disable-next-line react/jsx-no-bind */diff --git a/react/features/salesforce/components/native/styles.js b/react/features/salesforce/components/native/styles.tssimilarity index 100%rename from react/features/salesforce/components/native/styles.jsrename to react/features/salesforce/components/native/styles.tsdiff --git a/react/features/salesforce/useSalesforceLinkDialog.ts b/react/features/salesforce/useSalesforceLinkDialog.tsindex a93e42a53d..d5c86d33c9 100644--- a/react/features/salesforce/useSalesforceLinkDialog.ts+++ b/react/features/salesforce/useSalesforceLinkDialog.ts@@ -1,5 +1,6 @@import { useCallback, useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';+import { GestureResponderEvent } from 'react-native';import { useDispatch, useSelector } from 'react-redux';import { IReduxState } from '../app/types';@@ -21,7 +22,7 @@ import {interface ISelectedRecord {id: string;name: string;- onClick: (e?: React.MouseEvent) => void;+ onClick: (e?: React.MouseEvent | GestureResponderEvent) => void;type: string;}diff --git a/react/features/security/components/security-dialog/native/SecurityDialog.js b/react/features/security/components/security-dialog/native/SecurityDialog.tsxsimilarity index 91%rename from react/features/security/components/security-dialog/native/SecurityDialog.jsrename to react/features/security/components/security-dialog/native/SecurityDialog.tsxindex 2edce6d935..847a146b2c 100644--- a/react/features/security/components/security-dialog/native/SecurityDialog.js+++ b/react/features/security/components/security-dialog/native/SecurityDialog.tsx@@ -1,11 +1,14 @@import React, { PureComponent } from 'react';import {Text,- View+ TextStyle,+ View,+ ViewStyle} from 'react-native';import { connect } from 'react-redux';-import type { Dispatch } from 'redux';+import { IReduxState, IStore } from '../../../../app/types';+import { IJitsiConference } from '../../../../base/conference/reducer';import { getSecurityUiConfig } from '../../../../base/config/functions.any';import { MEETING_PASSWORD_ENABLED } from '../../../../base/flags/constants';import { getFeatureFlag } from '../../../../base/flags/functions';@@ -40,94 +43,94 @@ const _TEXT_INPUT_PROPS = {/*** The type of the React {@code Component} props of {@link SecurityDialog}.*/-type Props = {+interface IProps {/*** The JitsiConference which requires a password.*/- _conference: Object,+ _conference?: IJitsiConference;/*** Whether the local user is the moderator.*/- _isModerator: boolean,+ _isModerator: boolean;/*** State of the lobby mode.*/- _lobbyEnabled: boolean,+ _lobbyEnabled: boolean;/*** Whether the lobby mode switch is available or not.*/- _lobbyModeSwitchVisible: boolean,+ _lobbyModeSwitchVisible: boolean;/*** The value for how the conference is locked (or undefined if not locked)* as defined by room-lock constants.*/- _locked: string,+ _locked?: string;/*** Checks if the conference room is locked or not.*/- _lockedConference: boolean,+ _lockedConference: boolean;/*** The current known password for the JitsiConference.*/- _password: string,+ _password?: string;/*** Number of digits used in the room-lock password.*/- _passwordNumberOfDigits: number,+ _passwordNumberOfDigits?: number;/*** Whether setting a room password is available or not.*/- _roomPasswordControls: boolean,+ _roomPasswordControls: boolean;/*** Redux store dispatch function.*/- dispatch: Dispatch<any>,+ dispatch: IStore['dispatch'];/*** Invoked to obtain translated strings.*/- t: Function-};+ t: Function;+}/*** The type of the React {@code Component} state of {@link SecurityDialog}.*/-type State = {+interface IState {/*** Password added by the participant for room lock.*/- passwordInputValue: string,+ passwordInputValue: string;/*** Shows an input or a message.*/- showElement: boolean-};+ showElement: boolean;+}/*** Component that renders the security options dialog.** @returns {React$Element<any>}*/-class SecurityDialog extends PureComponent<Props, State> {+class SecurityDialog extends PureComponent<IProps, IState> {/*** Instantiates a new {@code SecurityDialog}.** @inheritdoc*/- constructor(props: Props) {+ constructor(props: IProps) {super(props);this.state = {@@ -180,8 +183,8 @@ class SecurityDialog extends PureComponent<Props, State> {<Text style = { styles.lobbyModeText }>{ t('lobby.enableDialogText') }</Text>- <View style = { styles.lobbyModeSection }>- <Text style = { styles.lobbyModeLabel } >+ <View style = { styles.lobbyModeSection as ViewStyle }>+ <Text style = { styles.lobbyModeLabel as TextStyle } >{ t('lobby.toggleLabel') }</Text><Switch@@ -267,7 +270,7 @@ class SecurityDialog extends PureComponent<Props, State> {if (_locked === LOCKED_REMOTELY) {if (_isModerator) {setPasswordControls = (- <View style = { styles.passwordSetRemotelyContainer }>+ <View style = { styles.passwordSetRemotelyContainer as ViewStyle }><Text style = { styles.passwordSetRemotelyText }>{ t('passwordSetRemotely') }</Text>@@ -281,7 +284,7 @@ class SecurityDialog extends PureComponent<Props, State> {);} else {setPasswordControls = (- <View style = { styles.passwordSetRemotelyContainer }>+ <View style = { styles.passwordSetRemotelyContainer as ViewStyle }><Text style = { styles.passwordSetRemotelyTextDisabled }>{ t('passwordSetRemotely') }</Text>@@ -306,7 +309,7 @@ class SecurityDialog extends PureComponent<Props, State> {<Viewstyle = {_locked !== LOCKED_REMOTELY- && styles.passwordContainerControls+ && styles.passwordContainerControls as ViewStyle}><View>{ this._setRoomPasswordMessage() }@@ -324,7 +327,7 @@ class SecurityDialog extends PureComponent<Props, State> {* @private*/_setRoomPasswordMessage() {- let textInputProps = _TEXT_INPUT_PROPS;+ let textInputProps: any = _TEXT_INPUT_PROPS;const {_isModerator,_locked,@@ -362,8 +365,8 @@ class SecurityDialog extends PureComponent<Props, State> {} else if (_locked) {if (_locked === LOCKED_LOCALLY && typeof _password !== 'undefined') {return (- <View style = { styles.savedPasswordContainer }>- <Text style = { styles.savedPasswordLabel }>+ <View style = { styles.savedPasswordContainer as ViewStyle }>+ <Text style = { styles.savedPasswordLabel as TextStyle }>{ t('info.password') }</Text><Text style = { styles.savedPassword }>@@ -376,8 +379,6 @@ class SecurityDialog extends PureComponent<Props, State> {}}- _onToggleLobbyMode: () => void;-/*** Handles the enable-disable lobby mode switch.*@@ -394,8 +395,6 @@ class SecurityDialog extends PureComponent<Props, State> {}}- _onAddPassword: () => void;-/*** Callback to be invoked when add password button is pressed.*@@ -431,15 +430,13 @@ class SecurityDialog extends PureComponent<Props, State> {return true;}- _onChangeText: string => void;-/*** Callback to be invoked when the text in the field changes.** @param {string} passwordInputValue - The value of password input.* @returns {void}*/- _onChangeText(passwordInputValue) {+ _onChangeText(passwordInputValue: string) {if (!this._validateInputValue(passwordInputValue)) {return;}@@ -449,8 +446,6 @@ class SecurityDialog extends PureComponent<Props, State> {});}- _onCancel: () => void;-/*** Cancels value typed in text input.*@@ -465,8 +460,6 @@ class SecurityDialog extends PureComponent<Props, State> {this.props.dispatch(unlockRoom());}- _onCopy: () => void;-/*** Copies room password.*@@ -478,8 +471,6 @@ class SecurityDialog extends PureComponent<Props, State> {copyText(passwordInputValue);}- _onSubmit: () => void;-/*** Submits value typed in text input.*@@ -492,7 +483,7 @@ class SecurityDialog extends PureComponent<Props, State> {} = this.props;const { passwordInputValue } = this.state;- dispatch(endRoomLockRequest(_conference, passwordInputValue));+ _conference && dispatch(endRoomLockRequest(_conference, passwordInputValue));}}@@ -500,14 +491,14 @@ class SecurityDialog extends PureComponent<Props, State> {* Maps part of the Redux state to the props of this component.** @param {Object} state - The Redux state.- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state: Object): Object {+function _mapStateToProps(state: IReduxState) {const { conference, locked, password } = state['features/base/conference'];const { disableLobbyPassword, hideLobbyButton } = getSecurityUiConfig(state);const { lobbyEnabled } = state['features/lobby'];const { roomPasswordNumberOfDigits } = state['features/base/config'];- const lobbySupported = conference && conference.isLobbySupported();+ const lobbySupported = conference?.isLobbySupported();const visible = getFeatureFlag(state, MEETING_PASSWORD_ENABLED, true);return {diff --git a/react/features/security/components/security-dialog/native/SecurityDialogButton.js b/react/features/security/components/security-dialog/native/SecurityDialogButton.tssimilarity index 79%rename from react/features/security/components/security-dialog/native/SecurityDialogButton.jsrename to react/features/security/components/security-dialog/native/SecurityDialogButton.tsindex 382317ff6c..a0a422e9a6 100644--- a/react/features/security/components/security-dialog/native/SecurityDialogButton.js+++ b/react/features/security/components/security-dialog/native/SecurityDialogButton.ts@@ -1,21 +1,17 @@-// @flow-import { connect } from 'react-redux';import { translate } from '../../../../base/i18n/functions';import { navigate } from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';import { screen } from '../../../../mobile/navigation/routes';import AbstractSecurityDialogButton, {- type Props as AbstractSecurityDialogButtonProps,+ IProps as AbstractSecurityDialogButtonProps,_mapStateToProps as _abstractMapStateToProps} from '../AbstractSecurityDialogButton';-type Props = AbstractSecurityDialogButtonProps;-/*** Implements an {@link AbstractSecurityDialogButton} to open the security screen.*/-class SecurityDialogButton<P: Props, S:*> extends AbstractSecurityDialogButton<P, S> {+class SecurityDialogButton<P extends AbstractSecurityDialogButtonProps, S> extends AbstractSecurityDialogButton<P, S> {/*** Opens / closes the security screen.diff --git a/react/features/security/components/security-dialog/native/styles.js b/react/features/security/components/security-dialog/native/styles.tssimilarity index 99%rename from react/features/security/components/security-dialog/native/styles.jsrename to react/features/security/components/security-dialog/native/styles.tsindex 7bae0abc3d..6d1784e52c 100644--- a/react/features/security/components/security-dialog/native/styles.js+++ b/react/features/security/components/security-dialog/native/styles.ts@@ -1,5 +1,3 @@-// @flow-import BaseTheme from '../../../../base/ui/components/BaseTheme.native';/**diff --git a/react/features/settings/components/native/FormRow.js b/react/features/settings/components/native/FormRow.tsxsimilarity index 81%rename from react/features/settings/components/native/FormRow.jsrename to react/features/settings/components/native/FormRow.tsxindex 0ccdfcde98..513e01fd71 100644--- a/react/features/settings/components/native/FormRow.js+++ b/react/features/settings/components/native/FormRow.tsx@@ -1,7 +1,6 @@-// @flow-import React, { Component } from 'react';-import { Text, View } from 'react-native';+import { WithTranslation } from 'react-i18next';+import { Text, View, ViewStyle } from 'react-native';import { translate } from '../../../base/i18n/functions';@@ -10,45 +9,40 @@ import styles, { ANDROID_UNDERLINE_COLOR, PLACEHOLDER_COLOR } from './styles';/*** The type of the React {@code Component} props of {@link FormRow}.*/-type Props = {+interface IProps extends WithTranslation {/**- *+ * Component's children.*/- children: Object,+ children: React.ReactElement;/*** Prop to decide if a row separator is to be rendered.*/- fieldSeparator: boolean,+ fieldSeparator?: boolean;/*** The i18n key of the text label of the form field.*/- label: string,+ label: string;/*** One of 'row' (default) or 'column'.*/- layout: string,-- /**- * Invoked to obtain translated strings.- */- t: Function+ layout?: string;}/*** Implements a React {@code Component} which renders a standardized row on a* form. The component should have exactly one child component.*/-class FormRow extends Component<Props> {+class FormRow extends Component<IProps> {/*** Initializes a new {@code FormRow} instance.** @param {Object} props - Component properties.*/- constructor(props) {+ constructor(props: IProps) {super(props);React.Children.only(this.props.children);@@ -77,7 +71,7 @@ class FormRow extends Component<Props> {return (<Viewstyle = { this._getRowStyle() } >- <View style = { styles.fieldLabelContainer } >+ <View style = { styles.fieldLabelContainer as ViewStyle } ><Textstyle = { [styles.text,@@ -87,15 +81,13 @@ class FormRow extends Component<Props> {{ t(this.props.label) }</Text></View>- <View style = { styles.fieldValueContainer } >+ <View style = { styles.fieldValueContainer as ViewStyle } >{ newChild }</View></View>);}- _getDefaultFieldProps: (field: Component<*, *>) => Object;-/*** Assembles the default props to the field child component of this form* row.@@ -108,8 +100,8 @@ class FormRow extends Component<Props> {* @private* @returns {Object}*/- _getDefaultFieldProps(field: Object) {- if (field && field.type) {+ _getDefaultFieldProps(field?: React.ReactElement) {+ if (field?.type) { // @ts-ignoreswitch (field.type.displayName) {case 'TextInput':return {@@ -126,8 +118,6 @@ class FormRow extends Component<Props> {return {};}- _getRowStyle: () => Array<Object>;-/*** Assembles the row style array based on the row's props.*@@ -136,8 +126,8 @@ class FormRow extends Component<Props> {*/_getRowStyle() {const { fieldSeparator, layout } = this.props;- const rowStyle = [- styles.fieldContainer+ const rowStyle: ViewStyle[] = [+ styles.fieldContainer as ViewStyle];if (fieldSeparator) {@@ -146,7 +136,7 @@ class FormRow extends Component<Props> {if (layout === 'column') {rowStyle.push(- styles.fieldContainerColumn+ styles.fieldContainerColumn as ViewStyle);}diff --git a/react/features/settings/components/native/FormSection.tsx b/react/features/settings/components/native/FormSection.tsxindex 70b0067701..f1dd010786 100644--- a/react/features/settings/components/native/FormSection.tsx+++ b/react/features/settings/components/native/FormSection.tsx@@ -4,7 +4,6 @@ import { Text, View } from 'react-native';import { translate } from '../../../base/i18n/functions';-// @ts-ignoreimport styles from './styles';diff --git a/react/features/settings/components/native/SettingsView.tsx b/react/features/settings/components/native/SettingsView.tsxindex 53461a45e5..abdc5d7631 100644--- a/react/features/settings/components/native/SettingsView.tsx+++ b/react/features/settings/components/native/SettingsView.tsx@@ -29,7 +29,6 @@ import { BUTTON_TYPES } from '../../../base/ui/constants.any';import { AVATAR_SIZE } from '../../../welcome/components/styles';import { isServerURLChangeEnabled, normalizeUserInputURL } from '../../functions.native';-// @ts-ignoreimport FormRow from './FormRow';import FormSection from './FormSection';import styles from './styles';diff --git a/react/features/shared-video/components/native/SharedVideoButton.js b/react/features/shared-video/components/native/SharedVideoButton.tssimilarity index 82%rename from react/features/shared-video/components/native/SharedVideoButton.jsrename to react/features/shared-video/components/native/SharedVideoButton.tsindex 9a0c2ba7f3..5fdf41b724 100644--- a/react/features/shared-video/components/native/SharedVideoButton.js+++ b/react/features/shared-video/components/native/SharedVideoButton.ts@@ -1,8 +1,6 @@-// @flow-import { connect } from 'react-redux';-import type { Dispatch } from 'redux';+import { IReduxState } from '../../../app/types';import { VIDEO_SHARE_BUTTON_ENABLED } from '../../../base/flags/constants';import { getFeatureFlag } from '../../../base/flags/functions';import { translate } from '../../../base/i18n/functions';@@ -15,30 +13,25 @@ import { isSharingStatus } from '../../functions';/*** The type of the React {@code Component} props of {@link TileViewButton}.*/-type Props = AbstractButtonProps & {+interface IProps extends AbstractButtonProps {/*** Whether or not the button is disabled.*/- _isDisabled: boolean,+ _isDisabled: boolean;/*** Whether or not the local participant is sharing a video.*/- _sharingVideo: boolean,-- /**- * The redux {@code dispatch} function.- */- dispatch: Dispatch<any>-};+ _sharingVideo: boolean;+}/*** Component that renders a toolbar button for toggling the tile layout view.** @augments AbstractButton*/-class VideoShareButton extends AbstractButton<Props, *> {+class VideoShareButton extends AbstractButton<IProps> {accessibilityLabel = 'toolbar.accessibilityLabel.sharedvideo';icon = IconPlay;label = 'toolbar.sharedvideo';@@ -94,17 +87,17 @@ class VideoShareButton extends AbstractButton<Props, *> {* @param {Object} state - The Redux state.* @param {Object} ownProps - The properties explicitly passed to the component instance.* @private- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state, ownProps): Object {+function _mapStateToProps(state: IReduxState, ownProps: any) {const { ownerId, status: sharedVideoStatus } = state['features/shared-video'];- const localParticipantId = getLocalParticipant(state).id;+ const localParticipantId = getLocalParticipant(state)?.id;const enabled = getFeatureFlag(state, VIDEO_SHARE_BUTTON_ENABLED, true);const { visible = enabled } = ownProps;if (ownerId !== localParticipantId) {return {- _isDisabled: isSharingStatus(sharedVideoStatus),+ _isDisabled: isSharingStatus(sharedVideoStatus ?? ''),_sharingVideo: false,visible};@@ -112,7 +105,7 @@ function _mapStateToProps(state, ownProps): Object {return {_isDisabled: false,- _sharingVideo: isSharingStatus(sharedVideoStatus),+ _sharingVideo: isSharingStatus(sharedVideoStatus ?? ''),visible};}diff --git a/react/features/shared-video/components/native/SharedVideoDialog.js b/react/features/shared-video/components/native/SharedVideoDialog.tsxsimilarity index 85%rename from react/features/shared-video/components/native/SharedVideoDialog.jsrename to react/features/shared-video/components/native/SharedVideoDialog.tsxindex 1478cfeece..aefa5b0d25 100644--- a/react/features/shared-video/components/native/SharedVideoDialog.js+++ b/react/features/shared-video/components/native/SharedVideoDialog.tsx@@ -1,22 +1,24 @@-// @flow-import React from 'react';import { connect } from 'react-redux';import InputDialog from '../../../base/dialog/components/native/InputDialog';import { translate } from '../../../base/i18n/functions';-import AbstractSharedVideoDialog from '../AbstractSharedVideoDialog';+import AbstractSharedVideoDialog, { IProps } from '../AbstractSharedVideoDialog';++interface IState {+ error: boolean;+}/*** Implements a component to render a display name prompt.*/-class SharedVideoDialog extends AbstractSharedVideoDialog<*> {+class SharedVideoDialog extends AbstractSharedVideoDialog<IState> {/*** Instantiates a new component.** @inheritdoc*/- constructor(props) {+ constructor(props: IProps) {super(props);this.state = {@@ -26,15 +28,13 @@ class SharedVideoDialog extends AbstractSharedVideoDialog<*> {this._onSubmitValue = this._onSubmitValue.bind(this);}- _onSubmitValue: () => boolean;-/*** Callback to be invoked when the value of the link input is submitted.** @param {string} value - The entered video link.* @returns {boolean}*/- _onSubmitValue(value) {+ _onSubmitValue(value: string) {const result = super._onSetVideoLink(value);if (!result) {diff --git a/react/features/speaker-stats/components/native/SpeakerStats.js b/react/features/speaker-stats/components/native/SpeakerStats.tsxsimilarity index 92%rename from react/features/speaker-stats/components/native/SpeakerStats.jsrename to react/features/speaker-stats/components/native/SpeakerStats.tsxindex c0e67c92e8..6b64c35a9d 100644--- a/react/features/speaker-stats/components/native/SpeakerStats.js+++ b/react/features/speaker-stats/components/native/SpeakerStats.tsx@@ -2,8 +2,7 @@ import React, { useEffect } from 'react';import { useDispatch } from 'react-redux';import JitsiScreen from '../../../base/modal/components/JitsiScreen';-import { resetSearchCriteria } from '../../actions';-+import { resetSearchCriteria } from '../../actions.native';import SpeakerStatsList from './SpeakerStatsList';import SpeakerStatsSearch from './SpeakerStatsSearch';diff --git a/react/features/speaker-stats/components/native/SpeakerStatsButton.js b/react/features/speaker-stats/components/native/SpeakerStatsButton.tssimilarity index 93%rename from react/features/speaker-stats/components/native/SpeakerStatsButton.jsrename to react/features/speaker-stats/components/native/SpeakerStatsButton.tsindex 72e2468c04..da3124f400 100644--- a/react/features/speaker-stats/components/native/SpeakerStatsButton.js+++ b/react/features/speaker-stats/components/native/SpeakerStatsButton.ts@@ -1,9 +1,8 @@-// @flow-import { connect } from 'react-redux';import { createToolbarEvent } from '../../../analytics/AnalyticsEvents';import { sendAnalytics } from '../../../analytics/functions';+import { IReduxState } from '../../../app/types';import { SPEAKERSTATS_ENABLED } from '../../../base/flags/constants';import { getFeatureFlag } from '../../../base/flags/functions';import { translate } from '../../../base/i18n/functions';@@ -39,7 +38,7 @@ class SpeakerStatsButton extends AbstractSpeakerStatsButton {* visible: boolean* }}*/-function _mapStateToProps(state): Object {+function _mapStateToProps(state: IReduxState) {const enabled = getFeatureFlag(state, SPEAKERSTATS_ENABLED, true);return {diff --git a/react/features/speaker-stats/components/native/SpeakerStatsItem.js b/react/features/speaker-stats/components/native/SpeakerStatsItem.tsxsimilarity index 81%rename from react/features/speaker-stats/components/native/SpeakerStatsItem.jsrename to react/features/speaker-stats/components/native/SpeakerStatsItem.tsxindex 86bb4aa7ba..9b73ba491e 100644--- a/react/features/speaker-stats/components/native/SpeakerStatsItem.js+++ b/react/features/speaker-stats/components/native/SpeakerStatsItem.tsx@@ -1,7 +1,5 @@-// @flow-import React from 'react';-import { Text, View } from 'react-native';+import { Text, View, ViewStyle } from 'react-native';import Avatar from '../../../base/avatar/components/Avatar';import StatelessAvatar from '../../../base/avatar/components/native/StatelessAvatar';@@ -11,46 +9,44 @@ import BaseTheme from '../../../base/ui/components/BaseTheme.native';import TimeElapsed from './TimeElapsed';import style from './styles';-type Props = {+interface IProps {/*** The name of the participant.*/- displayName: string,+ displayName: string;/*** The total milliseconds the participant has been dominant speaker.*/- dominantSpeakerTime: number,+ dominantSpeakerTime: number;/**- * The id of the user.+ * True if the participant is no longer in the meeting.*/- participantId: string,+ hasLeft: boolean;/**- * True if the participant is no longer in the meeting.+ * True if the participant is currently the dominant speaker.*/- hasLeft: boolean,+ isDominantSpeaker: boolean;/**- * True if the participant is currently the dominant speaker.+ * The id of the user.*/- isDominantSpeaker: boolean-};+ participantId: string;+}-const SpeakerStatsItem = (props: Props) =>+const SpeakerStatsItem = (props: IProps) =>(<Viewkey = { props.participantId }- style = { style.speakerStatsItemContainer }>+ style = { style.speakerStatsItemContainer as ViewStyle }><View style = { style.speakerStatsAvatar }>{props.hasLeft ? (<StatelessAvatar- className = 'userAvatar'color = { BaseTheme.palette.ui05 }- id = 'avatar'initials = { getInitials(props.displayName) }size = { BaseTheme.spacing[5] } />) : (@@ -61,7 +57,7 @@ const SpeakerStatsItem = (props: Props) =>)}</View>- <View style = { style.speakerStatsNameTime } >+ <View style = { style.speakerStatsNameTime as ViewStyle } ><Text style = { [ style.speakerStatsText, props.hasLeft && style.speakerStatsLeft ] }>{props.displayName}</Text>diff --git a/react/features/speaker-stats/components/native/SpeakerStatsList.js b/react/features/speaker-stats/components/native/SpeakerStatsList.tsxsimilarity index 97%rename from react/features/speaker-stats/components/native/SpeakerStatsList.jsrename to react/features/speaker-stats/components/native/SpeakerStatsList.tsxindex 949122a664..ae5f4d1505 100644--- a/react/features/speaker-stats/components/native/SpeakerStatsList.js+++ b/react/features/speaker-stats/components/native/SpeakerStatsList.tsx@@ -1,5 +1,3 @@-// @flow-import React from 'react';import { View } from 'react-native';@@ -22,5 +20,4 @@ const SpeakerStatsList = () => {);};-export default SpeakerStatsList;diff --git a/react/features/speaker-stats/components/native/SpeakerStatsSearch.js b/react/features/speaker-stats/components/native/SpeakerStatsSearch.tsxsimilarity index 96%rename from react/features/speaker-stats/components/native/SpeakerStatsSearch.jsrename to react/features/speaker-stats/components/native/SpeakerStatsSearch.tsxindex 2903207eb3..041ec5c369 100644--- a/react/features/speaker-stats/components/native/SpeakerStatsSearch.js+++ b/react/features/speaker-stats/components/native/SpeakerStatsSearch.tsx@@ -6,12 +6,11 @@ import { useDispatch, useSelector } from 'react-redux';import { IconSearch } from '../../../base/icons/svg';import Input from '../../../base/ui/components/native/Input';import { escapeRegexp } from '../../../base/util/helpers';-import { initSearch } from '../../actions';+import { initSearch } from '../../actions.native';import { isSpeakerStatsSearchDisabled } from '../../functions';import styles from './styles';-/*** React component for display an individual user's speaker stats.*diff --git a/react/features/speaker-stats/components/native/TimeElapsed.js b/react/features/speaker-stats/components/native/TimeElapsed.tsxsimilarity index 83%rename from react/features/speaker-stats/components/native/TimeElapsed.jsrename to react/features/speaker-stats/components/native/TimeElapsed.tsxindex 217da71e81..4114c4f55e 100644--- a/react/features/speaker-stats/components/native/TimeElapsed.js+++ b/react/features/speaker-stats/components/native/TimeElapsed.tsx@@ -1,6 +1,5 @@-/* @flow */-import React, { PureComponent } from 'react';+import { WithTranslation } from 'react-i18next';import { Text } from 'react-native';import { translate } from '../../../base/i18n/functions';@@ -9,23 +8,18 @@ import { createLocalizedTime } from '../timeFunctions';/*** The type of the React {@code Component} props of {@link TimeElapsed}.*/-type Props = {+interface IProps extends WithTranslation {/*** Style for text.*/- style: Object,-- /**- * The function to translate human-readable text.- */- t: Function,+ style: Object;/*** The milliseconds to be converted into a human-readable format.*/- time: number-};+ time: number;+}/*** React component for displaying total time elapsed. Converts a total count of@@ -34,7 +28,7 @@ type Props = {** @augments Component*/-class TimeElapsed extends PureComponent<Props> {+class TimeElapsed extends PureComponent<IProps> {/*** Implements React's {@link Component#render()}.*diff --git a/react/features/speaker-stats/components/native/styles.js b/react/features/speaker-stats/components/native/styles.tssimilarity index 100%rename from react/features/speaker-stats/components/native/styles.jsrename to react/features/speaker-stats/components/native/styles.tsdiff --git a/react/features/subtitles/components/native/Captions.tsx b/react/features/subtitles/components/native/Captions.tsxindex 81d5de374c..fb4edc46c4 100644--- a/react/features/subtitles/components/native/Captions.tsx+++ b/react/features/subtitles/components/native/Captions.tsx@@ -1,12 +1,8 @@-/* eslint-disable lines-around-comment */-import React, { ReactElement } from 'react';import { GestureResponderEvent, StyleProp } from 'react-native';import { connect } from 'react-redux';-// @ts-ignoreimport Container from '../../../base/react/components/native/Container';-// @ts-ignoreimport Text from '../../../base/react/components/native/Text';import {AbstractCaptions,@@ -14,10 +10,8 @@ import {_abstractMapStateToProps} from '../AbstractCaptions';-// @ts-ignoreimport styles from './styles';-/*** The type of the React {@code Component} props of {@link Captions}.*/diff --git a/react/features/subtitles/components/native/ClosedCaptionButton.tsx b/react/features/subtitles/components/native/ClosedCaptionButton.tsxindex 470b998a9b..b239b5f7d6 100644--- a/react/features/subtitles/components/native/ClosedCaptionButton.tsx+++ b/react/features/subtitles/components/native/ClosedCaptionButton.tsx@@ -1,5 +1,3 @@-/* eslint-disable lines-around-comment */-import { connect } from 'react-redux';import { IReduxState } from '../../../app/types';@@ -8,17 +6,13 @@ import { getFeatureFlag } from '../../../base/flags/functions';import { translate } from '../../../base/i18n/functions';import { IconSubtitles } from '../../../base/icons/svg';import { navigate }-// @ts-ignorefrom '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';-// @ts-ignoreimport { screen } from '../../../mobile/navigation/routes';import {AbstractClosedCaptionButton,- IAbstractProps,_abstractMapStateToProps} from '../AbstractClosedCaptionButton';-/*** A button which starts/stops the transcriptions.*/@@ -52,7 +46,7 @@ class ClosedCaptionButton* @private* @returns {Props}*/-export function mapStateToProps(state: IReduxState, ownProps: IAbstractProps) {+export function mapStateToProps(state: IReduxState, ownProps: any) {const enabled = getFeatureFlag(state, CLOSE_CAPTIONS_ENABLED, true);const abstractProps = _abstractMapStateToProps(state, ownProps);diff --git a/react/features/subtitles/components/native/LanguageList.tsx b/react/features/subtitles/components/native/LanguageList.tsxindex b9d0d8eb9d..e398f73445 100644--- a/react/features/subtitles/components/native/LanguageList.tsx+++ b/react/features/subtitles/components/native/LanguageList.tsx@@ -1,10 +1,7 @@-/* eslint-disable lines-around-comment */-import React from 'react';import { ScrollView } from 'react-native';import LanguageListItem from './LanguageListItem';-// @ts-ignoreimport styles from './styles';interface ILanguageListProps {@@ -13,7 +10,6 @@ interface ILanguageListProps {selectedLanguage: string;}-interface ILanguageItem {id: string;lang: string;@@ -30,7 +26,6 @@ const LanguageList = ({ items, onLanguageSelected }: ILanguageListProps) => {const listItems = items?.map(item => (<LanguageListItemkey = { item.id }- // @ts-ignorelang = { item.lang }onLanguageSelected = { onLanguageSelected }selected = { item.selected } />diff --git a/react/features/subtitles/components/native/LanguageListItem.tsx b/react/features/subtitles/components/native/LanguageListItem.tsxindex 2dd6f6d529..781914c94f 100644--- a/react/features/subtitles/components/native/LanguageListItem.tsx+++ b/react/features/subtitles/components/native/LanguageListItem.tsx@@ -1,5 +1,3 @@-/* eslint-disable lines-around-comment */-import React, { useCallback } from 'react';import { WithTranslation } from 'react-i18next';import { StyleProp, TouchableHighlight, View, ViewStyle } from 'react-native';@@ -9,7 +7,6 @@ import { translate } from '../../../base/i18n/functions';import Icon from '../../../base/icons/components/Icon';import { IconCheck } from '../../../base/icons/svg';-// @ts-ignoreimport styles from './styles';diff --git a/react/features/subtitles/components/native/LanguageSelectorDialog.tsx b/react/features/subtitles/components/native/LanguageSelectorDialog.tsxindex a942d30a1e..3cd997df6e 100644--- a/react/features/subtitles/components/native/LanguageSelectorDialog.tsx+++ b/react/features/subtitles/components/native/LanguageSelectorDialog.tsx@@ -1,21 +1,15 @@-/* eslint-disable lines-around-comment */-import React, { useCallback } from 'react';-// @ts-ignoreimport JitsiScreen from '../../../base/modal/components/JitsiScreen';import { goBack }-// @ts-ignorefrom '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';import AbstractLanguageSelectorDialog, {IAbstractLanguageSelectorDialogProps} from '../AbstractLanguageSelectorDialog';import LanguageList from './LanguageList';-// @ts-ignoreimport styles from './styles';-const LanguageSelectorDialog = (props: IAbstractLanguageSelectorDialogProps) => {const { language, listItems, onLanguageSelected, subtitles } = props;@@ -25,7 +19,6 @@ const LanguageSelectorDialog = (props: IAbstractLanguageSelectorDialogProps) =>}, [ language ]);return (- // @ts-ignore<JitsiScreendisableForcedKeyboardDismiss = { true }style = { styles.subtitlesContainer }>diff --git a/react/features/subtitles/components/native/styles.js b/react/features/subtitles/components/native/styles.tssimilarity index 100%rename from react/features/subtitles/components/native/styles.jsrename to react/features/subtitles/components/native/styles.tsdiff --git a/react/features/toolbox/components/native/AudioOnlyButton.js b/react/features/toolbox/components/native/AudioOnlyButton.tssimilarity index 89%rename from react/features/toolbox/components/native/AudioOnlyButton.jsrename to react/features/toolbox/components/native/AudioOnlyButton.tsindex c93a69603d..9af2b46843 100644--- a/react/features/toolbox/components/native/AudioOnlyButton.js+++ b/react/features/toolbox/components/native/AudioOnlyButton.ts@@ -1,7 +1,6 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { setAudioOnly, toggleAudioOnly } from '../../../base/audio-only/actions';import { AUDIO_ONLY_BUTTON_ENABLED } from '../../../base/flags/constants';import { getFeatureFlag } from '../../../base/flags/functions';@@ -16,28 +15,23 @@ import { screen } from '../../../mobile/navigation/routes';/*** The type of the React {@code Component} props of {@link AudioOnlyButton}.*/-type Props = AbstractButtonProps & {+interface IProps extends AbstractButtonProps {/*** Whether the current conference is in audio only mode or not.*/- _audioOnly: boolean,+ _audioOnly: boolean;/*** Indicates whether the car mode is enabled.*/- _startCarMode: boolean,-- /**- * The redux {@code dispatch} function.- */- dispatch: Function-};+ _startCarMode?: boolean;+}/*** An implementation of a button for toggling the audio-only mode.*/-class AudioOnlyButton extends AbstractButton<Props, *> {+class AudioOnlyButton extends AbstractButton<IProps> {accessibilityLabel = 'toolbar.accessibilityLabel.audioOnly';icon = IconAudioOnly;label = 'toolbar.audioOnlyOn';@@ -86,7 +80,7 @@ class AudioOnlyButton extends AbstractButton<Props, *> {* _audioOnly: boolean* }}*/-function _mapStateToProps(state, ownProps): Object {+function _mapStateToProps(state: IReduxState, ownProps: any) {const { enabled: audioOnly } = state['features/base/audio-only'];const enabledInFeatureFlags = getFeatureFlag(state, AUDIO_ONLY_BUTTON_ENABLED, true);const { startCarMode } = state['features/base/settings'];diff --git a/react/features/toolbox/components/native/HangupMenu.tsx b/react/features/toolbox/components/native/HangupMenu.tsxindex bac5584cb3..fba0b5f471 100644--- a/react/features/toolbox/components/native/HangupMenu.tsx+++ b/react/features/toolbox/components/native/HangupMenu.tsx@@ -1,17 +1,14 @@-/* eslint-disable lines-around-comment */import React, { useCallback } from 'react';import { View } from 'react-native';import { useDispatch, useSelector } from 'react-redux';import { createBreakoutRoomsEvent, createToolbarEvent } from '../../../analytics/AnalyticsEvents';import { sendAnalytics } from '../../../analytics/functions';-// @ts-ignoreimport { appNavigate } from '../../../app/actions';import { IReduxState } from '../../../app/types';import ColorSchemeRegistry from '../../../base/color-scheme/ColorSchemeRegistry';import { endConference } from '../../../base/conference/actions';import { hideSheet } from '../../../base/dialog/actions';-// @ts-ignoreimport BottomSheet from '../../../base/dialog/components/native/BottomSheet';import { PARTICIPANT_ROLE } from '../../../base/participants/constants';import { getLocalParticipant } from '../../../base/participants/functions';diff --git a/react/features/toolbox/components/native/HangupMenuButton.tsx b/react/features/toolbox/components/native/HangupMenuButton.tsxindex b1993f51b9..f51e363de4 100644--- a/react/features/toolbox/components/native/HangupMenuButton.tsx+++ b/react/features/toolbox/components/native/HangupMenuButton.tsx@@ -8,7 +8,6 @@ import { BUTTON_TYPES } from '../../../base/ui/constants.native';import HangupMenu from './HangupMenu';-/*** Button for showing the hangup menu.*diff --git a/react/features/toolbox/components/native/LinkToSalesforceButton.js b/react/features/toolbox/components/native/LinkToSalesforceButton.tssimilarity index 93%rename from react/features/toolbox/components/native/LinkToSalesforceButton.jsrename to react/features/toolbox/components/native/LinkToSalesforceButton.tsindex 18576f4872..c2377f10f3 100644--- a/react/features/toolbox/components/native/LinkToSalesforceButton.js+++ b/react/features/toolbox/components/native/LinkToSalesforceButton.ts@@ -1,9 +1,8 @@-// @flow-import { connect } from 'react-redux';import { createToolbarEvent } from '../../../analytics/AnalyticsEvents';import { sendAnalytics } from '../../../analytics/functions';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { IconCloudUpload } from '../../../base/icons/svg';import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';@@ -15,7 +14,7 @@ import { isSalesforceEnabled } from '../../../salesforce/functions';/*** Implementation of a button for opening the Salesforce link dialog.*/-class LinkToSalesforceButton extends AbstractButton<AbstractButtonProps, *> {+class LinkToSalesforceButton extends AbstractButton<AbstractButtonProps> {accessibilityLabel = 'toolbar.accessibilityLabel.linkToSalesforce';icon = IconCloudUpload;label = 'toolbar.linkToSalesforce';@@ -40,7 +39,7 @@ class LinkToSalesforceButton extends AbstractButton<AbstractButtonProps, *> {* @private* @returns {Props}*/-function mapStateToProps(state) {+function mapStateToProps(state: IReduxState) {return {visible: isSalesforceEnabled(state)};diff --git a/react/features/toolbox/components/native/OpenCarmodeButton.tsx b/react/features/toolbox/components/native/OpenCarmodeButton.tsxindex b6393f4dcd..ef42a4f679 100644--- a/react/features/toolbox/components/native/OpenCarmodeButton.tsx+++ b/react/features/toolbox/components/native/OpenCarmodeButton.tsx@@ -1,4 +1,3 @@-/* eslint-disable lines-around-comment */import { connect } from 'react-redux';import { IReduxState } from '../../../app/types';@@ -8,9 +7,7 @@ import { translate } from '../../../base/i18n/functions';import { IconCar } from '../../../base/icons/svg';import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';import { navigate }-// @ts-ignorefrom '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';-// @ts-ignoreimport { screen } from '../../../mobile/navigation/routes';/* eslint-enable lines-around-comment */@@ -50,5 +47,4 @@ function _mapStateToProps(state: IReduxState, ownProps: AbstractButtonProps): Ob};}-// @ts-ignoreexport default translate(connect(_mapStateToProps)(OpenCarmodeButton));diff --git a/react/features/toolbox/components/native/OverflowMenu.js b/react/features/toolbox/components/native/OverflowMenu.tsxsimilarity index 84%rename from react/features/toolbox/components/native/OverflowMenu.jsrename to react/features/toolbox/components/native/OverflowMenu.tsxindex 7199821df2..8892602426 100644--- a/react/features/toolbox/components/native/OverflowMenu.js+++ b/react/features/toolbox/components/native/OverflowMenu.tsx@@ -1,9 +1,9 @@-// @flow-import React, { PureComponent } from 'react';+import { ViewStyle } from 'react-native';import { Divider } from 'react-native-paper';import { connect } from 'react-redux';+import { IReduxState, IStore } from '../../../app/types';import { hideSheet } from '../../../base/dialog/actions';import BottomSheet from '../../../base/dialog/components/native/BottomSheet';import { bottomSheetStyles } from '../../../base/dialog/components/native/styles';@@ -32,58 +32,58 @@ import ScreenSharingButton from './ScreenSharingButton';/*** The type of the React {@code Component} props of {@link OverflowMenu}.*/-type Props = {+interface IProps {/*** True if the overflow menu is currently visible, false otherwise.*/- _isOpen: boolean,+ _isOpen: boolean;/**- * Whether the recoding button should be enabled or not.+ * Whether or not speaker stats is disable.*/- _recordingEnabled: boolean,+ _isSpeakerStatsDisabled?: boolean;/**- * The width of the screen.+ * Whether or not the reactions feature is enabled.*/- _width: number,+ _reactionsEnabled: boolean;/**- * Whether or not the reactions feature is enabled.+ * Whether the recoding button should be enabled or not.*/- _reactionsEnabled: boolean,+ _recordingEnabled: boolean;/**- * Used for hiding the dialog when the selection was completed.+ * The width of the screen.*/- dispatch: Function,+ _width: number;/**- * Whether or not speaker stats is disable.+ * Used for hiding the dialog when the selection was completed.*/- _isSpeakerStatsDisabled: boolean-};+ dispatch: IStore['dispatch'];+}-type State = {+interface IState {/**- * True if the bottom scheet is scrolled to the top.+ * True if the bottom sheet is scrolled to the top.*/- scrolledToTop: boolean+ scrolledToTop: boolean;}/*** Implements a React {@code Component} with some extra actions in addition to* those in the toolbar.*/-class OverflowMenu extends PureComponent<Props, State> {+class OverflowMenu extends PureComponent<IProps, IState> {/*** Initializes a new {@code OverflowMenu} instance.** @inheritdoc*/- constructor(props: Props) {+ constructor(props: IProps) {super(props);this.state = {@@ -105,7 +105,8 @@ class OverflowMenu extends PureComponent<Props, State> {const {_isSpeakerStatsDisabled,_reactionsEnabled,- _width+ _width,+ dispatch} = this.props;const toolbarButtons = getMovableButtons(_width);@@ -117,6 +118,7 @@ class OverflowMenu extends PureComponent<Props, State> {const topButtonProps = {afterClick: this._onCancel,+ dispatch,showLabel: true,styles: {...bottomSheetStyles.buttons,@@ -132,21 +134,24 @@ class OverflowMenu extends PureComponent<Props, State> {<BottomSheetrenderFooter = { _reactionsEnabled && !toolbarButtons.has('raisehand')? this._renderReactionMenu- : null }>+ : undefined }><OpenCarmodeButton { ...topButtonProps } /><AudioOnlyButton { ...buttonProps } />{!_reactionsEnabled && !toolbarButtons.has('raisehand') && <RaiseHandButton { ...buttonProps } />}- <Divider style = { styles.divider } />+ {/* @ts-ignore */}+ <Divider style = { styles.divider as ViewStyle } /><SecurityDialogButton { ...buttonProps } /><RecordButton { ...buttonProps } /><LiveStreamButton { ...buttonProps } /><LinkToSalesforceButton { ...buttonProps } />- <Divider style = { styles.divider } />+ {/* @ts-ignore */}+ <Divider style = { styles.divider as ViewStyle } /><SharedVideoButton { ...buttonProps } />{!toolbarButtons.has('screensharing') && <ScreenSharingButton { ...buttonProps } />}{!_isSpeakerStatsDisabled && <SpeakerStatsButton { ...buttonProps } />}{!toolbarButtons.has('tileview') && <TileViewButton { ...buttonProps } />}- <Divider style = { styles.divider } />+ {/* @ts-ignore */}+ <Divider style = { styles.divider as ViewStyle } /><ClosedCaptionButton { ...buttonProps } /><SharedDocumentButton { ...buttonProps } /><SettingsButton { ...buttonProps } />@@ -165,7 +170,7 @@ class OverflowMenu extends PureComponent<Props, State> {}/**- * Functoin to render the reaction menu as the footer of the bottom sheet.+ * Function to render the reaction menu as the footer of the bottom sheet.** @returns {React$Element}*/@@ -181,9 +186,9 @@ class OverflowMenu extends PureComponent<Props, State> {** @param {Object} state - Redux state.* @private- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state) {+function _mapStateToProps(state: IReduxState) {return {_isSpeakerStatsDisabled: isSpeakerStatsDisabled(state),_reactionsEnabled: isReactionsEnabled(state),diff --git a/react/features/toolbox/components/native/OverflowMenuButton.js b/react/features/toolbox/components/native/OverflowMenuButton.tssimilarity index 80%rename from react/features/toolbox/components/native/OverflowMenuButton.jsrename to react/features/toolbox/components/native/OverflowMenuButton.tsindex 81121e8375..65686f2b03 100644--- a/react/features/toolbox/components/native/OverflowMenuButton.js+++ b/react/features/toolbox/components/native/OverflowMenuButton.ts@@ -1,5 +1,6 @@import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { openSheet } from '../../../base/dialog/actions';import { OVERFLOW_MENU_ENABLED } from '../../../base/flags/constants';import { getFeatureFlag } from '../../../base/flags/functions';@@ -9,21 +10,10 @@ import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/tooimport OverflowMenu from './OverflowMenu';-/**- * The type of the React {@code Component} props of {@link OverflowMenuButton}.- */-type Props = AbstractButtonProps & {-- /**- * The redux {@code dispatch} function.- */- dispatch: Function-};-/*** An implementation of a button for showing the {@code OverflowMenu}.*/-class OverflowMenuButton extends AbstractButton<Props, *> {+class OverflowMenuButton extends AbstractButton<AbstractButtonProps> {accessibilityLabel = 'toolbar.accessibilityLabel.moreActions';icon = IconDotsHorizontal;label = 'toolbar.moreActions';@@ -47,7 +37,7 @@ class OverflowMenuButton extends AbstractButton<Props, *> {* @private* @returns {Props}*/-function _mapStateToProps(state): Object {+function _mapStateToProps(state: IReduxState) {const enabledFlag = getFeatureFlag(state, OVERFLOW_MENU_ENABLED, true);return {diff --git a/react/features/toolbox/components/native/RaiseHandButton.js b/react/features/toolbox/components/native/RaiseHandButton.tssimilarity index 84%rename from react/features/toolbox/components/native/RaiseHandButton.jsrename to react/features/toolbox/components/native/RaiseHandButton.tsindex 7922061648..7715f33bb8 100644--- a/react/features/toolbox/components/native/RaiseHandButton.js+++ b/react/features/toolbox/components/native/RaiseHandButton.ts@@ -1,10 +1,8 @@-// @flow-import { connect } from 'react-redux';-import { type Dispatch } from 'redux';import { createToolbarEvent } from '../../../analytics/AnalyticsEvents';import { sendAnalytics } from '../../../analytics/functions';+import { IReduxState } from '../../../app/types';import { RAISE_HAND_ENABLED } from '../../../base/flags/constants';import { getFeatureFlag } from '../../../base/flags/functions';import { translate } from '../../../base/i18n/functions';@@ -14,33 +12,29 @@ import {getLocalParticipant,hasRaisedHand} from '../../../base/participants/functions';+import { ILocalParticipant } from '../../../base/participants/types';import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';/*** The type of the React {@code Component} props of {@link RaiseHandButton}.*/-type Props = AbstractButtonProps & {+interface IProps extends AbstractButtonProps {/*** The local participant.*/- _localParticipant: Object,+ _localParticipant?: ILocalParticipant;/**- * Whether the participant raused their hand or not.+ * Whether the participant raised their hand or not.*/- _raisedHand: boolean,-- /**- * The redux {@code dispatch} function.- */- dispatch: Dispatch<any>-};+ _raisedHand: boolean;+}/*** An implementation of a button to raise or lower hand.*/-class RaiseHandButton extends AbstractButton<Props, *> {+class RaiseHandButton extends AbstractButton<IProps> {accessibilityLabel = 'toolbar.accessibilityLabel.raiseHand';icon = IconRaiseHand;label = 'toolbar.raiseYourHand';@@ -88,9 +82,9 @@ class RaiseHandButton extends AbstractButton<Props, *> {* @param {Object} state - The Redux state.* @param {Object} ownProps - The properties explicitly passed to the component instance.* @private- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state, ownProps): Object {+function _mapStateToProps(state: IReduxState, ownProps: any) {const _localParticipant = getLocalParticipant(state);const enabled = getFeatureFlag(state, RAISE_HAND_ENABLED, true);const { visible = enabled } = ownProps;diff --git a/react/features/toolbox/components/native/ToggleCameraButton.js b/react/features/toolbox/components/native/ToggleCameraButton.tssimilarity index 87%rename from react/features/toolbox/components/native/ToggleCameraButton.jsrename to react/features/toolbox/components/native/ToggleCameraButton.tsindex 5064759c3c..43d79b9853 100644--- a/react/features/toolbox/components/native/ToggleCameraButton.js+++ b/react/features/toolbox/components/native/ToggleCameraButton.ts@@ -1,7 +1,6 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { IconCameraRefresh } from '../../../base/icons/svg';import { toggleCameraFacingMode } from '../../../base/media/actions';@@ -12,28 +11,23 @@ import { isLocalTrackMuted } from '../../../base/tracks/functions.native';/*** The type of the React {@code Component} props of {@link ToggleCameraButton}.*/-type Props = AbstractButtonProps & {+interface IProps extends AbstractButtonProps {/*** Whether the current conference is in audio only mode or not.*/- _audioOnly: boolean,+ _audioOnly: boolean;/*** Whether video is currently muted or not.*/- _videoMuted: boolean,-- /**- * The redux {@code dispatch} function.- */- dispatch: Function-};+ _videoMuted: boolean;+}/*** An implementation of a button for toggling the camera facing mode.*/-class ToggleCameraButton extends AbstractButton<Props, *> {+class ToggleCameraButton extends AbstractButton<IProps> {accessibilityLabel = 'toolbar.accessibilityLabel.toggleCamera';icon = IconCameraRefresh;label = 'toolbar.toggleCamera';@@ -72,7 +66,7 @@ class ToggleCameraButton extends AbstractButton<Props, *> {* _videoMuted: boolean* }}*/-function _mapStateToProps(state): Object {+function _mapStateToProps(state: IReduxState) {const { enabled: audioOnly } = state['features/base/audio-only'];const tracks = state['features/base/tracks'];diff --git a/react/features/toolbox/components/native/ToggleSelfViewButton.js b/react/features/toolbox/components/native/ToggleSelfViewButton.tssimilarity index 86%rename from react/features/toolbox/components/native/ToggleSelfViewButton.jsrename to react/features/toolbox/components/native/ToggleSelfViewButton.tsindex 0ff49cb55c..d94c04c2a0 100644--- a/react/features/toolbox/components/native/ToggleSelfViewButton.js+++ b/react/features/toolbox/components/native/ToggleSelfViewButton.ts@@ -1,7 +1,6 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { IconAudioOnlyOff } from '../../../base/icons/svg';import { updateSettings } from '../../../base/settings/actions';@@ -10,23 +9,18 @@ import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/too/*** The type of the React {@code Component} props of {@link ToggleSelfViewButton}.*/-type Props = AbstractButtonProps & {+interface IProps extends AbstractButtonProps {/*** Whether the self view is disabled or not.*/- _disableSelfView: boolean,-- /**- * The redux {@code dispatch} function.- */- dispatch: Function-};+ _disableSelfView: boolean;+}/*** An implementation of a button for toggling the self view.*/-class ToggleSelfViewButton extends AbstractButton<Props, *> {+class ToggleSelfViewButton extends AbstractButton<IProps> {accessibilityLabel = 'toolbar.accessibilityLabel.selfView';icon = IconAudioOnlyOff;label = 'videothumbnail.hideSelfView';@@ -69,7 +63,7 @@ class ToggleSelfViewButton extends AbstractButton<Props, *> {* _disableSelfView: boolean* }}*/-function _mapStateToProps(state): Object {+function _mapStateToProps(state: IReduxState) {const { disableSelfView } = state['features/base/settings'];return {diff --git a/react/features/toolbox/components/native/Toolbox.js b/react/features/toolbox/components/native/Toolbox.tsxsimilarity index 84%rename from react/features/toolbox/components/native/Toolbox.jsrename to react/features/toolbox/components/native/Toolbox.tsxindex 12e4596f00..b63af6c941 100644--- a/react/features/toolbox/components/native/Toolbox.js+++ b/react/features/toolbox/components/native/Toolbox.tsx@@ -1,13 +1,11 @@-// @flow-import React from 'react';-import { View } from 'react-native';+import { View, ViewStyle } from 'react-native';import { SafeAreaView } from 'react-native-safe-area-context';import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import ColorSchemeRegistry from '../../../base/color-scheme/ColorSchemeRegistry';import Platform from '../../../base/react/Platform.native';-import { StyleType } from '../../../base/styles/functions.native';import ChatButton from '../../../chat/components/native/ChatButton';import ReactionsMenuButton from '../../../reactions/components/native/ReactionsMenuButton';import { isReactionsEnabled } from '../../../reactions/functions.any';@@ -27,38 +25,38 @@ import styles from './styles';/*** The type of {@link Toolbox}'s React {@code Component} props.*/-type Props = {+interface IProps {/*** Whether the end conference feature is supported.*/- _endConferenceSupported: boolean,+ _endConferenceSupported: boolean;/**- * Whether or not the reactions feature is enabled.+ * Whether we are in visitors mode.*/- _reactionsEnabled: boolean,+ _iAmVisitor: boolean;/**- * The color-schemed stylesheet of the feature.+ * Whether or not the reactions feature is enabled.*/- _styles: StyleType,+ _reactionsEnabled: boolean;/**- * The indicator which determines whether the toolbox is visible.+ * The color-schemed stylesheet of the feature.*/- _visible: boolean,+ _styles: any;/**- * Whether we are in visitors mode.+ * The indicator which determines whether the toolbox is visible.*/- _iAmVisitor: boolean,+ _visible: boolean;/*** The width of the screen.*/- _width: number-};+ _width: number;+}/*** Implements the conference Toolbox on React Native.@@ -66,7 +64,7 @@ type Props = {* @param {Object} props - The props of the component.* @returns {React$Element}.*/-function Toolbox(props: Props) {+function Toolbox(props: IProps) {const { _endConferenceSupported, _reactionsEnabled, _styles, _visible, _iAmVisitor, _width } = props;if (!_visible) {@@ -74,7 +72,7 @@ function Toolbox(props: Props) {}const bottomEdge = Platform.OS === 'ios' && _visible;- const { buttonStylesBorderless, hangupButtonStyles, hangupMenuButtonStyles, toggledButtonStyles } = _styles;+ const { buttonStylesBorderless, hangupButtonStyles, toggledButtonStyles } = _styles;const additionalButtons = getMovableButtons(_width);const backgroundToggledStyle = {...toggledButtonStyles,@@ -93,12 +91,14 @@ function Toolbox(props: Props) {return (<View- style = { styles.toolboxContainer }>+ style = { styles.toolboxContainer as ViewStyle }><SafeAreaViewaccessibilityRole = 'toolbar'++ // @ts-ignoreedges = { [ bottomEdge && 'bottom' ].filter(Boolean) }pointerEvents = 'box-none'- style = { style }>+ style = { style as ViewStyle }>{!_iAmVisitor && <AudioMuteButtonstyles = { buttonStylesBorderless }toggledStyles = { toggledButtonStyles } />@@ -108,9 +108,9 @@ function Toolbox(props: Props) {toggledStyles = { toggledButtonStyles } />}{additionalButtons.has('chat')- && <ChatButton- styles = { buttonStylesBorderless }- toggledStyles = { backgroundToggledStyle } />+ && <ChatButton+ styles = { buttonStylesBorderless }+ toggledStyles = { backgroundToggledStyle } />}{!_iAmVisitor && additionalButtons.has('screensharing')&& <ScreenSharingButton styles = { buttonStylesBorderless } />}@@ -127,9 +127,7 @@ function Toolbox(props: Props) {toggledStyles = { toggledButtonStyles } />}{ _endConferenceSupported- ? <HangupMenuButton- styles = { hangupMenuButtonStyles }- toggledStyles = { toggledButtonStyles } />+ ? <HangupMenuButton />: <HangupButtonstyles = { hangupButtonStyles } />}@@ -145,9 +143,9 @@ function Toolbox(props: Props) {* @param {Object} state - The redux state of which parts are to be mapped to* {@code Toolbox} props.* @private- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state: Object): Object {+function _mapStateToProps(state: IReduxState) {const { conference } = state['features/base/conference'];const endConferenceSupported = conference?.isEndConferenceSupported();diff --git a/react/features/toolbox/components/native/styles.js b/react/features/toolbox/components/native/styles.tssimilarity index 100%rename from react/features/toolbox/components/native/styles.jsrename to react/features/toolbox/components/native/styles.tsdiff --git a/react/features/transcribing/components/TranscribingExpandedLabel.native.js b/react/features/transcribing/components/TranscribingExpandedLabel.native.tsxsimilarity index 72%rename from react/features/transcribing/components/TranscribingExpandedLabel.native.jsrename to react/features/transcribing/components/TranscribingExpandedLabel.native.tsxindex 4e4a5e7fa2..e295b201b3 100644--- a/react/features/transcribing/components/TranscribingExpandedLabel.native.js+++ b/react/features/transcribing/components/TranscribingExpandedLabel.native.tsx@@ -1,11 +1,9 @@-// @flow+import { WithTranslation } from 'react-i18next';import { translate } from '../../base/i18n/functions';-import ExpandedLabel, { Props as AbstractProps } from '../../base/label/components/native/ExpandedLabel';+import ExpandedLabel, { IProps as AbstractProps } from '../../base/label/components/native/ExpandedLabel';-type Props = AbstractProps & {- t: Function-}+type Props = AbstractProps & WithTranslation;/*** A react {@code Component} that implements an expanded label as tooltip-likediff --git a/react/features/transcribing/components/TranscribingLabel.native.js b/react/features/transcribing/components/TranscribingLabel.native.tsxsimilarity index 82%rename from react/features/transcribing/components/TranscribingLabel.native.jsrename to react/features/transcribing/components/TranscribingLabel.native.tsxindex 3d8f0db5c7..330dce955f 100644--- a/react/features/transcribing/components/TranscribingLabel.native.js+++ b/react/features/transcribing/components/TranscribingLabel.native.tsx@@ -1,12 +1,10 @@-// @flow-import React, { Component } from 'react';import { connect } from 'react-redux';import { translate } from '../../base/i18n/functions';import Label from '../../base/label/components/native/Label';-import { type Props, _mapStateToProps } from './AbstractTranscribingLabel';+import { IProps, _mapStateToProps } from './AbstractTranscribingLabel';/*** React {@code Component} for displaying a label when a transcriber is in the@@ -14,7 +12,7 @@ import { type Props, _mapStateToProps } from './AbstractTranscribingLabel';** @augments Component*/-class TranscribingLabel extends Component<Props> {+class TranscribingLabel extends Component<IProps> {/*** Renders the platform-specific label component.diff --git a/react/features/video-menu/components/native/AskUnmuteButton.js b/react/features/video-menu/components/native/AskUnmuteButton.tssimilarity index 88%rename from react/features/video-menu/components/native/AskUnmuteButton.jsrename to react/features/video-menu/components/native/AskUnmuteButton.tsindex 2a7e4bcde9..6cf8469922 100644--- a/react/features/video-menu/components/native/AskUnmuteButton.js+++ b/react/features/video-menu/components/native/AskUnmuteButton.ts@@ -1,7 +1,6 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { approveParticipant } from '../../../av-moderation/actions';import { isSupported } from '../../../av-moderation/functions';import { translate } from '../../../base/i18n/functions';@@ -11,34 +10,29 @@ import { getParticipantById, isLocalParticipantModerator } from '../../../base/pimport AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';import { isForceMuted } from '../../../participants-pane/functions';-export type Props = AbstractButtonProps & {-- /**- * The redux {@code dispatch} function.- */- dispatch: Function,+export interface IProps extends AbstractButtonProps {/*** Whether or not the participant is audio force muted.*/- isAudioForceMuted: boolean,+ isAudioForceMuted: boolean;/*** Whether or not the participant is video force muted.*/- isVideoForceMuted: boolean,+ isVideoForceMuted: boolean;/*** The ID of the participant object that this button is supposed to* ask to unmute.*/- participantID: string-};+ participantID: string;+}/*** An abstract remote video menu button which asks the remote participant to unmute.*/-class AskUnmuteButton extends AbstractButton<Props, *> {+class AskUnmuteButton extends AbstractButton<IProps> {accessibilityLabel = 'participantsPane.actions.askUnmute';icon = IconMic;label = 'participantsPane.actions.askUnmute';@@ -91,16 +85,16 @@ class AskUnmuteButton extends AbstractButton<Props, *> {** @param {Object} state - The Redux state.* @param {Object} ownProps - Properties of component.- * @returns {Props}+ * @returns {IProps}*/-function mapStateToProps(state, ownProps) {+function mapStateToProps(state: IReduxState, ownProps: any) {const { participantID } = ownProps;const participant = getParticipantById(state, participantID);return {isAudioForceMuted: isForceMuted(participant, MEDIA_TYPE.AUDIO, state),isVideoForceMuted: isForceMuted(participant, MEDIA_TYPE.VIDEO, state),- visible: isLocalParticipantModerator(state) && isSupported()+ visible: isLocalParticipantModerator(state) && isSupported()(state)};}diff --git a/react/features/video-menu/components/native/ConnectionStatusButton.js b/react/features/video-menu/components/native/ConnectionStatusButton.tssimilarity index 76%rename from react/features/video-menu/components/native/ConnectionStatusButton.jsrename to react/features/video-menu/components/native/ConnectionStatusButton.tsindex 50ff1c7944..fbc797fbf3 100644--- a/react/features/video-menu/components/native/ConnectionStatusButton.js+++ b/react/features/video-menu/components/native/ConnectionStatusButton.ts@@ -7,28 +7,18 @@ import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/tooimport ConnectionStatusComponent from './ConnectionStatusComponent';-export type Props = AbstractButtonProps & {-- /**- * The redux {@code dispatch} function.- */- dispatch: Function,+export interface IProps extends AbstractButtonProps {/*** The ID of the participant that this button is supposed to pin.*/- participantID: string,-- /**- * The function to be used to translate i18n labels.- */- t: Function-};+ participantID: string;+}/*** A remote video menu button which shows the connection statistics.*/-class ConnectionStatusButton extends AbstractButton<Props, *> {+class ConnectionStatusButton extends AbstractButton<IProps> {icon = IconInfoCircle;label = 'videothumbnail.connectionInfo';diff --git a/react/features/video-menu/components/native/GrantModeratorButton.js b/react/features/video-menu/components/native/GrantModeratorButton.tssimilarity index 96%rename from react/features/video-menu/components/native/GrantModeratorButton.jsrename to react/features/video-menu/components/native/GrantModeratorButton.tsindex d5f8de5807..5d5956bf6a 100644--- a/react/features/video-menu/components/native/GrantModeratorButton.js+++ b/react/features/video-menu/components/native/GrantModeratorButton.ts@@ -1,5 +1,3 @@-// @flow-import { connect } from 'react-redux';import { translate } from '../../../base/i18n/functions';diff --git a/react/features/video-menu/components/native/GrantModeratorDialog.js b/react/features/video-menu/components/native/GrantModeratorDialog.tsxsimilarity index 95%rename from react/features/video-menu/components/native/GrantModeratorDialog.jsrename to react/features/video-menu/components/native/GrantModeratorDialog.tsxindex 492dc8d2a3..7015a3baa5 100644--- a/react/features/video-menu/components/native/GrantModeratorDialog.js+++ b/react/features/video-menu/components/native/GrantModeratorDialog.tsx@@ -1,5 +1,3 @@-// @flow-import React from 'react';import { connect } from 'react-redux';@@ -28,8 +26,6 @@ class GrantModeratorDialog extends AbstractGrantModeratorDialog {onSubmit = { this._onSubmit } />);}-- _onSubmit: () => boolean;}export default translate(connect(abstractMapStateToProps)(GrantModeratorDialog));diff --git a/react/features/video-menu/components/native/KickButton.js b/react/features/video-menu/components/native/KickButton.tssimilarity index 84%rename from react/features/video-menu/components/native/KickButton.jsrename to react/features/video-menu/components/native/KickButton.tsindex a5c78ab9e3..1a44bbb892 100644--- a/react/features/video-menu/components/native/KickButton.js+++ b/react/features/video-menu/components/native/KickButton.ts@@ -1,7 +1,6 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { isLocalParticipantModerator } from '../../../base/participants/functions';import AbstractKickButton from '../AbstractKickButton';@@ -12,7 +11,7 @@ import AbstractKickButton from '../AbstractKickButton';* @param {Object} state - The Redux state.* @returns {Props}*/-function _mapStateToProps(state) {+function _mapStateToProps(state: IReduxState) {return {visible: isLocalParticipantModerator(state)};diff --git a/react/features/video-menu/components/native/KickRemoteParticipantDialog.js b/react/features/video-menu/components/native/KickRemoteParticipantDialog.tsxsimilarity index 96%rename from react/features/video-menu/components/native/KickRemoteParticipantDialog.jsrename to react/features/video-menu/components/native/KickRemoteParticipantDialog.tsxindex fab6f065fb..fe6ca3a328 100644--- a/react/features/video-menu/components/native/KickRemoteParticipantDialog.js+++ b/react/features/video-menu/components/native/KickRemoteParticipantDialog.tsx@@ -1,5 +1,3 @@-// @flow-import React from 'react';import { connect } from 'react-redux';@@ -29,8 +27,6 @@ class KickRemoteParticipantDialog extends AbstractKickRemoteParticipantDialog {title = 'dialog.kickParticipantTitle' />);}-- _onSubmit: () => boolean;}export default translate(connect()(KickRemoteParticipantDialog));diff --git a/react/features/video-menu/components/native/LocalVideoMenu.js b/react/features/video-menu/components/native/LocalVideoMenu.tsxsimilarity index 77%rename from react/features/video-menu/components/native/LocalVideoMenu.jsrename to react/features/video-menu/components/native/LocalVideoMenu.tsxindex 7b5d3a2b8d..64d10097b0 100644--- a/react/features/video-menu/components/native/LocalVideoMenu.js+++ b/react/features/video-menu/components/native/LocalVideoMenu.tsx@@ -1,7 +1,8 @@import React, { PureComponent } from 'react';-import { Text, View } from 'react-native';+import { Text, TextStyle, View, ViewStyle } from 'react-native';import { connect } from 'react-redux';+import { IReduxState, IStore } from '../../../app/types';import Avatar from '../../../base/avatar/components/Avatar';import BottomSheet from '../../../base/dialog/components/native/BottomSheet';import { bottomSheetStyles } from '../../../base/dialog/components/native/styles';@@ -10,50 +11,50 @@ import {getLocalParticipant,getParticipantDisplayName} from '../../../base/participants/functions';+import { ILocalParticipant } from '../../../base/participants/types';import ToggleSelfViewButton from '../../../toolbox/components/native/ToggleSelfViewButton';import ConnectionStatusButton from './ConnectionStatusButton';import styles from './styles';-/*** Size of the rendered avatar in the menu.*/const AVATAR_SIZE = 24;-type Props = {+interface IProps {/*** The local participant.*/- _participant: Object,+ _participant?: ILocalParticipant;/*** Display name of the participant retrieved from Redux.*/- _participantDisplayName: string,+ _participantDisplayName: string;/*** The Redux dispatch function.*/- dispatch: Function,+ dispatch: IStore['dispatch'];/*** Translation function.*/- t: Function+ t: Function;}/*** Class to implement a popup menu that opens upon long pressing a thumbnail.*/-class LocalVideoMenu extends PureComponent<Props> {+class LocalVideoMenu extends PureComponent<IProps> {/*** Constructor of the component.** @inheritdoc*/- constructor(props: Props) {+ constructor(props: IProps) {super(props);this._renderMenuHeader = this._renderMenuHeader.bind(this);@@ -68,7 +69,7 @@ class LocalVideoMenu extends PureComponent<Props> {const { _participant } = this.props;const buttonProps = {showLabel: true,- participantID: _participant.id,+ participantID: _participant?.id ?? '',styles: bottomSheetStyles.buttons};@@ -94,11 +95,11 @@ class LocalVideoMenu extends PureComponent<Props> {<Viewstyle = { [bottomSheetStyles.sheet,- styles.participantNameContainer ] }>+ styles.participantNameContainer ] as ViewStyle[] }><Avatar- participantId = { _participant.id }+ participantId = { _participant?.id }size = { AVATAR_SIZE } />- <Text style = { styles.participantNameLabel }>+ <Text style = { styles.participantNameLabel as TextStyle }>{ this.props._participantDisplayName }</Text></View>@@ -111,14 +112,14 @@ class LocalVideoMenu extends PureComponent<Props> {** @param {Object} state - Redux state.* @private- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state) {+function _mapStateToProps(state: IReduxState) {const participant = getLocalParticipant(state);return {_participant: participant,- _participantDisplayName: getParticipantDisplayName(state, participant.id)+ _participantDisplayName: getParticipantDisplayName(state, participant?.id ?? '')};}diff --git a/react/features/video-menu/components/native/MuteButton.js b/react/features/video-menu/components/native/MuteButton.tssimilarity index 85%rename from react/features/video-menu/components/native/MuteButton.jsrename to react/features/video-menu/components/native/MuteButton.tsindex c9920c4787..8a846a5658 100644--- a/react/features/video-menu/components/native/MuteButton.js+++ b/react/features/video-menu/components/native/MuteButton.ts@@ -1,7 +1,6 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { isLocalParticipantModerator } from '../../../base/participants/functions';import AbstractMuteButton, { _mapStateToProps as _abstractMapStateToProps } from '../AbstractMuteButton';@@ -13,7 +12,7 @@ import AbstractMuteButton, { _mapStateToProps as _abstractMapStateToProps } from* @param {Object} ownProps - Properties of component.* @returns {Props}*/-function _mapStateToProps(state, ownProps) {+function _mapStateToProps(state: IReduxState, ownProps: any) {return {..._abstractMapStateToProps(state, ownProps),visible: isLocalParticipantModerator(state)diff --git a/react/features/video-menu/components/native/MuteEveryoneDialog.js b/react/features/video-menu/components/native/MuteEveryoneDialog.tsxsimilarity index 91%rename from react/features/video-menu/components/native/MuteEveryoneDialog.jsrename to react/features/video-menu/components/native/MuteEveryoneDialog.tsxindex b4d1f2fddf..acdebc9ebf 100644--- a/react/features/video-menu/components/native/MuteEveryoneDialog.js+++ b/react/features/video-menu/components/native/MuteEveryoneDialog.tsx@@ -1,4 +1,5 @@import React from 'react';+import { ViewStyle } from 'react-native';import Dialog from 'react-native-dialog';import { Divider } from 'react-native-paper';import { connect } from 'react-redux';@@ -46,7 +47,8 @@ class MuteEveryoneDialog extends AbstractMuteEveryoneDialog<IProps> {descriptionKey = { this.state.content }onSubmit = { this._onSubmit }title = { this.props.title } >- <Divider style = { styles.dividerDialog } />+ {/* @ts-ignore */}+ <Divider style = { styles.dividerDialog as ViewStyle } />{ this._renderSwitch() }</ConfirmDialog>);diff --git a/react/features/video-menu/components/native/MuteEveryoneElseButton.js b/react/features/video-menu/components/native/MuteEveryoneElseButton.tssimilarity index 85%rename from react/features/video-menu/components/native/MuteEveryoneElseButton.jsrename to react/features/video-menu/components/native/MuteEveryoneElseButton.tsindex 93d7cea232..1e9612b6f9 100644--- a/react/features/video-menu/components/native/MuteEveryoneElseButton.js+++ b/react/features/video-menu/components/native/MuteEveryoneElseButton.ts@@ -1,7 +1,6 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { isLocalParticipantModerator } from '../../../base/participants/functions';import AbstractMuteEveryoneElseButton from '../AbstractMuteEveryoneElseButton';@@ -12,7 +11,7 @@ import AbstractMuteEveryoneElseButton from '../AbstractMuteEveryoneElseButton';* @param {Object} state - The Redux state.* @returns {Props}*/-function _mapStateToProps(state) {+function _mapStateToProps(state: IReduxState) {return {visible: isLocalParticipantModerator(state)};diff --git a/react/features/video-menu/components/native/MuteRemoteParticipantsVideoDialog.js b/react/features/video-menu/components/native/MuteRemoteParticipantsVideoDialog.tsxsimilarity index 96%rename from react/features/video-menu/components/native/MuteRemoteParticipantsVideoDialog.jsrename to react/features/video-menu/components/native/MuteRemoteParticipantsVideoDialog.tsxindex 23b7fd25ba..705d5a66f8 100644--- a/react/features/video-menu/components/native/MuteRemoteParticipantsVideoDialog.js+++ b/react/features/video-menu/components/native/MuteRemoteParticipantsVideoDialog.tsx@@ -1,5 +1,3 @@-// @flow-import React from 'react';import { connect } from 'react-redux';@@ -29,8 +27,6 @@ class MuteRemoteParticipantsVideoDialog extends AbstractMuteRemoteParticipantsVionSubmit = { this._onSubmit } />);}-- _onSubmit: () => boolean;}export default translate(connect(abstractMapStateToProps)(MuteRemoteParticipantsVideoDialog));diff --git a/react/features/video-menu/components/native/MuteVideoButton.js b/react/features/video-menu/components/native/MuteVideoButton.tssimilarity index 86%rename from react/features/video-menu/components/native/MuteVideoButton.jsrename to react/features/video-menu/components/native/MuteVideoButton.tsindex 112db8ca93..2628008119 100644--- a/react/features/video-menu/components/native/MuteVideoButton.js+++ b/react/features/video-menu/components/native/MuteVideoButton.ts@@ -1,7 +1,6 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { isLocalParticipantModerator } from '../../../base/participants/functions';import AbstractMuteVideoButton, { _mapStateToProps as _abstractMapStateToProps } from '../AbstractMuteVideoButton';@@ -13,7 +12,7 @@ import AbstractMuteVideoButton, { _mapStateToProps as _abstractMapStateToProps }* @param {Object} ownProps - Properties of component.* @returns {Props}*/-function _mapStateToProps(state, ownProps) {+function _mapStateToProps(state: IReduxState, ownProps: any) {return {..._abstractMapStateToProps(state, ownProps),visible: isLocalParticipantModerator(state)diff --git a/react/features/video-menu/components/native/PinButton.js b/react/features/video-menu/components/native/PinButton.tssimilarity index 78%rename from react/features/video-menu/components/native/PinButton.jsrename to react/features/video-menu/components/native/PinButton.tsindex c9e1668d29..1a488ad7dc 100644--- a/react/features/video-menu/components/native/PinButton.js+++ b/react/features/video-menu/components/native/PinButton.ts@@ -1,40 +1,29 @@-// @flow-import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { IconEnlarge } from '../../../base/icons/svg';import { pinParticipant } from '../../../base/participants/actions';import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';import { shouldDisplayTileView } from '../../../video-layout/functions';-export type Props = AbstractButtonProps & {+export interface IProps extends AbstractButtonProps {/*** True if tile view is currently enabled.*/- _tileViewEnabled: boolean,-- /**- * The redux {@code dispatch} function.- */- dispatch: Function,+ _tileViewEnabled?: boolean;/*** The ID of the participant that this button is supposed to pin.*/- participantID: string,-- /**- * The function to be used to translate i18n labels.- */- t: Function-};+ participantID: string;+}/*** A remote video menu button which pins a participant and exist the tile view.*/-class PinButton extends AbstractButton<Props, *> {+class PinButton extends AbstractButton<IProps> {accessibilityLabel = 'toolbar.accessibilityLabel.show';icon = IconEnlarge;label = 'videothumbnail.show';@@ -57,9 +46,9 @@ class PinButton extends AbstractButton<Props, *> {* Maps part of the Redux state to the props of this component.** @param {Object} state - The Redux state.- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state) {+function _mapStateToProps(state: IReduxState) {const { isOpen } = state['features/participants-pane'];return {diff --git a/react/features/video-menu/components/native/RemoteVideoMenu.js b/react/features/video-menu/components/native/RemoteVideoMenu.tsxsimilarity index 84%rename from react/features/video-menu/components/native/RemoteVideoMenu.jsrename to react/features/video-menu/components/native/RemoteVideoMenu.tsxindex 80a1c64766..fe707ad735 100644--- a/react/features/video-menu/components/native/RemoteVideoMenu.js+++ b/react/features/video-menu/components/native/RemoteVideoMenu.tsx@@ -1,8 +1,9 @@import React, { PureComponent } from 'react';-import { Text, View } from 'react-native';+import { Text, TextStyle, View, ViewStyle } from 'react-native';import { Divider } from 'react-native-paper';import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import Avatar from '../../../base/avatar/components/Avatar';import { hideSheet } from '../../../base/dialog/actions';import BottomSheet from '../../../base/dialog/components/native/BottomSheet';@@ -16,10 +17,11 @@ import {isLocalParticipantModerator} from '../../../base/participants/functions';import { getBreakoutRooms, getCurrentRoomId } from '../../../breakout-rooms/functions';+import { IRoom } from '../../../breakout-rooms/types';import PrivateMessageButton from '../../../chat/components/native/PrivateMessageButton';-import ConnectionStatusButton from '../native/ConnectionStatusButton';import AskUnmuteButton from './AskUnmuteButton';+import ConnectionStatusButton from './ConnectionStatusButton';import GrantModeratorButton from './GrantModeratorButton';import KickButton from './KickButton';import MuteButton from './MuteButton';@@ -31,85 +33,84 @@ import styles from './styles';// import VolumeSlider from './VolumeSlider';-/*** Size of the rendered avatar in the menu.*/const AVATAR_SIZE = 24;-type Props = {-- /**- * The Redux dispatch function.- */- dispatch: Function,+interface IProps {/**- * The ID of the participant for which this menu opened for.+ * The id of the current room.*/- participantId: String,+ _currentRoomId: string;/**- * The id of the current room.+ * Whether or not to display the grant moderator button.*/- _currentRoomId: String,+ _disableGrantModerator: boolean;/*** Whether or not to display the kick button.*/- _disableKick: boolean,+ _disableKick: boolean;/*** Whether or not to display the send private message button.*/- _disablePrivateChat: Boolean,+ _disablePrivateChat: boolean;/*** Whether or not to display the remote mute buttons.*/- _disableRemoteMute: boolean,-- /**- * Whether or not to display the grant moderator button.- */- _disableGrantModerator: Boolean,+ _disableRemoteMute: boolean;/*** Whether the participant is present in the room or not.*/- _isParticipantAvailable?: boolean,+ _isParticipantAvailable?: boolean;/*** Whether the local participant is moderator or not.*/- _moderator: boolean,+ _moderator: boolean;/*** Display name of the participant retrieved from Redux.*/- _participantDisplayName: string,+ _participantDisplayName: string;/*** Array containing the breakout rooms.*/- _rooms: Array<Object>,+ _rooms: Array<IRoom>;++ /**+ * The Redux dispatch function.+ */+ dispatch: Function;++ /**+ * The ID of the participant for which this menu opened for.+ */+ participantId: string;/*** Translation function.*/- t: Function+ t: Function;}/*** Class to implement a popup menu that opens upon long pressing a thumbnail.*/-class RemoteVideoMenu extends PureComponent<Props> {+class RemoteVideoMenu extends PureComponent<IProps> {/*** Constructor of the component.** @inheritdoc*/- constructor(props: Props) {+ constructor(props: IProps) {super(props);this._onCancel = this._onCancel.bind(this);@@ -149,7 +150,8 @@ class RemoteVideoMenu extends PureComponent<Props> {{ !_disableRemoteMute && <MuteButton { ...buttonProps } /> }<MuteEveryoneElseButton { ...buttonProps } />{ !_disableRemoteMute && <MuteVideoButton { ...buttonProps } /> }- <Divider style = { styles.divider } />+ {/* @ts-ignore */}+ <Divider style = { styles.divider as ViewStyle } />{ !_disableKick && <KickButton { ...buttonProps } /> }{ !_disableGrantModerator && <GrantModeratorButton { ...buttonProps } /> }<PinButton { ...buttonProps } />@@ -158,9 +160,10 @@ class RemoteVideoMenu extends PureComponent<Props> {{ ...buttonProps }afterClick = { undefined } />{_moderator && _rooms.length > 1 && <>- <Divider style = { styles.divider } />- <View style = { styles.contextMenuItem }>- <Text style = { styles.contextMenuItemText }>+ {/* @ts-ignore */}+ <Divider style = { styles.divider as ViewStyle } />+ <View style = { styles.contextMenuItem as ViewStyle }>+ <Text style = { styles.contextMenuItemText as TextStyle }>{t('breakoutRooms.actions.sendToBreakoutRoom')}</Text></View>@@ -196,11 +199,11 @@ class RemoteVideoMenu extends PureComponent<Props> {<Viewstyle = { [bottomSheetStyles.sheet,- styles.participantNameContainer ] }>+ styles.participantNameContainer ] as ViewStyle[] }><AvatarparticipantId = { participantId }size = { AVATAR_SIZE } />- <Text style = { styles.participantNameLabel }>+ <Text style = { styles.participantNameLabel as TextStyle }>{ this.props._participantDisplayName }</Text></View>@@ -214,9 +217,9 @@ class RemoteVideoMenu extends PureComponent<Props> {* @param {Object} state - Redux state.* @param {Object} ownProps - Properties of component.* @private- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state, ownProps) {+function _mapStateToProps(state: IReduxState, ownProps: any) {const kickOutEnabled = getFeatureFlag(state, KICK_OUT_ENABLED, true);const { participantId } = ownProps;const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];diff --git a/react/features/video-menu/components/native/SendToBreakoutRoom.js b/react/features/video-menu/components/native/SendToBreakoutRoom.tssimilarity index 83%rename from react/features/video-menu/components/native/SendToBreakoutRoom.jsrename to react/features/video-menu/components/native/SendToBreakoutRoom.tsindex 2e0fca0527..ed082d4cd3 100644--- a/react/features/video-menu/components/native/SendToBreakoutRoom.js+++ b/react/features/video-menu/components/native/SendToBreakoutRoom.ts@@ -1,42 +1,32 @@-// @flow-import { connect } from 'react-redux';import { createBreakoutRoomsEvent } from '../../../analytics/AnalyticsEvents';import { sendAnalytics } from '../../../analytics/functions';+import { IReduxState } from '../../../app/types';import { translate } from '../../../base/i18n/functions';import { IconRingGroup } from '../../../base/icons/svg';import { isLocalParticipantModerator } from '../../../base/participants/functions';import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';import { sendParticipantToRoom } from '../../../breakout-rooms/actions';+import { IRoom } from '../../../breakout-rooms/types';-export type Props = AbstractButtonProps & {-- /**- * The redux {@code dispatch} function.- */- dispatch: Function,+export interface IProps extends AbstractButtonProps {/*** ID of the participant to send to breakout room.*/- participantID: string,+ participantID: string;/*** Room to send participant to.*/- room: Object,-- /**- * Translation function.- */- t: Function-};+ room: IRoom;+}/*** An abstract remote video menu button which sends the remote participant to a breakout room.*/-class SendToBreakoutRoom extends AbstractButton<Props, *> {+class SendToBreakoutRoom extends AbstractButton<IProps> {accessibilityLabel = 'breakoutRooms.actions.sendToBreakoutRoom';icon = IconRingGroup;@@ -70,9 +60,9 @@ class SendToBreakoutRoom extends AbstractButton<Props, *> {** @param {Object} state - The Redux state.* @param {Object} ownProps - Properties of component.- * @returns {Props}+ * @returns {IProps}*/-function mapStateToProps(state) {+function mapStateToProps(state: IReduxState) {return {visible: isLocalParticipantModerator(state)};diff --git a/react/features/video-menu/components/native/SharedVideoMenu.js b/react/features/video-menu/components/native/SharedVideoMenu.tsxsimilarity index 82%rename from react/features/video-menu/components/native/SharedVideoMenu.jsrename to react/features/video-menu/components/native/SharedVideoMenu.tsxindex d68354c5e3..e7907af686 100644--- a/react/features/video-menu/components/native/SharedVideoMenu.js+++ b/react/features/video-menu/components/native/SharedVideoMenu.tsx@@ -1,10 +1,9 @@-// @flow-import React, { PureComponent } from 'react';-import { Text, View } from 'react-native';+import { Text, TextStyle, View, ViewStyle } from 'react-native';import { Divider } from 'react-native-paper';import { connect } from 'react-redux';+import { IReduxState, IStore } from '../../../app/types';import Avatar from '../../../base/avatar/components/Avatar';import { hideSheet } from '../../../base/dialog/actions';import BottomSheet from '../../../base/dialog/components/native/BottomSheet';@@ -17,50 +16,49 @@ import SharedVideoButton from '../../../shared-video/components/native/SharedVidimport styles from './styles';-/*** Size of the rendered avatar in the menu.*/const AVATAR_SIZE = 24;-type Props = {+interface IProps {/**- * The Redux dispatch function.+ * True if the menu is currently open, false otherwise.*/- dispatch: Function,+ _isOpen: boolean;/**- * The ID of the participant for which this menu opened for.+ * Whether the participant is present in the room or not.*/- participantId: string,+ _isParticipantAvailable?: boolean;/**- * True if the menu is currently open, false otherwise.+ * Display name of the participant retrieved from Redux.*/- _isOpen: boolean,+ _participantDisplayName: string;/**- * Whether the participant is present in the room or not.+ * The Redux dispatch function.*/- _isParticipantAvailable?: boolean,+ dispatch: IStore['dispatch'];/**- * Display name of the participant retrieved from Redux.+ * The ID of the participant for which this menu opened for.*/- _participantDisplayName: string,+ participantId: string;}/*** Class to implement a popup menu that opens upon long pressing a fake participant thumbnail.*/-class SharedVideoMenu extends PureComponent<Props> {+class SharedVideoMenu extends PureComponent<IProps> {/*** Constructor of the component.** @inheritdoc*/- constructor(props: Props) {+ constructor(props: IProps) {super(props);this._onCancel = this._onCancel.bind(this);@@ -89,7 +87,8 @@ class SharedVideoMenu extends PureComponent<Props> {<BottomSheetrenderHeader = { this._renderMenuHeader }showSlidingView = { _isParticipantAvailable }>- <Divider style = { styles.divider } />+ {/* @ts-ignore */}+ <Divider style = { styles.divider as ViewStyle } /><SharedVideoButton { ...buttonProps } /></BottomSheet>);@@ -117,11 +116,11 @@ class SharedVideoMenu extends PureComponent<Props> {<Viewstyle = { [bottomSheetStyles.sheet,- styles.participantNameContainer ] }>+ styles.participantNameContainer ] as ViewStyle[] }><AvatarparticipantId = { participantId }size = { AVATAR_SIZE } />- <Text style = { styles.participantNameLabel }>+ <Text style = { styles.participantNameLabel as TextStyle }>{ this.props._participantDisplayName }</Text></View>@@ -135,9 +134,9 @@ class SharedVideoMenu extends PureComponent<Props> {* @param {Object} state - Redux state.* @param {Object} ownProps - Properties of component.* @private- * @returns {Props}+ * @returns {IProps}*/-function _mapStateToProps(state, ownProps) {+function _mapStateToProps(state: IReduxState, ownProps: any) {const { participantId } = ownProps;const isParticipantAvailable = getParticipantById(state, participantId);diff --git a/react/features/video-menu/components/native/VolumeSlider.js b/react/features/video-menu/components/native/VolumeSlider.tsxsimilarity index 84%rename from react/features/video-menu/components/native/VolumeSlider.jsrename to react/features/video-menu/components/native/VolumeSlider.tsxindex bd2c339026..142b209d6b 100644--- a/react/features/video-menu/components/native/VolumeSlider.js+++ b/react/features/video-menu/components/native/VolumeSlider.tsx@@ -1,12 +1,11 @@-// @flow-import Slider from '@react-native-community/slider';import _ from 'lodash';import React, { PureComponent } from 'react';-import { View } from 'react-native';+import { View, ViewStyle } from 'react-native';import { withTheme } from 'react-native-paper';import { connect } from 'react-redux';+import { IReduxState } from '../../../app/types';import Icon from '../../../base/icons/components/Icon';import { IconVolumeUp } from '../../../base/icons/svg';import { setVolume } from '../../../participants-pane/actions.native';@@ -14,57 +13,55 @@ import { VOLUME_SLIDER_SCALE } from '../../constants';import styles from './styles';-/*** The type of the React {@code Component} props of {@link VolumeSlider}.*/-type Props = {+interface IProps {/*** Whether the participant enters the conference silent.*/- _startSilent: boolean,+ _startSilent: boolean;/*** The volume level for the participant.*/- _volume: number,+ _volume: number;/*** The redux dispatch function.*/- dispatch: Function,+ dispatch: Function;/*** The ID of the participant.*/- participantID: string,+ participantID: string;/*** Theme used for styles.*/- theme: Object-};+ theme: any;+}/*** The type of the React {@code Component} state of {@link VolumeSlider}.*/-type State = {+interface IState {/*** The volume of the participant's audio element. The value will* be represented by a slider.*/- volumeLevel: number-};+ volumeLevel: number;+}/*** Component that renders the volume slider.** @returns {React$Element<any>}*/-class VolumeSlider extends PureComponent<Props, State> {- _onVolumeChange: Function;+class VolumeSlider extends PureComponent<IProps, IState> {_originalVolumeChange: Function;/**@@ -73,7 +70,7 @@ class VolumeSlider extends PureComponent<Props, State> {* @param {Object} props - The read-only properties with which the new* instance is to be initialized.*/- constructor(props: Props) {+ constructor(props: IProps) {super(props);this.state = {@@ -100,7 +97,7 @@ class VolumeSlider extends PureComponent<Props, State> {const onVolumeChange = _startSilent ? undefined : this._onVolumeChange;return (- <View style = { styles.volumeSliderContainer } >+ <View style = { styles.volumeSliderContainer as ViewStyle } ><Iconsize = { 24 }src = { IconVolumeUp } />@@ -110,7 +107,7 @@ class VolumeSlider extends PureComponent<Props, State> {minimumTrackTintColor = { palette.action01 }minimumValue = { 0 }onValueChange = { onVolumeChange }- style = { styles.sliderContainer }+ style = { styles.sliderContainer as ViewStyle }thumbTintColor = { palette.ui10 }value = { volumeLevel } /></View>@@ -126,7 +123,7 @@ class VolumeSlider extends PureComponent<Props, State> {* @private* @returns {void}*/- _onVolumeChange(volumeLevel) {+ _onVolumeChange(volumeLevel: number) {const { dispatch, participantID } = this.props;dispatch(setVolume(participantID, volumeLevel));@@ -139,9 +136,9 @@ class VolumeSlider extends PureComponent<Props, State> {** @param {Object} state - The Redux state.* @param {Object} ownProps - The own props of the component.- * @returns {Props}+ * @returns {IProps}*/-function mapStateToProps(state, ownProps): Object {+function mapStateToProps(state: IReduxState, ownProps: any) {const { participantID } = ownProps;const { participantsVolume } = state['features/participants-pane'];const { startSilent } = state['features/base/config'];diff --git a/react/features/video-quality/components/VideoQualityButton.native.js b/react/features/video-quality/components/VideoQualityButton.native.tssimilarity index 100%rename from react/features/video-quality/components/VideoQualityButton.native.jsrename to react/features/video-quality/components/VideoQualityButton.native.tsdiff --git a/react/features/video-quality/components/VideoQualityDialog.native.js b/react/features/video-quality/components/VideoQualityDialog.native.tssimilarity index 100%rename from react/features/video-quality/components/VideoQualityDialog.native.jsrename to react/features/video-quality/components/VideoQualityDialog.native.tsdiff --git a/react/features/video-quality/components/VideoQualityExpandedLabel.native.js b/react/features/video-quality/components/VideoQualityExpandedLabel.native.tssimilarity index 78%rename from react/features/video-quality/components/VideoQualityExpandedLabel.native.jsrename to react/features/video-quality/components/VideoQualityExpandedLabel.native.tsindex 7287ee12cc..26de58d640 100644--- a/react/features/video-quality/components/VideoQualityExpandedLabel.native.js+++ b/react/features/video-quality/components/VideoQualityExpandedLabel.native.ts@@ -1,13 +1,11 @@-// @flow+import { WithTranslation } from 'react-i18next';import { translate } from '../../base/i18n/functions';-import ExpandedLabel, { Props as AbstractProps } from '../../base/label/components/native/ExpandedLabel';+import ExpandedLabel, { IProps as AbstractProps } from '../../base/label/components/native/ExpandedLabel';import { AUD_LABEL_COLOR } from './styles';-type Props = AbstractProps & {- t: Function-}+type Props = AbstractProps & WithTranslation;/*** A react {@code Component} that implements an expanded label as tooltip-likediff --git a/react/features/video-quality/components/VideoQualityLabel.native.js b/react/features/video-quality/components/VideoQualityLabel.native.tsxsimilarity index 89%rename from react/features/video-quality/components/VideoQualityLabel.native.jsrename to react/features/video-quality/components/VideoQualityLabel.native.tsxindex b3605cbc10..7dbecf9b66 100644--- a/react/features/video-quality/components/VideoQualityLabel.native.js+++ b/react/features/video-quality/components/VideoQualityLabel.native.tsx@@ -1,5 +1,3 @@-// @flow-import React from 'react';import { connect } from 'react-redux';@@ -13,13 +11,13 @@ import AbstractVideoQualityLabel, {} from './AbstractVideoQualityLabel';import styles from './styles';-type Props = AbstractProps & {+interface IProps extends AbstractProps {/*** Style of the component passed as props.*/- style: ?StyleType-};+ style?: StyleType;+}/*** React {@code Component} responsible for displaying a label that indicates@@ -30,7 +28,7 @@ type Props = AbstractProps & {* is kept consistent with web and in the future we may introduce the required* api and extend this component with actual quality indication.*/-class VideoQualityLabel extends AbstractVideoQualityLabel<Props> {+class VideoQualityLabel extends AbstractVideoQualityLabel<IProps> {/*** Implements React {@link Component}'s render.@@ -46,7 +44,7 @@ class VideoQualityLabel extends AbstractVideoQualityLabel<Props> {}return (- <Label+ <Label // @ts-ignorestyle = { combineStyles(styles.indicatorAudioOnly, style) }text = { t('videoStatus.audioOnly') } />);diff --git a/react/features/video-quality/components/VideoQualitySlider.native.js b/react/features/video-quality/components/VideoQualitySlider.native.tssimilarity index 100%rename from react/features/video-quality/components/VideoQualitySlider.native.jsrename to react/features/video-quality/components/VideoQualitySlider.native.tsdiff --git a/react/features/video-quality/components/styles.js b/react/features/video-quality/components/styles.tssimilarity index 100%rename from react/features/video-quality/components/styles.jsrename to react/features/video-quality/components/styles.ts