feat: proper chat message styling without rerendering
This commit is contained in:
parent
7150ca87c3
commit
748e154ec4
7 changed files with 74 additions and 25 deletions
10
shared.ts
10
shared.ts
|
|
@ -58,6 +58,15 @@ export interface ChatMessage {
|
|||
author: User;
|
||||
}
|
||||
|
||||
// sent to the newly registered client to confirm that the username was not taken
|
||||
export interface ServerRegistrationConfirmed {
|
||||
type: "REGISTRATION_CONFIRMED";
|
||||
payload: {
|
||||
user: User;
|
||||
};
|
||||
}
|
||||
|
||||
// sent to all clients when a new client has joined the chat
|
||||
export interface ServerUserJoinedMessage {
|
||||
type: "USER_JOINED";
|
||||
payload: {
|
||||
|
|
@ -100,6 +109,7 @@ export interface ServerUserListMessage {
|
|||
}
|
||||
|
||||
export type ServerMessage =
|
||||
| ServerRegistrationConfirmed
|
||||
| ServerUserJoinedMessage
|
||||
| ServerUserLeftMessage
|
||||
| ServerChatMessage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue