AttachmentSource

sealed class AttachmentSource

The data of a new attachment. The SDK copies it into its own storage at create, so later changes to the source do not change the attachment.

In the browser, path names a file in the SDK's OPFS storage pool, and the SDK copies bytes to its worker; the caller keeps its buffer.

Every host passes bytes by copy, so a source holds its size in memory at least twice until create returns. Prefer path for data over 1 MiB: the SDK reads a path source in small chunks.

Inheritors

Types

Link copied to clipboard
data class Bytes(val bytes: ByteArray, val filename: String?, val mimeType: String) : AttachmentSource
Link copied to clipboard
object Companion
Link copied to clipboard
data class Path(val path: String, val filename: String?, val mimeType: String) : AttachmentSource