blob: d9323897046040ab070741072734c662f377f890 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
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
);
}
|