Skip to content

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

ref(TS) Convert constants tiles to TS (#12148)

Robert Pintilii247c54b6c636
diff --git a/react/features/calendar-sync/constants.js b/react/features/calendar-sync/constants.ts
similarity index 98%
rename from react/features/calendar-sync/constants.js
rename to react/features/calendar-sync/constants.ts
index fc4da87d0f..ebb2201c24 100644
--- a/react/features/calendar-sync/constants.js
+++ b/react/features/calendar-sync/constants.ts
@@ -1,5 +1,3 @@
-// @flow
-
/**
* An enumeration of support calendar integration types.
*
diff --git a/react/features/deep-linking/constants.js b/react/features/deep-linking/constants.ts
similarity index 100%
rename from react/features/deep-linking/constants.js
rename to react/features/deep-linking/constants.ts
diff --git a/react/features/filmstrip/components/web/Filmstrip.tsx b/react/features/filmstrip/components/web/Filmstrip.tsx
index b784f8c7e5..971f71e2fa 100644
--- a/react/features/filmstrip/components/web/Filmstrip.tsx
+++ b/react/features/filmstrip/components/web/Filmstrip.tsx
@@ -25,7 +25,8 @@ import { showToolbox } from '../../../toolbox/actions.web';
// @ts-ignore
import { isButtonEnabled, isToolboxVisible } from '../../../toolbox/functions.web';
// @ts-ignore
-import { getCurrentLayout, LAYOUTS } from '../../../video-layout';
+import { getCurrentLayout } from '../../../video-layout';
+import { LAYOUTS } from '../../../video-layout/constants';
import {
setFilmstripVisible,
setUserFilmstripHeight,
diff --git a/react/features/filmstrip/components/web/Thumbnail.tsx b/react/features/filmstrip/components/web/Thumbnail.tsx
index a00b495dfd..caa590bafc 100644
--- a/react/features/filmstrip/components/web/Thumbnail.tsx
+++ b/react/features/filmstrip/components/web/Thumbnail.tsx
@@ -45,7 +45,8 @@ import { getGifDisplayMode, getGifForParticipant } from '../../../gifs/functions
// @ts-ignore
import { PresenceLabel } from '../../../presence-status';
// @ts-ignore
-import { getCurrentLayout, LAYOUTS } from '../../../video-layout';
+import { getCurrentLayout } from '../../../video-layout';
+import { LAYOUTS } from '../../../video-layout/constants';
// @ts-ignore
import { togglePinStageParticipant } from '../../actions';
import {
diff --git a/react/features/follow-me/constants.js b/react/features/follow-me/constants.ts
similarity index 100%
rename from react/features/follow-me/constants.js
rename to react/features/follow-me/constants.ts
diff --git a/react/features/gifs/constants.js b/react/features/gifs/constants.ts
similarity index 100%
rename from react/features/gifs/constants.js
rename to react/features/gifs/constants.ts
diff --git a/react/features/invite/constants.js b/react/features/invite/constants.ts
similarity index 99%
rename from react/features/invite/constants.js
rename to react/features/invite/constants.ts
index bad6c222af..aad026c1a7 100644
--- a/react/features/invite/constants.js
+++ b/react/features/invite/constants.ts
@@ -1,5 +1,3 @@
-// @flow
-
/**
* The pathName for the dialInInfo page.
*
diff --git a/react/features/lobby/constants.js b/react/features/lobby/constants.ts
similarity index 100%
rename from react/features/lobby/constants.js
rename to react/features/lobby/constants.ts
diff --git a/react/features/mobile/watchos/constants.js b/react/features/mobile/watchos/constants.ts
similarity index 96%
rename from react/features/mobile/watchos/constants.js
rename to react/features/mobile/watchos/constants.ts
index 6b1f9f29d7..8de47de786 100644
--- a/react/features/mobile/watchos/constants.js
+++ b/react/features/mobile/watchos/constants.ts
@@ -1,5 +1,3 @@
-// @flow
-
// NOTE When changing any of the commands make sure to update JitsiMeetCommands enum in the WatchKit extension code.
export const CMD_HANG_UP = 'hangup';
diff --git a/react/features/no-audio-signal/constants.js b/react/features/no-audio-signal/constants.ts
similarity index 100%
rename from react/features/no-audio-signal/constants.js
rename to react/features/no-audio-signal/constants.ts
diff --git a/react/features/noise-detection/constants.js b/react/features/noise-detection/constants.ts
similarity index 100%
rename from react/features/noise-detection/constants.js
rename to react/features/noise-detection/constants.ts
diff --git a/react/features/participants-pane/components/web/FooterContextMenu.tsx b/react/features/participants-pane/components/web/FooterContextMenu.tsx
index 51c5b317a3..f5683cae05 100644
--- a/react/features/participants-pane/components/web/FooterContextMenu.tsx
+++ b/react/features/participants-pane/components/web/FooterContextMenu.tsx
@@ -33,11 +33,11 @@ import {
// @ts-ignore
import { isInBreakoutRoom } from '../../../breakout-rooms/functions';
import {
- SETTINGS_TABS,
openSettingsDialog,
shouldShowModeratorSettings
// @ts-ignore
} from '../../../settings';
+import { SETTINGS_TABS } from '../../../settings/constants';
// @ts-ignore
import { MuteEveryonesVideoDialog } from '../../../video-menu/components';
diff --git a/react/features/presence-status/constants.js b/react/features/presence-status/constants.ts
similarity index 100%
rename from react/features/presence-status/constants.js
rename to react/features/presence-status/constants.ts
diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx b/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx
index 84205e27c6..db804db7d1 100644
--- a/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx
+++ b/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx
@@ -18,7 +18,6 @@ import { StyleType } from '../../../base/styles';
import { authorizeDropbox, updateDropboxToken } from '../../../dropbox';
// @ts-ignore
import { isVpaasMeeting } from '../../../jaas/functions';
-// @ts-ignore
import { RECORDING_TYPES } from '../../constants';
// @ts-ignore
import { supportsLocalRecording } from '../../functions';
diff --git a/react/features/recording/components/Recording/native/StartRecordingDialogContent.tsx b/react/features/recording/components/Recording/native/StartRecordingDialogContent.tsx
index c0ae291fee..32f78dbbff 100644
--- a/react/features/recording/components/Recording/native/StartRecordingDialogContent.tsx
+++ b/react/features/recording/components/Recording/native/StartRecordingDialogContent.tsx
@@ -10,7 +10,6 @@ import { connect } from '../../../../base/redux/functions';
import Button from '../../../../base/ui/components/native/Button';
import Switch from '../../../../base/ui/components/native/Switch';
import { BUTTON_TYPES } from '../../../../base/ui/constants';
-// @ts-ignore
import { RECORDING_TYPES } from '../../../constants';
// @ts-ignore
import { getRecordingDurationEstimation } from '../../../functions';
diff --git a/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx b/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx
index bd4930573a..acfd691b48 100644
--- a/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx
+++ b/react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx
@@ -13,7 +13,6 @@ import {
import { connect } from '../../../../base/redux/functions';
import Button from '../../../../base/ui/components/web/Button';
import { BUTTON_TYPES } from '../../../../base/ui/constants';
-// @ts-ignore
import { RECORDING_TYPES } from '../../../constants';
// @ts-ignore
import { getRecordingDurationEstimation } from '../../../functions';
diff --git a/react/features/recording/constants.js b/react/features/recording/constants.ts
similarity index 99%
rename from react/features/recording/constants.js
rename to react/features/recording/constants.ts
index 163d7eb91f..f041996d7d 100644
--- a/react/features/recording/constants.js
+++ b/react/features/recording/constants.ts
@@ -1,5 +1,3 @@
-// @flow
-
import { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
diff --git a/react/features/remote-control/constants.js b/react/features/remote-control/constants.ts
similarity index 100%
rename from react/features/remote-control/constants.js
rename to react/features/remote-control/constants.ts
diff --git a/react/features/salesforce/components/web/RecordItem.tsx b/react/features/salesforce/components/web/RecordItem.tsx
index a8c72ef93b..13348dd93d 100644
--- a/react/features/salesforce/components/web/RecordItem.tsx
+++ b/react/features/salesforce/components/web/RecordItem.tsx
@@ -2,7 +2,6 @@ import { makeStyles } from '@material-ui/core';
import React from 'react';
import { useTranslation } from 'react-i18next';
-// @ts-ignore
import { RECORD_TYPE } from '../../constants';
/**
@@ -82,7 +81,7 @@ export const RecordItem = ({
}: Props) => {
const { t } = useTranslation();
const classes = useStyles();
- const Icon = RECORD_TYPE[type].icon;
+ const Icon = RECORD_TYPE[type as keyof typeof RECORD_TYPE].icon;
return (
<li
diff --git a/react/features/salesforce/components/web/SalesforceLinkDialog.tsx b/react/features/salesforce/components/web/SalesforceLinkDialog.tsx
index 543859ce8f..81ecdddb8e 100644
--- a/react/features/salesforce/components/web/SalesforceLinkDialog.tsx
+++ b/react/features/salesforce/components/web/SalesforceLinkDialog.tsx
@@ -12,7 +12,6 @@ import { IconSearch } from '../../../base/icons/svg';
// @ts-ignore
import { getFieldValue } from '../../../base/react';
import BaseTheme from '../../../base/ui/components/BaseTheme.web';
-// @ts-ignore
import { NOTES_MAX_LENGTH } from '../../constants';
// @ts-ignore
import { useSalesforceLinkDialog } from '../../useSalesforceLinkDialog';
diff --git a/react/features/salesforce/constants.js b/react/features/salesforce/constants.ts
similarity index 83%
rename from react/features/salesforce/constants.js
rename to react/features/salesforce/constants.ts
index 22bc1271c5..ac8dd357a9 100644
--- a/react/features/salesforce/constants.js
+++ b/react/features/salesforce/constants.ts
@@ -3,7 +3,7 @@ import {
IconRecordContact,
IconRecordLead,
IconRecordOpportunity
-} from '../base/icons';
+} from '../base/icons/svg';
export const NOTES_MAX_LENGTH = 255;
@@ -13,7 +13,12 @@ export const CONTENT_HEIGHT_OFFSET = 200;
export const LIST_HEIGHT_OFFSET = 250;
-export const RECORD_TYPE = {
+export const RECORD_TYPE: {
+ [key: string]: {
+ icon?: Function;
+ label: string;
+ };
+} = {
ACCOUNT: {
label: 'record.type.account',
icon: IconRecordAccount
diff --git a/react/features/screenshot-capture/constants.js b/react/features/screenshot-capture/constants.ts
similarity index 98%
rename from react/features/screenshot-capture/constants.js
rename to react/features/screenshot-capture/constants.ts
index e26cdd202e..d087e94de3 100644
--- a/react/features/screenshot-capture/constants.js
+++ b/react/features/screenshot-capture/constants.ts
@@ -1,5 +1,3 @@
-// @flow
-
/**
* Percent of pixels that signal if two images should be considered different.
*/
diff --git a/react/features/settings/components/web/SettingsDialog.tsx b/react/features/settings/components/web/SettingsDialog.tsx
index c621ea5c65..cc069e054f 100644
--- a/react/features/settings/components/web/SettingsDialog.tsx
+++ b/react/features/settings/components/web/SettingsDialog.tsx
@@ -23,7 +23,6 @@ import {
submitSoundsTab
// @ts-ignore
} from '../../actions';
-// @ts-ignore
import { SETTINGS_TABS } from '../../constants';
import {
getModeratorTabProps,
diff --git a/react/features/settings/constants.js b/react/features/settings/constants.ts
similarity index 100%
rename from react/features/settings/constants.js
rename to react/features/settings/constants.ts
diff --git a/react/features/shared-video/constants.js b/react/features/shared-video/constants.ts
similarity index 98%
rename from react/features/shared-video/constants.js
rename to react/features/shared-video/constants.ts
index f3d15410d9..5250a917d7 100644
--- a/react/features/shared-video/constants.js
+++ b/react/features/shared-video/constants.ts
@@ -1,5 +1,3 @@
-// @flow
-
/**
* Fixed name of the video player fake participant.
*
diff --git a/react/features/speaker-stats/components/web/SpeakerStats.tsx b/react/features/speaker-stats/components/web/SpeakerStats.tsx
index dc7d5341e2..c2ca60f071 100644
--- a/react/features/speaker-stats/components/web/SpeakerStats.tsx
+++ b/react/features/speaker-stats/components/web/SpeakerStats.tsx
@@ -13,7 +13,6 @@ import {
DISPLAY_SWITCH_BREAKPOINT,
MOBILE_BREAKPOINT,
RESIZE_SEARCH_SWITCH_CONTAINER_BREAKPOINT
- // @ts-ignore
} from '../../constants';
import FaceExpressionsSwitch from './FaceExpressionsSwitch';
diff --git a/react/features/speaker-stats/components/web/SpeakerStatsList.tsx b/react/features/speaker-stats/components/web/SpeakerStatsList.tsx
index 968a1ef18c..abb9ceb057 100644
--- a/react/features/speaker-stats/components/web/SpeakerStatsList.tsx
+++ b/react/features/speaker-stats/components/web/SpeakerStatsList.tsx
@@ -2,7 +2,6 @@
import { makeStyles } from '@material-ui/core/styles';
import React from 'react';
-// @ts-ignore
import { MOBILE_BREAKPOINT } from '../../constants';
// @ts-ignore
import abstractSpeakerStatsList from '../AbstractSpeakerStatsList';
diff --git a/react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx b/react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx
index 76784e6459..b769298d16 100644
--- a/react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx
+++ b/react/features/speaker-stats/components/web/SpeakerStatsSearch.tsx
@@ -9,7 +9,6 @@ import { IconSearch } from '../../../base/icons/svg';
// @ts-ignore
import { getFieldValue } from '../../../base/react';
import BaseTheme from '../../../base/ui/components/BaseTheme.web';
-// @ts-ignore
import { MOBILE_BREAKPOINT } from '../../constants';
// @ts-ignore
import { isSpeakerStatsSearchDisabled } from '../../functions';
diff --git a/react/features/speaker-stats/constants.js b/react/features/speaker-stats/constants.ts
similarity index 100%
rename from react/features/speaker-stats/constants.js
rename to react/features/speaker-stats/constants.ts
diff --git a/react/features/talk-while-muted/constants.js b/react/features/talk-while-muted/constants.ts
similarity index 100%
rename from react/features/talk-while-muted/constants.js
rename to react/features/talk-while-muted/constants.ts
diff --git a/react/features/video-layout/constants.js b/react/features/video-layout/constants.ts
similarity index 100%
rename from react/features/video-layout/constants.js
rename to react/features/video-layout/constants.ts
diff --git a/react/features/video-menu/components/web/VolumeSlider.tsx b/react/features/video-menu/components/web/VolumeSlider.tsx
index b79eb01e73..11d6e69386 100644
--- a/react/features/video-menu/components/web/VolumeSlider.tsx
+++ b/react/features/video-menu/components/web/VolumeSlider.tsx
@@ -7,7 +7,6 @@ import { WithTranslation } from 'react-i18next';
import { translate } from '../../../base/i18n/functions';
import Icon from '../../../base/icons/components/Icon';
import { IconVolume } from '../../../base/icons/svg';
-// @ts-ignore
import { VOLUME_SLIDER_SCALE } from '../../constants';
/**
diff --git a/react/features/video-menu/constants.js b/react/features/video-menu/constants.ts
similarity index 95%
rename from react/features/video-menu/constants.js
rename to react/features/video-menu/constants.ts
index 25f6de2c06..523a47bfd2 100644
--- a/react/features/video-menu/constants.js
+++ b/react/features/video-menu/constants.ts
@@ -1,5 +1,3 @@
-// @flow
-
/**
* Used to modify initialValue, which is expected to be a decimal value between
* 0 and 1, and converts it to a number representable by an input slider, which
diff --git a/react/features/welcome/constants.js b/react/features/welcome/constants.tsx
similarity index 78%
rename from react/features/welcome/constants.js
rename to react/features/welcome/constants.tsx
index f2fcb9dae9..e74287ef40 100644
--- a/react/features/welcome/constants.js
+++ b/react/features/welcome/constants.tsx
@@ -1,10 +1,11 @@
-// @flow
-
+/* eslint-disable lines-around-comment */
import React from 'react';
-import { IconEventNote, IconRestore, IconSettings } from '../base/icons';
+import { IconEventNote, IconRestore, IconSettings } from '../base/icons/svg';
+// @ts-ignore
import BaseTheme from '../base/ui/components/BaseTheme';
+// @ts-ignore
import TabIcon from './components/TabIcon';
export const INACTIVE_TAB_COLOR = BaseTheme.palette.tab01Disabled;
@@ -21,7 +22,7 @@ export const tabBarOptions = {
};
export const recentListTabBarOptions = {
- tabBarIcon: ({ focused }) => (
+ tabBarIcon: ({ focused }: { focused: boolean; }) => (
<TabIcon
focused = { focused }
src = { IconRestore } />
@@ -29,7 +30,7 @@ export const recentListTabBarOptions = {
};
export const calendarListTabBarOptions = {
- tabBarIcon: ({ focused }) => (
+ tabBarIcon: ({ focused }: { focused: boolean; }) => (
<TabIcon
focused = { focused }
src = { IconEventNote } />
@@ -37,7 +38,7 @@ export const calendarListTabBarOptions = {
};
export const settingsTabBarOptions = {
- tabBarIcon: ({ focused }) => (
+ tabBarIcon: ({ focused }: { focused: boolean; }) => (
<TabIcon
focused = { focused }
src = { IconSettings } />