From 7c523f3250538834eb51e2bba56e3200f7e7f2a7 Mon Sep 17 00:00:00 2001 From: Calinteodor Date: Fri, 8 Apr 2022 15:24:58 +0300 Subject: [PATCH] language(typescript) actionTypes.js -> actionTypes.ts (#10940) * language(typescript) first ts component, added ts configurations, actionTypes.js are now ts files --- .eslintignore | 2 +- CONTRIBUTING.md | 6 +- conference.js | 2 +- connection.js | 2 +- package-lock.json | 177 ++++++++++++++++++ package.json | 1 + .../{actionTypes.js => actionTypes.ts} | 0 react/features/analytics/functions.js | 4 +- react/features/app/actions.web.js | 2 +- .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../app/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../config/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../dialog/{actionTypes.js => actionTypes.ts} | 0 .../flags/{actionTypes.js => actionTypes.ts} | 0 .../i18n/{actionTypes.js => actionTypes.ts} | 0 .../jwt/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../lastn/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 react/features/base/lib-jitsi-meet/index.js | 4 - .../{actionTypes.js => actionTypes.ts} | 0 react/features/base/logging/middleware.js | 2 +- .../media/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../sounds/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../tracks/{actionTypes.js => actionTypes.ts} | 0 react/features/base/tracks/actions.js | 3 +- .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../chat/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 ...splayNameLabel.js => DisplayNameLabel.tsx} | 32 ++-- .../display-name/components/native/index.js | 2 - ...splayNameBadge.js => DisplayNameBadge.tsx} | 21 +-- .../{functions.js => functions.ts} | 3 +- .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../dynamic-branding/functions.any.js | 2 +- .../e2ee/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 4 +- react/features/face-landmarks/middleware.js | 2 - .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../gifs/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../invite/{actionTypes.js => actionTypes.ts} | 0 .../jaas/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../lobby/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../components/AbstractPageReloadOverlay.js | 2 +- react/features/overlay/middleware.js | 4 +- .../{actionTypes.js => actionTypes.ts} | 0 .../polls/{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 react/features/prejoin/actions.js | 3 +- .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 react/features/recording/actions.any.js | 7 +- .../{actionTypes.js => actionTypes.ts} | 0 react/features/rtcstats/middleware.js | 2 +- .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 react/features/transcribing/reducer.js | 4 +- .../{actionTypes.js => actionTypes.ts} | 0 react/features/video-layout/middleware.web.js | 2 +- .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 .../{actionTypes.js => actionTypes.ts} | 0 tsconfig.json | 17 ++ webpack.config.js | 8 + 105 files changed, 257 insertions(+), 63 deletions(-) rename react/features/analytics/{actionTypes.js => actionTypes.ts} (100%) rename react/features/authentication/{actionTypes.js => actionTypes.ts} (100%) rename react/features/av-moderation/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/app/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/audio-only/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/conference/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/config/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/connection/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/devices/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/dialog/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/flags/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/i18n/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/jwt/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/known-domains/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/lastn/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/lib-jitsi-meet/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/logging/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/media/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/net-info/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/participants/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/responsive-ui/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/settings/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/sounds/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/testing/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/tracks/{actionTypes.js => actionTypes.ts} (100%) rename react/features/base/user-interaction/{actionTypes.js => actionTypes.ts} (100%) rename react/features/breakout-rooms/{actionTypes.js => actionTypes.ts} (100%) rename react/features/calendar-sync/{actionTypes.js => actionTypes.ts} (100%) rename react/features/chat/{actionTypes.js => actionTypes.ts} (100%) rename react/features/deep-linking/{actionTypes.js => actionTypes.ts} (100%) rename react/features/display-name/components/native/{DisplayNameLabel.js => DisplayNameLabel.tsx} (64%) rename react/features/display-name/components/web/{DisplayNameBadge.js => DisplayNameBadge.tsx} (71%) rename react/features/display-name/{functions.js => functions.ts} (80%) rename react/features/dropbox/{actionTypes.js => actionTypes.ts} (100%) rename react/features/dynamic-branding/{actionTypes.js => actionTypes.ts} (100%) rename react/features/e2ee/{actionTypes.js => actionTypes.ts} (100%) rename react/features/etherpad/{actionTypes.js => actionTypes.ts} (100%) rename react/features/face-landmarks/{actionTypes.js => actionTypes.ts} (98%) rename react/features/feedback/{actionTypes.js => actionTypes.ts} (100%) rename react/features/filmstrip/{actionTypes.js => actionTypes.ts} (100%) rename react/features/follow-me/{actionTypes.js => actionTypes.ts} (100%) rename react/features/gifs/{actionTypes.js => actionTypes.ts} (100%) rename react/features/google-api/{actionTypes.js => actionTypes.ts} (100%) rename react/features/invite/{actionTypes.js => actionTypes.ts} (100%) rename react/features/jaas/{actionTypes.js => actionTypes.ts} (100%) rename react/features/keyboard-shortcuts/{actionTypes.js => actionTypes.ts} (100%) rename react/features/large-video/{actionTypes.js => actionTypes.ts} (100%) rename react/features/lobby/{actionTypes.js => actionTypes.ts} (100%) rename react/features/local-recording/{actionTypes.js => actionTypes.ts} (100%) rename react/features/mobile/audio-mode/{actionTypes.js => actionTypes.ts} (100%) rename react/features/mobile/background/{actionTypes.js => actionTypes.ts} (100%) rename react/features/mobile/call-integration/{actionTypes.js => actionTypes.ts} (100%) rename react/features/mobile/external-api/{actionTypes.js => actionTypes.ts} (100%) rename react/features/mobile/full-screen/{actionTypes.js => actionTypes.ts} (100%) rename react/features/mobile/picture-in-picture/{actionTypes.js => actionTypes.ts} (100%) rename react/features/mobile/watchos/{actionTypes.js => actionTypes.ts} (100%) rename react/features/no-audio-signal/{actionTypes.js => actionTypes.ts} (100%) rename react/features/noise-detection/{actionTypes.js => actionTypes.ts} (100%) rename react/features/notifications/{actionTypes.js => actionTypes.ts} (100%) rename react/features/overlay/{actionTypes.js => actionTypes.ts} (100%) rename react/features/participants-pane/{actionTypes.js => actionTypes.ts} (100%) rename react/features/polls/{actionTypes.js => actionTypes.ts} (100%) rename react/features/power-monitor/{actionTypes.js => actionTypes.ts} (100%) rename react/features/prejoin/{actionTypes.js => actionTypes.ts} (100%) rename react/features/reactions/{actionTypes.js => actionTypes.ts} (100%) rename react/features/recent-list/{actionTypes.js => actionTypes.ts} (100%) rename react/features/recording/{actionTypes.js => actionTypes.ts} (100%) rename react/features/remote-control/{actionTypes.js => actionTypes.ts} (100%) rename react/features/screen-share/{actionTypes.js => actionTypes.ts} (100%) rename react/features/screenshot-capture/{actionTypes.js => actionTypes.ts} (100%) rename react/features/settings/{actionTypes.js => actionTypes.ts} (100%) rename react/features/share-room/{actionTypes.js => actionTypes.ts} (100%) rename react/features/shared-video/{actionTypes.js => actionTypes.ts} (100%) rename react/features/speaker-stats/{actionTypes.js => actionTypes.ts} (100%) rename react/features/subtitles/{actionTypes.js => actionTypes.ts} (100%) rename react/features/talk-while-muted/{actionTypes.js => actionTypes.ts} (100%) rename react/features/toolbox/{actionTypes.js => actionTypes.ts} (100%) rename react/features/transcribing/{actionTypes.js => actionTypes.ts} (100%) rename react/features/video-layout/{actionTypes.js => actionTypes.ts} (100%) rename react/features/video-quality/{actionTypes.js => actionTypes.ts} (100%) rename react/features/videosipgw/{actionTypes.js => actionTypes.ts} (100%) rename react/features/virtual-background/{actionTypes.js => actionTypes.ts} (100%) create mode 100644 tsconfig.json diff --git a/.eslintignore b/.eslintignore index eab8d9621d..32e5e1fefb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -16,4 +16,4 @@ react/features/face-landmarks/resources/* !.eslintrc.js # Not worth it. -actionTypes.js +actionTypes.ts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index db85bd4bae..43c3c7514a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,8 @@ We would love to have your help. Before you start working however, please read and follow this short guide. # Reporting Issues -Provide as much information as possible. Mention the version of Jitsi Meet, -Jicofo and JVB you are using, and explain (as detailed as you can) how the +Provide as much information as possible. Mention the version of Jitsi Meet, +Jicofo and JVB you are using, and explain (as detailed as you can) how the problem can be reproduced. # Code contributions @@ -130,7 +130,7 @@ When adding a new feature, this would be the usual layout. ``` react/features/sample/ -├── actionTypes.js +├── actionTypes.ts ├── actions.js ├── components │   ├── AnotherComponent.js diff --git a/conference.js b/conference.js index 71e83b7a9b..b1c4626a86 100644 --- a/conference.js +++ b/conference.js @@ -66,7 +66,6 @@ import { } from './react/features/base/devices'; import { browser, - isFatalJitsiConnectionError, JitsiConferenceErrors, JitsiConferenceEvents, JitsiConnectionErrors, @@ -77,6 +76,7 @@ import { JitsiTrackErrors, JitsiTrackEvents } from './react/features/base/lib-jitsi-meet'; +import { isFatalJitsiConnectionError } from './react/features/base/lib-jitsi-meet/functions'; import { getStartWithAudioMuted, getStartWithVideoMuted, diff --git a/connection.js b/connection.js index faa9344ae8..07518b3ff4 100644 --- a/connection.js +++ b/connection.js @@ -13,10 +13,10 @@ import { import { openDialog } from './react/features/base/dialog/actions'; import { setJWT } from './react/features/base/jwt'; import { - isFatalJitsiConnectionError, JitsiConnectionErrors, JitsiConnectionEvents } from './react/features/base/lib-jitsi-meet'; +import { isFatalJitsiConnectionError } from './react/features/base/lib-jitsi-meet/functions'; import { getCustomerDetails } from './react/features/jaas/actions.any'; import { isVpaasMeeting, getJaasJWT } from './react/features/jaas/functions'; import { setPrejoinDisplayNameRequired } from './react/features/prejoin/actions'; diff --git a/package-lock.json b/package-lock.json index 9f5067f2ec..c392ae5c01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -161,6 +161,7 @@ "string-replace-loader": "3.0.3", "style-loader": "0.19.0", "traverse": "0.6.6", + "ts-loader": "9.2.6", "typescript": "4.3.5", "unorm": "1.6.0", "webpack": "5.57.1", @@ -18332,6 +18333,110 @@ "resolved": "https://registry.npmjs.org/ts-easing/-/ts-easing-0.2.0.tgz", "integrity": "sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==" }, + "node_modules/ts-loader": { + "version": "9.2.6", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz", + "integrity": "sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "typescript": "*", + "webpack": "^5.0.0" + } + }, + "node_modules/ts-loader/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ts-loader/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ts-loader/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ts-loader/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/ts-loader/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-loader/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-loader/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/tsconfig-paths": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", @@ -33840,6 +33945,78 @@ "resolved": "https://registry.npmjs.org/ts-easing/-/ts-easing-0.2.0.tgz", "integrity": "sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==" }, + "ts-loader": { + "version": "9.2.6", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz", + "integrity": "sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "tsconfig-paths": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", diff --git a/package.json b/package.json index f1634340a8..3442eb2432 100644 --- a/package.json +++ b/package.json @@ -166,6 +166,7 @@ "string-replace-loader": "3.0.3", "style-loader": "0.19.0", "traverse": "0.6.6", + "ts-loader": "9.2.6", "typescript": "4.3.5", "unorm": "1.6.0", "webpack": "5.57.1", diff --git a/react/features/analytics/actionTypes.js b/react/features/analytics/actionTypes.ts similarity index 100% rename from react/features/analytics/actionTypes.js rename to react/features/analytics/actionTypes.ts diff --git a/react/features/analytics/functions.js b/react/features/analytics/functions.js index e8b131b8e2..65ffd62b4b 100644 --- a/react/features/analytics/functions.js +++ b/react/features/analytics/functions.js @@ -8,9 +8,9 @@ import { } from '../base/environment/utils'; import JitsiMeetJS, { analytics, - browser, - isAnalyticsEnabled + browser } from '../base/lib-jitsi-meet'; +import { isAnalyticsEnabled } from '../base/lib-jitsi-meet/functions'; import { getJitsiMeetGlobalNS, loadScript, parseURIString } from '../base/util'; import { AmplitudeHandler, MatomoHandler } from './handlers'; diff --git a/react/features/app/actions.web.js b/react/features/app/actions.web.js index e70d3953d2..73a9d917fb 100644 --- a/react/features/app/actions.web.js +++ b/react/features/app/actions.web.js @@ -13,7 +13,7 @@ import { storeConfig } from '../base/config'; import { setLocationURL } from '../base/connection'; -import { loadConfig } from '../base/lib-jitsi-meet'; +import { loadConfig } from '../base/lib-jitsi-meet/functions.web'; import { getBackendSafeRoomName, parseURIString diff --git a/react/features/authentication/actionTypes.js b/react/features/authentication/actionTypes.ts similarity index 100% rename from react/features/authentication/actionTypes.js rename to react/features/authentication/actionTypes.ts diff --git a/react/features/av-moderation/actionTypes.js b/react/features/av-moderation/actionTypes.ts similarity index 100% rename from react/features/av-moderation/actionTypes.js rename to react/features/av-moderation/actionTypes.ts diff --git a/react/features/base/app/actionTypes.js b/react/features/base/app/actionTypes.ts similarity index 100% rename from react/features/base/app/actionTypes.js rename to react/features/base/app/actionTypes.ts diff --git a/react/features/base/audio-only/actionTypes.js b/react/features/base/audio-only/actionTypes.ts similarity index 100% rename from react/features/base/audio-only/actionTypes.js rename to react/features/base/audio-only/actionTypes.ts diff --git a/react/features/base/conference/actionTypes.js b/react/features/base/conference/actionTypes.ts similarity index 100% rename from react/features/base/conference/actionTypes.js rename to react/features/base/conference/actionTypes.ts diff --git a/react/features/base/config/actionTypes.js b/react/features/base/config/actionTypes.ts similarity index 100% rename from react/features/base/config/actionTypes.js rename to react/features/base/config/actionTypes.ts diff --git a/react/features/base/connection/actionTypes.js b/react/features/base/connection/actionTypes.ts similarity index 100% rename from react/features/base/connection/actionTypes.js rename to react/features/base/connection/actionTypes.ts diff --git a/react/features/base/devices/actionTypes.js b/react/features/base/devices/actionTypes.ts similarity index 100% rename from react/features/base/devices/actionTypes.js rename to react/features/base/devices/actionTypes.ts diff --git a/react/features/base/dialog/actionTypes.js b/react/features/base/dialog/actionTypes.ts similarity index 100% rename from react/features/base/dialog/actionTypes.js rename to react/features/base/dialog/actionTypes.ts diff --git a/react/features/base/flags/actionTypes.js b/react/features/base/flags/actionTypes.ts similarity index 100% rename from react/features/base/flags/actionTypes.js rename to react/features/base/flags/actionTypes.ts diff --git a/react/features/base/i18n/actionTypes.js b/react/features/base/i18n/actionTypes.ts similarity index 100% rename from react/features/base/i18n/actionTypes.js rename to react/features/base/i18n/actionTypes.ts diff --git a/react/features/base/jwt/actionTypes.js b/react/features/base/jwt/actionTypes.ts similarity index 100% rename from react/features/base/jwt/actionTypes.js rename to react/features/base/jwt/actionTypes.ts diff --git a/react/features/base/known-domains/actionTypes.js b/react/features/base/known-domains/actionTypes.ts similarity index 100% rename from react/features/base/known-domains/actionTypes.js rename to react/features/base/known-domains/actionTypes.ts diff --git a/react/features/base/lastn/actionTypes.js b/react/features/base/lastn/actionTypes.ts similarity index 100% rename from react/features/base/lastn/actionTypes.js rename to react/features/base/lastn/actionTypes.ts diff --git a/react/features/base/lib-jitsi-meet/actionTypes.js b/react/features/base/lib-jitsi-meet/actionTypes.ts similarity index 100% rename from react/features/base/lib-jitsi-meet/actionTypes.js rename to react/features/base/lib-jitsi-meet/actionTypes.ts diff --git a/react/features/base/lib-jitsi-meet/index.js b/react/features/base/lib-jitsi-meet/index.js index b316e0fa8e..4ecaa0c6f8 100644 --- a/react/features/base/lib-jitsi-meet/index.js +++ b/react/features/base/lib-jitsi-meet/index.js @@ -24,7 +24,3 @@ export const JitsiRecordingConstants = JitsiMeetJS.constants.recording; export const JitsiSIPVideoGWStatus = JitsiMeetJS.constants.sipVideoGW; export const JitsiTrackErrors = JitsiMeetJS.errors.track; export const JitsiTrackEvents = JitsiMeetJS.events.track; - -export * from './actions'; -export * from './actionTypes'; -export * from './functions'; diff --git a/react/features/base/logging/actionTypes.js b/react/features/base/logging/actionTypes.ts similarity index 100% rename from react/features/base/logging/actionTypes.js rename to react/features/base/logging/actionTypes.ts diff --git a/react/features/base/logging/middleware.js b/react/features/base/logging/middleware.js index 545ae177c4..2a2b7213d9 100644 --- a/react/features/base/logging/middleware.js +++ b/react/features/base/logging/middleware.js @@ -5,9 +5,9 @@ import Logger from '@jitsi/logger'; import { APP_WILL_MOUNT } from '../app'; import { CONFERENCE_JOINED, getCurrentConference } from '../conference'; import JitsiMeetJS, { - LIB_WILL_INIT, JitsiConferenceEvents } from '../lib-jitsi-meet'; +import { LIB_WILL_INIT } from '../lib-jitsi-meet/actionTypes'; import { MiddlewareRegistry } from '../redux'; import { isTestModeEnabled } from '../testing'; diff --git a/react/features/base/media/actionTypes.js b/react/features/base/media/actionTypes.ts similarity index 100% rename from react/features/base/media/actionTypes.js rename to react/features/base/media/actionTypes.ts diff --git a/react/features/base/net-info/actionTypes.js b/react/features/base/net-info/actionTypes.ts similarity index 100% rename from react/features/base/net-info/actionTypes.js rename to react/features/base/net-info/actionTypes.ts diff --git a/react/features/base/participants/actionTypes.js b/react/features/base/participants/actionTypes.ts similarity index 100% rename from react/features/base/participants/actionTypes.js rename to react/features/base/participants/actionTypes.ts diff --git a/react/features/base/responsive-ui/actionTypes.js b/react/features/base/responsive-ui/actionTypes.ts similarity index 100% rename from react/features/base/responsive-ui/actionTypes.js rename to react/features/base/responsive-ui/actionTypes.ts diff --git a/react/features/base/settings/actionTypes.js b/react/features/base/settings/actionTypes.ts similarity index 100% rename from react/features/base/settings/actionTypes.js rename to react/features/base/settings/actionTypes.ts diff --git a/react/features/base/sounds/actionTypes.js b/react/features/base/sounds/actionTypes.ts similarity index 100% rename from react/features/base/sounds/actionTypes.js rename to react/features/base/sounds/actionTypes.ts diff --git a/react/features/base/testing/actionTypes.js b/react/features/base/testing/actionTypes.ts similarity index 100% rename from react/features/base/testing/actionTypes.js rename to react/features/base/testing/actionTypes.ts diff --git a/react/features/base/tracks/actionTypes.js b/react/features/base/tracks/actionTypes.ts similarity index 100% rename from react/features/base/tracks/actionTypes.js rename to react/features/base/tracks/actionTypes.ts diff --git a/react/features/base/tracks/actions.js b/react/features/base/tracks/actions.js index 8d30390889..0288e2621c 100644 --- a/react/features/base/tracks/actions.js +++ b/react/features/base/tracks/actions.js @@ -7,7 +7,8 @@ import { import { NOTIFICATION_TIMEOUT_TYPE, showErrorNotification, showNotification } from '../../notifications'; import { getCurrentConference } from '../conference'; import { getMultipleVideoSupportFeatureFlag, getSourceNameSignalingFeatureFlag } from '../config'; -import { JitsiTrackErrors, JitsiTrackEvents, createLocalTrack } from '../lib-jitsi-meet'; +import { JitsiTrackErrors, JitsiTrackEvents } from '../lib-jitsi-meet'; +import { createLocalTrack } from '../lib-jitsi-meet/functions'; import { CAMERA_FACING_MODE, MEDIA_TYPE, diff --git a/react/features/base/user-interaction/actionTypes.js b/react/features/base/user-interaction/actionTypes.ts similarity index 100% rename from react/features/base/user-interaction/actionTypes.js rename to react/features/base/user-interaction/actionTypes.ts diff --git a/react/features/breakout-rooms/actionTypes.js b/react/features/breakout-rooms/actionTypes.ts similarity index 100% rename from react/features/breakout-rooms/actionTypes.js rename to react/features/breakout-rooms/actionTypes.ts diff --git a/react/features/calendar-sync/actionTypes.js b/react/features/calendar-sync/actionTypes.ts similarity index 100% rename from react/features/calendar-sync/actionTypes.js rename to react/features/calendar-sync/actionTypes.ts diff --git a/react/features/chat/actionTypes.js b/react/features/chat/actionTypes.ts similarity index 100% rename from react/features/chat/actionTypes.js rename to react/features/chat/actionTypes.ts diff --git a/react/features/deep-linking/actionTypes.js b/react/features/deep-linking/actionTypes.ts similarity index 100% rename from react/features/deep-linking/actionTypes.js rename to react/features/deep-linking/actionTypes.ts diff --git a/react/features/display-name/components/native/DisplayNameLabel.js b/react/features/display-name/components/native/DisplayNameLabel.tsx similarity index 64% rename from react/features/display-name/components/native/DisplayNameLabel.js rename to react/features/display-name/components/native/DisplayNameLabel.tsx index 797985cfa7..78a754446f 100644 --- a/react/features/display-name/components/native/DisplayNameLabel.js +++ b/react/features/display-name/components/native/DisplayNameLabel.tsx @@ -1,13 +1,11 @@ -// @flow - -import React, { Component } from 'react'; +import * as React from 'react'; import { Text, View } from 'react-native'; import { getParticipantById, getParticipantDisplayName -} from '../../../base/participants'; -import { connect } from '../../../base/redux'; +} from '../../../base/participants/functions'; +import { connect } from '../../../base/redux/functions'; import styles from './styles'; @@ -16,28 +14,28 @@ type Props = { /** * The name of the participant to render. */ - _participantName: string, + _participantName: string; /** * True of the label needs to be rendered. False otherwise. */ - _render: boolean, + _render: boolean; /** * Whether ot not the name is in a container. */ - contained?: boolean, + contained?: boolean; /** * The ID of the participant to render the label for. */ - participantId: string + participantId: string; } /** * Renders a label with the display name of the on-stage participant. */ -class DisplayNameLabel extends Component { +class DisplayNameLabel extends React.Component { /** * Implements {@code Component#render}. * @@ -63,18 +61,16 @@ class DisplayNameLabel extends Component { /** * Maps part of the Redux state to the props of this component. * - * @param {Object} state - The Redux state. + * @param {any} state - The Redux state. * @param {Props} ownProps - The own props of the component. - * @returns {{ - * }} + * @returns {Props} */ -function _mapStateToProps(state: Object, ownProps: Props) { - const { participantId, contained } = ownProps; - const participant = getParticipantById(state, participantId); +function _mapStateToProps(state: any, ownProps) { + const participant = getParticipantById(state, ownProps.participantId); return { - _participantName: getParticipantDisplayName(state, participantId), - _render: participant && (!participant?.local || contained) && !participant?.isFakeParticipant + _participantName: getParticipantDisplayName(state, ownProps.participantId), + _render: participant && (!participant?.local || ownProps.contained) && !participant?.isFakeParticipant }; } diff --git a/react/features/display-name/components/native/index.js b/react/features/display-name/components/native/index.js index fc844badf9..f31472b2f1 100644 --- a/react/features/display-name/components/native/index.js +++ b/react/features/display-name/components/native/index.js @@ -1,4 +1,2 @@ -// @flow - export { default as DisplayNameLabel } from './DisplayNameLabel'; export { default as DisplayNamePrompt } from './DisplayNamePrompt'; diff --git a/react/features/display-name/components/web/DisplayNameBadge.js b/react/features/display-name/components/web/DisplayNameBadge.tsx similarity index 71% rename from react/features/display-name/components/web/DisplayNameBadge.js rename to react/features/display-name/components/web/DisplayNameBadge.tsx index aafeeee8bc..f668756bf1 100644 --- a/react/features/display-name/components/web/DisplayNameBadge.js +++ b/react/features/display-name/components/web/DisplayNameBadge.tsx @@ -1,22 +1,19 @@ -// @flow - import { makeStyles } from '@material-ui/core/styles'; import React from 'react'; -type Props = { - - /** - * The name to be displayed within the badge. - */ - name: string +interface Theme { + palette: any; + text01: string; } -const useStyles = makeStyles(theme => { +const useStyles = makeStyles((theme: Theme) => { + const { text01 } = theme.palette; + return { badge: { background: 'rgba(0, 0, 0, 0.6)', borderRadius: '3px', - color: theme.palette.text01, + color: text01, maxWidth: '50%', overflow: 'hidden', padding: '2px 16px', @@ -32,12 +29,12 @@ const useStyles = makeStyles(theme => { * @param {Props} props - The props of the component. * @returns {ReactElement} */ -const DisplayNameBadge = ({ name }: Props) => { +const DisplayNameBadge: React.FC<{ name: string }> = ({ name }) => { const classes = useStyles(); return (
- {name} + { name }
); }; diff --git a/react/features/display-name/functions.js b/react/features/display-name/functions.ts similarity index 80% rename from react/features/display-name/functions.js rename to react/features/display-name/functions.ts index 728033e206..56f6392f48 100644 --- a/react/features/display-name/functions.js +++ b/react/features/display-name/functions.ts @@ -1,4 +1,3 @@ -// @flow /** * Appends a suffix to the display name. @@ -7,7 +6,7 @@ * @param {string} suffix - Suffix that will be appended. * @returns {string} The formatted display name. */ -export function appendSuffix(displayName: string, suffix: string = '') { +export function appendSuffix(displayName: string, suffix = ''): string { return `${displayName || suffix}${ displayName && suffix && displayName !== suffix ? ` (${suffix})` : ''}`; } diff --git a/react/features/dropbox/actionTypes.js b/react/features/dropbox/actionTypes.ts similarity index 100% rename from react/features/dropbox/actionTypes.js rename to react/features/dropbox/actionTypes.ts diff --git a/react/features/dynamic-branding/actionTypes.js b/react/features/dynamic-branding/actionTypes.ts similarity index 100% rename from react/features/dynamic-branding/actionTypes.js rename to react/features/dynamic-branding/actionTypes.ts diff --git a/react/features/dynamic-branding/functions.any.js b/react/features/dynamic-branding/functions.any.js index 93443bbee1..9f23aa9623 100644 --- a/react/features/dynamic-branding/functions.any.js +++ b/react/features/dynamic-branding/functions.any.js @@ -1,6 +1,6 @@ // @flow -import { loadConfig } from '../base/lib-jitsi-meet'; +import { loadConfig } from '../base/lib-jitsi-meet/functions'; /** * Extracts the fqn part from a path, where fqn represents diff --git a/react/features/e2ee/actionTypes.js b/react/features/e2ee/actionTypes.ts similarity index 100% rename from react/features/e2ee/actionTypes.js rename to react/features/e2ee/actionTypes.ts diff --git a/react/features/etherpad/actionTypes.js b/react/features/etherpad/actionTypes.ts similarity index 100% rename from react/features/etherpad/actionTypes.js rename to react/features/etherpad/actionTypes.ts diff --git a/react/features/face-landmarks/actionTypes.js b/react/features/face-landmarks/actionTypes.ts similarity index 98% rename from react/features/face-landmarks/actionTypes.js rename to react/features/face-landmarks/actionTypes.ts index d8ad6c952a..71fd0f60e5 100644 --- a/react/features/face-landmarks/actionTypes.js +++ b/react/features/face-landmarks/actionTypes.ts @@ -1,5 +1,3 @@ -// @flow - /** * Redux action type dispatched in order to add a face expression. * @@ -19,7 +17,7 @@ export const ADD_FACE_EXPRESSION = 'ADD_FACE_EXPRESSION'; * faceExpression: string * } */ -export const ADD_TO_FACE_EXPRESSIONS_BUFFER = 'ADD_TO_FACE_EXPRESSIONS_BUFFER '; +export const ADD_TO_FACE_EXPRESSIONS_BUFFER = 'ADD_TO_FACE_EXPRESSIONS_BUFFER'; /** * Redux action type dispatched in order to clear the face expressions buffer in the state. diff --git a/react/features/face-landmarks/middleware.js b/react/features/face-landmarks/middleware.js index a4f21a1393..451afcd40f 100644 --- a/react/features/face-landmarks/middleware.js +++ b/react/features/face-landmarks/middleware.js @@ -1,5 +1,3 @@ -// @flow - import { CONFERENCE_JOINED, CONFERENCE_WILL_LEAVE, diff --git a/react/features/feedback/actionTypes.js b/react/features/feedback/actionTypes.ts similarity index 100% rename from react/features/feedback/actionTypes.js rename to react/features/feedback/actionTypes.ts diff --git a/react/features/filmstrip/actionTypes.js b/react/features/filmstrip/actionTypes.ts similarity index 100% rename from react/features/filmstrip/actionTypes.js rename to react/features/filmstrip/actionTypes.ts diff --git a/react/features/follow-me/actionTypes.js b/react/features/follow-me/actionTypes.ts similarity index 100% rename from react/features/follow-me/actionTypes.js rename to react/features/follow-me/actionTypes.ts diff --git a/react/features/gifs/actionTypes.js b/react/features/gifs/actionTypes.ts similarity index 100% rename from react/features/gifs/actionTypes.js rename to react/features/gifs/actionTypes.ts diff --git a/react/features/google-api/actionTypes.js b/react/features/google-api/actionTypes.ts similarity index 100% rename from react/features/google-api/actionTypes.js rename to react/features/google-api/actionTypes.ts diff --git a/react/features/invite/actionTypes.js b/react/features/invite/actionTypes.ts similarity index 100% rename from react/features/invite/actionTypes.js rename to react/features/invite/actionTypes.ts diff --git a/react/features/jaas/actionTypes.js b/react/features/jaas/actionTypes.ts similarity index 100% rename from react/features/jaas/actionTypes.js rename to react/features/jaas/actionTypes.ts diff --git a/react/features/keyboard-shortcuts/actionTypes.js b/react/features/keyboard-shortcuts/actionTypes.ts similarity index 100% rename from react/features/keyboard-shortcuts/actionTypes.js rename to react/features/keyboard-shortcuts/actionTypes.ts diff --git a/react/features/large-video/actionTypes.js b/react/features/large-video/actionTypes.ts similarity index 100% rename from react/features/large-video/actionTypes.js rename to react/features/large-video/actionTypes.ts diff --git a/react/features/lobby/actionTypes.js b/react/features/lobby/actionTypes.ts similarity index 100% rename from react/features/lobby/actionTypes.js rename to react/features/lobby/actionTypes.ts diff --git a/react/features/local-recording/actionTypes.js b/react/features/local-recording/actionTypes.ts similarity index 100% rename from react/features/local-recording/actionTypes.js rename to react/features/local-recording/actionTypes.ts diff --git a/react/features/mobile/audio-mode/actionTypes.js b/react/features/mobile/audio-mode/actionTypes.ts similarity index 100% rename from react/features/mobile/audio-mode/actionTypes.js rename to react/features/mobile/audio-mode/actionTypes.ts diff --git a/react/features/mobile/background/actionTypes.js b/react/features/mobile/background/actionTypes.ts similarity index 100% rename from react/features/mobile/background/actionTypes.js rename to react/features/mobile/background/actionTypes.ts diff --git a/react/features/mobile/call-integration/actionTypes.js b/react/features/mobile/call-integration/actionTypes.ts similarity index 100% rename from react/features/mobile/call-integration/actionTypes.js rename to react/features/mobile/call-integration/actionTypes.ts diff --git a/react/features/mobile/external-api/actionTypes.js b/react/features/mobile/external-api/actionTypes.ts similarity index 100% rename from react/features/mobile/external-api/actionTypes.js rename to react/features/mobile/external-api/actionTypes.ts diff --git a/react/features/mobile/full-screen/actionTypes.js b/react/features/mobile/full-screen/actionTypes.ts similarity index 100% rename from react/features/mobile/full-screen/actionTypes.js rename to react/features/mobile/full-screen/actionTypes.ts diff --git a/react/features/mobile/picture-in-picture/actionTypes.js b/react/features/mobile/picture-in-picture/actionTypes.ts similarity index 100% rename from react/features/mobile/picture-in-picture/actionTypes.js rename to react/features/mobile/picture-in-picture/actionTypes.ts diff --git a/react/features/mobile/watchos/actionTypes.js b/react/features/mobile/watchos/actionTypes.ts similarity index 100% rename from react/features/mobile/watchos/actionTypes.js rename to react/features/mobile/watchos/actionTypes.ts diff --git a/react/features/no-audio-signal/actionTypes.js b/react/features/no-audio-signal/actionTypes.ts similarity index 100% rename from react/features/no-audio-signal/actionTypes.js rename to react/features/no-audio-signal/actionTypes.ts diff --git a/react/features/noise-detection/actionTypes.js b/react/features/noise-detection/actionTypes.ts similarity index 100% rename from react/features/noise-detection/actionTypes.js rename to react/features/noise-detection/actionTypes.ts diff --git a/react/features/notifications/actionTypes.js b/react/features/notifications/actionTypes.ts similarity index 100% rename from react/features/notifications/actionTypes.js rename to react/features/notifications/actionTypes.ts diff --git a/react/features/overlay/actionTypes.js b/react/features/overlay/actionTypes.ts similarity index 100% rename from react/features/overlay/actionTypes.js rename to react/features/overlay/actionTypes.ts diff --git a/react/features/overlay/components/AbstractPageReloadOverlay.js b/react/features/overlay/components/AbstractPageReloadOverlay.js index fa32f68aca..55084fb865 100644 --- a/react/features/overlay/components/AbstractPageReloadOverlay.js +++ b/react/features/overlay/components/AbstractPageReloadOverlay.js @@ -12,7 +12,7 @@ import { reloadNow } from '../../app/actions'; import { isFatalJitsiConferenceError, isFatalJitsiConnectionError -} from '../../base/lib-jitsi-meet'; +} from '../../base/lib-jitsi-meet/functions'; import logger from '../logger'; import ReloadButton from './web/ReloadButton'; diff --git a/react/features/overlay/middleware.js b/react/features/overlay/middleware.js index 0742899941..7271c42912 100644 --- a/react/features/overlay/middleware.js +++ b/react/features/overlay/middleware.js @@ -1,10 +1,10 @@ // @flow +import { JitsiConferenceErrors } from '../base/lib-jitsi-meet'; import { - JitsiConferenceErrors, isFatalJitsiConferenceError, isFatalJitsiConnectionError -} from '../base/lib-jitsi-meet'; +} from '../base/lib-jitsi-meet/functions'; import { StateListenerRegistry } from '../base/redux'; import { setFatalError } from './actions'; diff --git a/react/features/participants-pane/actionTypes.js b/react/features/participants-pane/actionTypes.ts similarity index 100% rename from react/features/participants-pane/actionTypes.js rename to react/features/participants-pane/actionTypes.ts diff --git a/react/features/polls/actionTypes.js b/react/features/polls/actionTypes.ts similarity index 100% rename from react/features/polls/actionTypes.js rename to react/features/polls/actionTypes.ts diff --git a/react/features/power-monitor/actionTypes.js b/react/features/power-monitor/actionTypes.ts similarity index 100% rename from react/features/power-monitor/actionTypes.js rename to react/features/power-monitor/actionTypes.ts diff --git a/react/features/prejoin/actionTypes.js b/react/features/prejoin/actionTypes.ts similarity index 100% rename from react/features/prejoin/actionTypes.js rename to react/features/prejoin/actionTypes.ts diff --git a/react/features/prejoin/actions.js b/react/features/prejoin/actions.js index 87fd6cb367..3f09c7d5d3 100644 --- a/react/features/prejoin/actions.js +++ b/react/features/prejoin/actions.js @@ -6,7 +6,8 @@ declare var APP: Object; import { v4 as uuidv4 } from 'uuid'; import { getDialOutStatusUrl, getDialOutUrl, updateConfig } from '../base/config'; -import { browser, createLocalTrack } from '../base/lib-jitsi-meet'; +import { browser } from '../base/lib-jitsi-meet'; +import { createLocalTrack } from '../base/lib-jitsi-meet/functions'; import { isVideoMutedByUser, MEDIA_TYPE } from '../base/media'; import { createLocalTracksF, diff --git a/react/features/reactions/actionTypes.js b/react/features/reactions/actionTypes.ts similarity index 100% rename from react/features/reactions/actionTypes.js rename to react/features/reactions/actionTypes.ts diff --git a/react/features/recent-list/actionTypes.js b/react/features/recent-list/actionTypes.ts similarity index 100% rename from react/features/recent-list/actionTypes.js rename to react/features/recent-list/actionTypes.ts diff --git a/react/features/recording/actionTypes.js b/react/features/recording/actionTypes.ts similarity index 100% rename from react/features/recording/actionTypes.js rename to react/features/recording/actionTypes.ts diff --git a/react/features/recording/actions.any.js b/react/features/recording/actions.any.js index cdced9c483..9945dabb57 100644 --- a/react/features/recording/actions.any.js +++ b/react/features/recording/actions.any.js @@ -21,7 +21,12 @@ import { SET_SELECTED_RECORDING_SERVICE, SET_STREAM_KEY } from './actionTypes'; -import { getRecordingLink, getResourceId, isSavingRecordingOnDropbox, sendMeetingHighlight } from './functions'; +import { + getRecordingLink, + getResourceId, + isSavingRecordingOnDropbox, + sendMeetingHighlight +} from './functions'; import logger from './logger'; declare var APP: Object; diff --git a/react/features/remote-control/actionTypes.js b/react/features/remote-control/actionTypes.ts similarity index 100% rename from react/features/remote-control/actionTypes.js rename to react/features/remote-control/actionTypes.ts diff --git a/react/features/rtcstats/middleware.js b/react/features/rtcstats/middleware.js index eb28651ec6..5b1d9196b7 100644 --- a/react/features/rtcstats/middleware.js +++ b/react/features/rtcstats/middleware.js @@ -4,7 +4,7 @@ import { jitsiLocalStorage } from '@jitsi/js-utils'; import { getAmplitudeIdentity } from '../analytics'; import { CONFERENCE_UNIQUE_ID_SET, E2E_RTT_CHANGED, getConferenceOptions, getRoomName } from '../base/conference'; -import { LIB_WILL_INIT } from '../base/lib-jitsi-meet'; +import { LIB_WILL_INIT } from '../base/lib-jitsi-meet/actionTypes'; import { DOMINANT_SPEAKER_CHANGED, getLocalParticipant } from '../base/participants'; import { MiddlewareRegistry } from '../base/redux'; import { ADD_FACE_EXPRESSION } from '../face-landmarks/actionTypes'; diff --git a/react/features/screen-share/actionTypes.js b/react/features/screen-share/actionTypes.ts similarity index 100% rename from react/features/screen-share/actionTypes.js rename to react/features/screen-share/actionTypes.ts diff --git a/react/features/screenshot-capture/actionTypes.js b/react/features/screenshot-capture/actionTypes.ts similarity index 100% rename from react/features/screenshot-capture/actionTypes.js rename to react/features/screenshot-capture/actionTypes.ts diff --git a/react/features/settings/actionTypes.js b/react/features/settings/actionTypes.ts similarity index 100% rename from react/features/settings/actionTypes.js rename to react/features/settings/actionTypes.ts diff --git a/react/features/share-room/actionTypes.js b/react/features/share-room/actionTypes.ts similarity index 100% rename from react/features/share-room/actionTypes.js rename to react/features/share-room/actionTypes.ts diff --git a/react/features/shared-video/actionTypes.js b/react/features/shared-video/actionTypes.ts similarity index 100% rename from react/features/shared-video/actionTypes.js rename to react/features/shared-video/actionTypes.ts diff --git a/react/features/speaker-stats/actionTypes.js b/react/features/speaker-stats/actionTypes.ts similarity index 100% rename from react/features/speaker-stats/actionTypes.js rename to react/features/speaker-stats/actionTypes.ts diff --git a/react/features/subtitles/actionTypes.js b/react/features/subtitles/actionTypes.ts similarity index 100% rename from react/features/subtitles/actionTypes.js rename to react/features/subtitles/actionTypes.ts diff --git a/react/features/talk-while-muted/actionTypes.js b/react/features/talk-while-muted/actionTypes.ts similarity index 100% rename from react/features/talk-while-muted/actionTypes.js rename to react/features/talk-while-muted/actionTypes.ts diff --git a/react/features/toolbox/actionTypes.js b/react/features/toolbox/actionTypes.ts similarity index 100% rename from react/features/toolbox/actionTypes.js rename to react/features/toolbox/actionTypes.ts diff --git a/react/features/transcribing/actionTypes.js b/react/features/transcribing/actionTypes.ts similarity index 100% rename from react/features/transcribing/actionTypes.js rename to react/features/transcribing/actionTypes.ts diff --git a/react/features/transcribing/reducer.js b/react/features/transcribing/reducer.js index 6efa389274..126e51bbd7 100644 --- a/react/features/transcribing/reducer.js +++ b/react/features/transcribing/reducer.js @@ -1,10 +1,12 @@ + import { ReducerRegistry } from '../base/redux'; + import { _TRANSCRIBER_JOINED, _TRANSCRIBER_LEFT, _POTENTIAL_TRANSCRIBER_JOINED, SET_PENDING_TRANSCRIBING_NOTIFICATION_UID -} from '../transcribing/actionTypes'; +} from './actionTypes'; /** * Returns initial state for transcribing feature part of Redux store. diff --git a/react/features/video-layout/actionTypes.js b/react/features/video-layout/actionTypes.ts similarity index 100% rename from react/features/video-layout/actionTypes.js rename to react/features/video-layout/actionTypes.ts diff --git a/react/features/video-layout/middleware.web.js b/react/features/video-layout/middleware.web.js index 11cf9bb229..9179346675 100644 --- a/react/features/video-layout/middleware.web.js +++ b/react/features/video-layout/middleware.web.js @@ -10,7 +10,7 @@ import { } from '../base/participants'; import { MiddlewareRegistry } from '../base/redux'; import { TRACK_ADDED, TRACK_REMOVED, TRACK_STOPPED } from '../base/tracks'; -import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from '../participants-pane/actionTypes.js'; +import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from '../participants-pane/actionTypes'; import './middleware.any'; diff --git a/react/features/video-quality/actionTypes.js b/react/features/video-quality/actionTypes.ts similarity index 100% rename from react/features/video-quality/actionTypes.js rename to react/features/video-quality/actionTypes.ts diff --git a/react/features/videosipgw/actionTypes.js b/react/features/videosipgw/actionTypes.ts similarity index 100% rename from react/features/videosipgw/actionTypes.js rename to react/features/videosipgw/actionTypes.ts diff --git a/react/features/virtual-background/actionTypes.js b/react/features/virtual-background/actionTypes.ts similarity index 100% rename from react/features/virtual-background/actionTypes.js rename to react/features/virtual-background/actionTypes.ts diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..37dd4e257d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "include": ["react/features/**/*.ts"], + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "module": "es6", + "target": "es6", + "jsx": "react", + "lib": [ "ES2020", "DOM" ], + "noEmit": false, + "moduleResolution": "Node", + "strict": true, + "noImplicitAny": true + }, + "exclude": [ + "node_modules" + ] +} diff --git a/webpack.config.js b/webpack.config.js index e12a7c8849..4c538c0d9b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -182,6 +182,10 @@ function getConfig(options = {}) { expandProps: 'start' } } ] + }, { + test: /\.tsx?$/, + exclude: /node_modules/, + loader: 'ts-loader' } ] }, node: { @@ -218,6 +222,10 @@ function getConfig(options = {}) { extensions: [ '.web.js', + // Typescript: + '.tsx', + '.ts', + // Webpack defaults: '.js', '.json'