import Foundation /// The pasteboard operations `SprachmittlerCapture` needs. Tests use a fake; the app uses /// `SystemPasteboard`. Every member is main-actor isolated because `NSPasteboard` is. @MainActor public protocol PasteboardAccessing: AnyObject, Sendable { /// The current pasteboard change count. var changeCount: Int { get } /// The plain-text string, read only after `changeCount` changed. func string() -> String? /// True when the pasteboard contains our own marker or a transient/concealed marker. func containsOwnWriteMarkers() -> Bool /// Snapshots every item and type, forcing lazy data. func snapshot() -> ClipboardSnapshot? /// Restores a snapshot only when `changeCount` still matches the recorded value. func restore(_ snapshot: ClipboardSnapshot, onlyIfChangeCountMatches: Int) -> Bool /// Writes `text` with the own/transient/concealed markers and returns the new change count. @discardableResult func write(_ text: String) -> Int }