Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ui-commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { actionsBar } from './actions-bar/commands';
import { layout } from './layout/commands';
import { navBar } from './nav-bar/commands';
import { sidekickArea } from './sidekick-area/commands';
import { dialogs } from './dialogs/commands';
import { UiCommands } from './types';

export const uiCommands: UiCommands = {
Expand All @@ -25,4 +26,5 @@ export const uiCommands: UiCommands = {
conference,
notification,
layout,
dialogs,
};
25 changes: 25 additions & 0 deletions src/ui-commands/dialogs/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { DialogsEnum } from './enums';
import { SetHideDialogsCommandArguments } from './types';

export const dialogs = {
/**
* Sets whether to hide dialogs or not (Both audio and video preview dialogs).
*
* @param setHideDialogsCommandArguments whether to hide dialogs or not.
* Refer to {@link SetHideDialogsCommandArguments} to understand the argument structure.
*/
setHideDialogs: (
setHideDialogsCommandArguments: SetHideDialogsCommandArguments,
) => {
const { hidden } = setHideDialogsCommandArguments;
window.dispatchEvent(
new CustomEvent<
SetHideDialogsCommandArguments
>(DialogsEnum.SET_HIDE_DIALOGS, {
detail: {
hidden,
},
}),
);
},
};
3 changes: 3 additions & 0 deletions src/ui-commands/dialogs/enums.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export enum DialogsEnum {
SET_HIDE_DIALOGS = 'SET_HIDE_DIALOGS_COMMAND',
}
9 changes: 9 additions & 0 deletions src/ui-commands/dialogs/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface SetHideDialogsCommandArguments {
hidden: boolean;
}

export interface UiCommandsDialogsObject {
setHideDialogs: (
setHideDialogsCommandArguments: SetHideDialogsCommandArguments
) => void;
}
2 changes: 2 additions & 0 deletions src/ui-commands/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { UiCommandsLayoutObject } from './layout/types';
import { UiCommandsNavBarObject } from './nav-bar/types';
import { UiCommandsCameraObject } from './camera/types';
import { UiCommandsSidekickArea } from './sidekick-area/types';
import { UiCommandsDialogsObject } from './dialogs/types';

export interface UiCommands {
layout: UiCommandsLayoutObject;
Expand All @@ -24,4 +25,5 @@ export interface UiCommands {
userStatus: UiCommandsUserStatusObject;
conference: UiCommandsConferenceObject;
notification: UiCommandsNotificationObject;
dialogs: UiCommandsDialogsObject;
}