// What the reader marks in a book, as the core answers it: a highlight// (`shell.reader`'s `highlights`, each a `highlight` row the core made), the// pencil it is drawn in, and a selection about to become one.//// The reader draws every one of a book's highlights back on the page as a// pencil line (Readium's underline decoration) at open and whenever one is// made, recoloured or removed; the row, its chapter, page and percent are// the core's (`reader.highlight`).importCottonPaperimportSwiftUI/// The three pencils a passage is underlined in, as they are drawn.enumHighlightPencil: String, CaseIterable, Sendable, Decodable {case red, yellow, tealvar material: BookFaceMaterial {switchself {case .red: .pencilRedcase .yellow: .pencilYellowcase .teal: .pencilTeal } }var colour: SwiftUI.Color { material.colour }}/// One highlight of the open book, as the page draws it.structBookHighlight: Equatable, Sendable, Identifiable, Decodable {let id: String/// Readium's Locator of the passage, serialised.let at: Stringvar pencil: HighlightPencilvar note: String?init(id: String, at: String, pencil: HighlightPencil, note: String? = nil) {self.id = idself.at = atself.pencil = pencilself.note = note }}/// A selection about to become a highlight: the words as they stand in the/// book, and Readium's Locator of them, serialised.structBookSelection: Equatable, Sendable {let words: Stringlet at: String}