mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-05-19 08:48:16 +00:00
d1209e6704
Co-authored-by: Jim Dovey <jimdovey@apple.com>
37 lines
909 B
Swift
37 lines
909 B
Swift
import Foundation
|
|
|
|
public struct MediaAttachment: Codable, Identifiable, Hashable, Equatable {
|
|
public struct MetaContainer: Codable, Equatable {
|
|
public struct Meta: Codable, Equatable {
|
|
public let width: Int?
|
|
public let height: Int?
|
|
}
|
|
|
|
public let original: Meta?
|
|
}
|
|
|
|
public enum SupportedType: String {
|
|
case image, gifv, video, audio
|
|
}
|
|
|
|
public func hash(into hasher: inout Hasher) {
|
|
hasher.combine(id)
|
|
}
|
|
|
|
public let id: String
|
|
public let type: String
|
|
public var supportedType: SupportedType? {
|
|
SupportedType(rawValue: type)
|
|
}
|
|
|
|
public let url: URL?
|
|
public let previewUrl: URL?
|
|
public let description: String?
|
|
public let meta: MetaContainer?
|
|
}
|
|
|
|
extension MediaAttachment: Sendable {}
|
|
extension MediaAttachment.MetaContainer: Sendable {}
|
|
extension MediaAttachment.MetaContainer.Meta: Sendable {}
|
|
extension MediaAttachment.SupportedType: Sendable {}
|