started work on frontend message handlers

added type annots to reinforce data structure robustness
started creating Chat.tsx event handlers
This commit is contained in:
Zhongheng Liu 2023-12-19 20:27:54 +02:00
commit 486751022c
No known key found for this signature in database
2 changed files with 69 additions and 1 deletions

23
src/Chat/ChatMessage.tsx Normal file
View file

@ -0,0 +1,23 @@
enum FileType {
FILE_TXT,
DOCUMENT_WORD,
DOCUMENT_PDF,
IMAGE,
EXEC_BINARY,
UNKNOWN,
}
export type Attachment = {
name: string,
uri: string,
sizeBytes: number,
filetype: FileType
}
export type ChatMessage = {
from: string,
fromIP: string,
to: Array<string>,
toIPs: Array<string>,
timestampPosted: number,
message: string,
attachments: Attachment
}