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: Convert some files to TS (#11929)
Robert Pintilii69365d7e1fb8
diff --git a/package-lock.json b/package-lock.jsonindex c1010e8700..96ebe16dcb 100644--- a/package-lock.json+++ b/package-lock.json@@ -146,9 +146,11 @@"@types/js-md5": "0.4.3","@types/lodash": "4.14.182","@types/react": "17.0.14",- "@types/react-native": "0.67.6",+ "@types/react-native": "0.68.1","@types/react-redux": "7.1.24",+ "@types/unorm": "1.3.28","@types/uuid": "8.3.4",+ "@types/zxcvbn": "4.4.1","@typescript-eslint/eslint-plugin": "5.30.5","@typescript-eslint/parser": "5.30.4","babel-loader": "8.2.3",@@ -5653,9 +5655,9 @@}},"node_modules/@types/react-native": {- "version": "0.67.6",- "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.67.6.tgz",- "integrity": "sha512-NM6atxrefIXMLE/PyQ1bIQjQ/lWLdls3uVxItzKvNUUVZlGqgn/uGN4MarM9quSf90uSqJYPIAeAgTtBTUjhgg==",+ "version": "0.68.1",+ "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.68.1.tgz",+ "integrity": "sha512-S+r6VamWqVutlQ3q/vhTn4b0F/DdZj8R6AIDdgwV9xN9Ln1kRdQd7o3mo7FnfdddVdzEkWMUVlK2sbkFOJFAiQ==","dev": true,"dependencies": {"@types/react": "*"@@ -5725,6 +5727,12 @@"@types/node": "*"}},+ "node_modules/@types/unorm": {+ "version": "1.3.28",+ "resolved": "https://registry.npmjs.org/@types/unorm/-/unorm-1.3.28.tgz",+ "integrity": "sha512-l3uh18vcvkQ964HSK7Tx0YbhxN/Hj+k1w3nLT08n770lngqVKljmF7Ht4e7elFbx6L2WYse97whtpJOo8MHtxQ==",+ "dev": true+ },"node_modules/@types/uuid": {"version": "8.3.4","resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz",@@ -5758,6 +5766,12 @@"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz","integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw=="},+ "node_modules/@types/zxcvbn": {+ "version": "4.4.1",+ "resolved": "https://registry.npmjs.org/@types/zxcvbn/-/zxcvbn-4.4.1.tgz",+ "integrity": "sha512-3NoqvZC2W5gAC5DZbTpCeJ251vGQmgcWIHQJGq2J240HY6ErQ9aWKkwfoKJlHLx+A83WPNTZ9+3cd2ILxbvr1w==",+ "dev": true+ },"node_modules/@typescript-eslint/eslint-plugin": {"version": "5.30.5","resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz",@@ -24977,9 +24991,9 @@}},"@types/react-native": {- "version": "0.67.6",- "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.67.6.tgz",- "integrity": "sha512-NM6atxrefIXMLE/PyQ1bIQjQ/lWLdls3uVxItzKvNUUVZlGqgn/uGN4MarM9quSf90uSqJYPIAeAgTtBTUjhgg==",+ "version": "0.68.1",+ "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.68.1.tgz",+ "integrity": "sha512-S+r6VamWqVutlQ3q/vhTn4b0F/DdZj8R6AIDdgwV9xN9Ln1kRdQd7o3mo7FnfdddVdzEkWMUVlK2sbkFOJFAiQ==","dev": true,"requires": {"@types/react": "*"@@ -25049,6 +25063,12 @@"@types/node": "*"}},+ "@types/unorm": {+ "version": "1.3.28",+ "resolved": "https://registry.npmjs.org/@types/unorm/-/unorm-1.3.28.tgz",+ "integrity": "sha512-l3uh18vcvkQ964HSK7Tx0YbhxN/Hj+k1w3nLT08n770lngqVKljmF7Ht4e7elFbx6L2WYse97whtpJOo8MHtxQ==",+ "dev": true+ },"@types/uuid": {"version": "8.3.4","resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz",@@ -25082,6 +25102,12 @@"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz","integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw=="},+ "@types/zxcvbn": {+ "version": "4.4.1",+ "resolved": "https://registry.npmjs.org/@types/zxcvbn/-/zxcvbn-4.4.1.tgz",+ "integrity": "sha512-3NoqvZC2W5gAC5DZbTpCeJ251vGQmgcWIHQJGq2J240HY6ErQ9aWKkwfoKJlHLx+A83WPNTZ9+3cd2ILxbvr1w==",+ "dev": true+ },"@typescript-eslint/eslint-plugin": {"version": "5.30.5","resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz",diff --git a/package.json b/package.jsonindex b07b4a997e..29544aeaac 100644--- a/package.json+++ b/package.json@@ -151,9 +151,11 @@"@types/js-md5": "0.4.3","@types/lodash": "4.14.182","@types/react": "17.0.14",- "@types/react-native": "0.67.6",+ "@types/react-native": "0.68.1","@types/react-redux": "7.1.24",+ "@types/unorm": "1.3.28","@types/uuid": "8.3.4",+ "@types/zxcvbn": "4.4.1","@typescript-eslint/eslint-plugin": "5.30.5","@typescript-eslint/parser": "5.30.4","babel-loader": "8.2.3",diff --git a/react/features/base/environment/environment.js b/react/features/base/environment/environment.tssimilarity index 90%rename from react/features/base/environment/environment.jsrename to react/features/base/environment/environment.tsindex 3b6a808efc..c1bc092871 100644--- a/react/features/base/environment/environment.js+++ b/react/features/base/environment/environment.ts@@ -1,7 +1,6 @@-// @flow-+// @ts-ignoreimport JitsiMeetJS from '../lib-jitsi-meet';-import Platform from '../react/Platform';+import Platform from '../react/Platform.web';import { isMobileBrowser } from './utils';@@ -15,7 +14,7 @@ const DEFAULT_OPTIMAL_BROWSERS = ['safari'];-const DEFAULT_UNSUPPORTED_BROWSERS = [];+const DEFAULT_UNSUPPORTED_BROWSERS: string[] = [];const browserNameToCheck = {chrome: browser.isChrome.bind(browser),@@ -27,7 +26,8 @@ const browserNameToCheck = {safari: browser.isSafari.bind(browser)};-declare var interfaceConfig: Object;+// eslint-disable-next-line no-var+declare var interfaceConfig: any;/*** Returns whether or not jitsi is optimized and targeted for the provided@@ -117,9 +117,9 @@ export function isSupportedMobileBrowser() {* @private* @returns {boolean}*/-function _isCurrentBrowserInList(list) {+function _isCurrentBrowserInList(list: string[]) {return Boolean(list.find(browserName => {- const checkFunction = browserNameToCheck[browserName];+ const checkFunction = browserNameToCheck[browserName as keyof typeof browserNameToCheck];return checkFunction ? checkFunction.call(browser) : false;}));diff --git a/react/features/base/react/Platform.web.js b/react/features/base/react/Platform.web.tssimilarity index 98%rename from react/features/base/react/Platform.web.jsrename to react/features/base/react/Platform.web.tsindex 127de2e9f7..9a65d2ebb7 100644--- a/react/features/base/react/Platform.web.js+++ b/react/features/base/react/Platform.web.ts@@ -1,5 +1,4 @@-/* @flow */-+// @ts-ignoreconst { userAgent, maxTouchPoints, platform } = navigator;let OS;diff --git a/react/features/base/user-interaction/middleware.js b/react/features/base/user-interaction/middleware.tssimilarity index 81%rename from react/features/base/user-interaction/middleware.jsrename to react/features/base/user-interaction/middleware.tsindex eb56004922..3124b86525 100644--- a/react/features/base/user-interaction/middleware.js+++ b/react/features/base/user-interaction/middleware.ts@@ -1,7 +1,5 @@-// @flow--import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';-import { MiddlewareRegistry } from '../redux';+import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app/actionTypes';+import MiddlewareRegistry from '../redux/MiddlewareRegistry';import { USER_INTERACTION_RECEIVED } from './actionTypes';@@ -11,7 +9,7 @@ import { USER_INTERACTION_RECEIVED } from './actionTypes';** @type {Function|null}*/-let userInteractionListener = null;+let userInteractionListener: Function|null = null;/*** Implements the entry point of the middleware of the feature base/user-interaction.@@ -41,7 +39,7 @@ MiddlewareRegistry.register(store => next => action => {* @private* @returns {void}*/-function _onUserInteractionReceived(dispatch, event) {+function _onUserInteractionReceived(dispatch: Function, event: any) {if (event.isTrusted) {dispatch({type: USER_INTERACTION_RECEIVED@@ -58,12 +56,15 @@ function _onUserInteractionReceived(dispatch, event) {* @private* @returns {void}*/-function _startListeningForUserInteraction({ dispatch }) {+function _startListeningForUserInteraction({ dispatch }: {dispatch: Function}) {_stopListeningForUserInteraction();userInteractionListener = _onUserInteractionReceived.bind(null, dispatch);+ // @ts-ignorewindow.addEventListener('mousedown', userInteractionListener);++ // @ts-ignorewindow.addEventListener('keydown', userInteractionListener);}@@ -74,7 +75,10 @@ function _startListeningForUserInteraction({ dispatch }) {* @returns {void}*/function _stopListeningForUserInteraction() {+ // @ts-ignorewindow.removeEventListener('mousedown', userInteractionListener);++ // @ts-ignorewindow.removeEventListener('keydown', userInteractionListener);userInteractionListener = null;diff --git a/react/features/base/util/downloadJSON.js b/react/features/base/util/downloadJSON.tssimilarity index 98%rename from react/features/base/util/downloadJSON.jsrename to react/features/base/util/downloadJSON.tsindex 8c49569884..d85a101d97 100644--- a/react/features/base/util/downloadJSON.js+++ b/react/features/base/util/downloadJSON.ts@@ -1,5 +1,3 @@-// @flow-/*** Downloads a JSON object.*diff --git a/react/features/base/util/helpers.js b/react/features/base/util/helpers.tssimilarity index 91%rename from react/features/base/util/helpers.jsrename to react/features/base/util/helpers.tsindex a01cd8780b..13838430b0 100644--- a/react/features/base/util/helpers.js+++ b/react/features/base/util/helpers.ts@@ -1,5 +1,3 @@-// @flow-import clipboardCopy from 'clipboard-copy';/**@@ -15,7 +13,7 @@ export function assignIfDefined(target: Object, source: Object) {for (const nextKey in source) {if (source.hasOwnProperty(nextKey)) {- const value = source[nextKey];+ const value = source[nextKey as keyof typeof source];if (typeof value !== 'undefined') {to[nextKey] = value;@@ -49,7 +47,7 @@ export async function copyText(textToCopy: string) {* @returns {{promise, resolve, reject}}*/export function createDeferred(): Object {- const deferred = {};+ const deferred: any = {};deferred.promise = new Promise((resolve, reject) => {deferred.resolve = resolve;@@ -83,7 +81,7 @@ export function escapeRegexp(s: string) {* @param {Object} w - Window object to use instead of the built in one.* @returns {string}*/-export function getBaseUrl(w: Object = window) {+export function getBaseUrl(w: Window = window) {const doc = w.document;const base = doc.querySelector('base');@@ -104,14 +102,19 @@ export function getBaseUrl(w: Object = window) {* NOTE: After React-ifying everything this should be the only global.*/export function getJitsiMeetGlobalNS() {+ // @ts-ignoreif (!window.JitsiMeetJS) {+ // @ts-ignorewindow.JitsiMeetJS = {};}+ // @ts-ignoreif (!window.JitsiMeetJS.app) {+ // @ts-ignorewindow.JitsiMeetJS.app = {};}+ // @ts-ignorereturn window.JitsiMeetJS.app;}@@ -122,9 +125,9 @@ export function getJitsiMeetGlobalNS() {* @param {string} msg - A custom message to print in addition to the error.* @returns {void}*/-export function reportError(e: Object, msg: string = '') {+export function reportError(e: Error, msg = '') {console.error(msg, e);- window.onerror && window.onerror(msg, null, null, null, e);+ window.onerror && window.onerror(msg, undefined, undefined, undefined, e);}/**@@ -168,7 +171,7 @@ export function setColorAlpha(color: string, opacity: number) {* @param {string} color -* @returns {Array<number>} - Array containing parsed r, g, b values of the color.*/-function parseShorthandColor(color) {+function parseShorthandColor(color: string) {let b, g, r;r = color.substring(1, 2);diff --git a/react/features/base/util/hooks.js b/react/features/base/util/hooks.tssimilarity index 97%rename from react/features/base/util/hooks.jsrename to react/features/base/util/hooks.tsindex c5a1dd77ea..921bc88f78 100644--- a/react/features/base/util/hooks.js+++ b/react/features/base/util/hooks.ts@@ -1,4 +1,3 @@-// @flowimport { useSelector } from 'react-redux';/**diff --git a/react/features/base/util/httpUtils.js b/react/features/base/util/httpUtils.tssimilarity index 94%rename from react/features/base/util/httpUtils.jsrename to react/features/base/util/httpUtils.tsindex 5692d3d364..94b7c176b7 100644--- a/react/features/base/util/httpUtils.js+++ b/react/features/base/util/httpUtils.ts@@ -17,7 +17,7 @@ const RETRY_TIMEOUT = 3000;* @returns {Promise<Object>} The response body, in JSON format, will be* through the Promise.*/-export function doGetJSON(url, retry, options) {+export function doGetJSON(url: string, retry?: boolean, options?: Object) {const fetchPromise = fetch(url, options).then(response => {const jsonify = response.json();diff --git a/react/features/base/util/isInsecureRoomName.js b/react/features/base/util/isInsecureRoomName.tssimilarity index 85%rename from react/features/base/util/isInsecureRoomName.jsrename to react/features/base/util/isInsecureRoomName.tsindex c6edec7341..b73a39865e 100644--- a/react/features/base/util/isInsecureRoomName.js+++ b/react/features/base/util/isInsecureRoomName.ts@@ -1,5 +1,3 @@-// @flow-import _ from 'lodash';import { NIL, parse as parseUUID } from 'uuid';import zxcvbn from 'zxcvbn';@@ -13,7 +11,7 @@ const NIL_UUID = parseUUID(NIL);* @param {string} str - The string to be checked.* @returns {boolean} - Whether the string is a valid UUID or not.*/-function isValidUUID(str) {+function isValidUUID(str: string) {let uuid;try {@@ -31,6 +29,6 @@ function isValidUUID(str) {* @param {string} roomName - The room name.* @returns {boolean}*/-export default function isInsecureRoomName(roomName: string = ''): boolean {+export default function isInsecureRoomName(roomName = ''): boolean {return !isValidUUID(roomName) && zxcvbn(roomName).score < 3;}diff --git a/react/features/base/util/loadScript.native.js b/react/features/base/util/loadScript.native.tssimilarity index 97%rename from react/features/base/util/loadScript.native.jsrename to react/features/base/util/loadScript.native.tsindex 63aa193a1e..46d4d4c57e 100644--- a/react/features/base/util/loadScript.native.js+++ b/react/features/base/util/loadScript.native.ts@@ -1,5 +1,3 @@-// @flow-/*** Default timeout for loading scripts.*/@@ -20,7 +18,7 @@ const DEFAULT_TIMEOUT = 5000;* @returns {void}*/export async function loadScript(- url: string, timeout: number = DEFAULT_TIMEOUT, skipEval: boolean = false): Promise<any> {+ url: string, timeout: number = DEFAULT_TIMEOUT, skipEval = false): Promise<any> {// XXX The implementation of fetch on Android will throw an Exception on// the Java side which will break the app if the URL is invalid (which// the implementation of fetch on Android calls 'unexpected url'). Indiff --git a/react/features/base/util/loadScript.web.js b/react/features/base/util/loadScript.web.tssimilarity index 90%rename from react/features/base/util/loadScript.web.jsrename to react/features/base/util/loadScript.web.tsindex f03a9d77ad..2f5f92e255 100644--- a/react/features/base/util/loadScript.web.js+++ b/react/features/base/util/loadScript.web.ts@@ -1,6 +1,5 @@-// @flow--declare var JitsiMeetJS: Object;+// eslint-disable-next-line no-var+declare var JitsiMeetJS: any;/*** Loads a script from a specific URL. The script will be interpreted upon load.diff --git a/react/features/base/util/openURLInBrowser.native.js b/react/features/base/util/openURLInBrowser.native.tssimilarity index 96%rename from react/features/base/util/openURLInBrowser.native.jsrename to react/features/base/util/openURLInBrowser.native.tsindex de12b5fbbd..775322078a 100644--- a/react/features/base/util/openURLInBrowser.native.js+++ b/react/features/base/util/openURLInBrowser.native.ts@@ -1,7 +1,6 @@-// @flow-import { Linking } from 'react-native';+// @ts-ignoreimport logger from './logger';/**diff --git a/react/features/base/util/openURLInBrowser.web.js b/react/features/base/util/openURLInBrowser.web.tssimilarity index 97%rename from react/features/base/util/openURLInBrowser.web.jsrename to react/features/base/util/openURLInBrowser.web.tsindex c1572ad13d..4f4e301357 100644--- a/react/features/base/util/openURLInBrowser.web.js+++ b/react/features/base/util/openURLInBrowser.web.ts@@ -1,5 +1,3 @@-// @flow-/*** Opens URL in the browser.*diff --git a/react/features/base/util/parseURLParams.js b/react/features/base/util/parseURLParams.tssimilarity index 93%rename from react/features/base/util/parseURLParams.jsrename to react/features/base/util/parseURLParams.tsindex 11494e4056..e67bc22192 100644--- a/react/features/base/util/parseURLParams.js+++ b/react/features/base/util/parseURLParams.ts@@ -1,5 +1,4 @@-/* @flow */-+// @ts-ignoreimport Bourne from '@hapi/bourne';import { reportError } from './helpers';@@ -24,14 +23,14 @@ const blacklist = [ '__proto__', 'constructor', 'prototype' ];*/export function parseURLParams(url: URL | string,- dontParse: boolean = false,- source: string = 'hash'): Object {+ dontParse = false,+ source = 'hash'): Object {if (typeof url === 'string') {// eslint-disable-next-line no-param-reassignurl = new URL(url);}const paramStr = source === 'search' ? url.search : url.hash;- const params = {};+ const params: any = {};const paramParts = (paramStr && paramStr.substr(1).split('&')) || [];// Detect and ignore hash params for hash routers.@@ -61,7 +60,7 @@ export function parseURLParams(value = decoded === 'undefined' ? undefined : Bourne.parse(decoded);}- } catch (e) {+ } catch (e: any) {reportError(e, `Failed to parse URL parameter value: ${String(value)}`);diff --git a/react/features/base/util/react-focus-lock-wrapper.js b/react/features/base/util/react-focus-lock-wrapper.jsindex f55b6c18e7..f71733fc8d 100644--- a/react/features/base/util/react-focus-lock-wrapper.js+++ b/react/features/base/util/react-focus-lock-wrapper.js@@ -10,7 +10,7 @@ import FocusLock, { MoveFocusInside } from 'react-focus-lock';* @param {Object} props - The props passed to the FocusLock.* @returns {ReactElement}*/-export default (props: Object) => {+export default (props: any) => {const { children, ...otherProps } = props;const forwardProps = {diff --git a/react/features/base/util/strings.native.js b/react/features/base/util/strings.native.tssimilarity index 98%rename from react/features/base/util/strings.native.jsrename to react/features/base/util/strings.native.tsindex f7595dab8c..619a36b38f 100644--- a/react/features/base/util/strings.native.js+++ b/react/features/base/util/strings.native.ts@@ -1,5 +1,3 @@-// @flow-import * as unorm from 'unorm';/**diff --git a/react/features/base/util/strings.web.js b/react/features/base/util/strings.web.tssimilarity index 98%rename from react/features/base/util/strings.web.jsrename to react/features/base/util/strings.web.tsindex 5113c33d41..3bf703627e 100644--- a/react/features/base/util/strings.web.js+++ b/react/features/base/util/strings.web.ts@@ -1,5 +1,3 @@-// @flow-/*** Applies NFKC normalization to the given text.*diff --git a/react/features/base/util/timeoutPromise.js b/react/features/base/util/timeoutPromise.tssimilarity index 99%rename from react/features/base/util/timeoutPromise.jsrename to react/features/base/util/timeoutPromise.tsindex 0124529321..7164b0176e 100644--- a/react/features/base/util/timeoutPromise.js+++ b/react/features/base/util/timeoutPromise.ts@@ -1,5 +1,3 @@-// @flow-/*** Returns a new {@code Promise} which settles when a specific {@code Promise}* settles and is automatically rejected if the specified {@code Promise}diff --git a/react/features/base/util/uri.js b/react/features/base/util/uri.tssimilarity index 94%rename from react/features/base/util/uri.jsrename to react/features/base/util/uri.tsindex 8cafc59ee3..a0c3403e1a 100644--- a/react/features/base/util/uri.js+++ b/react/features/base/util/uri.ts@@ -1,6 +1,6 @@-// @flow-import { parseURLParams } from './parseURLParams';+// eslint-disable-next-line lines-around-comment+// @ts-ignoreimport { normalizeNFKC } from './strings';/**@@ -53,7 +53,7 @@ export const URI_PROTOCOL_PATTERN = '^([a-z][a-z0-9\\.\\+-]*:)';* @private* @returns {?string}*/-function _fixPathPart(pathPart: ?string) {+function _fixPathPart(pathPart?: string) {return pathPart? pathPart.replace(new RegExp(_ROOM_EXCLUDE_PATTERN, 'g'), ''): pathPart;@@ -107,7 +107,7 @@ function _fixURIStringScheme(uri: string) {* @param {string?} path - The path to convert.* @returns {string?}*/-export function getBackendSafePath(path: ?string): ?string {+export function getBackendSafePath(path?: string): string|undefined {if (!path) {return path;}@@ -124,7 +124,7 @@ export function getBackendSafePath(path: ?string): ?string {* @param {string?} room - The room name to convert.* @returns {string?}*/-export function getBackendSafeRoomName(room: ?string): ?string {+export function getBackendSafeRoomName(room?: string): string|undefined {if (!room) {return room;}@@ -146,10 +146,10 @@ export function getBackendSafeRoomName(room: ?string): ?string {room = normalizeNFKC(room);// Only decoded and normalized strings can be lowercased properly.- room = room.toLowerCase();+ room = room?.toLowerCase();// But we still need to (re)encode it.- room = encodeURIComponent(room);+ room = encodeURIComponent(room ?? '');/* eslint-enable no-param-reassign */// Unfortunately we still need to lowercase it, because encoding a string will@@ -192,7 +192,7 @@ function _objectToURLParamsArray(obj = {}) {for (const key in obj) { // eslint-disable-line guard-for-intry {params.push(- `${key}=${encodeURIComponent(JSON.stringify(obj[key]))}`);+ `${key}=${encodeURIComponent(JSON.stringify(obj[key as keyof typeof obj]))}`);} catch (e) {console.warn(`Error encoding ${key}: ${e}`);}@@ -221,7 +221,7 @@ function _objectToURLParamsArray(obj = {}) {export function parseStandardURIString(str: string) {/* eslint-disable no-param-reassign */- const obj: Object = {+ const obj: {[key: string]: any} = {toString: _standardURIToString};@@ -258,6 +258,7 @@ export function parseStandardURIString(str: string) {authority = authority.substring(userinfoEndIndex + 1);}+ // @ts-ignoreobj.host = authority;// port@@ -276,7 +277,7 @@ export function parseStandardURIString(str: string) {regex = new RegExp(`^${_URI_PATH_PATTERN}`, 'gi');match = regex.exec(str);- let pathname: ?string;+ let pathname: string|undefined;if (match) {pathname = match[1];@@ -329,7 +330,7 @@ export function parseStandardURIString(str: string) {* search: string* }}*/-export function parseURIString(uri: ?string) {+export function parseURIString(uri?: string) {if (typeof uri !== 'string') {return undefined;}@@ -338,13 +339,14 @@ export function parseURIString(uri: ?string) {// XXX While the components/segments of pathname are URI encoded, Jitsi Meet// on the client and/or server sides still don't support certain characters.- obj.pathname = obj.pathname.split('/').map(pathPart => _fixPathPart(pathPart))+ obj.pathname = obj.pathname.split('/').map((pathPart: any) => _fixPathPart(pathPart)).join('/');// Add the properties that are specific to a Jitsi Meet resource (location)// such as contextRoot, room:// contextRoot+ // @ts-ignoreobj.contextRoot = getLocationContextRoot(obj);// The room (name) is the last component/segment of pathname.@@ -371,7 +373,8 @@ export function parseURIString(uri: ?string) {* function is invoked on such an instance.* @returns {string}*/-function _standardURIToString(thiz: ?Object) {+function _standardURIToString(thiz?: Object) {+ // @ts-ignore// eslint-disable-next-line no-invalid-thisconst { hash, host, pathname, protocol, search } = thiz || this;let str = '';@@ -418,7 +421,7 @@ export function safeDecodeURIComponent(text: string) {* @returns {string} - A {@code String} representation of the specified* {@code obj} which is supposed to represent a URL.*/-export function toURLString(obj: ?(Object | string)): ?string {+export function toURLString(obj?: (Object | string)): string|undefined|null {let str;switch (typeof obj) {@@ -449,7 +452,7 @@ export function toURLString(obj: ?(Object | string)): ?string {* @returns {string} - A {@code String} representation of the specified* {@code Object}.*/-export function urlObjectToString(o: Object): ?string {+export function urlObjectToString(o: {[key: string]: any}): string|undefined {// First normalize the given url. It come as o.url or split into o.serverURL// and o.room.let tmp;@@ -466,7 +469,7 @@ export function urlObjectToString(o: Object): ?string {// protocolif (!url.protocol) {- let protocol: ?string = o.protocol || o.scheme;+ let protocol: string|undefined = o.protocol || o.scheme;if (protocol) {// Protocol is supposed to be the scheme and the final ':'. Anyway,@@ -484,7 +487,7 @@ export function urlObjectToString(o: Object): ?string {//// It may be host/hostname and pathname with the latter denoting the// tenant.- const domain: ?string = o.domain || o.host || o.hostname;+ const domain: string|undefined = o.domain || o.host || o.hostname;if (domain) {const { host, hostname, pathname: contextRoot, port }