[MM-55503] Update Calls Desktop API (#2937)

* Update Calls Desktop API

* Update tests

* Handle Calls links internally

---------

Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
This commit is contained in:
Claudio Costa
2024-01-24 09:54:19 -06:00
committed by GitHub
parent 37829f11d2
commit 1613eb17bc
7 changed files with 146 additions and 72 deletions

View File

@@ -1,3 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export declare type DesktopSourcesOptions = {
types: Array<'screen' | 'window'>;
thumbnailSize?: {
@@ -30,18 +32,6 @@ export declare type DesktopAPI = {
onBrowserHistoryStatusUpdated: (listener: (canGoBack: boolean, canGoForward: boolean) => void) => () => void;
onBrowserHistoryPush: (listener: (pathName: string) => void) => () => void;
sendBrowserHistoryPush: (path: string) => void;
openLinkFromCallsWidget: (url: string) => void;
openScreenShareModal: () => void;
onScreenShared: (listener: (sourceID: string, withAudio: boolean) => void) => () => void;
callsWidgetConnected: (callID: string, sessionID: string) => void;
onJoinCallRequest: (listener: (callID: string) => void) => () => void;
resizeCallsWidget: (width: number, height: number) => void;
focusPopout: () => void;
leaveCall: () => void;
sendCallsError: (err: string, callID?: string, errMsg?: string) => void;
getDesktopSources: (opts: DesktopSourcesOptions) => Promise<DesktopCaptureSource[]>;
onOpenScreenShareModal: (listener: () => void) => () => void;
shareScreen: (sourceID: string, withAudi: boolean) => void;
joinCall: (opts: {
callID: string;
title: string;
@@ -51,7 +41,19 @@ export declare type DesktopAPI = {
callID: string;
sessionID: string;
}>;
sendJoinCallRequest: (callId: string) => void;
leaveCall: () => void;
callsWidgetConnected: (callID: string, sessionID: string) => void;
resizeCallsWidget: (width: number, height: number) => void;
sendCallsError: (err: string, callID?: string, errMsg?: string) => void;
onCallsError: (listener: (err: string, callID?: string, errMsg?: string) => void) => () => void;
getDesktopSources: (opts: DesktopSourcesOptions) => Promise<DesktopCaptureSource[]>;
openScreenShareModal: () => void;
onOpenScreenShareModal: (listener: () => void) => () => void;
shareScreen: (sourceID: string, withAudio: boolean) => void;
onScreenShared: (listener: (sourceID: string, withAudio: boolean) => void) => () => void;
sendJoinCallRequest: (callId: string) => void;
onJoinCallRequest: (listener: (callID: string) => void) => () => void;
openLinkFromCalls: (url: string) => void;
focusPopout: () => void;
unregister: (channel: string) => void;
};