57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
export type SupportAttachmentType = 'image' | 'audio'
|
|||
|
|
export type SupportMessageSender = 'user' | 'admin'
|
||
|
|
export type SupportMessageStatus = 'sending' | 'sent' | 'seen'
|
||
|
|
|
||
|
|
export type SupportMessageReplyTo = {
|
||
|
|
id: string
|
||
|
|
sender?: SupportMessageSender
|
||
|
|
text?: string
|
||
|
|
attachment?: {
|
||
|
|
type: 'image' | 'audio'
|
||
|
|
url: string
|
||
|
|
name?: string
|
||
|
|
} | null
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface SupportAttachment {
|
||
|
|
id: string
|
||
|
|
type: SupportAttachmentType
|
||
|
|
url: string
|
||
|
|
name: string
|
||
|
|
size?: number
|
||
|
|
mimeType?: string
|
||
|
|
durationMs?: number
|
||
|
|
file?: File
|
||
|
|
uploading?: boolean
|
||
|
|
uploadProgress?: number
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface SupportMessage {
|
||
|
|
id: string
|
||
|
|
sender: SupportMessageSender
|
||
|
|
text?: string
|
||
|
|
createdAt: string
|
||
|
|
createdAtRaw?: string | number | Date | null
|
||
|
|
status?: SupportMessageStatus
|
||
|
|
attachments?: SupportAttachment[]
|
||
|
|
replyTo?: SupportMessageReplyTo | null
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface SupportConversation {
|
||
|
|
id: string
|
||
|
|
userName: string
|
||
|
|
avatar: string
|
||
|
|
online: boolean
|
||
|
|
unreadCount: number
|
||
|
|
lastSeenText: string
|
||
|
|
lastMessagePreview: string
|
||
|
|
updatedAtText: string
|
||
|
|
messages: SupportMessage[]
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ComposerSendPayload {
|
||
|
|
text: string
|
||
|
|
attachments: SupportAttachment[]
|
||
|
|
replyTo?: SupportMessageReplyTo | null
|
||
|
|
}
|