TeaWeb/shared/js/ui/frames/side/HeaderDefinitions.ts

74 lines
1.7 KiB
TypeScript
Raw Normal View History

import {RemoteIconInfo} from "tc-shared/file/Icons";
export type SideHeaderState = SideHeaderStateNone | SideHeaderStateConversation | SideHeaderStateClient | SideHeaderStateMusicBot;
export type SideHeaderStateNone = {
state: "none"
};
export type SideHeaderStateConversation = {
state: "conversation",
2021-01-05 15:26:26 +00:00
mode: "channel" | "private" | "server"
};
export type SideHeaderStateClient = {
state: "client",
}
export type SideHeaderStateMusicBot = {
state: "music-bot"
}
export type SideHeaderChannelState = {
state: "not-connected"
} | {
state: "connected",
channelName: string,
channelIcon: RemoteIconInfo,
channelUserCount: number,
channelMaxUser: number | -1
};
export type SideHeaderPingInfo = {
native: number,
javaScript: number | undefined
};
export type PrivateConversationInfo = {
unread: number,
open: number
};
2021-01-05 15:26:26 +00:00
export type SideHeaderServerInfo = {
name: string,
icon: RemoteIconInfo
}
export interface SideHeaderEvents {
action_bot_manage: {},
action_bot_add_song: {},
action_switch_channel_chat: {},
action_open_conversation: {},
2021-01-05 15:26:26 +00:00
query_server_info: {},
query_current_channel_state: { mode: "voice" | "text" },
query_private_conversations: {},
query_client_info_own_client: {},
query_ping: {},
notify_current_channel_state: {
mode: "voice" | "text",
state: SideHeaderChannelState
},
notify_ping: {
ping: SideHeaderPingInfo | undefined
},
notify_private_conversations: {
info: PrivateConversationInfo
},
notify_client_info_own_client: {
isOwnClient: boolean
2021-01-05 15:26:26 +00:00
},
notify_server_info: {
info: SideHeaderServerInfo | undefined
}
}