// Cotton Story's calls into the core (apps/story/CORE.md and// assets/design/story/CONTRACT.md): the rules of a screenplay live in Rust,// once (`story.*`); the phone names the methods here and in `StoryBook`, and// decides nothing itself.importCottonFacesimportCottonKitimportCottonValuesimportFoundation/// The `story.*` methods, by name.enumStoryMethod {staticlet sceneWrite = "story.scene.write"staticlet sceneNear = "story.scene.near"staticlet start = "story.start"staticlet sceneMove = "story.scene.move"staticlet sceneNew = "story.scene.new"staticlet sceneDuplicate = "story.scene.duplicate"staticlet recordsUpdate = "records.update"staticlet recordsDelete = "records.delete"}/// The tables Story keeps, by id.enumStoryTable {staticlet story = "story_story"staticlet scene = "story_scene"staticlet place = "story_place"}/// The whole story laid out by screenplay rules (`story.script`): the paper,/// the title page, every page's lines already wrapped and indented, and/// where each scene begins. The reader and the PDF draw it as it is.structStoryScript: Decodable, Equatable {structPaper: Decodable, Equatable {structMargins: Decodable, Equatable { let top, bottom, left, right: Double }let name: Stringlet width: Doublelet height: Doublelet margins: MarginsenumCodingKeys: String, CodingKey {case namecase width = "width_pt"case height = "height_pt"case margins = "margins_pt" } }structTitlePage: Decodable, Equatable {let title: Stringlet credit: String?let author: String?let lines: [String]? }structLine: Decodable, Equatable {structScene: Decodable, Equatable { let id: String; let number: Int }/// An element's kind, `blank`, or `more` for `(MORE)`.let kind: Stringlet text: String/// Characters from the left margin.let indent: Intlet scene: Scene? }structPage: Decodable, Equatable {let number: Intlet lines: [Line] }structSceneStart: Decodable, Equatable {let id: Stringlet number: Intlet page: Int }let paper: Paperlet titlePage: TitlePage?let pages: [Page]let scenes: [SceneStart]enumCodingKeys: String, CodingKey {case paper, pages, scenescase titlePage = "title_page" }}