TeaWeb/shared/js/events/GlobalEvents.ts

61 lines
1.7 KiB
TypeScript
Raw Normal View History

import {ConnectionHandler} from "../ConnectionHandler";
import {Registry} from "../events";
import {VideoBroadcastType} from "tc-shared/connection/VideoConnection";
2020-04-06 14:29:40 +00:00
export type PermissionEditorTab = "groups-server" | "groups-channel" | "channel" | "client" | "client-channel";
2020-04-06 14:29:40 +00:00
export interface ClientGlobalControlEvents {
/* open a basic window */
2020-04-06 14:29:40 +00:00
action_open_window: {
window:
2020-09-07 10:42:00 +00:00
"settings" | /* use action_open_window_settings! */
"about" |
2020-09-17 21:06:02 +00:00
"settings-registry" |
"css-variable-editor" |
"bookmark-manage" |
"query-manage" |
"query-create" |
"ban-list" |
"permissions" |
"token-list" |
2020-11-28 14:41:44 +00:00
"token-use" |
"server-echo-test",
2020-04-06 14:29:40 +00:00
connection?: ConnectionHandler
},
2020-08-08 13:20:32 +00:00
action_w2g: {
following: number,
handlerId: string
} | {
videoUrl: string,
handlerId: string
},
/* Start/open a new video broadcast */
action_toggle_video_broadcasting: {
connection: ConnectionHandler,
broadcastType: VideoBroadcastType,
enabled: boolean,
quickSelect?: boolean,
defaultDevice?: string
},
/* Open the broadcast edit window */
action_edit_video_broadcasting: {
connection: ConnectionHandler,
broadcastType: VideoBroadcastType,
},
2020-08-08 13:20:32 +00:00
/* some more specific window openings */
action_open_window_connect: {
2020-09-07 10:42:00 +00:00
newTab: boolean
},
2020-09-07 10:42:00 +00:00
action_open_window_settings: {
defaultCategory?: string
},
action_open_window_permissions: {
connection?: ConnectionHandler,
defaultTab: PermissionEditorTab
2020-04-06 14:29:40 +00:00
}
}
export const global_client_actions = new Registry<ClientGlobalControlEvents>();