Message content
Structure text, attachments, and location shares in a message.
Every message has "content" which specifies the information in the message. This could be some formatted text, a file attachment, or a shared location.
See the conceptual documentation for message content to learn more about how TalkJS represents message content.
The content of a message is structured as a list of content blocks.
No properties or methods are currently defined.
A block of formatted text in a message’s content.
| constructor | |
| == | Inherited from |
Full documentation of each TextNode variant
A node in a TextBlock that renders its children with a specific style.
| constructor | |
| == | Inherited from |
The kind of formatting to apply when rendering the children
- type: "bold" is used when users type *text* and is rendered with HTML <strong>
- type: "italic" is used when users type _text_ and is rendered with HTML <em>
- type: "strikethrough" is used when users type ~text~ and is rendered with HTML <s>
A node in a TextBlock that adds indentation for a bullet-point list around its children (HTML <ul>).
| constructor | |
| == | Inherited from |
func bulletList.==(_:_:) -> Bool
Inherited from Equatable.==(_:_:).
Returns
A node in a TextBlock that renders its children with a bullet-point (HTML <li>).
| constructor | |
| == | Inherited from |
func bulletPoint.==(_:_:) -> Bool
Inherited from Equatable.==(_:_:).
Returns
A node in a TextBlock that renders its children as a clickable link (HTML <a>).
| constructor | |
| == | Inherited from |
Inherited from Clickable.children.
The URL to open when the node is clicked.
A node in a TextBlock that renders text as a link (HTML <a>).
The text to display in the link.
The URL to open when a user clicks this node.
A node in a TextBlock that renders its children as a clickable action link which triggers a custom action.
| constructor | |
| == | Inherited from |
The name of the custom action to invoke when the link is clicked.
Inherited from Clickable.children.
The parameters to pass to the custom action when the link is clicked.
func actionLink.==(_:_:) -> Bool
Inherited from Equatable.==(_:_:).
Returns
A node in a TextBlock that renders its children as a clickable action button which triggers a custom action.
| constructor | |
| == | Inherited from |
The name of the custom action to invoke when the button is clicked.
Inherited from Clickable.children.
The parameters to pass to the custom action when the button is clicked.
func actionButton.==(_:_:) -> Bool
Inherited from Equatable.==(_:_:).
Returns
A node in a TextBlock that renders text in an inline code span (HTML <code>).
Inherited from Leaf.text.
A node in a TextBlock that is used for custom emoji.
The name (including colons at the start and end) of the custom emoji to show.
A node in a TextBlock that is used when a user is mentioned.
The ID of the user who is mentioned.
The name of the user who is mentioned.
No properties or methods are currently defined.
Full documentation of each FileBlock variant
The most basic FileBlock variant, used whenever there is no additional metadata for a file.
The name of the file, including file extension
An encoded identifier for this file. Use in SendFileBlock to send this file in another message.
The size of the file in bytes
The URL where you can fetch the file
A FileBlock variant for a video attachment, with additional video-specific metadata.
The duration of the video in seconds, if known.
The name of the video file, including file extension.
An encoded identifier for this file. Use in SendFileBlock to send this video in another message.
The height of the video in pixels, if known.
The size of the file in bytes.
The URL where you can fetch the file.
The width of the video in pixels, if known.
A FileBlock variant for an image attachment, with additional image-specific metadata.
The name of the image file, including file extension.
An encoded identifier for this file. Use in SendFileBlock to send this image in another message.
The height of the image in pixels, if known.
The size of the file in bytes.
The URL where you can fetch the file.
The width of the image in pixels, if known.
A FileBlock variant for an audio attachment, with additional audio-specific metadata.
The duration of the audio in seconds, if known
The name of the audio file, including file extension
An encoded identifier for this file. Use in SendFileBlock to send this file in another message.
The size of the file in bytes
The URL where you can fetch the file
A FileBlock variant for a voice recording attachment, with additional voice-recording-specific metadata.
The duration of the voice recording in seconds, if known
The name of the file, including file extension
An encoded identifier for this file. Use in SendFileBlock to send this voice recording in another message.
The size of the file in bytes
The URL where you can fetch the file
A block showing a location in the world, typically because a user shared their location in the chat.
The north-south coordinate of the location.
Usually listed first in a pair of coordinates.
Must be a number between -90 and 90
The east-west coordinate of the location.
Usually listed second in a pair of coordinates.
Must be a number between -180 and 180
The version of ContentBlock that is used when sending or editing messages.
No properties or methods are currently defined.
The version of FileBlock that is used when sending or editing messages.
The encoded identifier for the file, obtained by uploading a file with Session/sendFile, or taken from another message.