feat: initial JaniChat messenger — PWA, WebSocket, admin panel
This commit is contained in:
74
frontend/src/types.ts
Normal file
74
frontend/src/types.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
export interface User {
|
||||
id: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
avatarColor: string;
|
||||
bio?: string;
|
||||
phone?: string;
|
||||
isAdmin: boolean;
|
||||
lastSeen?: string;
|
||||
online?: boolean;
|
||||
}
|
||||
|
||||
export interface ChatMember {
|
||||
id: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
avatarColor: string;
|
||||
role: 'owner' | 'admin' | 'member';
|
||||
online: boolean;
|
||||
lastSeen: string;
|
||||
canSendMessages: boolean;
|
||||
}
|
||||
|
||||
export interface Chat {
|
||||
id: string;
|
||||
type: 'private' | 'group' | 'channel';
|
||||
title: string;
|
||||
description?: string;
|
||||
avatarColor: string;
|
||||
isPublic?: boolean;
|
||||
role: 'owner' | 'admin' | 'member';
|
||||
lastMessage?: string;
|
||||
lastMessageAt?: string;
|
||||
unreadCount: number;
|
||||
memberCount: number;
|
||||
privateUserId?: string;
|
||||
createdAt: string;
|
||||
members?: ChatMember[];
|
||||
myRole?: string;
|
||||
canSendMessages?: boolean;
|
||||
canAddMembers?: boolean;
|
||||
}
|
||||
|
||||
export interface Attachment {
|
||||
id: string;
|
||||
filename: string;
|
||||
originalName: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
id: string;
|
||||
chatId: string;
|
||||
content: string;
|
||||
type: 'text' | 'image' | 'file' | 'system';
|
||||
isDeleted: boolean;
|
||||
isEdited: boolean;
|
||||
editedAt?: string;
|
||||
createdAt: string;
|
||||
replyTo?: {
|
||||
id: string;
|
||||
content: string;
|
||||
senderName: string;
|
||||
} | null;
|
||||
attachments: Attachment[];
|
||||
sender: {
|
||||
id: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
avatarColor: string;
|
||||
} | null;
|
||||
}
|
||||
Reference in New Issue
Block a user