Skip to main content

Chat

Represents a conversation with a contact.
export interface Chat {
  id: string
  contactId: string
  messageIds: string[]
  unreadCount: number
  archived?: boolean
  muted?: boolean
  lastActivityAt: string
  lastMessagePreview?: string
}
id
string
required
Unique identifier for the chat
contactId
string
required
ID of the contact this chat is with
messageIds
string[]
required
Ordered array of message IDs in this chat
unreadCount
number
required
Number of unread messages in this chat
archived
boolean
Whether the chat has been archived
muted
boolean
Whether notifications are muted for this chat
lastActivityAt
string
required
ISO 8601 timestamp of the last message or activity
lastMessagePreview
string
Preview text of the most recent message

DraftMessage

Stores unsent message content and attachments.
export interface DraftMessage {
  chatId: string
  text: string
  attachments: MediaAttachment[]
}
chatId
string
required
ID of the chat this draft belongs to
text
string
required
Draft text content
attachments
MediaAttachment[]
required
Media files attached to the draft
Draft messages are automatically saved as the user types and restored when they return to a chat.

TypingIndicator

Indicates when a contact is typing in a chat.
export interface TypingIndicator {
  chatId: string
  authorId: string
  startedAt: string
}
chatId
string
required
ID of the chat where typing is occurring
authorId
string
required
ID of the contact who is typing
startedAt
string
required
ISO 8601 timestamp when typing started
Typing indicators typically expire after a few seconds of inactivity.

ChatSearchHistoryItem

Stores previous search queries for quick access.
export interface ChatSearchHistoryItem {
  id: string
  value: string
  lastUsedAt: string
}
id
string
required
Unique identifier for the search history item
value
string
required
The search query text
lastUsedAt
string
required
ISO 8601 timestamp when this query was last used

Build docs developers (and LLMs) love