progress on server refactor

This commit is contained in:
Craig
2020-01-20 16:22:24 +00:00
parent 78af798d68
commit d497806443
13 changed files with 436 additions and 51 deletions

View File

@ -1,10 +1,14 @@
export const EVENT = {
// Internal Events
CONNECTING: 'CONNECTING',
CONNECTED: 'CONNECTED',
DISCONNECTED: 'DISCONNECTED',
TRACK: 'TRACK',
MESSAGE: 'MESSAGE',
DATA: 'DATA',
// Websocket Events
DISCONNECT: 'disconnect',
SIGNAL: {
ANSWER: 'signal/answer',
PROVIDE: 'signal/provide',
@ -25,8 +29,7 @@ export const EVENT = {
REQUESTING: 'control/requesting',
},
CHAT: {
SEND: 'chat/send',
RECEIVE: 'chat/receive',
MESSAGE: 'chat/message',
EMOJI: 'chat/emoji',
},
ADMIN: {
@ -43,9 +46,10 @@ export const EVENT = {
} as const
export type Events = typeof EVENT
export type WebSocketEvents = ControlEvents | IdentityEvents | MemberEvents | SignalEvents | ChatEvents
export type WebSocketEvents = SystemEvents | ControlEvents | IdentityEvents | MemberEvents | SignalEvents | ChatEvents
export type SystemEvents = typeof EVENT.DISCONNECT
export type ControlEvents = typeof EVENT.CONTROL.LOCKED | typeof EVENT.CONTROL.RELEASE | typeof EVENT.CONTROL.REQUEST
export type IdentityEvents = typeof EVENT.IDENTITY.PROVIDE | typeof EVENT.IDENTITY.DETAILS
export type MemberEvents = typeof EVENT.MEMBER.LIST | typeof EVENT.MEMBER.CONNECTED | typeof EVENT.MEMBER.DISCONNECTED
export type SignalEvents = typeof EVENT.SIGNAL.ANSWER | typeof EVENT.SIGNAL.PROVIDE
export type ChatEvents = typeof EVENT.CHAT.SEND | typeof EVENT.CHAT.RECEIVE
export type ChatEvents = typeof EVENT.CHAT.MESSAGE | typeof EVENT.CHAT.EMOJI