MediaAttachment

public struct MediaAttachment : Codable, Hashable, Identifiable, Sendable

Represents a file or media attachment that can be added to a post.

  • Undocumented

    Declaration

    Swift

    public init(id: String, type: AttachmentType, url: String, remoteUrl: String? = nil, previewUrl: String? = nil, meta: AttachmentMeta? = nil, description: String? = nil, blurhash: String? = nil)
  • id

    The ID of the attachment in the database.

    Declaration

    Swift

    public var id: String
  • The type of the attachment.

    Declaration

    Swift

    public var type: AttachmentType
  • url

    The location of the original full-size attachment.

    Declaration

    Swift

    public var url: String
  • The location of the full-size original attachment on the remote website.

    Declaration

    Swift

    public var remoteUrl: String?
  • The location of a scaled-down preview of the attachment.

    Declaration

    Swift

    public var previewUrl: String?
  • Metadata returned by Paperclip, only original, small and focus are serialized.

    Declaration

    Swift

    public var meta: AttachmentMeta?
  • Alternate text that describes what is in the media attachment, to be used for the visually impaired or when media attachments do not load.

    Declaration

    Swift

    public var description: String?
  • A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.

    Declaration

    Swift

    public var blurhash: String?
  • Undocumented

    Declaration

    Swift

    var aspectRatio: Double? { get }