From cd58dcfa276a6250b0002389c7f71a561fa8deb6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:38:10 +0000 Subject: [PATCH 1/5] Prepare Swift interface update From eaaca57b26ee298baebaf265d524b0f4871aa066 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 07:05:54 +0200 Subject: [PATCH 2/5] Update watchos Swift interfaces (#6) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../FoundationExtensions.swiftinterface | 820 ++++++++++++++++++ .../FoundationExtensionsMacros.swiftinterface | 10 + 2 files changed, 830 insertions(+) create mode 100644 .agents/interfaces/watchos/FoundationExtensions.swiftinterface create mode 100644 .agents/interfaces/watchos/FoundationExtensionsMacros.swiftinterface diff --git a/.agents/interfaces/watchos/FoundationExtensions.swiftinterface b/.agents/interfaces/watchos/FoundationExtensions.swiftinterface new file mode 100644 index 0000000..408a117 --- /dev/null +++ b/.agents/interfaces/watchos/FoundationExtensions.swiftinterface @@ -0,0 +1,820 @@ +// swift-interface-format-version: 1.0 +// swift-compiler-version: Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) +// swift-module-flags: -target arm64-apple-watchos6.0-simulator -enable-objc-interop -swift-version 6 -O -module-name FoundationExtensions -package-name swift_foundation_extensions +// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.3 +@_exported import AssociatedObjects +import Combine +import Dispatch +@_exported import Equated +@_exported @preconcurrency import Foundation +@_exported import Resettable +import Swift +import _Concurrency +import _StringProcessing +import _SwiftConcurrencyShims +extension Swift.ClosedRange { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value < lowerBound { + return lowerBound + } else if value > upperBound { + return upperBound + } else { + return value + } + } +} +extension Swift.PartialRangeFrom { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value < lowerBound { + return lowerBound + } else { + return value + } + } +} +extension Swift.PartialRangeThrough { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value > upperBound { + return upperBound + } else { + return value + } + } +} +@available(*, deprecated, renamed: "Optional.UnwrappingError", message: "Use Optional.UnwrappingError instead") +public typealias UnwrappingError = Swift.Optional.UnwrappingError +extension Swift.Optional.UnwrappingError { + @available(*, deprecated, message: "Instead of UnwrappingError, use Optional.UnwrappingError") + public typealias T = Wrapped +} +extension Foundation.Bundle { + @inlinable public var appVersionNumber: Swift.String? { + get { infoDictionary?["CFBundleShortVersionString"] as? String } + } + @inlinable public var buildVersionNumber: Swift.String? { + get { infoDictionary?["CFBundleVersion"] as? String } + } + @inlinable public var teamIdentifierPrefix: Swift.String? { + get { infoDictionary?["TeamIdentifierPrefix"] as? String } + } + @inlinable public var keyPrefix: Swift.String { + get { + return bundleIdentifier.map { $0.appending(".") }.or("") + } + } + @inlinable public func makeKey(_ key: Swift.String) -> Swift.String { + return keyPrefix.appending(key) + } + @inlinable public func appGroupID(for teamIdentifier: Swift.String) -> Swift.String? { + return teamIdentifierPrefix.map { "\($0)\(teamIdentifier)" } + } +} +public enum RawCodingKey : Swift.CodingKey, Swift.ExpressibleByStringLiteral, Swift.ExpressibleByIntegerLiteral { + case key(Swift.String) + case index(Swift.Int) + @inlinable public init(stringLiteral value: Swift.String) { + self.init(stringValue: value) + } + @inlinable public init(stringValue: Swift.String) { + self = .key(stringValue) + } + @inlinable public init(integerLiteral value: Swift.Int) { + self.init(intValue: value) + } + @inlinable public init(intValue: Swift.Int) { + self = .index(intValue) + } + @inlinable public var stringValue: Swift.String { + get { + switch self { + case let .key(value): + return value + case let .index(value): + return value.description + } + } + } + @inlinable public var intValue: Swift.Int? { + get { + switch self { + case let .index(value): + return value + default: + return nil + } + } + } + public typealias ExtendedGraphemeClusterLiteralType = Swift.String + public typealias IntegerLiteralType = Swift.Int + public typealias StringLiteralType = Swift.String + public typealias UnicodeScalarLiteralType = Swift.String +} +extension Swift.Decoder { + @inlinable public func decode(_ decode: (Swift.KeyedDecodingContainer) throws -> T) throws -> T { + return try self.decode(RawCodingKey.self, decode) + } + @inlinable public func decode(_ codingKeys: CodingKeys.Type, _ decode: (Swift.KeyedDecodingContainer) throws -> T) throws -> T where CodingKeys : Swift.CodingKey { + let container = try container(keyedBy: codingKeys) + return try decode(container) + } +} +extension Swift.Encoder { + @inlinable public func encode(_ encode: (inout Swift.KeyedEncodingContainer) throws -> T) throws -> T { + return try self.encode(RawCodingKey.self, encode) + } + @inlinable public func encode(_ codingKeys: CodingKeys.Type, _ encode: (inout Swift.KeyedEncodingContainer) throws -> T) throws -> T where CodingKeys : Swift.CodingKey { + var container = container(keyedBy: codingKeys) + return try encode(&container) + } +} +extension Swift.KeyedDecodingContainer { + @inlinable public func decode(_ key: K) throws -> T where T : Swift.Decodable { + try decode(T.self, forKey: key) + } + @inlinable public func decodeIfPresent(_ key: K) throws -> T? where T : Swift.Decodable { + try decodeIfPresent(T.self, forKey: key) + } +} +extension Swift.Collection { + @inlinable public var isNotEmpty: Swift.Bool { + get { !self.isEmpty } + } +} +extension Swift.Array { + @inlinable public mutating func bringFront(elementsSatisfying predicate: (Element) -> Swift.Bool) { + let leftHalf = self.filter { predicate($0) } + let rightHalf = self.filter { !predicate($0) } + self = leftHalf + rightHalf + } +} +extension Swift.MutableCollection { + @inlinable public subscript(safe index: Self.Index?) -> Self.Element? { + get { + guard let index = index else { return nil } + return self[safe: index] + } + set { + guard let index = index else { return } + self[safe: index] = newValue + } + } + @inlinable public subscript(safe index: Self.Index) -> Self.Element? { + get { + guard indices.contains(index) + else { return nil } + return self[index] + } + set { + guard + indices.contains(index), + let value = newValue + else { return } + return self[index] = value + } + } +} +extension Swift.Collection { + @inlinable public subscript(safe index: Self.Index?) -> Self.Element? { + get { + guard let index = index else { return nil } + return self[safe: index] + } + } + @inlinable public subscript(safe index: Self.Index) -> Self.Element? { + get { + guard indices.contains(index) + else { return nil } + return self[index] + } + } +} +extension Swift.Comparable { + @inlinable public func clamped(in range: Swift.ClosedRange) -> Self { + min(max(range.lowerBound, self), range.upperBound) + } + @inlinable public mutating func clamp(in range: Swift.ClosedRange) { + self = self.clamped(in: range) + } + @inlinable public func clamped(in range: Swift.PartialRangeFrom) -> Self { + max(range.lowerBound, self) + } + @inlinable public mutating func clamp(in range: Swift.PartialRangeFrom) { + self = self.clamped(in: range) + } + @inlinable public func clamped(in range: Swift.PartialRangeThrough) -> Self { + min(self, range.upperBound) + } + @inlinable public mutating func clamp(in range: Swift.PartialRangeThrough) { + self = self.clamped(in: range) + } +} +extension Dispatch.DispatchTimeInterval { + @inlinable public static func interval(_ value: Foundation.TimeInterval) -> Dispatch.DispatchTimeInterval { + return .nanoseconds(Int(value * pow(10, 9))) + } +} +extension Dispatch.DispatchTime : @retroactive Swift.ExpressibleByFloatLiteral { + public typealias FloatLiteralType = Foundation.TimeInterval +} +extension Dispatch.DispatchTime { + @inlinable public static func interval(_ interval: Foundation.TimeInterval) -> Dispatch.DispatchTime { + return .now() + .interval(interval) + } + @inlinable public init(floatLiteral value: Foundation.TimeInterval) { + self = .interval(value) + } +} +extension Swift.FloatingPoint { + @inlinable public func progress(in total: Self) -> Self { + total != 0 ? self / total : 0 + } +} +extension Foundation.NSMutableAttributedString { + @inlinable public func addAttribute(_ key: Foundation.NSAttributedString.Key, value: Any) { + addAttribute(key, value: value, range: NSRange(0.. Swift.Void) -> Foundation.NSAttributedString { + let attributedString = NSMutableAttributedString(attributedString: self) + let range = NSRange(0.. Swift.Void) -> Foundation.NSAttributedString { + let attributedString = NSMutableAttributedString(attributedString: self) + let range = NSRange(0..(_ value: T, in object: inout T) { + mutate(&object, with: { $0 = value }) + } + @inlinable public func mutate(_ object: T, with closure: (T) -> Swift.Void) where T : AnyObject { + execute { closure(object) } + } + @inlinable public func mutate(_ object: inout T, with closure: (inout T) -> Swift.Void) { + execute { closure(&object) } + } + @inlinable public func assign(_ value: Value, to keyPath: Swift.ReferenceWritableKeyPath, on object: T) where T : AnyObject { + execute { object[keyPath: keyPath] = value } + } + @inlinable public func assign(_ value: Value, to keyPath: Swift.WritableKeyPath, on object: inout T) { + execute { object[keyPath: keyPath] = value } + } + @discardableResult + @inlinable public func execute(_ closure: () -> T) -> T { + withLock(closure) + } +} +public protocol NSObjectSwizzlingProtocol : ObjectiveC.NSObjectProtocol { +} +extension FoundationExtensions.NSObjectSwizzlingProtocol { + @available(*, deprecated, message: "Use `objc_exchangeImplementations(_,_,_)` instead") + @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC.Selector, _ swizzledSelector: ObjectiveC.Selector) { + objc_exchangeImplementations( + originalSelector, + swizzledSelector, + using: class_getInstanceMethod + ) + } + @discardableResult + @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC.Selector, _ swizzledSelector: ObjectiveC.Selector, using extractMethod: (Swift.AnyClass?, ObjectiveC.Selector) -> ObjectiveC.Method?) -> Swift.Bool { + let originalMethod = extractMethod( + Self.self, + originalSelector + ) + + let swizzledMethod = extractMethod( + Self.self, + swizzledSelector + ) + + guard + let originalMethod, + let swizzledMethod + else { return false } + + method_exchangeImplementations(originalMethod, swizzledMethod) + return true + } +} +extension ObjectiveC.NSObject : FoundationExtensions.NSObjectSwizzlingProtocol { +} +extension Swift.Optional { + @inlinable public func orThrow(_ error: @autoclosure () -> any Swift.Error) throws -> Wrapped { + switch self { + case .some(let wrapped): + return wrapped + case .none: + throw error() + } + } + @inlinable public var isNil: Swift.Bool { + get { + switch self { + case .none: return true + case .some: return false + } + } + } + @inlinable public var isNotNil: Swift.Bool { + get { !isNil } + } + @inlinable public func or(_ value: @autoclosure () -> Wrapped) -> Wrapped { + self ?? value() + } + @inlinable public func or(_ value: @autoclosure () -> Wrapped?) -> Wrapped? { + self ?? value() + } + @inlinable public func unwrap(function: Swift.String = #function, file: Swift.String = #file, line: Swift.Int = #line) -> Swift.Result.UnwrappingError> { + switch self { + case .some(let value): + return .success(value) + case .none: + return .failure( + UnwrappingError( + function: function, + file: file, + line: line + ) + ) + } + } + @inlinable public func assign(to keyPath: Swift.ReferenceWritableKeyPath>, on target: T) where T : AnyObject { target[keyPath: keyPath] = self } + @inlinable public func ifLetAssign(to keyPath: Swift.ReferenceWritableKeyPath, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } + @inlinable public func ifLetAssign(to keyPath: Swift.ReferenceWritableKeyPath>, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } + @inlinable public func assign(to keyPath: Swift.WritableKeyPath>, on target: inout T) { target[keyPath: keyPath] = self } + @inlinable public func ifLetAssign(to keyPath: Swift.WritableKeyPath, on target: inout T) { map { target[keyPath: keyPath] = $0 } } + @inlinable public func ifLetAssign(to keyPath: Swift.WritableKeyPath>, on target: inout T) { map { target[keyPath: keyPath] = $0 } } +} +extension Swift.Optional where Wrapped : Swift.Collection { + @inlinable public var isNilOrEmpty: Swift.Bool { + get { + map(\.isEmpty).or(true) + } + } +} +extension Swift.Optional { + public struct UnwrappingError : Swift.Error { + public let type: Wrapped.Type + public let function: Swift.String + public let file: Swift.String + public let line: Swift.Int + public init(_ type: Wrapped.Type = Wrapped.self, function: Swift.String = #function, file: Swift.String = #file, line: Swift.Int = #line) + @inlinable public var debugDescription: Swift.String { + get { + localizedDescription + .appending("\n{") + .appending("\n function: \(function)") + .appending("\n file: \(file),") + .appending("\n line: \(line)") + .appending("\n}") + } + } + } +} +extension Swift.Range where Bound : Swift.Numeric { + @inlinable public var length: Bound { + get { upperBound - lowerBound } + } +} +extension Swift.ClosedRange where Bound : Swift.Numeric { + @inlinable public var length: Bound { + get { upperBound - lowerBound } + } +} +extension Swift.Result { + @inlinable public var value: Success? { + get { + switch self { + case let .success(value): return value + default: return nil + } + } + } + @inlinable public var error: Failure? { + get { + switch self { + case let .failure(error): return error + default: return nil + } + } + } + @inlinable public func eraseError() -> Swift.Result { + mapError { $0 as Error } + } + @inlinable public func replaceError(with success: Success) -> Swift.Result { + replaceError { _ in success } + } + @inlinable public func replaceError(with closure: (any Swift.Error) -> Success) -> Swift.Result { + switch self { + case .success(let value): + return .success(value) + case .failure(let error): + return .success(closure(error)) + } + } +} +extension Swift.String { + @inlinable public func ranges(of substring: Swift.String, options: Swift.String.CompareOptions = [], locale: Foundation.Locale? = nil) -> [Swift.Range] { + var ranges: [Range] = [] + while + let range = range( + of: substring, + options: options, + range: (ranges.last?.upperBound ?? startIndex).. { + final public var content: Content + @inlinable final public var wrappedValue: Content { + get { content } + set { content = newValue } + } + @inlinable convenience public init() where Content == T? { + self.init(wrappedValue: nil) + } + @inlinable convenience public init(_ wrappedValue: Content) { + self.init(wrappedValue: wrappedValue) + } + public init(wrappedValue: Content) + @inlinable final public var projectedValue: FoundationExtensions.Reference { + get { reference } + } + @inlinable final public var reference: FoundationExtensions.Reference { + get { + .object(self, keyPath: \.wrappedValue) + } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.KeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + set { self.wrappedValue[keyPath: keyPath] = newValue } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.ReferenceWritableKeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + set { self.wrappedValue[keyPath: keyPath] = newValue } + } + @objc deinit +} +extension FoundationExtensions.ReadonlyReference { + @inlinable public static func constant(_ value: Value) -> FoundationExtensions.ReadonlyReference { + ReadonlyReference { value } + } + @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions.ReadonlyReference where Object : AnyObject { + ReadonlyReference(read: { read(object) }) + } +} +@propertyWrapper @dynamicMemberLookup public struct ReadonlyReference { + @usableFromInline + internal var _read: () -> Value + @inlinable public init(wrappedValue: Value) { + self.init(read: { wrappedValue }) + } + public init(read: @escaping () -> Value) + @inlinable public var wrappedValue: Value { + get { + self._read() + } + } + @inlinable public var projectedValue: FoundationExtensions.ReadonlyReference { + get { + ReadonlyReference(read: _read) + } + } + @inlinable public var asWritable: FoundationExtensions.Reference { + get { + Reference(read: _read, write: { _ in }) + } + } + @inlinable public func writable(with write: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference { + Reference(read: _read, write: write) + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> FoundationExtensions.Reference { + get { + .readonly { wrappedValue[keyPath: keyPath] } + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference { + get { + Reference( + read: { _read()[keyPath: keyPath] }, + write: { _read()[keyPath: keyPath] = $0 }) + } + } +} +extension FoundationExtensions.Reference { + @inlinable public static func readonly(_ read: @escaping () -> Value) -> FoundationExtensions.Reference { + Reference(read: read, write: { _ in }) + } + @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions.Reference where Object : AnyObject { + .readonly { read(object) } + } + @inlinable public static func object(_ object: Object, keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference where Object : AnyObject { + Reference( + read: { object[keyPath: keyPath] }, + write: { object[keyPath: keyPath] = $0 } + ) + } + @inlinable public static func variable(_ initialValue: Value) -> FoundationExtensions.Reference { + Reference(wrappedValue: initialValue) + } + @inlinable public static func constant(_ value: Value) -> FoundationExtensions.Reference { + .readonly { value } + } +} +@propertyWrapper @dynamicMemberLookup public struct Reference { + @usableFromInline + internal var _read: () -> Value + @usableFromInline + internal var _write: (Value) -> Swift.Void + @inlinable public init(wrappedValue: Value) { + var value = wrappedValue + self.init( + read: { value }, + write: { value = $0 } + ) + } + public init(read: @escaping () -> Value, write: @escaping (Value) -> Swift.Void) + @inlinable public func read() -> Value { _read() } + @inlinable public func write(_ value: Value) { _write(value) } + @inlinable public var wrappedValue: Value { + get { _read() } + nonmutating set { _write(newValue) } + } + @inlinable public var projectedValue: FoundationExtensions.Reference { + get { + Reference(read: _read, write: _write) + } + } + @inlinable public var readonly: FoundationExtensions.ReadonlyReference { + get { ReadonlyReference(read: _read) } + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> FoundationExtensions.Reference { + get { + .readonly { wrappedValue[keyPath: keyPath] } + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> FoundationExtensions.Reference { + get { + Reference( + read: { _read()[keyPath: keyPath] }, + write: { localValue in + var value = _read() + value[keyPath: keyPath] = localValue + _write(value) + } + ) + } + } +} +extension FoundationExtensions.Reference { + public func map(read: @escaping (Value) -> T, write: @escaping (T) -> Value) -> FoundationExtensions.Reference + public func onSet(perform action: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference + public func onChange(perform action: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference where Value : Swift.Equatable +} +public protocol ReferenceProvider : AnyObject { +} +extension FoundationExtensions.ReferenceProvider { + @inlinable public func reference(for keyPath: Swift.KeyPath) -> FoundationExtensions.ReadonlyReference { + .object(self, read: { $0[keyPath: keyPath] }) + } + @inlinable public func reference(for keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference { + .object(self, keyPath: keyPath) + } +} +extension ObjectiveC.NSObject : FoundationExtensions.ReferenceProvider { +} +public protocol Castable { + func `as`(_ type: T.Type) -> T? + func `is`(_ type: T.Type) -> Swift.Bool +} +extension FoundationExtensions.Castable { + public func `as`(_ type: T.Type) -> T? + public func `is`(_ type: T.Type) -> Swift.Bool +} +extension Swift.Optional : FoundationExtensions.Castable { +} +extension ObjectiveC.NSObject : FoundationExtensions.Castable { +} +@propertyWrapper @dynamicMemberLookup public struct Indirect { + @usableFromInline + internal class Storage : @unchecked Swift.Sendable { + @usableFromInline + internal var value: Value + @usableFromInline + internal init(_ value: Value) + @objc @usableFromInline + deinit + } + @usableFromInline + internal var storage: FoundationExtensions.Indirect.Storage + @inlinable public init(_ value: Value) { + self.init(wrappedValue: value) + } + @inlinable public init(wrappedValue: Value) { + self.storage = .init(wrappedValue) + } + @inlinable public var wrappedValue: Value { + get { storage.value } + set { + if !isKnownUniquelyReferenced(&storage) { + storage = Storage(storage.value) + } + storage.value = newValue + } + } + @inlinable public var projectedValue: FoundationExtensions.Indirect { + get { self } + set { self = newValue } + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> T { + get { + wrappedValue[keyPath: keyPath] + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> T { + get { wrappedValue[keyPath: keyPath] } + set { wrappedValue[keyPath: keyPath] = newValue } + } + @inlinable public func _setValue(_ value: Value) { + storage.value = value + } + @inlinable public func _modifyValue(_ transform: (inout Value) -> Swift.Void) { + transform(&storage.value) + } + @inlinable public func _sharesStorage(with other: FoundationExtensions.Indirect) -> Swift.Bool { + storage === other.storage + } +} +extension FoundationExtensions.Indirect : Swift.Sendable where Value : Swift.Sendable { +} +extension FoundationExtensions.Indirect : Swift.Equatable where Value : Swift.Equatable { + @inlinable public static func == (lhs: FoundationExtensions.Indirect, rhs: FoundationExtensions.Indirect) -> Swift.Bool { + lhs.wrappedValue == rhs.wrappedValue + } +} +extension FoundationExtensions.Indirect : Swift.Hashable where Value : Swift.Hashable { + @inlinable public func hash(into hasher: inout Swift.Hasher) { + wrappedValue.hash(into: &hasher) + } + public var hashValue: Swift.Int { + get + } +} +extension FoundationExtensions.Indirect : Swift.Comparable where Value : Swift.Comparable { + @inlinable public static func < (lhs: FoundationExtensions.Indirect, rhs: FoundationExtensions.Indirect) -> Swift.Bool { + lhs.wrappedValue < rhs.wrappedValue + } +} +extension FoundationExtensions.Indirect : Swift.Decodable where Value : Swift.Decodable { + @inlinable public init(from decoder: any Swift.Decoder) throws { + try self.init(.init(from: decoder)) + } +} +extension FoundationExtensions.Indirect : Swift.Encodable where Value : Swift.Encodable { + @inlinable public func encode(to encoder: any Swift.Encoder) throws { + try wrappedValue.encode(to: encoder) + } +} +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +extension FoundationExtensions.Indirect : Swift.Identifiable where Value : Swift.Identifiable { + @inlinable public var id: Value.ID { + get { wrappedValue.id } + } + @available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *) + public typealias ID = Value.ID +} +@propertyWrapper public struct PropertyProxy where Object : AnyObject { + public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift.ReferenceWritableKeyPath, storage storageKeyPath: Swift.ReferenceWritableKeyPath>) -> Value { + get + set + } + private let keyPath: Swift.ReferenceWritableKeyPath + @available(*, unavailable, message: "@PropertyProxy can only be applied to classes") + public var wrappedValue: Value { + get + set + } + public init(_ keyPath: Swift.ReferenceWritableKeyPath) +} +@propertyWrapper public struct ReadonlyPropertyProxy where Object : AnyObject { + public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift.KeyPath, storage storageKeyPath: Swift.KeyPath>) -> Value { + get + } + private let keyPath: Swift.KeyPath + @available(*, unavailable, message: "@PropertyProxy can only be applied to classes") + public var wrappedValue: Value { + get + set + } + public init(_ keyPath: Swift.KeyPath) +} +extension Foundation.NSNotification.Name { + @available(*, deprecated, message: "Use IssueReporting module from https://github.com/pointfreeco/swift-issue-reporting") + @_hasInitialValue public static let foundationExtensionsRuntimeWarning: Foundation.NSNotification.Name +} +@available(*, deprecated, message: "Use IssueReporting module from https://github.com/pointfreeco/swift-issue-reporting") +@_transparent @inlinable @inline(__always) public func runtimeWarn(_ message: @autoclosure () -> Swift.String, category: Swift.String? = "FoundationExtensions", notificationName: Foundation.Notification.Name? = .foundationExtensionsRuntimeWarning) { +} +@_hasInitialValue public let isTesting: Swift.Bool +public struct USID : Swift.Equatable, Swift.Hashable, Swift.RawRepresentable, Swift.ExpressibleByStringLiteral, Swift.ExpressibleByStringInterpolation, Swift.LosslessStringConvertible { + public let rawValue: Swift.String + @inlinable public init(_ uuid: Foundation.UUID = .init()) { + self.init(uuid.uuidString) + } + @inlinable public init(stringLiteral value: Swift.String) { + self.init(value) + } + @inlinable public init(_ value: Swift.String) { + self.init(rawValue: value) + } + @inlinable public init(usidString value: Swift.String) { + self.init(rawValue: value) + } + @inlinable public init(rawValue value: Swift.String) { + self.rawValue = value + } + @inlinable public var description: Swift.String { + get { rawValue } + } + @inlinable public var usidString: Swift.String { + get { rawValue } + } + @inlinable public var intValue: Swift.Int? { + get { Int(rawValue) } + } + @inlinable public var uuidValue: Foundation.UUID? { + get { UUID(uuidString: rawValue) } + } + public typealias ExtendedGraphemeClusterLiteralType = Swift.String + public typealias RawValue = Swift.String + public typealias StringInterpolation = Swift.DefaultStringInterpolation + public typealias StringLiteralType = Swift.String + public typealias UnicodeScalarLiteralType = Swift.String +} +extension FoundationExtensions.USID : Swift.Codable { + @inlinable public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.singleValueContainer() + self.init(rawValue: try container.decode(String.self)) + } + @inlinable public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} +extension FoundationExtensions.USID : Swift.ExpressibleByIntegerLiteral { + @inlinable public init(integerLiteral value: Swift.Int) { + self = .describing(value) + } + public typealias IntegerLiteralType = Swift.Int +} +extension FoundationExtensions.USID { + @inlinable public static func describing(_ value: Value) -> FoundationExtensions.USID where Value : Swift.CustomStringConvertible { + return USID(rawValue: String(describing: value)) + } + @inlinable public static func hash(of value: Value) -> FoundationExtensions.USID where Value : Swift.Hashable { + return .describing(value.hashValue) + } + @inlinable public static func dump(_ value: T) -> FoundationExtensions.USID { + var buffer = "\(type(of: value))\n" + Swift.dump(value, to: &buffer) + return USID(rawValue: buffer) + } +} +extension Swift.String { + @inlinable public func usid() -> FoundationExtensions.USID { .init(self) } +} diff --git a/.agents/interfaces/watchos/FoundationExtensionsMacros.swiftinterface b/.agents/interfaces/watchos/FoundationExtensionsMacros.swiftinterface new file mode 100644 index 0000000..98dfcc9 --- /dev/null +++ b/.agents/interfaces/watchos/FoundationExtensionsMacros.swiftinterface @@ -0,0 +1,10 @@ +// swift-interface-format-version: 1.0 +// swift-compiler-version: Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) +// swift-module-flags: -target arm64-apple-watchos6.0-simulator -enable-objc-interop -swift-version 6 -O -module-name FoundationExtensionsMacros -package-name swift_foundation_extensions +// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.3 +@_exported import AssociatedObjectsMacros +@_exported import FoundationExtensions +import Swift +import _Concurrency +import _StringProcessing +import _SwiftConcurrencyShims From 1d9b91af6c74e71d082990589fc6ab96d0fb62b4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 07:05:57 +0200 Subject: [PATCH 3/5] Update ios Swift interfaces (#7) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../ios/FoundationExtensions.swiftinterface | 820 ++++++++++++++++++ .../FoundationExtensionsMacros.swiftinterface | 10 + 2 files changed, 830 insertions(+) create mode 100644 .agents/interfaces/ios/FoundationExtensions.swiftinterface create mode 100644 .agents/interfaces/ios/FoundationExtensionsMacros.swiftinterface diff --git a/.agents/interfaces/ios/FoundationExtensions.swiftinterface b/.agents/interfaces/ios/FoundationExtensions.swiftinterface new file mode 100644 index 0000000..6b9ac2f --- /dev/null +++ b/.agents/interfaces/ios/FoundationExtensions.swiftinterface @@ -0,0 +1,820 @@ +// swift-interface-format-version: 1.0 +// swift-compiler-version: Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) +// swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -swift-version 6 -O -module-name FoundationExtensions -package-name swift_foundation_extensions +// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.3 +@_exported import AssociatedObjects +import Combine +import Dispatch +@_exported import Equated +@_exported @preconcurrency import Foundation +@_exported import Resettable +import Swift +import _Concurrency +import _StringProcessing +import _SwiftConcurrencyShims +extension Swift.ClosedRange { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value < lowerBound { + return lowerBound + } else if value > upperBound { + return upperBound + } else { + return value + } + } +} +extension Swift.PartialRangeFrom { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value < lowerBound { + return lowerBound + } else { + return value + } + } +} +extension Swift.PartialRangeThrough { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value > upperBound { + return upperBound + } else { + return value + } + } +} +@available(*, deprecated, renamed: "Optional.UnwrappingError", message: "Use Optional.UnwrappingError instead") +public typealias UnwrappingError = Swift.Optional.UnwrappingError +extension Swift.Optional.UnwrappingError { + @available(*, deprecated, message: "Instead of UnwrappingError, use Optional.UnwrappingError") + public typealias T = Wrapped +} +extension Foundation.Bundle { + @inlinable public var appVersionNumber: Swift.String? { + get { infoDictionary?["CFBundleShortVersionString"] as? String } + } + @inlinable public var buildVersionNumber: Swift.String? { + get { infoDictionary?["CFBundleVersion"] as? String } + } + @inlinable public var teamIdentifierPrefix: Swift.String? { + get { infoDictionary?["TeamIdentifierPrefix"] as? String } + } + @inlinable public var keyPrefix: Swift.String { + get { + return bundleIdentifier.map { $0.appending(".") }.or("") + } + } + @inlinable public func makeKey(_ key: Swift.String) -> Swift.String { + return keyPrefix.appending(key) + } + @inlinable public func appGroupID(for teamIdentifier: Swift.String) -> Swift.String? { + return teamIdentifierPrefix.map { "\($0)\(teamIdentifier)" } + } +} +public enum RawCodingKey : Swift.CodingKey, Swift.ExpressibleByStringLiteral, Swift.ExpressibleByIntegerLiteral { + case key(Swift.String) + case index(Swift.Int) + @inlinable public init(stringLiteral value: Swift.String) { + self.init(stringValue: value) + } + @inlinable public init(stringValue: Swift.String) { + self = .key(stringValue) + } + @inlinable public init(integerLiteral value: Swift.Int) { + self.init(intValue: value) + } + @inlinable public init(intValue: Swift.Int) { + self = .index(intValue) + } + @inlinable public var stringValue: Swift.String { + get { + switch self { + case let .key(value): + return value + case let .index(value): + return value.description + } + } + } + @inlinable public var intValue: Swift.Int? { + get { + switch self { + case let .index(value): + return value + default: + return nil + } + } + } + public typealias ExtendedGraphemeClusterLiteralType = Swift.String + public typealias IntegerLiteralType = Swift.Int + public typealias StringLiteralType = Swift.String + public typealias UnicodeScalarLiteralType = Swift.String +} +extension Swift.Decoder { + @inlinable public func decode(_ decode: (Swift.KeyedDecodingContainer) throws -> T) throws -> T { + return try self.decode(RawCodingKey.self, decode) + } + @inlinable public func decode(_ codingKeys: CodingKeys.Type, _ decode: (Swift.KeyedDecodingContainer) throws -> T) throws -> T where CodingKeys : Swift.CodingKey { + let container = try container(keyedBy: codingKeys) + return try decode(container) + } +} +extension Swift.Encoder { + @inlinable public func encode(_ encode: (inout Swift.KeyedEncodingContainer) throws -> T) throws -> T { + return try self.encode(RawCodingKey.self, encode) + } + @inlinable public func encode(_ codingKeys: CodingKeys.Type, _ encode: (inout Swift.KeyedEncodingContainer) throws -> T) throws -> T where CodingKeys : Swift.CodingKey { + var container = container(keyedBy: codingKeys) + return try encode(&container) + } +} +extension Swift.KeyedDecodingContainer { + @inlinable public func decode(_ key: K) throws -> T where T : Swift.Decodable { + try decode(T.self, forKey: key) + } + @inlinable public func decodeIfPresent(_ key: K) throws -> T? where T : Swift.Decodable { + try decodeIfPresent(T.self, forKey: key) + } +} +extension Swift.Collection { + @inlinable public var isNotEmpty: Swift.Bool { + get { !self.isEmpty } + } +} +extension Swift.Array { + @inlinable public mutating func bringFront(elementsSatisfying predicate: (Element) -> Swift.Bool) { + let leftHalf = self.filter { predicate($0) } + let rightHalf = self.filter { !predicate($0) } + self = leftHalf + rightHalf + } +} +extension Swift.MutableCollection { + @inlinable public subscript(safe index: Self.Index?) -> Self.Element? { + get { + guard let index = index else { return nil } + return self[safe: index] + } + set { + guard let index = index else { return } + self[safe: index] = newValue + } + } + @inlinable public subscript(safe index: Self.Index) -> Self.Element? { + get { + guard indices.contains(index) + else { return nil } + return self[index] + } + set { + guard + indices.contains(index), + let value = newValue + else { return } + return self[index] = value + } + } +} +extension Swift.Collection { + @inlinable public subscript(safe index: Self.Index?) -> Self.Element? { + get { + guard let index = index else { return nil } + return self[safe: index] + } + } + @inlinable public subscript(safe index: Self.Index) -> Self.Element? { + get { + guard indices.contains(index) + else { return nil } + return self[index] + } + } +} +extension Swift.Comparable { + @inlinable public func clamped(in range: Swift.ClosedRange) -> Self { + min(max(range.lowerBound, self), range.upperBound) + } + @inlinable public mutating func clamp(in range: Swift.ClosedRange) { + self = self.clamped(in: range) + } + @inlinable public func clamped(in range: Swift.PartialRangeFrom) -> Self { + max(range.lowerBound, self) + } + @inlinable public mutating func clamp(in range: Swift.PartialRangeFrom) { + self = self.clamped(in: range) + } + @inlinable public func clamped(in range: Swift.PartialRangeThrough) -> Self { + min(self, range.upperBound) + } + @inlinable public mutating func clamp(in range: Swift.PartialRangeThrough) { + self = self.clamped(in: range) + } +} +extension Dispatch.DispatchTimeInterval { + @inlinable public static func interval(_ value: Foundation.TimeInterval) -> Dispatch.DispatchTimeInterval { + return .nanoseconds(Int(value * pow(10, 9))) + } +} +extension Dispatch.DispatchTime : @retroactive Swift.ExpressibleByFloatLiteral { + public typealias FloatLiteralType = Foundation.TimeInterval +} +extension Dispatch.DispatchTime { + @inlinable public static func interval(_ interval: Foundation.TimeInterval) -> Dispatch.DispatchTime { + return .now() + .interval(interval) + } + @inlinable public init(floatLiteral value: Foundation.TimeInterval) { + self = .interval(value) + } +} +extension Swift.FloatingPoint { + @inlinable public func progress(in total: Self) -> Self { + total != 0 ? self / total : 0 + } +} +extension Foundation.NSMutableAttributedString { + @inlinable public func addAttribute(_ key: Foundation.NSAttributedString.Key, value: Any) { + addAttribute(key, value: value, range: NSRange(0.. Swift.Void) -> Foundation.NSAttributedString { + let attributedString = NSMutableAttributedString(attributedString: self) + let range = NSRange(0.. Swift.Void) -> Foundation.NSAttributedString { + let attributedString = NSMutableAttributedString(attributedString: self) + let range = NSRange(0..(_ value: T, in object: inout T) { + mutate(&object, with: { $0 = value }) + } + @inlinable public func mutate(_ object: T, with closure: (T) -> Swift.Void) where T : AnyObject { + execute { closure(object) } + } + @inlinable public func mutate(_ object: inout T, with closure: (inout T) -> Swift.Void) { + execute { closure(&object) } + } + @inlinable public func assign(_ value: Value, to keyPath: Swift.ReferenceWritableKeyPath, on object: T) where T : AnyObject { + execute { object[keyPath: keyPath] = value } + } + @inlinable public func assign(_ value: Value, to keyPath: Swift.WritableKeyPath, on object: inout T) { + execute { object[keyPath: keyPath] = value } + } + @discardableResult + @inlinable public func execute(_ closure: () -> T) -> T { + withLock(closure) + } +} +public protocol NSObjectSwizzlingProtocol : ObjectiveC.NSObjectProtocol { +} +extension FoundationExtensions.NSObjectSwizzlingProtocol { + @available(*, deprecated, message: "Use `objc_exchangeImplementations(_,_,_)` instead") + @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC.Selector, _ swizzledSelector: ObjectiveC.Selector) { + objc_exchangeImplementations( + originalSelector, + swizzledSelector, + using: class_getInstanceMethod + ) + } + @discardableResult + @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC.Selector, _ swizzledSelector: ObjectiveC.Selector, using extractMethod: (Swift.AnyClass?, ObjectiveC.Selector) -> ObjectiveC.Method?) -> Swift.Bool { + let originalMethod = extractMethod( + Self.self, + originalSelector + ) + + let swizzledMethod = extractMethod( + Self.self, + swizzledSelector + ) + + guard + let originalMethod, + let swizzledMethod + else { return false } + + method_exchangeImplementations(originalMethod, swizzledMethod) + return true + } +} +extension ObjectiveC.NSObject : FoundationExtensions.NSObjectSwizzlingProtocol { +} +extension Swift.Optional { + @inlinable public func orThrow(_ error: @autoclosure () -> any Swift.Error) throws -> Wrapped { + switch self { + case .some(let wrapped): + return wrapped + case .none: + throw error() + } + } + @inlinable public var isNil: Swift.Bool { + get { + switch self { + case .none: return true + case .some: return false + } + } + } + @inlinable public var isNotNil: Swift.Bool { + get { !isNil } + } + @inlinable public func or(_ value: @autoclosure () -> Wrapped) -> Wrapped { + self ?? value() + } + @inlinable public func or(_ value: @autoclosure () -> Wrapped?) -> Wrapped? { + self ?? value() + } + @inlinable public func unwrap(function: Swift.String = #function, file: Swift.String = #file, line: Swift.Int = #line) -> Swift.Result.UnwrappingError> { + switch self { + case .some(let value): + return .success(value) + case .none: + return .failure( + UnwrappingError( + function: function, + file: file, + line: line + ) + ) + } + } + @inlinable public func assign(to keyPath: Swift.ReferenceWritableKeyPath>, on target: T) where T : AnyObject { target[keyPath: keyPath] = self } + @inlinable public func ifLetAssign(to keyPath: Swift.ReferenceWritableKeyPath, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } + @inlinable public func ifLetAssign(to keyPath: Swift.ReferenceWritableKeyPath>, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } + @inlinable public func assign(to keyPath: Swift.WritableKeyPath>, on target: inout T) { target[keyPath: keyPath] = self } + @inlinable public func ifLetAssign(to keyPath: Swift.WritableKeyPath, on target: inout T) { map { target[keyPath: keyPath] = $0 } } + @inlinable public func ifLetAssign(to keyPath: Swift.WritableKeyPath>, on target: inout T) { map { target[keyPath: keyPath] = $0 } } +} +extension Swift.Optional where Wrapped : Swift.Collection { + @inlinable public var isNilOrEmpty: Swift.Bool { + get { + map(\.isEmpty).or(true) + } + } +} +extension Swift.Optional { + public struct UnwrappingError : Swift.Error { + public let type: Wrapped.Type + public let function: Swift.String + public let file: Swift.String + public let line: Swift.Int + public init(_ type: Wrapped.Type = Wrapped.self, function: Swift.String = #function, file: Swift.String = #file, line: Swift.Int = #line) + @inlinable public var debugDescription: Swift.String { + get { + localizedDescription + .appending("\n{") + .appending("\n function: \(function)") + .appending("\n file: \(file),") + .appending("\n line: \(line)") + .appending("\n}") + } + } + } +} +extension Swift.Range where Bound : Swift.Numeric { + @inlinable public var length: Bound { + get { upperBound - lowerBound } + } +} +extension Swift.ClosedRange where Bound : Swift.Numeric { + @inlinable public var length: Bound { + get { upperBound - lowerBound } + } +} +extension Swift.Result { + @inlinable public var value: Success? { + get { + switch self { + case let .success(value): return value + default: return nil + } + } + } + @inlinable public var error: Failure? { + get { + switch self { + case let .failure(error): return error + default: return nil + } + } + } + @inlinable public func eraseError() -> Swift.Result { + mapError { $0 as Error } + } + @inlinable public func replaceError(with success: Success) -> Swift.Result { + replaceError { _ in success } + } + @inlinable public func replaceError(with closure: (any Swift.Error) -> Success) -> Swift.Result { + switch self { + case .success(let value): + return .success(value) + case .failure(let error): + return .success(closure(error)) + } + } +} +extension Swift.String { + @inlinable public func ranges(of substring: Swift.String, options: Swift.String.CompareOptions = [], locale: Foundation.Locale? = nil) -> [Swift.Range] { + var ranges: [Range] = [] + while + let range = range( + of: substring, + options: options, + range: (ranges.last?.upperBound ?? startIndex).. { + final public var content: Content + @inlinable final public var wrappedValue: Content { + get { content } + set { content = newValue } + } + @inlinable convenience public init() where Content == T? { + self.init(wrappedValue: nil) + } + @inlinable convenience public init(_ wrappedValue: Content) { + self.init(wrappedValue: wrappedValue) + } + public init(wrappedValue: Content) + @inlinable final public var projectedValue: FoundationExtensions.Reference { + get { reference } + } + @inlinable final public var reference: FoundationExtensions.Reference { + get { + .object(self, keyPath: \.wrappedValue) + } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.KeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + set { self.wrappedValue[keyPath: keyPath] = newValue } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.ReferenceWritableKeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + set { self.wrappedValue[keyPath: keyPath] = newValue } + } + @objc deinit +} +extension FoundationExtensions.ReadonlyReference { + @inlinable public static func constant(_ value: Value) -> FoundationExtensions.ReadonlyReference { + ReadonlyReference { value } + } + @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions.ReadonlyReference where Object : AnyObject { + ReadonlyReference(read: { read(object) }) + } +} +@propertyWrapper @dynamicMemberLookup public struct ReadonlyReference { + @usableFromInline + internal var _read: () -> Value + @inlinable public init(wrappedValue: Value) { + self.init(read: { wrappedValue }) + } + public init(read: @escaping () -> Value) + @inlinable public var wrappedValue: Value { + get { + self._read() + } + } + @inlinable public var projectedValue: FoundationExtensions.ReadonlyReference { + get { + ReadonlyReference(read: _read) + } + } + @inlinable public var asWritable: FoundationExtensions.Reference { + get { + Reference(read: _read, write: { _ in }) + } + } + @inlinable public func writable(with write: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference { + Reference(read: _read, write: write) + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> FoundationExtensions.Reference { + get { + .readonly { wrappedValue[keyPath: keyPath] } + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference { + get { + Reference( + read: { _read()[keyPath: keyPath] }, + write: { _read()[keyPath: keyPath] = $0 }) + } + } +} +extension FoundationExtensions.Reference { + @inlinable public static func readonly(_ read: @escaping () -> Value) -> FoundationExtensions.Reference { + Reference(read: read, write: { _ in }) + } + @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions.Reference where Object : AnyObject { + .readonly { read(object) } + } + @inlinable public static func object(_ object: Object, keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference where Object : AnyObject { + Reference( + read: { object[keyPath: keyPath] }, + write: { object[keyPath: keyPath] = $0 } + ) + } + @inlinable public static func variable(_ initialValue: Value) -> FoundationExtensions.Reference { + Reference(wrappedValue: initialValue) + } + @inlinable public static func constant(_ value: Value) -> FoundationExtensions.Reference { + .readonly { value } + } +} +@propertyWrapper @dynamicMemberLookup public struct Reference { + @usableFromInline + internal var _read: () -> Value + @usableFromInline + internal var _write: (Value) -> Swift.Void + @inlinable public init(wrappedValue: Value) { + var value = wrappedValue + self.init( + read: { value }, + write: { value = $0 } + ) + } + public init(read: @escaping () -> Value, write: @escaping (Value) -> Swift.Void) + @inlinable public func read() -> Value { _read() } + @inlinable public func write(_ value: Value) { _write(value) } + @inlinable public var wrappedValue: Value { + get { _read() } + nonmutating set { _write(newValue) } + } + @inlinable public var projectedValue: FoundationExtensions.Reference { + get { + Reference(read: _read, write: _write) + } + } + @inlinable public var readonly: FoundationExtensions.ReadonlyReference { + get { ReadonlyReference(read: _read) } + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> FoundationExtensions.Reference { + get { + .readonly { wrappedValue[keyPath: keyPath] } + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> FoundationExtensions.Reference { + get { + Reference( + read: { _read()[keyPath: keyPath] }, + write: { localValue in + var value = _read() + value[keyPath: keyPath] = localValue + _write(value) + } + ) + } + } +} +extension FoundationExtensions.Reference { + public func map(read: @escaping (Value) -> T, write: @escaping (T) -> Value) -> FoundationExtensions.Reference + public func onSet(perform action: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference + public func onChange(perform action: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference where Value : Swift.Equatable +} +public protocol ReferenceProvider : AnyObject { +} +extension FoundationExtensions.ReferenceProvider { + @inlinable public func reference(for keyPath: Swift.KeyPath) -> FoundationExtensions.ReadonlyReference { + .object(self, read: { $0[keyPath: keyPath] }) + } + @inlinable public func reference(for keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference { + .object(self, keyPath: keyPath) + } +} +extension ObjectiveC.NSObject : FoundationExtensions.ReferenceProvider { +} +public protocol Castable { + func `as`(_ type: T.Type) -> T? + func `is`(_ type: T.Type) -> Swift.Bool +} +extension FoundationExtensions.Castable { + public func `as`(_ type: T.Type) -> T? + public func `is`(_ type: T.Type) -> Swift.Bool +} +extension Swift.Optional : FoundationExtensions.Castable { +} +extension ObjectiveC.NSObject : FoundationExtensions.Castable { +} +@propertyWrapper @dynamicMemberLookup public struct Indirect { + @usableFromInline + internal class Storage : @unchecked Swift.Sendable { + @usableFromInline + internal var value: Value + @usableFromInline + internal init(_ value: Value) + @objc @usableFromInline + deinit + } + @usableFromInline + internal var storage: FoundationExtensions.Indirect.Storage + @inlinable public init(_ value: Value) { + self.init(wrappedValue: value) + } + @inlinable public init(wrappedValue: Value) { + self.storage = .init(wrappedValue) + } + @inlinable public var wrappedValue: Value { + get { storage.value } + set { + if !isKnownUniquelyReferenced(&storage) { + storage = Storage(storage.value) + } + storage.value = newValue + } + } + @inlinable public var projectedValue: FoundationExtensions.Indirect { + get { self } + set { self = newValue } + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> T { + get { + wrappedValue[keyPath: keyPath] + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> T { + get { wrappedValue[keyPath: keyPath] } + set { wrappedValue[keyPath: keyPath] = newValue } + } + @inlinable public func _setValue(_ value: Value) { + storage.value = value + } + @inlinable public func _modifyValue(_ transform: (inout Value) -> Swift.Void) { + transform(&storage.value) + } + @inlinable public func _sharesStorage(with other: FoundationExtensions.Indirect) -> Swift.Bool { + storage === other.storage + } +} +extension FoundationExtensions.Indirect : Swift.Sendable where Value : Swift.Sendable { +} +extension FoundationExtensions.Indirect : Swift.Equatable where Value : Swift.Equatable { + @inlinable public static func == (lhs: FoundationExtensions.Indirect, rhs: FoundationExtensions.Indirect) -> Swift.Bool { + lhs.wrappedValue == rhs.wrappedValue + } +} +extension FoundationExtensions.Indirect : Swift.Hashable where Value : Swift.Hashable { + @inlinable public func hash(into hasher: inout Swift.Hasher) { + wrappedValue.hash(into: &hasher) + } + public var hashValue: Swift.Int { + get + } +} +extension FoundationExtensions.Indirect : Swift.Comparable where Value : Swift.Comparable { + @inlinable public static func < (lhs: FoundationExtensions.Indirect, rhs: FoundationExtensions.Indirect) -> Swift.Bool { + lhs.wrappedValue < rhs.wrappedValue + } +} +extension FoundationExtensions.Indirect : Swift.Decodable where Value : Swift.Decodable { + @inlinable public init(from decoder: any Swift.Decoder) throws { + try self.init(.init(from: decoder)) + } +} +extension FoundationExtensions.Indirect : Swift.Encodable where Value : Swift.Encodable { + @inlinable public func encode(to encoder: any Swift.Encoder) throws { + try wrappedValue.encode(to: encoder) + } +} +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +extension FoundationExtensions.Indirect : Swift.Identifiable where Value : Swift.Identifiable { + @inlinable public var id: Value.ID { + get { wrappedValue.id } + } + @available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *) + public typealias ID = Value.ID +} +@propertyWrapper public struct PropertyProxy where Object : AnyObject { + public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift.ReferenceWritableKeyPath, storage storageKeyPath: Swift.ReferenceWritableKeyPath>) -> Value { + get + set + } + private let keyPath: Swift.ReferenceWritableKeyPath + @available(*, unavailable, message: "@PropertyProxy can only be applied to classes") + public var wrappedValue: Value { + get + set + } + public init(_ keyPath: Swift.ReferenceWritableKeyPath) +} +@propertyWrapper public struct ReadonlyPropertyProxy where Object : AnyObject { + public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift.KeyPath, storage storageKeyPath: Swift.KeyPath>) -> Value { + get + } + private let keyPath: Swift.KeyPath + @available(*, unavailable, message: "@PropertyProxy can only be applied to classes") + public var wrappedValue: Value { + get + set + } + public init(_ keyPath: Swift.KeyPath) +} +extension Foundation.NSNotification.Name { + @available(*, deprecated, message: "Use IssueReporting module from https://github.com/pointfreeco/swift-issue-reporting") + @_hasInitialValue public static let foundationExtensionsRuntimeWarning: Foundation.NSNotification.Name +} +@available(*, deprecated, message: "Use IssueReporting module from https://github.com/pointfreeco/swift-issue-reporting") +@_transparent @inlinable @inline(__always) public func runtimeWarn(_ message: @autoclosure () -> Swift.String, category: Swift.String? = "FoundationExtensions", notificationName: Foundation.Notification.Name? = .foundationExtensionsRuntimeWarning) { +} +@_hasInitialValue public let isTesting: Swift.Bool +public struct USID : Swift.Equatable, Swift.Hashable, Swift.RawRepresentable, Swift.ExpressibleByStringLiteral, Swift.ExpressibleByStringInterpolation, Swift.LosslessStringConvertible { + public let rawValue: Swift.String + @inlinable public init(_ uuid: Foundation.UUID = .init()) { + self.init(uuid.uuidString) + } + @inlinable public init(stringLiteral value: Swift.String) { + self.init(value) + } + @inlinable public init(_ value: Swift.String) { + self.init(rawValue: value) + } + @inlinable public init(usidString value: Swift.String) { + self.init(rawValue: value) + } + @inlinable public init(rawValue value: Swift.String) { + self.rawValue = value + } + @inlinable public var description: Swift.String { + get { rawValue } + } + @inlinable public var usidString: Swift.String { + get { rawValue } + } + @inlinable public var intValue: Swift.Int? { + get { Int(rawValue) } + } + @inlinable public var uuidValue: Foundation.UUID? { + get { UUID(uuidString: rawValue) } + } + public typealias ExtendedGraphemeClusterLiteralType = Swift.String + public typealias RawValue = Swift.String + public typealias StringInterpolation = Swift.DefaultStringInterpolation + public typealias StringLiteralType = Swift.String + public typealias UnicodeScalarLiteralType = Swift.String +} +extension FoundationExtensions.USID : Swift.Codable { + @inlinable public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.singleValueContainer() + self.init(rawValue: try container.decode(String.self)) + } + @inlinable public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} +extension FoundationExtensions.USID : Swift.ExpressibleByIntegerLiteral { + @inlinable public init(integerLiteral value: Swift.Int) { + self = .describing(value) + } + public typealias IntegerLiteralType = Swift.Int +} +extension FoundationExtensions.USID { + @inlinable public static func describing(_ value: Value) -> FoundationExtensions.USID where Value : Swift.CustomStringConvertible { + return USID(rawValue: String(describing: value)) + } + @inlinable public static func hash(of value: Value) -> FoundationExtensions.USID where Value : Swift.Hashable { + return .describing(value.hashValue) + } + @inlinable public static func dump(_ value: T) -> FoundationExtensions.USID { + var buffer = "\(type(of: value))\n" + Swift.dump(value, to: &buffer) + return USID(rawValue: buffer) + } +} +extension Swift.String { + @inlinable public func usid() -> FoundationExtensions.USID { .init(self) } +} diff --git a/.agents/interfaces/ios/FoundationExtensionsMacros.swiftinterface b/.agents/interfaces/ios/FoundationExtensionsMacros.swiftinterface new file mode 100644 index 0000000..5c8d1ba --- /dev/null +++ b/.agents/interfaces/ios/FoundationExtensionsMacros.swiftinterface @@ -0,0 +1,10 @@ +// swift-interface-format-version: 1.0 +// swift-compiler-version: Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) +// swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -swift-version 6 -O -module-name FoundationExtensionsMacros -package-name swift_foundation_extensions +// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.3 +@_exported import AssociatedObjectsMacros +@_exported import FoundationExtensions +import Swift +import _Concurrency +import _StringProcessing +import _SwiftConcurrencyShims From 938f37a05c700e8539341efaa4aefffba770cf53 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 07:06:01 +0200 Subject: [PATCH 4/5] Update tvos Swift interfaces (#8) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../tvos/FoundationExtensions.swiftinterface | 820 ++++++++++++++++++ .../FoundationExtensionsMacros.swiftinterface | 10 + 2 files changed, 830 insertions(+) create mode 100644 .agents/interfaces/tvos/FoundationExtensions.swiftinterface create mode 100644 .agents/interfaces/tvos/FoundationExtensionsMacros.swiftinterface diff --git a/.agents/interfaces/tvos/FoundationExtensions.swiftinterface b/.agents/interfaces/tvos/FoundationExtensions.swiftinterface new file mode 100644 index 0000000..d141423 --- /dev/null +++ b/.agents/interfaces/tvos/FoundationExtensions.swiftinterface @@ -0,0 +1,820 @@ +// swift-interface-format-version: 1.0 +// swift-compiler-version: Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) +// swift-module-flags: -target arm64-apple-tvos13.0-simulator -enable-objc-interop -swift-version 6 -O -module-name FoundationExtensions -package-name swift_foundation_extensions +// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.3 +@_exported import AssociatedObjects +import Combine +import Dispatch +@_exported import Equated +@_exported @preconcurrency import Foundation +@_exported import Resettable +import Swift +import _Concurrency +import _StringProcessing +import _SwiftConcurrencyShims +extension Swift.ClosedRange { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value < lowerBound { + return lowerBound + } else if value > upperBound { + return upperBound + } else { + return value + } + } +} +extension Swift.PartialRangeFrom { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value < lowerBound { + return lowerBound + } else { + return value + } + } +} +extension Swift.PartialRangeThrough { + @available(*, deprecated, message: "Use value.clamped(in: range) instead") + @inlinable public func clamped(_ value: Bound) -> Bound { + if value > upperBound { + return upperBound + } else { + return value + } + } +} +@available(*, deprecated, renamed: "Optional.UnwrappingError", message: "Use Optional.UnwrappingError instead") +public typealias UnwrappingError = Swift.Optional.UnwrappingError +extension Swift.Optional.UnwrappingError { + @available(*, deprecated, message: "Instead of UnwrappingError, use Optional.UnwrappingError") + public typealias T = Wrapped +} +extension Foundation.Bundle { + @inlinable public var appVersionNumber: Swift.String? { + get { infoDictionary?["CFBundleShortVersionString"] as? String } + } + @inlinable public var buildVersionNumber: Swift.String? { + get { infoDictionary?["CFBundleVersion"] as? String } + } + @inlinable public var teamIdentifierPrefix: Swift.String? { + get { infoDictionary?["TeamIdentifierPrefix"] as? String } + } + @inlinable public var keyPrefix: Swift.String { + get { + return bundleIdentifier.map { $0.appending(".") }.or("") + } + } + @inlinable public func makeKey(_ key: Swift.String) -> Swift.String { + return keyPrefix.appending(key) + } + @inlinable public func appGroupID(for teamIdentifier: Swift.String) -> Swift.String? { + return teamIdentifierPrefix.map { "\($0)\(teamIdentifier)" } + } +} +public enum RawCodingKey : Swift.CodingKey, Swift.ExpressibleByStringLiteral, Swift.ExpressibleByIntegerLiteral { + case key(Swift.String) + case index(Swift.Int) + @inlinable public init(stringLiteral value: Swift.String) { + self.init(stringValue: value) + } + @inlinable public init(stringValue: Swift.String) { + self = .key(stringValue) + } + @inlinable public init(integerLiteral value: Swift.Int) { + self.init(intValue: value) + } + @inlinable public init(intValue: Swift.Int) { + self = .index(intValue) + } + @inlinable public var stringValue: Swift.String { + get { + switch self { + case let .key(value): + return value + case let .index(value): + return value.description + } + } + } + @inlinable public var intValue: Swift.Int? { + get { + switch self { + case let .index(value): + return value + default: + return nil + } + } + } + public typealias ExtendedGraphemeClusterLiteralType = Swift.String + public typealias IntegerLiteralType = Swift.Int + public typealias StringLiteralType = Swift.String + public typealias UnicodeScalarLiteralType = Swift.String +} +extension Swift.Decoder { + @inlinable public func decode(_ decode: (Swift.KeyedDecodingContainer) throws -> T) throws -> T { + return try self.decode(RawCodingKey.self, decode) + } + @inlinable public func decode(_ codingKeys: CodingKeys.Type, _ decode: (Swift.KeyedDecodingContainer) throws -> T) throws -> T where CodingKeys : Swift.CodingKey { + let container = try container(keyedBy: codingKeys) + return try decode(container) + } +} +extension Swift.Encoder { + @inlinable public func encode(_ encode: (inout Swift.KeyedEncodingContainer) throws -> T) throws -> T { + return try self.encode(RawCodingKey.self, encode) + } + @inlinable public func encode(_ codingKeys: CodingKeys.Type, _ encode: (inout Swift.KeyedEncodingContainer) throws -> T) throws -> T where CodingKeys : Swift.CodingKey { + var container = container(keyedBy: codingKeys) + return try encode(&container) + } +} +extension Swift.KeyedDecodingContainer { + @inlinable public func decode(_ key: K) throws -> T where T : Swift.Decodable { + try decode(T.self, forKey: key) + } + @inlinable public func decodeIfPresent(_ key: K) throws -> T? where T : Swift.Decodable { + try decodeIfPresent(T.self, forKey: key) + } +} +extension Swift.Collection { + @inlinable public var isNotEmpty: Swift.Bool { + get { !self.isEmpty } + } +} +extension Swift.Array { + @inlinable public mutating func bringFront(elementsSatisfying predicate: (Element) -> Swift.Bool) { + let leftHalf = self.filter { predicate($0) } + let rightHalf = self.filter { !predicate($0) } + self = leftHalf + rightHalf + } +} +extension Swift.MutableCollection { + @inlinable public subscript(safe index: Self.Index?) -> Self.Element? { + get { + guard let index = index else { return nil } + return self[safe: index] + } + set { + guard let index = index else { return } + self[safe: index] = newValue + } + } + @inlinable public subscript(safe index: Self.Index) -> Self.Element? { + get { + guard indices.contains(index) + else { return nil } + return self[index] + } + set { + guard + indices.contains(index), + let value = newValue + else { return } + return self[index] = value + } + } +} +extension Swift.Collection { + @inlinable public subscript(safe index: Self.Index?) -> Self.Element? { + get { + guard let index = index else { return nil } + return self[safe: index] + } + } + @inlinable public subscript(safe index: Self.Index) -> Self.Element? { + get { + guard indices.contains(index) + else { return nil } + return self[index] + } + } +} +extension Swift.Comparable { + @inlinable public func clamped(in range: Swift.ClosedRange) -> Self { + min(max(range.lowerBound, self), range.upperBound) + } + @inlinable public mutating func clamp(in range: Swift.ClosedRange) { + self = self.clamped(in: range) + } + @inlinable public func clamped(in range: Swift.PartialRangeFrom) -> Self { + max(range.lowerBound, self) + } + @inlinable public mutating func clamp(in range: Swift.PartialRangeFrom) { + self = self.clamped(in: range) + } + @inlinable public func clamped(in range: Swift.PartialRangeThrough) -> Self { + min(self, range.upperBound) + } + @inlinable public mutating func clamp(in range: Swift.PartialRangeThrough) { + self = self.clamped(in: range) + } +} +extension Dispatch.DispatchTimeInterval { + @inlinable public static func interval(_ value: Foundation.TimeInterval) -> Dispatch.DispatchTimeInterval { + return .nanoseconds(Int(value * pow(10, 9))) + } +} +extension Dispatch.DispatchTime : @retroactive Swift.ExpressibleByFloatLiteral { + public typealias FloatLiteralType = Foundation.TimeInterval +} +extension Dispatch.DispatchTime { + @inlinable public static func interval(_ interval: Foundation.TimeInterval) -> Dispatch.DispatchTime { + return .now() + .interval(interval) + } + @inlinable public init(floatLiteral value: Foundation.TimeInterval) { + self = .interval(value) + } +} +extension Swift.FloatingPoint { + @inlinable public func progress(in total: Self) -> Self { + total != 0 ? self / total : 0 + } +} +extension Foundation.NSMutableAttributedString { + @inlinable public func addAttribute(_ key: Foundation.NSAttributedString.Key, value: Any) { + addAttribute(key, value: value, range: NSRange(0.. Swift.Void) -> Foundation.NSAttributedString { + let attributedString = NSMutableAttributedString(attributedString: self) + let range = NSRange(0.. Swift.Void) -> Foundation.NSAttributedString { + let attributedString = NSMutableAttributedString(attributedString: self) + let range = NSRange(0..(_ value: T, in object: inout T) { + mutate(&object, with: { $0 = value }) + } + @inlinable public func mutate(_ object: T, with closure: (T) -> Swift.Void) where T : AnyObject { + execute { closure(object) } + } + @inlinable public func mutate(_ object: inout T, with closure: (inout T) -> Swift.Void) { + execute { closure(&object) } + } + @inlinable public func assign(_ value: Value, to keyPath: Swift.ReferenceWritableKeyPath, on object: T) where T : AnyObject { + execute { object[keyPath: keyPath] = value } + } + @inlinable public func assign(_ value: Value, to keyPath: Swift.WritableKeyPath, on object: inout T) { + execute { object[keyPath: keyPath] = value } + } + @discardableResult + @inlinable public func execute(_ closure: () -> T) -> T { + withLock(closure) + } +} +public protocol NSObjectSwizzlingProtocol : ObjectiveC.NSObjectProtocol { +} +extension FoundationExtensions.NSObjectSwizzlingProtocol { + @available(*, deprecated, message: "Use `objc_exchangeImplementations(_,_,_)` instead") + @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC.Selector, _ swizzledSelector: ObjectiveC.Selector) { + objc_exchangeImplementations( + originalSelector, + swizzledSelector, + using: class_getInstanceMethod + ) + } + @discardableResult + @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC.Selector, _ swizzledSelector: ObjectiveC.Selector, using extractMethod: (Swift.AnyClass?, ObjectiveC.Selector) -> ObjectiveC.Method?) -> Swift.Bool { + let originalMethod = extractMethod( + Self.self, + originalSelector + ) + + let swizzledMethod = extractMethod( + Self.self, + swizzledSelector + ) + + guard + let originalMethod, + let swizzledMethod + else { return false } + + method_exchangeImplementations(originalMethod, swizzledMethod) + return true + } +} +extension ObjectiveC.NSObject : FoundationExtensions.NSObjectSwizzlingProtocol { +} +extension Swift.Optional { + @inlinable public func orThrow(_ error: @autoclosure () -> any Swift.Error) throws -> Wrapped { + switch self { + case .some(let wrapped): + return wrapped + case .none: + throw error() + } + } + @inlinable public var isNil: Swift.Bool { + get { + switch self { + case .none: return true + case .some: return false + } + } + } + @inlinable public var isNotNil: Swift.Bool { + get { !isNil } + } + @inlinable public func or(_ value: @autoclosure () -> Wrapped) -> Wrapped { + self ?? value() + } + @inlinable public func or(_ value: @autoclosure () -> Wrapped?) -> Wrapped? { + self ?? value() + } + @inlinable public func unwrap(function: Swift.String = #function, file: Swift.String = #file, line: Swift.Int = #line) -> Swift.Result.UnwrappingError> { + switch self { + case .some(let value): + return .success(value) + case .none: + return .failure( + UnwrappingError( + function: function, + file: file, + line: line + ) + ) + } + } + @inlinable public func assign(to keyPath: Swift.ReferenceWritableKeyPath>, on target: T) where T : AnyObject { target[keyPath: keyPath] = self } + @inlinable public func ifLetAssign(to keyPath: Swift.ReferenceWritableKeyPath, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } + @inlinable public func ifLetAssign(to keyPath: Swift.ReferenceWritableKeyPath>, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } + @inlinable public func assign(to keyPath: Swift.WritableKeyPath>, on target: inout T) { target[keyPath: keyPath] = self } + @inlinable public func ifLetAssign(to keyPath: Swift.WritableKeyPath, on target: inout T) { map { target[keyPath: keyPath] = $0 } } + @inlinable public func ifLetAssign(to keyPath: Swift.WritableKeyPath>, on target: inout T) { map { target[keyPath: keyPath] = $0 } } +} +extension Swift.Optional where Wrapped : Swift.Collection { + @inlinable public var isNilOrEmpty: Swift.Bool { + get { + map(\.isEmpty).or(true) + } + } +} +extension Swift.Optional { + public struct UnwrappingError : Swift.Error { + public let type: Wrapped.Type + public let function: Swift.String + public let file: Swift.String + public let line: Swift.Int + public init(_ type: Wrapped.Type = Wrapped.self, function: Swift.String = #function, file: Swift.String = #file, line: Swift.Int = #line) + @inlinable public var debugDescription: Swift.String { + get { + localizedDescription + .appending("\n{") + .appending("\n function: \(function)") + .appending("\n file: \(file),") + .appending("\n line: \(line)") + .appending("\n}") + } + } + } +} +extension Swift.Range where Bound : Swift.Numeric { + @inlinable public var length: Bound { + get { upperBound - lowerBound } + } +} +extension Swift.ClosedRange where Bound : Swift.Numeric { + @inlinable public var length: Bound { + get { upperBound - lowerBound } + } +} +extension Swift.Result { + @inlinable public var value: Success? { + get { + switch self { + case let .success(value): return value + default: return nil + } + } + } + @inlinable public var error: Failure? { + get { + switch self { + case let .failure(error): return error + default: return nil + } + } + } + @inlinable public func eraseError() -> Swift.Result { + mapError { $0 as Error } + } + @inlinable public func replaceError(with success: Success) -> Swift.Result { + replaceError { _ in success } + } + @inlinable public func replaceError(with closure: (any Swift.Error) -> Success) -> Swift.Result { + switch self { + case .success(let value): + return .success(value) + case .failure(let error): + return .success(closure(error)) + } + } +} +extension Swift.String { + @inlinable public func ranges(of substring: Swift.String, options: Swift.String.CompareOptions = [], locale: Foundation.Locale? = nil) -> [Swift.Range] { + var ranges: [Range] = [] + while + let range = range( + of: substring, + options: options, + range: (ranges.last?.upperBound ?? startIndex).. { + final public var content: Content + @inlinable final public var wrappedValue: Content { + get { content } + set { content = newValue } + } + @inlinable convenience public init() where Content == T? { + self.init(wrappedValue: nil) + } + @inlinable convenience public init(_ wrappedValue: Content) { + self.init(wrappedValue: wrappedValue) + } + public init(wrappedValue: Content) + @inlinable final public var projectedValue: FoundationExtensions.Reference { + get { reference } + } + @inlinable final public var reference: FoundationExtensions.Reference { + get { + .object(self, keyPath: \.wrappedValue) + } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.KeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + set { self.wrappedValue[keyPath: keyPath] = newValue } + } + @inlinable final public subscript(dynamicMember keyPath: Swift.ReferenceWritableKeyPath) -> U { + get { self.wrappedValue[keyPath: keyPath] } + set { self.wrappedValue[keyPath: keyPath] = newValue } + } + @objc deinit +} +extension FoundationExtensions.ReadonlyReference { + @inlinable public static func constant(_ value: Value) -> FoundationExtensions.ReadonlyReference { + ReadonlyReference { value } + } + @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions.ReadonlyReference where Object : AnyObject { + ReadonlyReference(read: { read(object) }) + } +} +@propertyWrapper @dynamicMemberLookup public struct ReadonlyReference { + @usableFromInline + internal var _read: () -> Value + @inlinable public init(wrappedValue: Value) { + self.init(read: { wrappedValue }) + } + public init(read: @escaping () -> Value) + @inlinable public var wrappedValue: Value { + get { + self._read() + } + } + @inlinable public var projectedValue: FoundationExtensions.ReadonlyReference { + get { + ReadonlyReference(read: _read) + } + } + @inlinable public var asWritable: FoundationExtensions.Reference { + get { + Reference(read: _read, write: { _ in }) + } + } + @inlinable public func writable(with write: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference { + Reference(read: _read, write: write) + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> FoundationExtensions.Reference { + get { + .readonly { wrappedValue[keyPath: keyPath] } + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference { + get { + Reference( + read: { _read()[keyPath: keyPath] }, + write: { _read()[keyPath: keyPath] = $0 }) + } + } +} +extension FoundationExtensions.Reference { + @inlinable public static func readonly(_ read: @escaping () -> Value) -> FoundationExtensions.Reference { + Reference(read: read, write: { _ in }) + } + @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions.Reference where Object : AnyObject { + .readonly { read(object) } + } + @inlinable public static func object(_ object: Object, keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference where Object : AnyObject { + Reference( + read: { object[keyPath: keyPath] }, + write: { object[keyPath: keyPath] = $0 } + ) + } + @inlinable public static func variable(_ initialValue: Value) -> FoundationExtensions.Reference { + Reference(wrappedValue: initialValue) + } + @inlinable public static func constant(_ value: Value) -> FoundationExtensions.Reference { + .readonly { value } + } +} +@propertyWrapper @dynamicMemberLookup public struct Reference { + @usableFromInline + internal var _read: () -> Value + @usableFromInline + internal var _write: (Value) -> Swift.Void + @inlinable public init(wrappedValue: Value) { + var value = wrappedValue + self.init( + read: { value }, + write: { value = $0 } + ) + } + public init(read: @escaping () -> Value, write: @escaping (Value) -> Swift.Void) + @inlinable public func read() -> Value { _read() } + @inlinable public func write(_ value: Value) { _write(value) } + @inlinable public var wrappedValue: Value { + get { _read() } + nonmutating set { _write(newValue) } + } + @inlinable public var projectedValue: FoundationExtensions.Reference { + get { + Reference(read: _read, write: _write) + } + } + @inlinable public var readonly: FoundationExtensions.ReadonlyReference { + get { ReadonlyReference(read: _read) } + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> FoundationExtensions.Reference { + get { + .readonly { wrappedValue[keyPath: keyPath] } + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> FoundationExtensions.Reference { + get { + Reference( + read: { _read()[keyPath: keyPath] }, + write: { localValue in + var value = _read() + value[keyPath: keyPath] = localValue + _write(value) + } + ) + } + } +} +extension FoundationExtensions.Reference { + public func map(read: @escaping (Value) -> T, write: @escaping (T) -> Value) -> FoundationExtensions.Reference + public func onSet(perform action: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference + public func onChange(perform action: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference where Value : Swift.Equatable +} +public protocol ReferenceProvider : AnyObject { +} +extension FoundationExtensions.ReferenceProvider { + @inlinable public func reference(for keyPath: Swift.KeyPath) -> FoundationExtensions.ReadonlyReference { + .object(self, read: { $0[keyPath: keyPath] }) + } + @inlinable public func reference(for keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference { + .object(self, keyPath: keyPath) + } +} +extension ObjectiveC.NSObject : FoundationExtensions.ReferenceProvider { +} +public protocol Castable { + func `as`(_ type: T.Type) -> T? + func `is`(_ type: T.Type) -> Swift.Bool +} +extension FoundationExtensions.Castable { + public func `as`(_ type: T.Type) -> T? + public func `is`(_ type: T.Type) -> Swift.Bool +} +extension Swift.Optional : FoundationExtensions.Castable { +} +extension ObjectiveC.NSObject : FoundationExtensions.Castable { +} +@propertyWrapper @dynamicMemberLookup public struct Indirect { + @usableFromInline + internal class Storage : @unchecked Swift.Sendable { + @usableFromInline + internal var value: Value + @usableFromInline + internal init(_ value: Value) + @objc @usableFromInline + deinit + } + @usableFromInline + internal var storage: FoundationExtensions.Indirect.Storage + @inlinable public init(_ value: Value) { + self.init(wrappedValue: value) + } + @inlinable public init(wrappedValue: Value) { + self.storage = .init(wrappedValue) + } + @inlinable public var wrappedValue: Value { + get { storage.value } + set { + if !isKnownUniquelyReferenced(&storage) { + storage = Storage(storage.value) + } + storage.value = newValue + } + } + @inlinable public var projectedValue: FoundationExtensions.Indirect { + get { self } + set { self = newValue } + } + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> T { + get { + wrappedValue[keyPath: keyPath] + } + } + @inlinable public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> T { + get { wrappedValue[keyPath: keyPath] } + set { wrappedValue[keyPath: keyPath] = newValue } + } + @inlinable public func _setValue(_ value: Value) { + storage.value = value + } + @inlinable public func _modifyValue(_ transform: (inout Value) -> Swift.Void) { + transform(&storage.value) + } + @inlinable public func _sharesStorage(with other: FoundationExtensions.Indirect) -> Swift.Bool { + storage === other.storage + } +} +extension FoundationExtensions.Indirect : Swift.Sendable where Value : Swift.Sendable { +} +extension FoundationExtensions.Indirect : Swift.Equatable where Value : Swift.Equatable { + @inlinable public static func == (lhs: FoundationExtensions.Indirect, rhs: FoundationExtensions.Indirect) -> Swift.Bool { + lhs.wrappedValue == rhs.wrappedValue + } +} +extension FoundationExtensions.Indirect : Swift.Hashable where Value : Swift.Hashable { + @inlinable public func hash(into hasher: inout Swift.Hasher) { + wrappedValue.hash(into: &hasher) + } + public var hashValue: Swift.Int { + get + } +} +extension FoundationExtensions.Indirect : Swift.Comparable where Value : Swift.Comparable { + @inlinable public static func < (lhs: FoundationExtensions.Indirect, rhs: FoundationExtensions.Indirect) -> Swift.Bool { + lhs.wrappedValue < rhs.wrappedValue + } +} +extension FoundationExtensions.Indirect : Swift.Decodable where Value : Swift.Decodable { + @inlinable public init(from decoder: any Swift.Decoder) throws { + try self.init(.init(from: decoder)) + } +} +extension FoundationExtensions.Indirect : Swift.Encodable where Value : Swift.Encodable { + @inlinable public func encode(to encoder: any Swift.Encoder) throws { + try wrappedValue.encode(to: encoder) + } +} +@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) +extension FoundationExtensions.Indirect : Swift.Identifiable where Value : Swift.Identifiable { + @inlinable public var id: Value.ID { + get { wrappedValue.id } + } + @available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *) + public typealias ID = Value.ID +} +@propertyWrapper public struct PropertyProxy where Object : AnyObject { + public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift.ReferenceWritableKeyPath, storage storageKeyPath: Swift.ReferenceWritableKeyPath>) -> Value { + get + set + } + private let keyPath: Swift.ReferenceWritableKeyPath + @available(*, unavailable, message: "@PropertyProxy can only be applied to classes") + public var wrappedValue: Value { + get + set + } + public init(_ keyPath: Swift.ReferenceWritableKeyPath) +} +@propertyWrapper public struct ReadonlyPropertyProxy where Object : AnyObject { + public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift.KeyPath, storage storageKeyPath: Swift.KeyPath>) -> Value { + get + } + private let keyPath: Swift.KeyPath + @available(*, unavailable, message: "@PropertyProxy can only be applied to classes") + public var wrappedValue: Value { + get + set + } + public init(_ keyPath: Swift.KeyPath) +} +extension Foundation.NSNotification.Name { + @available(*, deprecated, message: "Use IssueReporting module from https://github.com/pointfreeco/swift-issue-reporting") + @_hasInitialValue public static let foundationExtensionsRuntimeWarning: Foundation.NSNotification.Name +} +@available(*, deprecated, message: "Use IssueReporting module from https://github.com/pointfreeco/swift-issue-reporting") +@_transparent @inlinable @inline(__always) public func runtimeWarn(_ message: @autoclosure () -> Swift.String, category: Swift.String? = "FoundationExtensions", notificationName: Foundation.Notification.Name? = .foundationExtensionsRuntimeWarning) { +} +@_hasInitialValue public let isTesting: Swift.Bool +public struct USID : Swift.Equatable, Swift.Hashable, Swift.RawRepresentable, Swift.ExpressibleByStringLiteral, Swift.ExpressibleByStringInterpolation, Swift.LosslessStringConvertible { + public let rawValue: Swift.String + @inlinable public init(_ uuid: Foundation.UUID = .init()) { + self.init(uuid.uuidString) + } + @inlinable public init(stringLiteral value: Swift.String) { + self.init(value) + } + @inlinable public init(_ value: Swift.String) { + self.init(rawValue: value) + } + @inlinable public init(usidString value: Swift.String) { + self.init(rawValue: value) + } + @inlinable public init(rawValue value: Swift.String) { + self.rawValue = value + } + @inlinable public var description: Swift.String { + get { rawValue } + } + @inlinable public var usidString: Swift.String { + get { rawValue } + } + @inlinable public var intValue: Swift.Int? { + get { Int(rawValue) } + } + @inlinable public var uuidValue: Foundation.UUID? { + get { UUID(uuidString: rawValue) } + } + public typealias ExtendedGraphemeClusterLiteralType = Swift.String + public typealias RawValue = Swift.String + public typealias StringInterpolation = Swift.DefaultStringInterpolation + public typealias StringLiteralType = Swift.String + public typealias UnicodeScalarLiteralType = Swift.String +} +extension FoundationExtensions.USID : Swift.Codable { + @inlinable public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.singleValueContainer() + self.init(rawValue: try container.decode(String.self)) + } + @inlinable public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} +extension FoundationExtensions.USID : Swift.ExpressibleByIntegerLiteral { + @inlinable public init(integerLiteral value: Swift.Int) { + self = .describing(value) + } + public typealias IntegerLiteralType = Swift.Int +} +extension FoundationExtensions.USID { + @inlinable public static func describing(_ value: Value) -> FoundationExtensions.USID where Value : Swift.CustomStringConvertible { + return USID(rawValue: String(describing: value)) + } + @inlinable public static func hash(of value: Value) -> FoundationExtensions.USID where Value : Swift.Hashable { + return .describing(value.hashValue) + } + @inlinable public static func dump(_ value: T) -> FoundationExtensions.USID { + var buffer = "\(type(of: value))\n" + Swift.dump(value, to: &buffer) + return USID(rawValue: buffer) + } +} +extension Swift.String { + @inlinable public func usid() -> FoundationExtensions.USID { .init(self) } +} diff --git a/.agents/interfaces/tvos/FoundationExtensionsMacros.swiftinterface b/.agents/interfaces/tvos/FoundationExtensionsMacros.swiftinterface new file mode 100644 index 0000000..ebdf0c6 --- /dev/null +++ b/.agents/interfaces/tvos/FoundationExtensionsMacros.swiftinterface @@ -0,0 +1,10 @@ +// swift-interface-format-version: 1.0 +// swift-compiler-version: Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) +// swift-module-flags: -target arm64-apple-tvos13.0-simulator -enable-objc-interop -swift-version 6 -O -module-name FoundationExtensionsMacros -package-name swift_foundation_extensions +// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.3 +@_exported import AssociatedObjectsMacros +@_exported import FoundationExtensions +import Swift +import _Concurrency +import _StringProcessing +import _SwiftConcurrencyShims From 113c7567398c0ec3459b61f22c2111fc25d32695 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 07:06:03 +0200 Subject: [PATCH 5/5] Update macos Swift interfaces (#9) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../macos/FoundationExtensions.swiftinterface | 396 +++++++++--------- .../FoundationExtensionsMacros.swiftinterface | 6 +- 2 files changed, 201 insertions(+), 201 deletions(-) diff --git a/.agents/interfaces/macos/FoundationExtensions.swiftinterface b/.agents/interfaces/macos/FoundationExtensions.swiftinterface index 8f00391..91a1433 100644 --- a/.agents/interfaces/macos/FoundationExtensions.swiftinterface +++ b/.agents/interfaces/macos/FoundationExtensions.swiftinterface @@ -1,7 +1,7 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 6.4 (swiftlang-6.4.0.25.4 clang-2100.3.25.1) -// swift-module-flags: -target arm64-apple-macos12.0 -enable-objc-interop -language-mode 6 -O -enable-experimental-feature DebugDescriptionMacro -module-name FoundationExtensions -package-name swift_foundation_extensions -// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.4 +// swift-compiler-version: Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) +// swift-module-flags: -target arm64-apple-macosx10.15 -enable-objc-interop -swift-version 6 -O -module-name FoundationExtensions -package-name swift_foundation_extensions +// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.3 @_exported import AssociatedObjects import Combine import Dispatch @@ -12,7 +12,7 @@ import Swift import _Concurrency import _StringProcessing import _SwiftConcurrencyShims -extension Swift::ClosedRange { +extension Swift.ClosedRange { @available(*, deprecated, message: "Use value.clamped(in: range) instead") @inlinable public func clamped(_ value: Bound) -> Bound { if value < lowerBound { @@ -24,7 +24,7 @@ extension Swift::ClosedRange { } } } -extension Swift::PartialRangeFrom { +extension Swift.PartialRangeFrom { @available(*, deprecated, message: "Use value.clamped(in: range) instead") @inlinable public func clamped(_ value: Bound) -> Bound { if value < lowerBound { @@ -34,7 +34,7 @@ extension Swift::PartialRangeFrom { } } } -extension Swift::PartialRangeThrough { +extension Swift.PartialRangeThrough { @available(*, deprecated, message: "Use value.clamped(in: range) instead") @inlinable public func clamped(_ value: Bound) -> Bound { if value > upperBound { @@ -45,49 +45,49 @@ extension Swift::PartialRangeThrough { } } @available(*, deprecated, renamed: "Optional.UnwrappingError", message: "Use Optional.UnwrappingError instead") -public typealias UnwrappingError = Swift::Optional.FoundationExtensions::UnwrappingError -extension Swift::Optional.FoundationExtensions::UnwrappingError { +public typealias UnwrappingError = Swift.Optional.UnwrappingError +extension Swift.Optional.UnwrappingError { @available(*, deprecated, message: "Instead of UnwrappingError, use Optional.UnwrappingError") public typealias T = Wrapped } -extension Foundation::Bundle { - @inlinable public var appVersionNumber: Swift::String? { +extension Foundation.Bundle { + @inlinable public var appVersionNumber: Swift.String? { get { infoDictionary?["CFBundleShortVersionString"] as? String } } - @inlinable public var buildVersionNumber: Swift::String? { + @inlinable public var buildVersionNumber: Swift.String? { get { infoDictionary?["CFBundleVersion"] as? String } } - @inlinable public var teamIdentifierPrefix: Swift::String? { + @inlinable public var teamIdentifierPrefix: Swift.String? { get { infoDictionary?["TeamIdentifierPrefix"] as? String } } - @inlinable public var keyPrefix: Swift::String { + @inlinable public var keyPrefix: Swift.String { get { return bundleIdentifier.map { $0.appending(".") }.or("") } } - @inlinable public func makeKey(_ key: Swift::String) -> Swift::String { + @inlinable public func makeKey(_ key: Swift.String) -> Swift.String { return keyPrefix.appending(key) } - @inlinable public func appGroupID(for teamIdentifier: Swift::String) -> Swift::String? { + @inlinable public func appGroupID(for teamIdentifier: Swift.String) -> Swift.String? { return teamIdentifierPrefix.map { "\($0)\(teamIdentifier)" } } } -public enum RawCodingKey : Swift::CodingKey, Swift::ExpressibleByStringLiteral, Swift::ExpressibleByIntegerLiteral { - case key(Swift::String) - case index(Swift::Int) - @inlinable public init(stringLiteral value: Swift::String) { +public enum RawCodingKey : Swift.CodingKey, Swift.ExpressibleByStringLiteral, Swift.ExpressibleByIntegerLiteral { + case key(Swift.String) + case index(Swift.Int) + @inlinable public init(stringLiteral value: Swift.String) { self.init(stringValue: value) } - @inlinable public init(stringValue: Swift::String) { + @inlinable public init(stringValue: Swift.String) { self = .key(stringValue) } - @inlinable public init(integerLiteral value: Swift::Int) { + @inlinable public init(integerLiteral value: Swift.Int) { self.init(intValue: value) } - @inlinable public init(intValue: Swift::Int) { + @inlinable public init(intValue: Swift.Int) { self = .index(intValue) } - @inlinable public var stringValue: Swift::String { + @inlinable public var stringValue: Swift.String { get { switch self { case let .key(value): @@ -97,7 +97,7 @@ public enum RawCodingKey : Swift::CodingKey, Swift::ExpressibleByStringLiteral, } } } - @inlinable public var intValue: Swift::Int? { + @inlinable public var intValue: Swift.Int? { get { switch self { case let .index(value): @@ -107,50 +107,50 @@ public enum RawCodingKey : Swift::CodingKey, Swift::ExpressibleByStringLiteral, } } } - public typealias ExtendedGraphemeClusterLiteralType = Swift::String - public typealias IntegerLiteralType = Swift::Int - public typealias StringLiteralType = Swift::String - public typealias UnicodeScalarLiteralType = Swift::String + public typealias ExtendedGraphemeClusterLiteralType = Swift.String + public typealias IntegerLiteralType = Swift.Int + public typealias StringLiteralType = Swift.String + public typealias UnicodeScalarLiteralType = Swift.String } -extension Swift::Decoder { - @inlinable public func decode(_ decode: (Swift::KeyedDecodingContainer) throws -> T) throws -> T { +extension Swift.Decoder { + @inlinable public func decode(_ decode: (Swift.KeyedDecodingContainer) throws -> T) throws -> T { return try self.decode(RawCodingKey.self, decode) } - @inlinable public func decode(_ codingKeys: CodingKeys.Type, _ decode: (Swift::KeyedDecodingContainer) throws -> T) throws -> T where CodingKeys : Swift::CodingKey { + @inlinable public func decode(_ codingKeys: CodingKeys.Type, _ decode: (Swift.KeyedDecodingContainer) throws -> T) throws -> T where CodingKeys : Swift.CodingKey { let container = try container(keyedBy: codingKeys) return try decode(container) } } -extension Swift::Encoder { - @inlinable public func encode(_ encode: (inout Swift::KeyedEncodingContainer) throws -> T) throws -> T { +extension Swift.Encoder { + @inlinable public func encode(_ encode: (inout Swift.KeyedEncodingContainer) throws -> T) throws -> T { return try self.encode(RawCodingKey.self, encode) } - @inlinable public func encode(_ codingKeys: CodingKeys.Type, _ encode: (inout Swift::KeyedEncodingContainer) throws -> T) throws -> T where CodingKeys : Swift::CodingKey { + @inlinable public func encode(_ codingKeys: CodingKeys.Type, _ encode: (inout Swift.KeyedEncodingContainer) throws -> T) throws -> T where CodingKeys : Swift.CodingKey { var container = container(keyedBy: codingKeys) return try encode(&container) } } -extension Swift::KeyedDecodingContainer { - @inlinable public func decode(_ key: K) throws -> T where T : Swift::Decodable { +extension Swift.KeyedDecodingContainer { + @inlinable public func decode(_ key: K) throws -> T where T : Swift.Decodable { try decode(T.self, forKey: key) } - @inlinable public func decodeIfPresent(_ key: K) throws -> T? where T : Swift::Decodable { + @inlinable public func decodeIfPresent(_ key: K) throws -> T? where T : Swift.Decodable { try decodeIfPresent(T.self, forKey: key) } } -extension Swift::Collection { - @inlinable public var isNotEmpty: Swift::Bool { +extension Swift.Collection { + @inlinable public var isNotEmpty: Swift.Bool { get { !self.isEmpty } } } -extension Swift::Array { - @inlinable public mutating func bringFront(elementsSatisfying predicate: (Element) -> Swift::Bool) { +extension Swift.Array { + @inlinable public mutating func bringFront(elementsSatisfying predicate: (Element) -> Swift.Bool) { let leftHalf = self.filter { predicate($0) } let rightHalf = self.filter { !predicate($0) } self = leftHalf + rightHalf } } -extension Swift::MutableCollection { +extension Swift.MutableCollection { @inlinable public subscript(safe index: Self.Index?) -> Self.Element? { get { guard let index = index else { return nil } @@ -176,7 +176,7 @@ extension Swift::MutableCollection { } } } -extension Swift::Collection { +extension Swift.Collection { @inlinable public subscript(safe index: Self.Index?) -> Self.Element? { get { guard let index = index else { return nil } @@ -191,54 +191,54 @@ extension Swift::Collection { } } } -extension Swift::Comparable { - @inlinable public func clamped(in range: Swift::ClosedRange) -> Self { +extension Swift.Comparable { + @inlinable public func clamped(in range: Swift.ClosedRange) -> Self { min(max(range.lowerBound, self), range.upperBound) } - @inlinable public mutating func clamp(in range: Swift::ClosedRange) { + @inlinable public mutating func clamp(in range: Swift.ClosedRange) { self = self.clamped(in: range) } - @inlinable public func clamped(in range: Swift::PartialRangeFrom) -> Self { + @inlinable public func clamped(in range: Swift.PartialRangeFrom) -> Self { max(range.lowerBound, self) } - @inlinable public mutating func clamp(in range: Swift::PartialRangeFrom) { + @inlinable public mutating func clamp(in range: Swift.PartialRangeFrom) { self = self.clamped(in: range) } - @inlinable public func clamped(in range: Swift::PartialRangeThrough) -> Self { + @inlinable public func clamped(in range: Swift.PartialRangeThrough) -> Self { min(self, range.upperBound) } - @inlinable public mutating func clamp(in range: Swift::PartialRangeThrough) { + @inlinable public mutating func clamp(in range: Swift.PartialRangeThrough) { self = self.clamped(in: range) } } -extension Dispatch::DispatchTimeInterval { - @inlinable public static func interval(_ value: Foundation::TimeInterval) -> Dispatch::DispatchTimeInterval { +extension Dispatch.DispatchTimeInterval { + @inlinable public static func interval(_ value: Foundation.TimeInterval) -> Dispatch.DispatchTimeInterval { return .nanoseconds(Int(value * pow(10, 9))) } } -extension Dispatch::DispatchTime : @retroactive Swift::ExpressibleByFloatLiteral { - public typealias FloatLiteralType = Foundation::TimeInterval +extension Dispatch.DispatchTime : @retroactive Swift.ExpressibleByFloatLiteral { + public typealias FloatLiteralType = Foundation.TimeInterval } -extension Dispatch::DispatchTime { - @inlinable public static func interval(_ interval: Foundation::TimeInterval) -> Dispatch::DispatchTime { +extension Dispatch.DispatchTime { + @inlinable public static func interval(_ interval: Foundation.TimeInterval) -> Dispatch.DispatchTime { return .now() + .interval(interval) } - @inlinable public init(floatLiteral value: Foundation::TimeInterval) { + @inlinable public init(floatLiteral value: Foundation.TimeInterval) { self = .interval(value) } } -extension Swift::FloatingPoint { +extension Swift.FloatingPoint { @inlinable public func progress(in total: Self) -> Self { total != 0 ? self / total : 0 } } -extension Foundation::NSMutableAttributedString { - @inlinable public func addAttribute(_ key: Foundation::NSAttributedString.Foundation::Key, value: Any) { +extension Foundation.NSMutableAttributedString { + @inlinable public func addAttribute(_ key: Foundation.NSAttributedString.Key, value: Any) { addAttribute(key, value: value, range: NSRange(0.. Swift::Void) -> Foundation::NSAttributedString { +extension Foundation.NSAttributedString { + @inlinable public func mapRegex(_ regex: Foundation.NSRegularExpression, _ transform: (Foundation.NSMutableAttributedString, Foundation.NSRange) -> Swift.Void) -> Foundation.NSAttributedString { let attributedString = NSMutableAttributedString(attributedString: self) let range = NSRange(0.. Swift::Void) -> Foundation::NSAttributedString { + @inlinable public func mapRegex(_ regex: Foundation.NSRegularExpression, at groupIndex: Swift.Int, _ transform: (Foundation.NSMutableAttributedString, Foundation.NSRange) -> Swift.Void) -> Foundation.NSAttributedString { let attributedString = NSMutableAttributedString(attributedString: self) let range = NSRange(0..(_ value: T, in object: inout T) { mutate(&object, with: { $0 = value }) } - @inlinable public func mutate(_ object: T, with closure: (T) -> Swift::Void) where T : AnyObject { + @inlinable public func mutate(_ object: T, with closure: (T) -> Swift.Void) where T : AnyObject { execute { closure(object) } } - @inlinable public func mutate(_ object: inout T, with closure: (inout T) -> Swift::Void) { + @inlinable public func mutate(_ object: inout T, with closure: (inout T) -> Swift.Void) { execute { closure(&object) } } - @inlinable public func assign(_ value: Value, to keyPath: Swift::ReferenceWritableKeyPath, on object: T) where T : AnyObject { + @inlinable public func assign(_ value: Value, to keyPath: Swift.ReferenceWritableKeyPath, on object: T) where T : AnyObject { execute { object[keyPath: keyPath] = value } } - @inlinable public func assign(_ value: Value, to keyPath: Swift::WritableKeyPath, on object: inout T) { + @inlinable public func assign(_ value: Value, to keyPath: Swift.WritableKeyPath, on object: inout T) { execute { object[keyPath: keyPath] = value } } @discardableResult @@ -292,11 +292,11 @@ extension Foundation::NSLocking { withLock(closure) } } -public protocol NSObjectSwizzlingProtocol : ObjectiveC::NSObjectProtocol { +public protocol NSObjectSwizzlingProtocol : ObjectiveC.NSObjectProtocol { } -extension FoundationExtensions::NSObjectSwizzlingProtocol { +extension FoundationExtensions.NSObjectSwizzlingProtocol { @available(*, deprecated, message: "Use `objc_exchangeImplementations(_,_,_)` instead") - @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC::Selector, _ swizzledSelector: ObjectiveC::Selector) { + @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC.Selector, _ swizzledSelector: ObjectiveC.Selector) { objc_exchangeImplementations( originalSelector, swizzledSelector, @@ -304,7 +304,7 @@ extension FoundationExtensions::NSObjectSwizzlingProtocol { ) } @discardableResult - @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC::Selector, _ swizzledSelector: ObjectiveC::Selector, using extractMethod: (Swift::AnyClass?, ObjectiveC::Selector) -> ObjectiveC::Method?) -> Swift::Bool { + @inlinable public static func objc_exchangeImplementations(_ originalSelector: ObjectiveC.Selector, _ swizzledSelector: ObjectiveC.Selector, using extractMethod: (Swift.AnyClass?, ObjectiveC.Selector) -> ObjectiveC.Method?) -> Swift.Bool { let originalMethod = extractMethod( Self.self, originalSelector @@ -324,10 +324,10 @@ extension FoundationExtensions::NSObjectSwizzlingProtocol { return true } } -extension ObjectiveC::NSObject : FoundationExtensions::NSObjectSwizzlingProtocol { +extension ObjectiveC.NSObject : FoundationExtensions.NSObjectSwizzlingProtocol { } -extension Swift::Optional { - @inlinable public func orThrow(_ error: @autoclosure () -> any Swift::Error) throws -> Wrapped { +extension Swift.Optional { + @inlinable public func orThrow(_ error: @autoclosure () -> any Swift.Error) throws -> Wrapped { switch self { case .some(let wrapped): return wrapped @@ -335,7 +335,7 @@ extension Swift::Optional { throw error() } } - @inlinable public var isNil: Swift::Bool { + @inlinable public var isNil: Swift.Bool { get { switch self { case .none: return true @@ -343,7 +343,7 @@ extension Swift::Optional { } } } - @inlinable public var isNotNil: Swift::Bool { + @inlinable public var isNotNil: Swift.Bool { get { !isNil } } @inlinable public func or(_ value: @autoclosure () -> Wrapped) -> Wrapped { @@ -352,7 +352,7 @@ extension Swift::Optional { @inlinable public func or(_ value: @autoclosure () -> Wrapped?) -> Wrapped? { self ?? value() } - @inlinable public func unwrap(function: Swift::String = #function, file: Swift::String = #file, line: Swift::Int = #line) -> Swift::Result.FoundationExtensions::UnwrappingError> { + @inlinable public func unwrap(function: Swift.String = #function, file: Swift.String = #file, line: Swift.Int = #line) -> Swift.Result.UnwrappingError> { switch self { case .some(let value): return .success(value) @@ -366,28 +366,28 @@ extension Swift::Optional { ) } } - @inlinable public func assign(to keyPath: Swift::ReferenceWritableKeyPath>, on target: T) where T : AnyObject { target[keyPath: keyPath] = self } - @inlinable public func ifLetAssign(to keyPath: Swift::ReferenceWritableKeyPath, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } - @inlinable public func ifLetAssign(to keyPath: Swift::ReferenceWritableKeyPath>, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } - @inlinable public func assign(to keyPath: Swift::WritableKeyPath>, on target: inout T) { target[keyPath: keyPath] = self } - @inlinable public func ifLetAssign(to keyPath: Swift::WritableKeyPath, on target: inout T) { map { target[keyPath: keyPath] = $0 } } - @inlinable public func ifLetAssign(to keyPath: Swift::WritableKeyPath>, on target: inout T) { map { target[keyPath: keyPath] = $0 } } + @inlinable public func assign(to keyPath: Swift.ReferenceWritableKeyPath>, on target: T) where T : AnyObject { target[keyPath: keyPath] = self } + @inlinable public func ifLetAssign(to keyPath: Swift.ReferenceWritableKeyPath, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } + @inlinable public func ifLetAssign(to keyPath: Swift.ReferenceWritableKeyPath>, on target: T) where T : AnyObject { map { target[keyPath: keyPath] = $0 } } + @inlinable public func assign(to keyPath: Swift.WritableKeyPath>, on target: inout T) { target[keyPath: keyPath] = self } + @inlinable public func ifLetAssign(to keyPath: Swift.WritableKeyPath, on target: inout T) { map { target[keyPath: keyPath] = $0 } } + @inlinable public func ifLetAssign(to keyPath: Swift.WritableKeyPath>, on target: inout T) { map { target[keyPath: keyPath] = $0 } } } -extension Swift::Optional where Wrapped : Swift::Collection { - @inlinable public var isNilOrEmpty: Swift::Bool { +extension Swift.Optional where Wrapped : Swift.Collection { + @inlinable public var isNilOrEmpty: Swift.Bool { get { map(\.isEmpty).or(true) } } } -extension Swift::Optional { - public struct UnwrappingError : Swift::Error { +extension Swift.Optional { + public struct UnwrappingError : Swift.Error { public let type: Wrapped.Type - public let function: Swift::String - public let file: Swift::String - public let line: Swift::Int - public init(_ type: Wrapped.Type = Wrapped.self, function: Swift::String = #function, file: Swift::String = #file, line: Swift::Int = #line) - @inlinable public var debugDescription: Swift::String { + public let function: Swift.String + public let file: Swift.String + public let line: Swift.Int + public init(_ type: Wrapped.Type = Wrapped.self, function: Swift.String = #function, file: Swift.String = #file, line: Swift.Int = #line) + @inlinable public var debugDescription: Swift.String { get { localizedDescription .appending("\n{") @@ -399,17 +399,17 @@ extension Swift::Optional { } } } -extension Swift::Range where Bound : Swift::Numeric { +extension Swift.Range where Bound : Swift.Numeric { @inlinable public var length: Bound { get { upperBound - lowerBound } } } -extension Swift::ClosedRange where Bound : Swift::Numeric { +extension Swift.ClosedRange where Bound : Swift.Numeric { @inlinable public var length: Bound { get { upperBound - lowerBound } } } -extension Swift::Result { +extension Swift.Result { @inlinable public var value: Success? { get { switch self { @@ -426,13 +426,13 @@ extension Swift::Result { } } } - @inlinable public func eraseError() -> Swift::Result { + @inlinable public func eraseError() -> Swift.Result { mapError { $0 as Error } } - @inlinable public func replaceError(with success: Success) -> Swift::Result { + @inlinable public func replaceError(with success: Success) -> Swift.Result { replaceError { _ in success } } - @inlinable public func replaceError(with closure: (any Swift::Error) -> Success) -> Swift::Result { + @inlinable public func replaceError(with closure: (any Swift.Error) -> Success) -> Swift.Result { switch self { case .success(let value): return .success(value) @@ -441,8 +441,8 @@ extension Swift::Result { } } } -extension Swift::String { - @inlinable public func ranges(of substring: Swift::String, options: Swift::String.Foundation::CompareOptions = [], locale: Foundation::Locale? = nil) -> [Swift::Range] { +extension Swift.String { + @inlinable public func ranges(of substring: Swift.String, options: Swift.String.CompareOptions = [], locale: Foundation.Locale? = nil) -> [Swift.Range] { var ranges: [Range] = [] while let range = range( @@ -469,32 +469,32 @@ extension Swift::String { self.init(wrappedValue: wrappedValue) } public init(wrappedValue: Content) - @inlinable final public var projectedValue: FoundationExtensions::Reference { + @inlinable final public var projectedValue: FoundationExtensions.Reference { get { reference } } - @inlinable final public var reference: FoundationExtensions::Reference { + @inlinable final public var reference: FoundationExtensions.Reference { get { .object(self, keyPath: \.wrappedValue) } } - @inlinable final public subscript(dynamicMember keyPath: Swift::KeyPath) -> U { + @inlinable final public subscript(dynamicMember keyPath: Swift.KeyPath) -> U { get { self.wrappedValue[keyPath: keyPath] } } - @inlinable final public subscript(dynamicMember keyPath: Swift::WritableKeyPath) -> U { + @inlinable final public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> U { get { self.wrappedValue[keyPath: keyPath] } set { self.wrappedValue[keyPath: keyPath] = newValue } } - @inlinable final public subscript(dynamicMember keyPath: Swift::ReferenceWritableKeyPath) -> U { + @inlinable final public subscript(dynamicMember keyPath: Swift.ReferenceWritableKeyPath) -> U { get { self.wrappedValue[keyPath: keyPath] } set { self.wrappedValue[keyPath: keyPath] = newValue } } @objc deinit } -extension FoundationExtensions::ReadonlyReference { - @inlinable public static func constant(_ value: Value) -> FoundationExtensions::ReadonlyReference { +extension FoundationExtensions.ReadonlyReference { + @inlinable public static func constant(_ value: Value) -> FoundationExtensions.ReadonlyReference { ReadonlyReference { value } } - @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions::ReadonlyReference where Object : AnyObject { + @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions.ReadonlyReference where Object : AnyObject { ReadonlyReference(read: { read(object) }) } } @@ -510,25 +510,25 @@ extension FoundationExtensions::ReadonlyReference { self._read() } } - @inlinable public var projectedValue: FoundationExtensions::ReadonlyReference { + @inlinable public var projectedValue: FoundationExtensions.ReadonlyReference { get { ReadonlyReference(read: _read) } } - @inlinable public var asWritable: FoundationExtensions::Reference { + @inlinable public var asWritable: FoundationExtensions.Reference { get { Reference(read: _read, write: { _ in }) } } - @inlinable public func writable(with write: @escaping (Value) -> Swift::Void) -> FoundationExtensions::Reference { + @inlinable public func writable(with write: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference { Reference(read: _read, write: write) } - @inlinable public subscript(dynamicMember keyPath: Swift::KeyPath) -> FoundationExtensions::Reference { + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> FoundationExtensions.Reference { get { .readonly { wrappedValue[keyPath: keyPath] } } } - @inlinable public subscript(dynamicMember keyPath: Swift::ReferenceWritableKeyPath) -> FoundationExtensions::Reference { + @inlinable public subscript(dynamicMember keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference { get { Reference( read: { _read()[keyPath: keyPath] }, @@ -536,23 +536,23 @@ extension FoundationExtensions::ReadonlyReference { } } } -extension FoundationExtensions::Reference { - @inlinable public static func readonly(_ read: @escaping () -> Value) -> FoundationExtensions::Reference { +extension FoundationExtensions.Reference { + @inlinable public static func readonly(_ read: @escaping () -> Value) -> FoundationExtensions.Reference { Reference(read: read, write: { _ in }) } - @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions::Reference where Object : AnyObject { + @inlinable public static func object(_ object: Object, read: @escaping (Object) -> Value) -> FoundationExtensions.Reference where Object : AnyObject { .readonly { read(object) } } - @inlinable public static func object(_ object: Object, keyPath: Swift::ReferenceWritableKeyPath) -> FoundationExtensions::Reference where Object : AnyObject { + @inlinable public static func object(_ object: Object, keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference where Object : AnyObject { Reference( read: { object[keyPath: keyPath] }, write: { object[keyPath: keyPath] = $0 } ) } - @inlinable public static func variable(_ initialValue: Value) -> FoundationExtensions::Reference { + @inlinable public static func variable(_ initialValue: Value) -> FoundationExtensions.Reference { Reference(wrappedValue: initialValue) } - @inlinable public static func constant(_ value: Value) -> FoundationExtensions::Reference { + @inlinable public static func constant(_ value: Value) -> FoundationExtensions.Reference { .readonly { value } } } @@ -560,7 +560,7 @@ extension FoundationExtensions::Reference { @usableFromInline internal var _read: () -> Value @usableFromInline - internal var _write: (Value) -> Swift::Void + internal var _write: (Value) -> Swift.Void @inlinable public init(wrappedValue: Value) { var value = wrappedValue self.init( @@ -568,27 +568,27 @@ extension FoundationExtensions::Reference { write: { value = $0 } ) } - public init(read: @escaping () -> Value, write: @escaping (Value) -> Swift::Void) + public init(read: @escaping () -> Value, write: @escaping (Value) -> Swift.Void) @inlinable public func read() -> Value { _read() } @inlinable public func write(_ value: Value) { _write(value) } @inlinable public var wrappedValue: Value { get { _read() } nonmutating set { _write(newValue) } } - @inlinable public var projectedValue: FoundationExtensions::Reference { + @inlinable public var projectedValue: FoundationExtensions.Reference { get { Reference(read: _read, write: _write) } } - @inlinable public var readonly: FoundationExtensions::ReadonlyReference { + @inlinable public var readonly: FoundationExtensions.ReadonlyReference { get { ReadonlyReference(read: _read) } } - @inlinable public subscript(dynamicMember keyPath: Swift::KeyPath) -> FoundationExtensions::Reference { + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> FoundationExtensions.Reference { get { .readonly { wrappedValue[keyPath: keyPath] } } } - @inlinable public subscript(dynamicMember keyPath: Swift::WritableKeyPath) -> FoundationExtensions::Reference { + @inlinable public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> FoundationExtensions.Reference { get { Reference( read: { _read()[keyPath: keyPath] }, @@ -601,38 +601,38 @@ extension FoundationExtensions::Reference { } } } -extension FoundationExtensions::Reference { - public func map(read: @escaping (Value) -> T, write: @escaping (T) -> Value) -> FoundationExtensions::Reference - public func onSet(perform action: @escaping (Value) -> Swift::Void) -> FoundationExtensions::Reference - public func onChange(perform action: @escaping (Value) -> Swift::Void) -> FoundationExtensions::Reference where Value : Swift::Equatable +extension FoundationExtensions.Reference { + public func map(read: @escaping (Value) -> T, write: @escaping (T) -> Value) -> FoundationExtensions.Reference + public func onSet(perform action: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference + public func onChange(perform action: @escaping (Value) -> Swift.Void) -> FoundationExtensions.Reference where Value : Swift.Equatable } public protocol ReferenceProvider : AnyObject { } -extension FoundationExtensions::ReferenceProvider { - @inlinable public func reference(for keyPath: Swift::KeyPath) -> FoundationExtensions::ReadonlyReference { +extension FoundationExtensions.ReferenceProvider { + @inlinable public func reference(for keyPath: Swift.KeyPath) -> FoundationExtensions.ReadonlyReference { .object(self, read: { $0[keyPath: keyPath] }) } - @inlinable public func reference(for keyPath: Swift::ReferenceWritableKeyPath) -> FoundationExtensions::Reference { + @inlinable public func reference(for keyPath: Swift.ReferenceWritableKeyPath) -> FoundationExtensions.Reference { .object(self, keyPath: keyPath) } } -extension ObjectiveC::NSObject : FoundationExtensions::ReferenceProvider { +extension ObjectiveC.NSObject : FoundationExtensions.ReferenceProvider { } public protocol Castable { func `as`(_ type: T.Type) -> T? - func `is`(_ type: T.Type) -> Swift::Bool + func `is`(_ type: T.Type) -> Swift.Bool } -extension FoundationExtensions::Castable { +extension FoundationExtensions.Castable { public func `as`(_ type: T.Type) -> T? - public func `is`(_ type: T.Type) -> Swift::Bool + public func `is`(_ type: T.Type) -> Swift.Bool } -extension Swift::Optional : FoundationExtensions::Castable { +extension Swift.Optional : FoundationExtensions.Castable { } -extension ObjectiveC::NSObject : FoundationExtensions::Castable { +extension ObjectiveC.NSObject : FoundationExtensions.Castable { } @propertyWrapper @dynamicMemberLookup public struct Indirect { @usableFromInline - internal class Storage : @unchecked Swift::Sendable { + internal class Storage : @unchecked Swift.Sendable { @usableFromInline internal var value: Value @usableFromInline @@ -641,7 +641,7 @@ extension ObjectiveC::NSObject : FoundationExtensions::Castable { deinit } @usableFromInline - internal var storage: FoundationExtensions::Indirect.FoundationExtensions::Storage + internal var storage: FoundationExtensions.Indirect.Storage @inlinable public init(_ value: Value) { self.init(wrappedValue: value) } @@ -657,164 +657,164 @@ extension ObjectiveC::NSObject : FoundationExtensions::Castable { storage.value = newValue } } - @inlinable public var projectedValue: FoundationExtensions::Indirect { + @inlinable public var projectedValue: FoundationExtensions.Indirect { get { self } set { self = newValue } } - @inlinable public subscript(dynamicMember keyPath: Swift::KeyPath) -> T { + @inlinable public subscript(dynamicMember keyPath: Swift.KeyPath) -> T { get { wrappedValue[keyPath: keyPath] } } - @inlinable public subscript(dynamicMember keyPath: Swift::WritableKeyPath) -> T { + @inlinable public subscript(dynamicMember keyPath: Swift.WritableKeyPath) -> T { get { wrappedValue[keyPath: keyPath] } set { wrappedValue[keyPath: keyPath] = newValue } } @inlinable public func _setValue(_ value: Value) { storage.value = value } - @inlinable public func _modifyValue(_ transform: (inout Value) -> Swift::Void) { + @inlinable public func _modifyValue(_ transform: (inout Value) -> Swift.Void) { transform(&storage.value) } - @inlinable public func _sharesStorage(with other: FoundationExtensions::Indirect) -> Swift::Bool { + @inlinable public func _sharesStorage(with other: FoundationExtensions.Indirect) -> Swift.Bool { storage === other.storage } } -extension FoundationExtensions::Indirect : Swift::Sendable where Value : Swift::Sendable { +extension FoundationExtensions.Indirect : Swift.Sendable where Value : Swift.Sendable { } -extension FoundationExtensions::Indirect : Swift::Equatable where Value : Swift::Equatable { - @inlinable public static func == (lhs: FoundationExtensions::Indirect, rhs: FoundationExtensions::Indirect) -> Swift::Bool { +extension FoundationExtensions.Indirect : Swift.Equatable where Value : Swift.Equatable { + @inlinable public static func == (lhs: FoundationExtensions.Indirect, rhs: FoundationExtensions.Indirect) -> Swift.Bool { lhs.wrappedValue == rhs.wrappedValue } } -extension FoundationExtensions::Indirect : Swift::Hashable where Value : Swift::Hashable { - @inlinable public func hash(into hasher: inout Swift::Hasher) { +extension FoundationExtensions.Indirect : Swift.Hashable where Value : Swift.Hashable { + @inlinable public func hash(into hasher: inout Swift.Hasher) { wrappedValue.hash(into: &hasher) } - public var hashValue: Swift::Int { + public var hashValue: Swift.Int { get } } -extension FoundationExtensions::Indirect : Swift::Comparable where Value : Swift::Comparable { - @inlinable public static func < (lhs: FoundationExtensions::Indirect, rhs: FoundationExtensions::Indirect) -> Swift::Bool { +extension FoundationExtensions.Indirect : Swift.Comparable where Value : Swift.Comparable { + @inlinable public static func < (lhs: FoundationExtensions.Indirect, rhs: FoundationExtensions.Indirect) -> Swift.Bool { lhs.wrappedValue < rhs.wrappedValue } } -extension FoundationExtensions::Indirect : Swift::Decodable where Value : Swift::Decodable { - @inlinable public init(from decoder: any Swift::Decoder) throws { +extension FoundationExtensions.Indirect : Swift.Decodable where Value : Swift.Decodable { + @inlinable public init(from decoder: any Swift.Decoder) throws { try self.init(.init(from: decoder)) } } -extension FoundationExtensions::Indirect : Swift::Encodable where Value : Swift::Encodable { - @inlinable public func encode(to encoder: any Swift::Encoder) throws { +extension FoundationExtensions.Indirect : Swift.Encodable where Value : Swift.Encodable { + @inlinable public func encode(to encoder: any Swift.Encoder) throws { try wrappedValue.encode(to: encoder) } } @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension FoundationExtensions::Indirect : Swift::Identifiable where Value : Swift::Identifiable { +extension FoundationExtensions.Indirect : Swift.Identifiable where Value : Swift.Identifiable { @inlinable public var id: Value.ID { get { wrappedValue.id } } - @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) + @available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *) public typealias ID = Value.ID } @propertyWrapper public struct PropertyProxy where Object : AnyObject { - public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift::ReferenceWritableKeyPath, storage storageKeyPath: Swift::ReferenceWritableKeyPath>) -> Value { + public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift.ReferenceWritableKeyPath, storage storageKeyPath: Swift.ReferenceWritableKeyPath>) -> Value { get set } - private let keyPath: Swift::ReferenceWritableKeyPath + private let keyPath: Swift.ReferenceWritableKeyPath @available(*, unavailable, message: "@PropertyProxy can only be applied to classes") public var wrappedValue: Value { get set } - public init(_ keyPath: Swift::ReferenceWritableKeyPath) + public init(_ keyPath: Swift.ReferenceWritableKeyPath) } @propertyWrapper public struct ReadonlyPropertyProxy where Object : AnyObject { - public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift::KeyPath, storage storageKeyPath: Swift::KeyPath>) -> Value { + public static subscript(_enclosingInstance instance: Object, wrapped wrappedKeyPath: Swift.KeyPath, storage storageKeyPath: Swift.KeyPath>) -> Value { get } - private let keyPath: Swift::KeyPath + private let keyPath: Swift.KeyPath @available(*, unavailable, message: "@PropertyProxy can only be applied to classes") public var wrappedValue: Value { get set } - public init(_ keyPath: Swift::KeyPath) + public init(_ keyPath: Swift.KeyPath) } -extension Foundation::NSNotification.Foundation::Name { +extension Foundation.NSNotification.Name { @available(*, deprecated, message: "Use IssueReporting module from https://github.com/pointfreeco/swift-issue-reporting") - @_hasInitialValue public static let foundationExtensionsRuntimeWarning: Foundation::NSNotification.Foundation::Name + @_hasInitialValue public static let foundationExtensionsRuntimeWarning: Foundation.NSNotification.Name } @available(*, deprecated, message: "Use IssueReporting module from https://github.com/pointfreeco/swift-issue-reporting") -@_transparent @inlinable @inline(__always) public func runtimeWarn(_ message: @autoclosure () -> Swift::String, category: Swift::String? = "FoundationExtensions", notificationName: Foundation::Notification.Foundation::Name? = .foundationExtensionsRuntimeWarning) { +@_transparent @inlinable @inline(__always) public func runtimeWarn(_ message: @autoclosure () -> Swift.String, category: Swift.String? = "FoundationExtensions", notificationName: Foundation.Notification.Name? = .foundationExtensionsRuntimeWarning) { } -@_hasInitialValue public let isTesting: Swift::Bool -public struct USID : Swift::Equatable, Swift::Hashable, Swift::RawRepresentable, Swift::ExpressibleByStringLiteral, Swift::ExpressibleByStringInterpolation, Swift::LosslessStringConvertible { - public let rawValue: Swift::String - @inlinable public init(_ uuid: Foundation::UUID = .init()) { +@_hasInitialValue public let isTesting: Swift.Bool +public struct USID : Swift.Equatable, Swift.Hashable, Swift.RawRepresentable, Swift.ExpressibleByStringLiteral, Swift.ExpressibleByStringInterpolation, Swift.LosslessStringConvertible { + public let rawValue: Swift.String + @inlinable public init(_ uuid: Foundation.UUID = .init()) { self.init(uuid.uuidString) } - @inlinable public init(stringLiteral value: Swift::String) { + @inlinable public init(stringLiteral value: Swift.String) { self.init(value) } - @inlinable public init(_ value: Swift::String) { + @inlinable public init(_ value: Swift.String) { self.init(rawValue: value) } - @inlinable public init(usidString value: Swift::String) { + @inlinable public init(usidString value: Swift.String) { self.init(rawValue: value) } - @inlinable public init(rawValue value: Swift::String) { + @inlinable public init(rawValue value: Swift.String) { self.rawValue = value } - @inlinable public var description: Swift::String { + @inlinable public var description: Swift.String { get { rawValue } } - @inlinable public var usidString: Swift::String { + @inlinable public var usidString: Swift.String { get { rawValue } } - @inlinable public var intValue: Swift::Int? { + @inlinable public var intValue: Swift.Int? { get { Int(rawValue) } } - @inlinable public var uuidValue: Foundation::UUID? { + @inlinable public var uuidValue: Foundation.UUID? { get { UUID(uuidString: rawValue) } } - public typealias ExtendedGraphemeClusterLiteralType = Swift::String - public typealias RawValue = Swift::String - public typealias StringInterpolation = Swift::DefaultStringInterpolation - public typealias StringLiteralType = Swift::String - public typealias UnicodeScalarLiteralType = Swift::String + public typealias ExtendedGraphemeClusterLiteralType = Swift.String + public typealias RawValue = Swift.String + public typealias StringInterpolation = Swift.DefaultStringInterpolation + public typealias StringLiteralType = Swift.String + public typealias UnicodeScalarLiteralType = Swift.String } -extension FoundationExtensions::USID : Swift::Codable { - @inlinable public init(from decoder: any Swift::Decoder) throws { +extension FoundationExtensions.USID : Swift.Codable { + @inlinable public init(from decoder: any Swift.Decoder) throws { let container = try decoder.singleValueContainer() self.init(rawValue: try container.decode(String.self)) } - @inlinable public func encode(to encoder: any Swift::Encoder) throws { + @inlinable public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.singleValueContainer() try container.encode(rawValue) } } -extension FoundationExtensions::USID : Swift::ExpressibleByIntegerLiteral { - @inlinable public init(integerLiteral value: Swift::Int) { +extension FoundationExtensions.USID : Swift.ExpressibleByIntegerLiteral { + @inlinable public init(integerLiteral value: Swift.Int) { self = .describing(value) } - public typealias IntegerLiteralType = Swift::Int + public typealias IntegerLiteralType = Swift.Int } -extension FoundationExtensions::USID { - @inlinable public static func describing(_ value: Value) -> FoundationExtensions::USID where Value : Swift::CustomStringConvertible { +extension FoundationExtensions.USID { + @inlinable public static func describing(_ value: Value) -> FoundationExtensions.USID where Value : Swift.CustomStringConvertible { return USID(rawValue: String(describing: value)) } - @inlinable public static func hash(of value: Value) -> FoundationExtensions::USID where Value : Swift::Hashable { + @inlinable public static func hash(of value: Value) -> FoundationExtensions.USID where Value : Swift.Hashable { return .describing(value.hashValue) } - @inlinable public static func dump(_ value: T) -> FoundationExtensions::USID { + @inlinable public static func dump(_ value: T) -> FoundationExtensions.USID { var buffer = "\(type(of: value))\n" Swift.dump(value, to: &buffer) return USID(rawValue: buffer) } } -extension Swift::String { - @inlinable public func usid() -> FoundationExtensions::USID { .init(self) } +extension Swift.String { + @inlinable public func usid() -> FoundationExtensions.USID { .init(self) } } diff --git a/.agents/interfaces/macos/FoundationExtensionsMacros.swiftinterface b/.agents/interfaces/macos/FoundationExtensionsMacros.swiftinterface index dddc769..23c241a 100644 --- a/.agents/interfaces/macos/FoundationExtensionsMacros.swiftinterface +++ b/.agents/interfaces/macos/FoundationExtensionsMacros.swiftinterface @@ -1,7 +1,7 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 6.4 (swiftlang-6.4.0.25.4 clang-2100.3.25.1) -// swift-module-flags: -target arm64-apple-macos12.0 -enable-objc-interop -language-mode 6 -O -enable-experimental-feature DebugDescriptionMacro -module-name FoundationExtensionsMacros -package-name swift_foundation_extensions -// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.4 +// swift-compiler-version: Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) +// swift-module-flags: -target arm64-apple-macosx10.15 -enable-objc-interop -swift-version 6 -O -module-name FoundationExtensionsMacros -package-name swift_foundation_extensions +// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.3 @_exported import AssociatedObjectsMacros @_exported import FoundationExtensions import Swift