Files
Termind/Frameworks/TermindApplication/Agent/ContextAttachmentLoading.swift
T
2026-09-11 21:07:44 +08:00

20 lines
720 B
Swift

import Foundation
/// Bounded attachment decoding is supplied by Infrastructure, never by a view.
public nonisolated struct ContextAttachmentLoading: Sendable {
public static let maximumAttachments = 20
public var file: @Sendable (URL) async throws -> ContextChip
public var image: @Sendable (Data, String) async throws -> ContextChip
public init(
file: @escaping @Sendable (URL) async throws -> ContextChip,
image: @escaping @Sendable (Data, String) async throws -> ContextChip
) {
self.file = file
self.image = image
}
public static let unavailable = Self(
file: { _ in throw CancellationError() }, image: { _, _ in throw CancellationError() })
}