CONSUME-AS-DATA-05: Target rows with column / find / rowPos
What it demonstrates
Section titled “What it demonstrates”TableView offers column(name), find(pred), and rowPos(i) for column slices, predicate lookups, and per-row source positions.
Builds on: CONSUME-AS-DATA-04: Iterate a TableView’s typed rows
How it’s done
Section titled “How it’s done”A TypeScript program against the library API; inline comments show the resulting values and behavior.
const files = doc.body.files;files.column("File"); // ["grammar.ts", "leaves.ts", "legacy.ts"]files.find(r => r.Kind === "delete")?.File; // "legacy.ts" — typed predicatefiles.find((_r, i) => i === 0)?.File; // "grammar.ts" — index available toofiles.rowPos(2); // { line: 7, col: 1 } — that row's SourcePosSurfaces exercised
Section titled “Surfaces exercised”TableView.column(name).find(pred) with row+index.rowPos(i) returning SourcePos