public struct URL: Equatable, Hashable { public var absoluteString: String public var path: String { absoluteString } public init?(string: String) { self.absoluteString = string } public init(fileURLWithPath path: String) { self.absoluteString = path } } public struct UUID: Equatable, Hashable { public let uuidString: String public init() { self.uuidString = "ark-uuid-mock" // Dummy for now } public init?(uuidString: String) { self.uuidString = uuidString } } public struct Date: Comparable, Hashable { public var timeIntervalSinceReferenceDate: Double public init() { self.timeIntervalSinceReferenceDate = 0 // Mock } public init(timeIntervalSinceReferenceDate: Double) { self.timeIntervalSinceReferenceDate = timeIntervalSinceReferenceDate } public static let distantPast = Date(timeIntervalSinceReferenceDate: -63114076800.0) // Year 0001 public static let distantFuture = Date(timeIntervalSinceReferenceDate: 63113904000.0) // Year 4000 public static func < (lhs: Date, rhs: Date) -> Bool { return lhs.timeIntervalSinceReferenceDate < rhs.timeIntervalSinceReferenceDate } } public struct Data: Equatable, Hashable, Codable { public var bytes: [UInt8] public var count: Int { bytes.count } public init() { self.bytes = [] } public init(_ bytes: [UInt8]) { self.bytes = bytes } public mutating func append(_ newElements: [UInt8]) { bytes.append(contentsOf: newElements) } } public class JSONEncoder { public init() {} public func encode(_ value: T) throws -> Data { return Data() // Dummy } } public class JSONDecoder { public init() {} public func decode(_ type: T.Type, from data: Data) throws -> T { fatalError("Decoding not supported on baremetal") } } public class FileManager { public static let `default` = FileManager() public func fileExists(atPath path: String) -> Bool { return false // Dummy } } // MARK: - Dispatch & Foundation Utilities Mocks public typealias TimeInterval = Double public class DispatchQueue { public init(label: String) {} public func async(execute work: @escaping () -> Void) { // Execute inline for baremetal mock work() } } public class DispatchSemaphore { public init(value: Int) {} public enum WaitResult { case success case timedOut } public func wait(timeout: DispatchTime) -> WaitResult { return .success } public func wait() { _ = wait(timeout: DispatchTime.now()) } public func signal() {} } public struct DispatchTime { public var uptimeNanoseconds: UInt64 = 0 public static func now() -> DispatchTime { return DispatchTime() } } public class ProcessInfo { public static let processInfo = ProcessInfo() public var systemUptime: TimeInterval { // Return dummy time based on a counter return 0.0 } public var processName: String { return "ArkApp" } } public class Thread { public static func sleep(forTimeInterval ti: TimeInterval) { // Do nothing in mock } } public class Mutex { private var value: T public init(_ value: T) { self.value = value } public func withLock(_ body: (inout T) throws -> R) rethrows -> R { return try body(&value) } } public struct Calendar: Equatable { public static let current = Calendar() } public struct TimeZone: Equatable { public static let current = TimeZone() } public struct Locale: Equatable { public static let current = Locale() } public class UserDefaults { public static let standard = UserDefaults() private var storage = [String: String]() public func set(_ value: String?, forKey key: String) { storage[key] = value } public func string(forKey key: String) -> String? { return storage[key] } public func synchronize() {} } public func sin(_ x: Double) -> Double { return 0.0 // Stub for baremetal } public func cos(_ x: Double) -> Double { return 1.0 // Stub for baremetal } public func atan2(_ y: Double, _ x: Double) -> Double { return 0.0 // Stub for baremetal }