/** * The header row of a spreadsheet, as a column index → name map. * * A map rather than an array, so that a blank header in the middle of the row * can be dropped without moving the names after it: with an array compacted by * `filter(Boolean)`, every later name shifts one column left and each value lands * in its neighbour's field. */ export interface SheetHeaders { /** Column index (0-based) → the field name that column feeds. */ byColumn: Map; /** The names in column order: the import's `propertiesOrder`. */ order: string[]; } /** A cell as the readers hand it over: a primitive, or null when empty. */ export type SheetCell = string | number | boolean | Date | null; /** * Name the columns from the header row. * * - A blank header over a column that holds data is named `ColumnN` after its * position, so its values are kept; over an empty column (a trailing delimiter, * a spacer) it is left out. * - A repeated name gets a suffix, `name`, `name_1`, `name_2`, as SheetJS did. * Without one, the second column's values overwrote the first's and a column of * data disappeared. * - A `__proto__` header is left out: it would be the prototype setter, not a key. */ export declare function getWorksheetHeaders(headerRow: readonly SheetCell[], dataRows?: ReadonlyArray): SheetHeaders; /** * Turn a sheet's rows into one object per record, keyed by the header row. * * The header row is the first row with anything in it, so a table that starts * lower down the sheet reads as it did with SheetJS. A wholly empty row is not a * record, and an empty cell contributes no key: the import treats "absent" and * "blank" differently, and only an absent key leaves a collection's default value * in place. */ export declare function sheetRowsToObjects(rows: ReadonlyArray): { headers: string[]; data: Record[]; };