// // Notifications.swift // KeymanEngine // // Created by Gabriel Wong on 2017-10-30. // Copyright © 2017 SIL International. All rights reserved. // import Foundation @available(*, deprecated, message: "Download notifications are now package-based. Use `PackageDownloadStartedNotification` instead.") public typealias KeyboardDownloadStartedNotification = [InstallableKeyboard] @available(*, deprecated, message: "Download notifications are now package-based. Use `PackageDownloadCompletedNotification` instead.") public typealias KeyboardDownloadCompletedNotification = [InstallableKeyboard] @available(*, deprecated, message: "Download notifications are now package-based. Use `PackageDownloadFailedNotification` instead.") public struct KeyboardDownloadFailedNotification { public let keyboards: [InstallableKeyboard] public let error: Error } @available(*, deprecated, message: "Download notifications are now package-based. Use `PackageDownloadStartedNotification` instead.") public typealias LexicalModelDownloadStartedNotification = [InstallableLexicalModel] @available(*, deprecated, message: "Download notifications are now package-based. Use `PackageDownloadCompletedNotification` instead.") public typealias LexicalModelDownloadCompletedNotification = [InstallableLexicalModel] @available(*, deprecated, message: "Download notifications are now package-based. Use `PackageDownloadFailedNotification` instead.") public struct LexicalModelDownloadFailedNotification { public let lmOrLanguageID: String public let error: Error } public typealias PackageDownloadStartedNotification = KeymanPackage.Key public typealias PackageDownloadCompletedNotification = KeymanPackage public struct PackageDownloadFailedNotification { public let packageKey: KeymanPackage.Key? public let error: Error } public typealias BatchUpdateStartedNotification = [AnyLanguageResource] public struct BatchUpdateCompletedNotification { public let successes: [KeymanPackage.Key] public let failures: [(KeymanPackage.Key, Error)] } public typealias KeyboardLoadedNotification = InstallableKeyboard public typealias KeyboardChangedNotification = InstallableKeyboard public typealias KeyboardRemovedNotification = InstallableKeyboard public typealias KeyboardPickerDismissedNotification = Void public typealias LexicalModelLoadedNotification = InstallableLexicalModel public typealias LexicalModelChangedNotification = InstallableLexicalModel public typealias LexicalModelRemovedNotification = InstallableLexicalModel public typealias LexicalModelPickerDismissedNotification = Void public struct Notifications { public static let packageDownloadStarted = NotificationName("KeymanPackageDownloadStarted") public static let packageDownloadCompleted = NotificationName("KeymanPackageDownloadCompleted") public static let packageDownloadFailed = NotificationName("KeymanPackageDownloadFailed") @available(swift, deprecated: 0.1, obsoleted: 0.1, message: "Download notifications are now package-based. Use `packageDownloadStarted` instead.", renamed: "packageDownloadStarted") public static let keyboardDownloadStarted = NotificationName("KeymanKeyboardDownloadStarted") @available(swift, deprecated: 0.1, obsoleted: 0.1, message: "Download notifications are now package-based. Use `packageDownloadCompleted` instead.", renamed: "packageDownloadCompleted") public static let keyboardDownloadCompleted = NotificationName("KeymanKeyboardDownloadCompleted") @available(swift, deprecated: 0.1, obsoleted: 0.1, message: "Download notifications are now package-based. Use `packageDownloadFailed` instead.", renamed: "packageDownloadFailed") public static let keyboardDownloadFailed = NotificationName("KeymanKeyboardDownloadFailed") public static let keyboardLoaded = NotificationName("KeymanKeyboardLoaded") public static let keyboardChanged = NotificationName("KeymanKeyboardChanged") public static let keyboardRemoved = NotificationName("KeymanKeyboardRemoved") public static let keyboardPickerDismissed = NotificationName("KeymanKeyboardPickerDismissed") @available(swift, deprecated: 0.1, obsoleted: 0.1, message: "Download notifications are now package-based. Use `packageDownloadStarted` instead.", renamed: "packageDownloadStarted") public static let lexicalModelDownloadStarted = NotificationName("KeymanLexicalModelDownloadStarted") @available(swift, deprecated: 0.1, obsoleted: 0.1, message: "Download notifications are now package-based. Use `packageDownloadCompleted` instead.", renamed: "packageDownloadCompleted") public static let lexicalModelDownloadCompleted = NotificationName("KeymanLexicalModelDownloadCompleted") @available(swift, deprecated: 0.1, obsoleted: 0.1, message: "Download notifications are now package-based. Use `packageDownloadFailed` instead.", renamed: "packageDownloadFailed") public static let lexicalModelDownloadFailed = NotificationName("KeymanLexicalModelDownloadFailed") public static let lexicalModelLoaded = NotificationName("KeymanLexicalModelLoaded") public static let lexicalModelChanged = NotificationName("KeymanLexicalModelChanged") public static let lexicalModelRemoved = NotificationName("KeymanLexicalModelRemoved") public static let lexicalModelPickerDismissed = NotificationName("KeymanLexicalModelPickerDismissed") public static let batchUpdateStarted = NotificationName("KeymanBatchUpdateStarted") public static let batchUpdateCompleted = NotificationName("KeymanBatchUpdateCompleted") }