ARCHITECTURE
Data structures
cyexcel uses a sparse WorkbookSnapshot. External object arrays are import sources, not live bindings.
Top-level structure
ts
{
version: 1,
sheetOrder: ["sheet-1"],
sheets: {
"sheet-1": {
id: "sheet-1",
name: "Sheet1",
blankRows: 1000,
blankColumns: 26,
cellData: { /* row -> column -> CellRecord */ },
rowData: { /* row -> RowMeta */ },
columnData: { /* column -> ColumnMeta */ },
mergeData: [],
dataValidations: [ /* Validation rules; omitted means empty */ ]
}
},
styles: { /* styleId -> CellStyle */ },
resources: []
}Cells
ts
// Store only nonempty cell records.
"0,0": { v: "CY-100001" }
"0,1": { v: "Industrial temperature sensor" }
"0,2": { v: 128 }| Name | Type | Description |
|---|---|---|
| v | string | number | boolean | Cell value. |
| t | string | Optional semantic type, such as text, number, or date. |
| s | string | Style ID referencing the workbook's top-level styles table. |
| f | string | Optional formula text. |
Coordinate space
ts
rowCount = maxOccupiedRow + 1 + blankRows columnCount = maxOccupiedColumn + 1 + blankColumns
| Name | Type | Description |
|---|---|---|
| getUsedRowCount() | number | The occupied row extent, excluding trailing blank rows. |
| getRowCount() | number | The coordinate-space row count, including trailing blank rows. |
| getColumnCount() | number | The coordinate-space column count, including trailing blank columns. |
Validation rules
ts
dataValidations: [
{
id: "dv-1",
// Range list (sqref): disjoint rectangles within and across rules
ranges: [{ startRow: 1, startColumn: 1, endRow: 99, endColumn: 1 }],
criteria: { type: "whole", operator: "between", value1: 1, value2: 100 },
errorStyle: "stop",
errorMessage: "Quantity must be an integer from 1 to 100"
}
]| Name | Type | Description |
|---|---|---|
| ranges | CellRange[] | Rule coverage is stored in dataValidations and updated when row or column structure changes. |
| criteria | object | Criteria type: whole / decimal / textLength / date / time / list / custom. Dates and times use serial numbers. Custom rules store only name and params; validator functions are not serialized. |
| allowBlank | boolean | Defaults to true. |
| errorStyle | "stop" | "warning" | "information" | Defaults to stop. stop rejects invalid editor submissions; warning and information allow submission and show invalid markers. |
| renderMode / showDropDown | List only | text / arrow / custom (default: arrow) and dropdown visibility. list.colors maps options to hexadecimal colors. |