@@ -25,7 +25,7 @@ public final class Observer {
2525 Application ( forKnownProcessID: self . pid) !
2626
2727 /// Creates and starts an observer on the given `processID`.
28- public init ( processID: pid_t , callback: @escaping Callback ) throws {
28+ public init ( processID: pid_t , callback: @escaping Callback ) throws ( AXError ) {
2929 var axObserver : AXObserver ?
3030 let error = AXObserverCreate ( processID, internalCallback, & axObserver)
3131
@@ -46,7 +46,7 @@ public final class Observer {
4646 ///
4747 /// Use this initializer if you want the extra user info provided with notifications.
4848 /// - seeAlso: [UserInfo Keys for Posting Accessibility Notifications](https://developer.apple.com/library/mac/documentation/AppKit/Reference/NSAccessibility_Protocol_Reference/index.html#//apple_ref/doc/constant_group/UserInfo_Keys_for_Posting_Accessibility_Notifications)
49- public init ( processID: pid_t , callback: @escaping CallbackWithInfo ) throws {
49+ public init ( processID: pid_t , callback: @escaping CallbackWithInfo ) throws ( AXError ) {
5050 var axObserver : AXObserver ?
5151 let error = AXObserverCreateWithInfoCallback ( processID, internalInfoCallback, & axObserver)
5252
@@ -101,7 +101,7 @@ public final class Observer {
101101 /// - throws: `Error.NotificationUnsupported`: The element does not support notifications (note
102102 /// that the system-wide element does not support notifications).
103103 public func addNotification( _ notification: UIElement . AXNotification ,
104- forElement element: UIElement ) throws {
104+ forElement element: UIElement ) throws ( AXError ) {
105105 let selfPtr = UnsafeMutableRawPointer ( Unmanaged . passUnretained ( self ) . toOpaque ( ) )
106106 let error = AXObserverAddNotification (
107107 axObserver, element. element, notification. rawValue as CFString , selfPtr
@@ -120,7 +120,7 @@ public final class Observer {
120120 /// - throws: `Error.NotificationUnsupported`: The element does not support notifications (note
121121 /// that the system-wide element does not support notifications).
122122 public func removeNotification( _ notification: UIElement . AXNotification ,
123- forElement element: UIElement ) throws {
123+ forElement element: UIElement ) throws ( AXError ) {
124124 let error = AXObserverRemoveNotification (
125125 axObserver, element. element, notification. rawValue as CFString
126126 )
0 commit comments