import type { Element, Style } from "./elements.js"; import { type Piece } from "./paint.js"; export { clipText as clipCell } from "./paint.js"; export declare const CURSOR_BG = "#3a3a3a"; export type CellStyle = Pick; export type TableColumn = { key: string; header: string; /** Absent = natural content width. `"flex"` shares the leftover frame * width. `{ min }` = natural with a floor. */ width?: number | "flex" | { min: number; }; align?: "left" | "right"; cell: (row: Row) => string | Piece[]; headerStyle?: () => CellStyle; cellStyle?: (row: Row) => CellStyle; }; export type TableFrame = { columns: TableColumn[]; rows: Row[]; /** Index into `rows` of the cursor row, or null for no cursor. */ cursor: number | null; sort?: { columnKey: string; direction: "asc" | "desc"; }; width: number; showHeader?: boolean; cursorBg?: string; }; export declare class TableComponent { render(frame: TableFrame): Element; private resolveWidths; /** Content width plus one trailing space so adjacent columns never * touch. Header labels reserve room for a sort arrow. */ private naturalWidth; private renderHeader; private renderRow; }