Chat state
Properties:
Name | Type | Description |
---|---|---|
channels |
ChatState.ChannelsState | State of chat channels |
session |
ChatState.ChatSessionState | State of the user session |
users |
ChatState.ChatUserState | State of chat users |
channelInput |
ChatState.ChatChannelInputState | Chat text input state |
Type Definitions
Object
# ChannelsState
Chat channel state
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
sid |
ChatState.ChannelState |
<optional> |
State of chat channel by sid |
Object
# ChannelState
An object which represents a state of a channel.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
currentPaginator |
Paginator |
<optional> |
Paginator class to request messages on previous or next pages. See structure here: https://media.twiliocdn.com/sdk/js/chat/releases/3.2.4/docs/Paginator.html | |
selectionStart |
number | 0 | Index of the selection start | |
selectionEnd |
number | 0 | Index of the selection end | |
isLoadingMessages |
boolean | false | Indicates if messages are currently loading | |
isLoadingMembers |
boolean | false | Indicates if members are currently loading | |
isLoadingChannel |
boolean | false | Indicates if channel is currently loading | |
lastConsumedMessageIndex |
number | 0 | Index of the last read message | |
members |
Map.<string, ChatState.MemberState> | Members of the chat | ||
messages |
Array.<ChatState.MessageState> | Map() | Messages in the channel | |
source |
Channel |
<optional> |
Reference to the channel. See structure here: https://media.twiliocdn.com/sdk/js/chat/releases/3.2.4/docs/Channel.html | |
typers |
Array.<ChatState.MemberState> | Members, who are currently typing a message | ||
errorWhileLoadingChannel |
boolean | false | Indicates if there was an error while loading a channel |
Object
# ChatChannelInputState
Properties:
Name | Type | Description |
---|---|---|
sid |
ChatState.MessageState | Message state for a sid |
Object
# ChatMessageListState
Object containing the status of the ChatMessageList component. Used to identify unread messages.
Properties:
Name | Type | Description |
---|---|---|
isScrollToBottom |
boolean | Whether the ChatMessageList is currently scrolled to the bottom |
activeChatChannel |
string | ID of the chat channel currently shown in the ChatMessageList component |
Object
# ChatSessionState
Properties:
Name | Type | Default | Description |
---|---|---|---|
connectionState |
string | "" | State of the connection |
isActive |
boolean | true | Indicates if chat session is active |
Object
# ChatUserState
A state of chat users value UserDescriptor from Twilio Chat SDK.
Properties:
Name | Type | Description |
---|---|---|
sid |
UserDescriptor | User descriptor of the user by sid. See structure here: https://media.twiliocdn.com/sdk/js/chat/releases/3.2.4/docs/UserDescriptor.html |
Object
# MemberState
A state of remote client in a Channel.
Properties:
Name | Type | Description |
---|---|---|
source |
Member | Represents the remote client in a Channel. See structure here: https://media.twiliocdn.com/sdk/js/chat/releases/3.2.4/docs/Member.html |
friendlyName |
string | It represents the friendly name of the remote client. |
online |
boolean | It represents if the member is online or not. |
Object
# MessageState
An object which represents a state of a single message.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
isFromMe |
boolean | Is the message from me. | |
source |
Message | Represents the message object. See structure here: https://media.twiliocdn.com/sdk/js/chat/releases/3.2.4/docs/Message.html | |
groupWithNext |
boolean | should the message be grouped with the next message. | |
groupWithPrevious |
boolean | should the message be grouped with the previous message. | |
index |
number | index of the message within the remote messages array. | |
error |
boolean |
<optional> |
If set to true, the message has failed to be delivered. |
Object
# MessageState
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
inputText |
string | "" | Text of the message | |
selectionStart |
number | 0 | Start of the message selection | |
selectionEnd |
number | 0 | End of the message selection | |
attachedFiles |
Array.<File> |
<optional> |
Files attached to the message |