Immutable message with an author, timestamp and non-empty text.
interface ChatMessage {
id: RowKey
text: string
timestamp: Date | string
author: ChatUser
status?: 'pending' | 'sent' | 'error'
}| Field | Meaning |
|---|---|
| id | Unique stable ID. |
| text | Text to display. |
| timestamp | Message timestamp. |
| author | Message author. |
| status | Local message status. |
import type { ChatMessage } from '@tekocloud.de/tecexpress'
const example: ChatMessage = { id: 1, text: 'Hello', timestamp: new Date(), author: { id: 'me', name: 'Alex' } }
console.log(example)