2020-12-09 18:45:11 +01:00
|
|
|
import {Registry} from "tc-shared/events";
|
|
|
|
import {PrivateConversationUIEvents} from "tc-shared/ui/frames/side/PrivateConversationDefinitions";
|
2020-12-09 20:44:33 +01:00
|
|
|
import {AbstractConversationUiEvents} from "./side/AbstractConversationDefinitions";
|
2020-12-09 18:45:11 +01:00
|
|
|
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-09 18:45:11 +01:00
|
|
|
|
|
|
|
/* TODO: Somehow outsource the event registries to IPC? */
|
|
|
|
|
|
|
|
export type SideBarType = "none" | "channel-chat" | "private-chat" | "client-info" | "music-manage";
|
|
|
|
export interface SideBarTypeData {
|
|
|
|
"none": {},
|
|
|
|
"channel-chat": {
|
2020-12-09 20:44:33 +01:00
|
|
|
events: Registry<AbstractConversationUiEvents>,
|
2020-12-09 18:45:11 +01:00
|
|
|
handlerId: string
|
|
|
|
},
|
|
|
|
"private-chat": {
|
|
|
|
events: Registry<PrivateConversationUIEvents>,
|
|
|
|
handlerId: string
|
|
|
|
},
|
|
|
|
"client-info": {
|
|
|
|
events: Registry<ClientInfoEvents>,
|
|
|
|
},
|
|
|
|
"music-manage": {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|