|
@@ -5,6 +5,7 @@ import { connect } from 'react-redux';
|
5
|
5
|
import { IStore } from '../../app/types';
|
6
|
6
|
import { hideDialog } from '../../base/dialog/actions';
|
7
|
7
|
import { translate } from '../../base/i18n/functions';
|
|
8
|
+import { DesktopSharingSourceType } from '../../base/tracks/types';
|
8
|
9
|
import Dialog from '../../base/ui/components/web/Dialog';
|
9
|
10
|
import Tabs from '../../base/ui/components/web/Tabs';
|
10
|
11
|
import { THUMBNAIL_SIZE } from '../constants';
|
|
@@ -32,7 +33,7 @@ const TAB_LABELS = {
|
32
|
33
|
window: 'dialog.applicationWindow'
|
33
|
34
|
};
|
34
|
35
|
|
35
|
|
-const VALID_TYPES = Object.keys(TAB_LABELS);
|
|
36
|
+const VALID_TYPES = Object.keys(TAB_LABELS) as DesktopSharingSourceType[];
|
36
|
37
|
|
37
|
38
|
/**
|
38
|
39
|
* The type of the React {@code Component} props of {@link DesktopPicker}.
|
|
@@ -42,7 +43,7 @@ interface IProps extends WithTranslation {
|
42
|
43
|
/**
|
43
|
44
|
* An array with desktop sharing sources to be displayed.
|
44
|
45
|
*/
|
45
|
|
- desktopSharingSources: Array<string>;
|
|
46
|
+ desktopSharingSources: Array<DesktopSharingSourceType>;
|
46
|
47
|
|
47
|
48
|
/**
|
48
|
49
|
* Used to request DesktopCapturerSources.
|
|
@@ -84,7 +85,7 @@ interface IState {
|
84
|
85
|
/**
|
85
|
86
|
* The desktop source types to fetch previews for.
|
86
|
87
|
*/
|
87
|
|
- types: Array<string>;
|
|
88
|
+ types: Array<DesktopSharingSourceType>;
|
88
|
89
|
}
|
89
|
90
|
|
90
|
91
|
|
|
@@ -112,7 +113,7 @@ class DesktopPicker extends PureComponent<IProps, IState> {
|
112
|
113
|
* @private
|
113
|
114
|
* @returns {Array<string>} The filtered types.
|
114
|
115
|
*/
|
115
|
|
- static _getValidTypes(types: string[] = []) {
|
|
116
|
+ static _getValidTypes(types: DesktopSharingSourceType[] = []) {
|
116
|
117
|
return types.filter(
|
117
|
118
|
type => VALID_TYPES.includes(type));
|
118
|
119
|
}
|
|
@@ -346,10 +347,10 @@ class DesktopPicker extends PureComponent<IProps, IState> {
|
346
|
347
|
= types.map(
|
347
|
348
|
type => {
|
348
|
349
|
return {
|
349
|
|
- accessibilityLabel: t(TAB_LABELS[type as keyof typeof TAB_LABELS]),
|
|
350
|
+ accessibilityLabel: t(TAB_LABELS[type]),
|
350
|
351
|
id: `${type}`,
|
351
|
352
|
controlsId: `${type}-panel`,
|
352
|
|
- label: t(TAB_LABELS[type as keyof typeof TAB_LABELS])
|
|
353
|
+ label: t(TAB_LABELS[type])
|
353
|
354
|
};
|
354
|
355
|
});
|
355
|
356
|
|