2020-12-09 18:45:11 +01:00
|
|
|
import {Registry} from "tc-shared/events";
|
|
|
|
import {PrivateConversationUIEvents} from "tc-shared/ui/frames/side/PrivateConversationDefinitions";
|
|
|
|
import {ClientInfoEvents} from "tc-shared/ui/frames/side/ClientInfoDefinitions";
|
2020-12-09 20:44:33 +01:00
|
|
|
import {SideHeaderEvents} from "tc-shared/ui/frames/side/HeaderDefinitions";
|
2020-12-18 17:06:38 +01:00
|
|
|
import {ChannelBarUiEvents} from "tc-shared/ui/frames/side/ChannelBarDefinitions";
|
2020-12-29 16:53:04 +01:00
|
|
|
import {MusicBotUiEvents} from "tc-shared/ui/frames/side/MusicBotDefinitions";
|
|
|
|
import {MusicPlaylistUiEvents} from "tc-shared/ui/frames/side/MusicPlaylistDefinitions";
|
2021-01-05 16:26:26 +01:00
|
|
|
import {ChannelConversationUiEvents} from "tc-shared/ui/frames/side/ChannelConversationDefinitions";
|
2020-12-09 18:45:11 +01:00
|
|
|
|
|
|
|
/* TODO: Somehow outsource the event registries to IPC? */
|
|
|
|
|
2021-01-05 16:26:26 +01:00
|
|
|
export type SideBarType = "none" | "server" | "channel" | "private-chat" | "client-info" | "music-manage";
|
2020-12-09 18:45:11 +01:00
|
|
|
export interface SideBarTypeData {
|
|
|
|
"none": {},
|
2020-12-18 17:06:38 +01:00
|
|
|
"channel": {
|
|
|
|
events: Registry<ChannelBarUiEvents>
|
2020-12-09 18:45:11 +01:00
|
|
|
},
|
|
|
|
"private-chat": {
|
|
|
|
events: Registry<PrivateConversationUIEvents>,
|
|
|
|
handlerId: string
|
|
|
|
},
|
|
|
|
"client-info": {
|
|
|
|
events: Registry<ClientInfoEvents>,
|
|
|
|
},
|
|
|
|
"music-manage": {
|
2020-12-29 16:53:04 +01:00
|
|
|
botEvents: Registry<MusicBotUiEvents>,
|
|
|
|
playlistEvents: Registry<MusicPlaylistUiEvents>
|
2021-01-05 16:26:26 +01:00
|
|
|
},
|
|
|
|
"server": {
|
|
|
|
handlerId: string,
|
|
|
|
chatEvents: Registry<ChannelConversationUiEvents>
|
2020-12-09 18:45:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SideBarNotifyContentData<T extends SideBarType> = {
|
|
|
|
content: T,
|
|
|
|
data: SideBarTypeData[T]
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SideBarEvents {
|
|
|
|
query_content: {},
|
|
|
|
query_content_data: { content: SideBarType },
|
2020-12-09 20:44:33 +01:00
|
|
|
query_header_data: {},
|
2020-12-09 18:45:11 +01:00
|
|
|
|
|
|
|
notify_content: { content: SideBarType },
|
2020-12-09 20:44:33 +01:00
|
|
|
notify_content_data: SideBarNotifyContentData<SideBarType>,
|
|
|
|
notify_header_data: { events: Registry<SideHeaderEvents> }
|
2020-12-09 18:45:11 +01:00
|
|
|
}
|