mattermost-desktop/api-types/lib/index.d.ts
aaron 057377207a
Some checks failed
release / begin-notification (push) Has been cancelled
release / build-linux (push) Has been cancelled
release / build-msi-installer (push) Has been cancelled
release / build-mac-installer (push) Has been cancelled
release / upload-to-s3 (push) Has been cancelled
release / github-release (push) Has been cancelled
release / end-notification (push) Has been cancelled
first commit bois
2024-10-03 06:35:14 -07:00

70 lines
2.9 KiB
TypeScript

export type DesktopSourcesOptions = {
types: Array<'screen' | 'window'>;
thumbnailSize?: {
height: number;
width: number;
};
fetchWindowIcons?: boolean;
};
export type DesktopCaptureSource = {
id: string;
name: string;
thumbnailURL: string;
};
export type DesktopAPI = {
isDev: () => Promise<boolean>;
getAppInfo: () => Promise<{
name: string;
version: string;
}>;
reactAppInitialized: () => void;
setSessionExpired: (isExpired: boolean) => void;
onUserActivityUpdate: (listener: (userIsActive: boolean, idleTime: number, isSystemEvent: boolean) => void) => () => void;
onLogin: () => void;
onLogout: () => void;
sendNotification: (title: string, body: string, channelId: string, teamId: string, url: string, silent: boolean, soundName: string) => Promise<{
status: string;
reason?: string;
data?: string;
}>;
onNotificationClicked: (listener: (channelId: string, teamId: string, url: string) => void) => () => void;
setUnreadsAndMentions: (isUnread: boolean, mentionCount: number) => void;
requestBrowserHistoryStatus: () => Promise<{
canGoBack: boolean;
canGoForward: boolean;
}>;
onBrowserHistoryStatusUpdated: (listener: (canGoBack: boolean, canGoForward: boolean) => void) => () => void;
onBrowserHistoryPush: (listener: (pathName: string) => void) => () => void;
sendBrowserHistoryPush: (path: string) => void;
joinCall: (opts: {
callID: string;
title: string;
rootID: string;
channelURL: string;
}) => Promise<{
callID: string;
sessionID: string;
}>;
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;
openThreadForCalls: (threadID: string) => void;
onOpenThreadForCalls: (listener: (threadID: string) => void) => () => void;
openStopRecordingModal: (channelID: string) => void;
onOpenStopRecordingModal: (listener: (channelID: string) => void) => () => void;
openCallsUserSettings: () => void;
onOpenCallsUserSettings: (listener: () => void) => () => void;
unregister: (channel: string) => void;
};