Repository Public
1import Foundation23/// Strongly typed identifiers so a pane id can never be passed where a tab id is expected.4public struct PaneID: Hashable, Codable, Sendable, CustomStringConvertible {5 public let raw: UUID6 public init(_ raw: UUID = UUID()) { self.raw = raw }7 public init(from decoder: Decoder) throws { raw = try decoder.singleValueContainer().decode(UUID.self) }8 public func encode(to encoder: Encoder) throws { var c = encoder.singleValueContainer(); try c.encode(raw) }9 public var description: String { "pane-\(raw.uuidString.prefix(8))" }10}1112public struct TabID: Hashable, Codable, Sendable, CustomStringConvertible {13 public let raw: UUID14 public init(_ raw: UUID = UUID()) { self.raw = raw }15 public init(from decoder: Decoder) throws { raw = try decoder.singleValueContainer().decode(UUID.self) }16 public func encode(to encoder: Encoder) throws { var c = encoder.singleValueContainer(); try c.encode(raw) }17 public var description: String { "tab-\(raw.uuidString.prefix(8))" }18}1920public struct WindowID: Hashable, Codable, Sendable, CustomStringConvertible {21 public let raw: UUID22 public init(_ raw: UUID = UUID()) { self.raw = raw }23 public init(from decoder: Decoder) throws { raw = try decoder.singleValueContainer().decode(UUID.self) }24 public func encode(to encoder: Encoder) throws { var c = encoder.singleValueContainer(); try c.encode(raw) }25 public var description: String { "window-\(raw.uuidString.prefix(8))" }26}27