Shared types

View as Markdown

interface App

Holds information about your TalkJS app.

Properties

custom
: Record<string, string>

Custom data set for this app.

This can be configured from your TalkJS dashboard.

defaultLocale
: string

The default locale.

This can be configured from your TalkJS dashboard.

id
: string

Your app's unique TalkJS ID. You can find it on the Settings page of the TalkJS dashboard.

name
: string

The name of your app.

interface CommonChatboxProps

A collection of props that's shared by every themed component used in the Chatbox UI.

Properties

app
: App

Holds information about your TalkJS app.

Public interface of the chatbox instance.

conversation
: ConversationSnapshot

The conversation displayed in the chatbox.

conversationId
: string

The ID of the conversation displayed in the chatbox.

Prefer this field instead of common.conversation.id (which always has the same value), as this enables an optimization that prevents needless re-renders.

currentUser
: UserSnapshot

The user that mounted this chatbox.

Describes the capabilities of the current device.

session
: TalkSession

The underlying TalkJS session object that handles sending and receiving chat data.

A translation object which holds localized strings for internationalization purposes.

theme
: Theme

The theme object that the chatbox's is currently using.

Tells you which participants are currently typing

themeCustom (optional)
: any

Arbitrary custom data passed down to the theme.

The data that you pass to ChatboxProps​.themeCustom will show up here so that you can use it from within theme components.

interface CommonConversationListProps

A collection of props that's shared by every themed component used in the ConversationList UI.

Properties

app
: App

Holds information about your TalkJS app.

conversationList
: ConversationListController

Public interface of the conversation list instance.

currentUser
: UserSnapshot

The user that mounted this chatbox.

Describes the capabilities of the current device.

session
: TalkSession

The underlying TalkJS session object that handles sending and receiving chat data.

A translation object which holds localized strings for internationalization purposes.

theme
: Theme

The theme object that the chatbox's is currently using.

themeCustom (optional)
: any

Arbitrary custom data passed down to the theme.

The data that you pass to ConversationListProps​.themeCustom will show up here so that you can use it from within theme components.

interface Coordinates

Properties

latitude
: number
longitude
: number

interface DeviceFeatures

Describes the capabilities of the current device.

Properties

isMobile
: boolean

True if the user agents reports the current device as a mobile/tablet.

supportsEmojiPicker
: boolean

True if the browser supports IndexedDB, which the emoji picker depends on.

interface MessagePermissions

A set of permissions the current user has for a given message.

The values of these permissions come from the user's role.

Properties

canAddReaction
: boolean

True if the user has the ability to add an emoji reaction to the given message.

canDeleteMessage
: boolean

True if the user has the ability to delete the given message.

canEditMessage
: boolean

True if the user has the ability to edit the given message.

canLeaveConversation
: boolean

True if the user has the permission to leave a given conversation.

canMarkConversationAsUnread
: boolean

True if the user has the permission to mark the given conversation as unread.

canMention
: boolean

True if mentions are enabled.

canReplyToMessage
: boolean

True if the user has the ability to reply to the given message.

canSendVoiceMessage
: boolean

True if voice messages are enabled.

canShareFile
: boolean

True if file sharing is enabled.

canShareLocation
: boolean

True if location sharing is enabled.

showOnlineStatus
: boolean

True if online status indicators are enabled.

showTypingIndicator
: boolean

True if typing indicators are enabled.

type MessageStatus

The current status of the message.

This type can have one of these values:

- "sending" - Message is still being sent to the server. a loading spinner is typically shown in chat UIs.

- "sent" - Message has arrived on the server. Typically represented using a single checkmark in chat UIs.

- "everyoneRead" - Everyone in the conversation has read this message. Typically represented using two checkmarks in chat UIs.

- "virtual" - a virtual message made with the system component

interface Theme

A theme can be used to customize the appearance & behavior of your TalkJS Chatbox and/or ConversationList.

The implementation of TalkJS's default theme is open-source and available on Github.

Properties

AfterMessages
: React.ComponentType<AfterMessagesProps>
AudioBlock
: React.ComponentType<AudioBlockProps>
Avatar
: React.ComponentType<AvatarProps>
BeforeMessages
: React.ComponentType<BeforeMessagesProps>
ChatHeader
: React.ComponentType<ChatHeaderProps>
CompactMessageContent
: React.ComponentType<CompactMessageContentProps>
ConversationImage
: React.ComponentType<ConversationImageProps>
ConversationListItem
: React.ComponentType<ConversationListItemProps>
FileBlock
: React.ComponentType<FileBlockProps>
GroupChatImage
: React.ComponentType<GroupChatImageProps>
Icon
: React.ComponentType<IconProps>
ImageBlock
: React.ComponentType<ImageBlockProps>
LocationBlock
: React.ComponentType<LocationBlockProps>
Message
: React.ComponentType<MessageProps>
MessageActionMenu
: React.ComponentType<MessageActionMenuProps>
MessageDivider
: React.ComponentType<MessageDividerProps>
MessageField
: React.ComponentType<MessageFieldProps>
MessageListFooter
: React.ComponentType<MessageListFooterProps>
MessageListHeader
: React.ComponentType<MessageListHeaderProps>
NoConversationSelected
: React.ComponentType<NoConversationSelectedProps>
RecordingPreview
: React.ComponentType<RecordingPreviewProps>
ReferencedMessage
: React.ComponentType<ReferencedMessageProps>
ReplyBar
: React.ComponentType<ReplyBarProps>
TextBlock
: React.ComponentType<TextBlockProps>
TimeAgo
: React.ComponentType<TimeAgoProps>
VideoBlock
: React.ComponentType<VideoBlockProps>
VoiceBlock
: React.ComponentType<VoiceBlockProps>
VoiceRecorder
: React.ComponentType<VoiceRecorderProps>

interface Translation

Translation object

Properties

ADD_REACTION
: string
ARIA_CANCEL_RECORDING
: string
ARIA_CANCEL_UPLOAD
: string
ARIA_CHAT
: string
ARIA_CLOSE_CHAT_POPUP
: string
ARIA_INSERT_EMOJI
: string
ARIA_LEAVE_SEARCH_MODE
: string
ARIA_MORE_ACTIONS
: string
ARIA_PAUSE_AUDIO
: string
ARIA_PLAY_AUDIO
: string
ARIA_REACTION_COUNT
: (numReactions: number, emoji: string) => string
ARIA_REPLYING_TO
: (senderName: string, content: string) => string
: string
ARIA_SEARCH_DOWN
: string
ARIA_SEARCH_INSIDE_CONVERSATION
: string
ARIA_SEARCH_UP
: string
ARIA_SET_PLAYBACK_SPEED
: string
ARIA_STOP_RECORDING
: string
AUTH_EXPIRED_OVERLAY_DESCRIPTION
: string
AUTH_EXPIRED_OVERLAY_TITLE
: string
CANCEL
: string
CHAT_NOT_FOUND
: string
CONTACT_INFORMATION_HIDDEN
: string
DAYS
: string
DELETE_MESSAGE
: string
DELETION_EXPLANATION
: string
DESKTOP_NOTIFICATIONS
: string
DESKTOP_NOTIFICATIONS_DEMO_BODY
: string
DESKTOP_NOTIFICATIONS_DEMO_TITLE
: (appName: string) => string
DESKTOP_NOTIFICATIONS_ERROR
: string
DISABLE_TRANSLATION
: string
EDITED_INDICATOR
: string
EDIT_MESSAGE
: string
ENABLE_TRANSLATION
: string
ENTRYBOX_PLACEHOLDER
: string
ENTRYBOX_PLACEHOLDER_CHAT_CLOSED
: string
ENTRYBOX_PLACEHOLDER_CHAT_READONLY
: string
ENTRYBOX_TEXT_LIMIT
: string
HOURS
: string
HUB_EMPTY
: string
HUB_SHOW_EARLIER
: string
INBOX
: string
INBOX_NO_CHATS_BODY
: string
INBOX_NO_CHATS_TITLE
: string
JUST_NOW
: string
LEAVE_CONVERSATION
: string
LOADING
: string
LOCATION
: string
MARK_CONVERSATION_AS_UNREAD
: string
MESSAGELIST_LOADING_OLDER
: string
MESSAGELIST_NEW_MARKER
: string
MESSAGELIST_SHOW_OLDER
: string
MESSAGE_SENT_VIA_EMAIL
: string
MINUTES
: string
REPLY_MODE_LEAVE_ARIA_LABEL
: string
REPLY_TO_MESSAGE
: string
SAVE
: string
SEARCH_NO_MORE_RESULTS
: string
SEARCH_NO_RESULTS
: string
SEARCH_PLACEHOLDER_TEXT
: string
SEARCH_SEARCHING
: string
SEND_BUTTON_TEXT
: string
SHARE_LOCATION_ERROR
: string
STATUS_INDICATOR_OFFLINE
: string
STATUS_INDICATOR_ONLINE
: string
TODAY
: string
UPLOAD_ERROR
: string
UPLOAD_IN_PROGRESS
: string
UPLOAD_SEND_FILE
: string
UPLOAD_SHARE_LOCATION
: string
VOICE_MESSAGE
: string
YESTERDAY
: string
YOU_MARKER
: string
locale
: string

interface UserPermissions

A set of permissions for the current user.

The values of these permissions come from the user's role.

Properties

canLeaveConversation
: boolean

True if the user has the permission to leave a given conversation.

canMarkConversationAsUnread
: boolean

True if the user has the permission to mark the given conversation as unread.

canMention
: boolean

True if mentions are enabled.

canSendVoiceMessage
: boolean

True if voice messages are enabled.

canShareFile
: boolean

True if file sharing is enabled.

canShareLocation
: boolean

True if location sharing is enabled.

showOnlineStatus
: boolean

True if online status indicators are enabled.

showTypingIndicator
: boolean

True if typing indicators are enabled.