Skip to content
Snippets Groups Projects
Unverified Commit 54e8f3c9 authored by Michael Telatynski's avatar Michael Telatynski Committed by GitHub
Browse files

Simplify global types (#4831)

parent 1fcc375d
No related branches found
No related tags found
No related merge requests found
......@@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// this is needed to tell TS about globalThis.Olm
import "@matrix-org/olm";
export {};
declare global {
......@@ -34,39 +31,18 @@ declare global {
}
}
interface MediaDevices {
// This is experimental and types don't know about it yet
// https://github.com/microsoft/TypeScript/issues/33232
getDisplayMedia(constraints: MediaStreamConstraints | DesktopCapturerConstraints): Promise<MediaStream>;
getUserMedia(constraints: MediaStreamConstraints | DesktopCapturerConstraints): Promise<MediaStream>;
}
interface DesktopCapturerConstraints {
audio:
| boolean
| {
mandatory: {
// Chrome-specific getUserMedia constraints
interface MediaTrackConstraints {
mandatory?: {
chromeMediaSource: string;
chromeMediaSourceId: string;
};
};
video:
| boolean
| {
mandatory: {
chromeMediaSource: string;
chromeMediaSourceId: string;
};
};
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DummyInterfaceWeShouldntBeUsingThis {}
interface Navigator {
// We check for the webkit-prefixed getUserMedia to detect if we're
// on webkit: we should check if we still need to do this
webkitGetUserMedia?: DummyInterfaceWeShouldntBeUsingThis;
webkitGetUserMedia?: unknown;
}
export interface Uint8ArrayToBase64Options {
......
......@@ -462,7 +462,7 @@ export class MediaHandler extends TypedEventEmitter<
};
}
private getScreenshareContraints(opts: IScreensharingOpts): DesktopCapturerConstraints {
private getScreenshareContraints(opts: IScreensharingOpts): MediaStreamConstraints {
const { desktopCapturerSourceId, audio } = opts;
if (desktopCapturerSourceId) {
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment