import { BodyElement, TableProperties, TableRow } from '../core/document-model/index.js'; /** * Wrap a grid in its printed row and column headings (§18.3.1.70 `headings`): * the column letters across the top, the row numbers down the left, each in a * thin box, the way the sheet looks on screen. A banded sheet gets its own * letters per band, which is what both references print. * * @param rows The band's rows. * @param widths The band's column widths in twips. * @param colStart The absolute index of the band's first column. * @param rowNumbers The absolute 1-based row number of each row. * @returns The rows and widths with the heading band added. */ export declare function withHeadingBand(rows: ReadonlyArray, widths: ReadonlyArray, colStart: number, rowNumbers: ReadonlyArray): { rows: Array; widths: Array; }; /** A contiguous run of columns that prints together as one band (E-SHEET SE1). */ export interface ColumnBand { /** First local column index (inclusive). */ readonly start: number; /** Last local column index (inclusive). */ readonly end: number; } /** * Greedy fill: accumulate column widths until the next column would overflow the * content width, then start a new band. A manual column break (`colBreaks` holds * local indices that begin a new page) always starts a new band. Every band keeps * at least one column — a single column wider than the page stands alone (the * layout shrinks it, the one case where fitting is unavoidable). * * @param columnWidths Per-column widths in twips, by local index. * @param contentWidthTwips The printable content width one band must fit within. * @param colBreaks Local column indices that force a new band. * @returns The bands in left-to-right order. */ export declare function computeColumnBands(columnWidths: ReadonlyArray, contentWidthTwips: number, colBreaks: ReadonlySet): Array; /** * Build one table {@link BodyElement} per band from the fully materialised rows + * column widths (twips, local index). Bands after the first force a page break * before their first row, so each band starts on a fresh page. A horizontal span * that crosses a band boundary is clipped to the band it starts in; later bands * render the overlapped columns blank, matching Excel's split-at-the-break * behaviour. * * @param rows The full sheet rows (every band slices the same rows). * @param columnWidths Per-column widths in twips, by local index. * @param bands The bands from {@link computeColumnBands}. * @param properties The shared table properties applied to every band. * @param titleRowIndex The print-title row, or -1. * @param drawingReachTwips How far right the sheet's drawings reach (0 if none). * @param headings §18.3.1.70 — the printed row/column headings, when the sheet * asks for them: the absolute index of the grid's first column and the sheet * row number of each emitted row. Each band gets ITS OWN letters, which is * what both references print across the top of a continuation page. * @returns One table body element per band, in band order. */ export declare function bandedTables(rows: ReadonlyArray, columnWidths: ReadonlyArray, bands: ReadonlyArray, properties: TableProperties, titleRowIndex?: number, drawingReachTwips?: number, headings?: { readonly colStart: number; readonly rowNumbers: ReadonlyArray; }): Array;