API
matrixToWorkbookSnapshot()
Convert a two-dimensional array to a WorkbookSnapshot. Imported sheet data is independent of the source array.
Signature
ts
function matrixToWorkbookSnapshot( matrix: readonly (readonly (CellValue | null | undefined)[])[], options?: MatrixToWorkbookSnapshotOptions ): WorkbookSnapshot
| Name | Type | Description |
|---|---|---|
| matrix | readonly (readonly CellValue[])?[] | Row i, column j maps to cell (i, j). |
| options.blankRows | number | Additional blank rows after the imported data. |
| options.blankColumns | number | Additional blank columns after the widest imported row. |
Importing object arrays
Use rowsToWorkbookSnapshot(rows, fields) to import object arrays. fields specifies the import order; imported data uses the same snapshot format.
ts
function rowsToWorkbookSnapshot( rows: readonly ImportRow[], fields: readonly string[], options?: RowsToWorkbookSnapshotOptions ): WorkbookSnapshot