Lines 10–16 at 143 (were 10–16 at 142)
13− type View,
1414} from "../../src/engine/index.ts"; 1515import { differenceSet, StableOverlaySet } from "../../src/engine/state-source.ts"; 1616import { definedTwice } from "./definitions.ts"; Lines 147–154 at 143 (were 147–154 at 142)
148148 origin: (atom: AtomId, spaceName: string) => Origin, 150− yoursView: View,
151− theirsView: View,
150+ yoursView: ReadView, 151+ theirsView: ReadView, 152152 spaceName: string, 154154 const file = fileOfKey(pair.keys[0]!.key, yoursView); Lines 157–163 at 143 (were 157–163 at 142)
157157 if (attrsOnly.length === fileKeys.length) { 158158 // Both set the same attribute of the file: show each side's value. 159159 const name = attrsOnly[0]!.attr!; 160− const valueIn = (view: View, atom: AtomId): string => {
160+ const valueIn = (view: ReadView, atom: AtomId): string => { 161161 const set = (g.atom(atom).attrs ?? []).find((a) => a.file === file && a.name === name); 162162 return set?.value ?? (name === "exec" ? "" : String(view.attrs(file)[name] ?? "")); Lines 177–183 at 143 (were 177–183 at 142)
180−export function fileOfKey(key: string, view: View): string {
180+export function fileOfKey(key: string, view: ReadView): string { 181181 const { kind, node } = parseKey(key); 182182 if (kind === "attr") return node; 183183 return node.startsWith("^") ? node.slice(1) : view.fileOf(node); Lines 187–193 at 143 (were 187–193 at 142)
187187 * The files some atoms change: the graph's files of each, and, in views 188188 * with moves (#28), wherever the lines they touch are in those views. 190−export function touchedFiles(g: Graph, ids: Iterable<AtomId>, views: readonly View[]): Set<string> {
190+export function touchedFiles(g: Graph, ids: Iterable<AtomId>, views: readonly ReadView[]): Set<string> { 191191 const out = new Set<string>(); 192192 const moved = views.filter((v) => v.hasMoves()); 193193 for (const id of ids) { Lines 206–212 at 143 (were 206–212 at 142)
208208/** The atom's visible lines in a file of a view, or where it acted when none are left. */ 209−export function describeSide(view: View, atom: AtomId, file: string, keys: readonly string[]): CollisionSide {
209+export function describeSide(view: ReadView, atom: AtomId, file: string, keys: readonly string[]): CollisionSide { 210210 const visible = view.lines(file); 212212 let lastLine = -1; Lines 238–244 at 143 (were 238–244 at 142)
238238 spaceOf(agent: AgentState): Space; 239239 agentSet(agent: AgentState): ReadonlySet<AtomId>; 240240 draft(agent: AgentState): AtomId[]; 241− agentView(agent: AgentState): View;
241+ agentView(agent: AgentState): ReadView; 242242 at(space: Space, version: number): ReadonlySet<AtomId>;