diff --git a/Sources/KanaKanjiConverterModule/CIDData.swift b/Sources/KanaKanjiConverterModule/CIDData.swift index 04e6be4..c0c270c 100644 --- a/Sources/KanaKanjiConverterModule/CIDData.swift +++ b/Sources/KanaKanjiConverterModule/CIDData.swift @@ -8,7 +8,7 @@ import Foundation -public enum CIDData { +public enum CIDData: Sendable { static var totalCount: Int { 1319 } diff --git a/Sources/KanaKanjiConverterModule/Candidate.swift b/Sources/KanaKanjiConverterModule/Candidate.swift index be8b25c..eb5af89 100644 --- a/Sources/KanaKanjiConverterModule/Candidate.swift +++ b/Sources/KanaKanjiConverterModule/Candidate.swift @@ -62,13 +62,13 @@ struct CandidateData { } } -public enum CompleteAction { +public enum CompleteAction: Sendable { /// カーソルを調整する case moveCursor(Int) } /// 変換候補のデータ -public struct Candidate { +public struct Candidate: Sendable { /// 入力となるテキスト public var text: String /// 評価値 diff --git a/Sources/KanaKanjiConverterModule/ComposingText.swift b/Sources/KanaKanjiConverterModule/ComposingText.swift index 7e025b7..fa7b213 100644 --- a/Sources/KanaKanjiConverterModule/ComposingText.swift +++ b/Sources/KanaKanjiConverterModule/ComposingText.swift @@ -14,7 +14,7 @@ import SwiftUtils /// のようになる。` /// カーソルのポジションもこのクラスが管理する。 /// 設計方針として、inputStyleに関わる実装の違いは全てアップデート方法の違いとして吸収し、`input` / `delete` / `moveCursor` / `complete`時の違いとしては露出させないようにすることを目指した。 -public struct ComposingText { +public struct ComposingText: Sendable { public init(convertTargetCursorPosition: Int = 0, input: [ComposingText.InputElement] = [], convertTarget: String = "") { self.convertTargetCursorPosition = convertTargetCursorPosition self.input = input @@ -29,7 +29,7 @@ public struct ComposingText { public private(set) var convertTarget: String = "" /// ユーザ入力の単位 - public struct InputElement { + public struct InputElement: Sendable { /// 入力された文字 public var character: Character /// そのときの入力方式(ローマ字入力 / ダイレクト入力) diff --git a/Sources/KanaKanjiConverterModule/Converter/ConvertRequestOptions.swift b/Sources/KanaKanjiConverterModule/Converter/ConvertRequestOptions.swift index 1702f8f..be5429f 100644 --- a/Sources/KanaKanjiConverterModule/Converter/ConvertRequestOptions.swift +++ b/Sources/KanaKanjiConverterModule/Converter/ConvertRequestOptions.swift @@ -8,7 +8,7 @@ import Foundation -public struct ConvertRequestOptions { +public struct ConvertRequestOptions: Sendable { /// 変換リクエストに必要な設定データ /// /// - parameters: @@ -91,7 +91,7 @@ public struct ConvertRequestOptions { ) } - public struct Metadata { + public struct Metadata: Sendable { /// - parameters: /// - appVersionString: アプリのバージョンを指定します。このデータは`KanaKanjiCovnerter.toVersionCandidate(_:)`などで用いられます。 public init(appVersionString: String) { diff --git a/Sources/KanaKanjiConverterModule/DicdataStore/DicdataElement.swift b/Sources/KanaKanjiConverterModule/DicdataStore/DicdataElement.swift index 027ecef..56a0a92 100644 --- a/Sources/KanaKanjiConverterModule/DicdataStore/DicdataElement.swift +++ b/Sources/KanaKanjiConverterModule/DicdataStore/DicdataElement.swift @@ -8,7 +8,7 @@ import Foundation -public struct DicdataElement: Equatable, Hashable { +public struct DicdataElement: Equatable, Hashable, Sendable { static let BOSData = Self(word: "", ruby: "", cid: CIDData.BOS.cid, mid: MIDData.BOS.mid, value: 0, adjust: 0) static let EOSData = Self(word: "", ruby: "", cid: CIDData.EOS.cid, mid: MIDData.EOS.mid, value: 0, adjust: 0) diff --git a/Sources/KanaKanjiConverterModule/MIDData.swift b/Sources/KanaKanjiConverterModule/MIDData.swift index add411e..17e809c 100644 --- a/Sources/KanaKanjiConverterModule/MIDData.swift +++ b/Sources/KanaKanjiConverterModule/MIDData.swift @@ -8,7 +8,7 @@ import Foundation -public enum MIDData { +public enum MIDData: Sendable { static var totalCount: Int { 503 } diff --git a/Sources/KanaKanjiConverterModule/Replacer/TextReplacer.swift b/Sources/KanaKanjiConverterModule/Replacer/TextReplacer.swift index 6165516..b9b7e92 100644 --- a/Sources/KanaKanjiConverterModule/Replacer/TextReplacer.swift +++ b/Sources/KanaKanjiConverterModule/Replacer/TextReplacer.swift @@ -74,7 +74,7 @@ public struct TextReplacer { return results } - public struct SearchResultItem { + public struct SearchResultItem: Sendable { public var query: String public var text: String public var inputable: Bool { @@ -113,7 +113,7 @@ public struct TextReplacer { } } -public struct ReplacementCandidate { +public struct ReplacementCandidate: Sendable { public var target: String public var replace: String public var base: String diff --git a/Sources/KanaKanjiConverterModule/States.swift b/Sources/KanaKanjiConverterModule/States.swift index b831ae8..11caba5 100644 --- a/Sources/KanaKanjiConverterModule/States.swift +++ b/Sources/KanaKanjiConverterModule/States.swift @@ -5,7 +5,7 @@ // Created by ensan on 2023/04/30. // -public enum InputStyle: String { +public enum InputStyle: String, Sendable { /// 入力された文字を直接入力するスタイル case direct = "direct" /// ローマ字日本語入力とするスタイル @@ -19,7 +19,7 @@ public enum KeyboardLanguage: String, Codable, Equatable, Sendable { case none } -public enum LearningType: Int, CaseIterable { +public enum LearningType: Int, CaseIterable, Sendable { case inputAndOutput case onlyOutput case nothing @@ -33,13 +33,13 @@ public enum LearningType: Int, CaseIterable { } } -public enum ConverterBehaviorSemantics { +public enum ConverterBehaviorSemantics: Sendable { /// 標準的な日本語入力のように、変換する候補を選ぶパターン case conversion /// iOSの英語入力のように、確定は不要だが、左右の文字列の置き換え候補が出てくるパターン case replacement([ReplacementTarget]) - public enum ReplacementTarget: UInt8 { + public enum ReplacementTarget: UInt8, Sendable { case emoji } } diff --git a/Sources/KanaKanjiConverterModule/TemplateData.swift b/Sources/KanaKanjiConverterModule/TemplateData.swift index 9600c23..4f27106 100644 --- a/Sources/KanaKanjiConverterModule/TemplateData.swift +++ b/Sources/KanaKanjiConverterModule/TemplateData.swift @@ -9,7 +9,7 @@ import Foundation import SwiftUtils -public struct TemplateData: Codable { +public struct TemplateData: Codable, Sendable { public var name: String public var literal: any TemplateLiteralProtocol public var type: TemplateLiteralType @@ -92,13 +92,13 @@ public struct TemplateData: Codable { } } -public protocol TemplateLiteralProtocol { +public protocol TemplateLiteralProtocol: Sendable { func export() -> String func previewString() -> String } -public enum TemplateLiteralType { +public enum TemplateLiteralType: Sendable { case date case random } @@ -113,7 +113,7 @@ public extension TemplateLiteralProtocol { } } -public struct DateTemplateLiteral: TemplateLiteralProtocol, Equatable { +public struct DateTemplateLiteral: TemplateLiteralProtocol, Equatable, Sendable { public init(format: String, type: DateTemplateLiteral.CalendarType, language: DateTemplateLiteral.Language, delta: String, deltaUnit: Int) { self.format = format self.type = type @@ -129,7 +129,7 @@ public struct DateTemplateLiteral: TemplateLiteralProtocol, Equatable { public var delta: String public var deltaUnit: Int - public enum CalendarType: String { + public enum CalendarType: String, Sendable { case western case japanese @@ -143,7 +143,7 @@ public struct DateTemplateLiteral: TemplateLiteralProtocol, Equatable { } } - public enum Language: String { + public enum Language: String, Sendable { case english = "en_US" case japanese = "ja_JP" @@ -183,7 +183,7 @@ public struct DateTemplateLiteral: TemplateLiteralProtocol, Equatable { } } -public struct RandomTemplateLiteral: TemplateLiteralProtocol, Equatable { +public struct RandomTemplateLiteral: TemplateLiteralProtocol, Equatable, Sendable { public init(value: RandomTemplateLiteral.Value) { self.value = value } @@ -192,12 +192,12 @@ public struct RandomTemplateLiteral: TemplateLiteralProtocol, Equatable { lhs.value == rhs.value } - public enum ValueType: String { + public enum ValueType: String, Sendable { case int case double case string } - public enum Value: Equatable { + public enum Value: Equatable, Sendable { case int(from: Int, to: Int) case double(from: Double, to: Double) case string([String]) diff --git a/Sources/SwiftUtils/AppVersion.swift b/Sources/SwiftUtils/AppVersion.swift index c5e839f..d5f647d 100644 --- a/Sources/SwiftUtils/AppVersion.swift +++ b/Sources/SwiftUtils/AppVersion.swift @@ -13,7 +13,7 @@ import Foundation /// It is initialized with a string that represents a version of an app. /// The string must be in the format of "major.minor.patch". /// The string must not contain any other characters than numbers and dots. -public struct AppVersion: Codable, Equatable, Comparable, Hashable, LosslessStringConvertible, CustomStringConvertible { +public struct AppVersion: Codable, Equatable, Comparable, Hashable, LosslessStringConvertible, CustomStringConvertible, Sendable { /// ParseError is an enum that represents an error that occurs when parsing a string to an AppVersion. private enum ParseError: Error {