import Ratio from "./math/Ratio"; export interface Cell { value?: string; widthRatio: Ratio; } export interface Row { cells: Cell[]; } export interface Part { title?: string; rows: Row[]; } export interface Grid { id: string; baseCellSize: number; baseCellWidthRatio: Ratio; parts: Part[]; } export interface Doc { grids: Grid[]; } export interface RowRef { partIndex: number; rowIndex: number; } // TODO Should probably have a gridId export interface CellRef { partIndex: number; rowIndex: number; cellIndex: number; } export function cellRefEquals(a: CellRef, b: CellRef): boolean { return ( a.partIndex === b.partIndex && a.rowIndex === b.rowIndex && a.cellIndex === b.cellIndex ); }