/** * The fit layer for `Table`. Purity is a property of the CHAIN, not of this * file: `control_surface` stays importable here only while its own React-Native * import remains type-only. * * The register degrades in tiers instead of overflowing: everything fits, else * drop droppable columns by `priority`, else every row STACKS. All of it derives * from the CONTAINER width, not the viewport. */ /** The column fields the fit decision reads — `TableColumn` extends this. */ export interface TableFitColumn { /** Stable id. */ key: string; /** The WORDS the header band draws over this column, and in stacked mode the * overline over the cell's value. A fit field because a column has to be wide * enough for its own name. */ label?: string; /** Fixed width in px; omit for a flexible column. Side by side it is the * column's own width; stacked, THIS field line's value floor. */ width?: number; /** Fixed CHROME inside this flexible cell, in px, plus its gap. Added to the * read floor so the cell keeps {@link FLEX_READ_WIDTH} for the TEXT. Ignored * on a fixed-`width` column. Default 0. */ lead?: number; /** * THE COLUMN THAT SAYS WHICH ROW THIS IS. Stated rather than inferred from the * column's place, because a register's subject is not always its first. It is * NEVER shed — a register that cannot seat it stacks. One column. */ subject?: boolean; /** This column's claim on space, **`1` = highest**, the way P1/P2/P3 rank a * bug: the column you least want to lose gets the SMALLEST number. The larger * the number, the sooner the column drops, and ties drop right-to-left. The * FIRST column is the row's identity and never drops. * * `"never"` is the top of that one scale rather than a second axis: the * column is NEVER shed, and a register that cannot seat it stacks instead. * Spend it on the fact the row is SCANNED for, never on a convenience — * every one is width the fit may not reclaim. * * An unannotated column defaults to `columns.length + index`, which sits * above the small ranks a real annotation uses rather than interleaved with * them, so an unannotated register still sheds right-to-left AND an explicit * priority is strictly safer than none. */ priority?: number | "never"; /** * WHAT THIS COLUMN'S OWN ROWS DRAW, in px, measured by the caller that can see * them ({@link textWidthSm}). It bounds the column at BOTH ends: unmeasured, a * flexible column holds {@link FLEX_READ_WIDTH} at the floor and its `flex` * share of the leftover at the ceiling, whatever it has to put there. * * Stated only where the cell draws TEXT the caller can measure — a meter reads * by its LENGTH and a caller's own node is not ours to measure. */ content?: number; } /** * A register row's height — THE REGISTER BAND PLUS ONE REGION RUNG, never a * fourth number: a register of OBJECTS seats a two-line identity cell where a * grid of measures seats one figure, and the hover wash has to read as a surface * rather than a stripe. * * A caller that needs density overrides it per row (`TableRow`'s `minHeight`). */ export declare const ROW_HEIGHT: number; /** * The register's CONTENT gutter — zero, because the washed row bleeds outward * (`ROW_WASH_BLEED`) rather than pushing content in. A named constant rather * than a literal: the header band, the rows and the fit math must agree. */ export declare const ROW_GUTTER = 0; /** Width a flexible column needs to stay OPERABLE — below this it is crushed to * ellipsis soup. `DataGrid`, which sheds nothing, uses it as the column's hard * floor. `Table` can shed, so it asks the harder question — see * {@link FLEX_READ_WIDTH}. */ export declare const FLEX_MIN_WIDTH = 120; /** * What a FIXED column lays out at — what it declared, or its heading where that * is wider. One statement, read by the fit's arithmetic and by the box the * register renders, so the reservation and the layout cannot disagree. */ export declare function fixedColumnWidth(width: number, label: string | undefined): number; /** * WHAT ONE COLUMN IS BUDGETED AT — the number the fit reserves, and the number * the column lays out from. Read by both, so the reservation IS the layout and a * column cannot be laid out below what it was fitted at. */ export declare function columnFloor(column: TableFitColumn): number; /** * WHERE A FLEXIBLE COLUMN STARTS FROM — what it draws, falling back to * {@link columnFloor} where nothing measured it, so the ink settles before the * `flex` ranking. Never below the floor. A fixed column has no say here. */ export declare function columnBasis(column: TableFitColumn): number; export interface TableFit { /** Keys of the columns that render side-by-side. All keys when `stacked`. */ visibleKeys: ReadonlySet; /** The minimum column set can't fit — rows render as label-over-value stacks. */ stacked: boolean; /** * THE COLUMNS THIS WIDTH COULD NOT SEAT, in the order they were given up — * empty when everything fits, and empty when the register STACKS. The pure * layer states WHAT it dropped and the renderer is what warns: a `console` * here would make the fit decision unrunnable in a test. */ shed: readonly string[]; } /** * Pure fit decision for a measured container width: which columns stay * side-by-side, or whether the register stacks. */ export declare function computeTableFit(columns: TableFitColumn[], leading: number, trailing: number, width: number): TableFit;