import { type Inline, type InlineRenderer } from "./inline.js"; import type { ArrayLike } from "./util.js"; export type Cell = { type: "cell"; /** * If true, this cell can be omitted for space. Collapsible cells MUST be at * the end of a row. */ collapsible: boolean; content: Inline; }; export declare function Cell(options: { collapsible?: boolean; }, content: Inline): Cell; export declare function Cell(content: Inline): Cell; export declare function Collapsible(content: Inline): Cell; export type Row = { type: "row"; cells: Cell[]; }; type CellLike = Inline | Cell; export declare function Row(options: never, cells: ArrayLike): Row; export declare function Row(cells: ArrayLike): Row; export type Table = { type: "table"; /** * If true, then the first cell of each row should be interpreted as a * potential sort of the slugs. Sortable tables MUST have the first rows * each starting with an input slug, potentially with extra rows after. */ sortable: boolean; columns: number; rows: Row[]; }; type RowLike = Row | ArrayLike; export declare function Table(options: { sortable?: boolean; }, rows: RowLike[]): Table; export declare function Table(rows: RowLike[]): Table; export declare function Sortable(rows: RowLike[]): Table; type CellJoinedTable = Omit & { rows: (Omit & { cells: (Cell & { rendered: I; })[]; })[]; }; /** A renderer for tables. */ export type TableRenderer = (table: CellJoinedTable, options: Options) => T; /** Render a table. */ export declare function renderTable(inline: InlineRenderer | ((inline: Inline, options: Options) => I), table: TableRenderer, template: Table, options: Options): T; export {}; //# sourceMappingURL=table.d.ts.map