For AI agents: Find a documentation index at https://talkjs.com/llms.txt (full content at https://talkjs.com/llms-full.txt). Get a markdown version of any page by appending .md to its URL path.

Other types

Understand component events and shared data types.

View as Markdown

data class BackButtonClickEvent

An event object dispatched by the Chatbox's onBackButtonClick event.

Properties

currentUser
: UserSnapshot

data class PermissionPromptRequest

Passed to the beforePermissionPrompt callback of Chatbox when a system permission dialog needs to be shown to the user.

Properties

cancel
: () -> Unit

Cancel whatever user action caused the permission to be requested.

For example, if a user wants to share their location for the first time so that this event is triggered, then if you call cancel(), no permission will be requested from the system, the location sharing will be cancelled, and TalkJS will continue as if the location sharing button had not been clicked at all.

This may be useful if you're using this event to show custom UI elements that nudge users towards granting permission, and this UI has a "cancel" button.

permissions
: List<String>

The types of permissions requested.

showPrompt
: suspend () -> GrantResult

Show the system permission prompt that lets the user allow or deny this permission.

When the user clicks "Allow", then the user action that triggered the system permission request will proceed and the return value is GrantResult.GRANTED.

When the user clicks "Deny", then the user action is cancelled, the onMissingPermission callback of Chatbox is triggered, and the return value is GrantResult.DENIED.

enum GrantResult

Values:

  • GRANTED
  • DENIED

data class DeleteMessageEvent

An event object dispatched by the Chatbox's onDeleteMessage event.

Properties

conversation
: ConversationSnapshot

The conversation that the message used to be in.

currentUser
: UserSnapshot
message
: MessageSnapshot

The message that was just deleted.

data class MissingPermissionEvent

Sent by the onMissingPermission callback of Chatbox when the user tried to do an action that require explicit system permission, but that permission has been denied.

This event is meant to let you show a message to the user if an action (eg sharing a location, or enabling notifications) can't proceed because the system permission for that has been denied.

If you want to control when to show the system permissions prompt, use beforePermissionPrompt.

This event is emitted both when the user has denied this permission in the past, and when a user action just triggered a system permissions prompt which the user then denied. If you need to differentiate between these two cases, use beforePermissionPrompt, and inspect the return value of PermissionPromptRequest.showPrompt.

Properties

permissions
: List<String>

The types of permissions that were denied.

data class SelectConversationEvent

An event object dispatched by the ConversationList's onSelectConversation event.

Properties

conversation (optional)
: ConversationSnapshot?

The newly-selected conversation, or null if a conversation was de-selected.

currentUser
: UserSnapshot
focusedMessage (optional)
: MessageSnapshot?

The message that was scrolled into view within the conversation

data class SendMessageEvent

An event object dispatched by the Chatbox's onSendMessage event.

Properties

conversation
: ConversationSnapshot

The conversation the message was sent in.

currentUser
: UserSnapshot
message
: MessageSnapshot

The message that was just sent.

data class MessageActionEvent

An event object dispatched by the Chatbox's onMessageAction event.

Properties

action
: String

The name of the action that was triggered.

conversation
: ConversationSnapshot

The current conversation.

message
: MessageSnapshot

The message that contained the action link or action button.

params
: Map<String, String>

The parameters of the action that was triggered, if any.

data class FocusMessageEvent

An event object dispatched by the Chatbox's onFocusMessage event.

Properties

message (optional)
: MessageSnapshot?

The message that was focused (or null if the focus was cleared)

data class Coordinates

Properties

latitude
: Double
longitude
: Double

enum BaseTheme

Values:

  • CLASSIC
  • DEFAULT