Skip to main content

Type Alias: ChatOptions

ChatOptions = ChatCallbacks & object

Defined in: chat.ts:124

Options accepted by defineChat.

Type Declaration

avatar?

optional avatar: string

Initial chat picture. A chat may have none.

maxEntries?

optional maxEntries: number

Keep at most this many entries, dropping the oldest beyond it.

Remarks

Uncapped by default, so history is never silently lost. Because auto-save serializes the whole state tree into sessionStorage, a long-running chat should set a cap; the package warns once a transcript passes ENTRY_WARN_THRESHOLD without one.

participants?

optional participants: (Contact | string)[]

Initial members, making this a group chat.

Remarks

Membership changes during play, so this is only the starting point.

peer?

optional peer: Contact | string

The single other participant, making this a direct chat.

Remarks

Its avatar and name become the chat's fallbacks.

readOnly?

optional readOnly: boolean

Whether the player can never reply, as in a channel or an announcement feed.

Remarks

Distinct from simply having no reply available right now - check Chat.canReply for the structural answer and Chat.pendingChoice for the transient one.

title?

optional title: StaticText

Display title. Required in practice for a group; a direct chat falls back to its peer's name.