import { DisplayTableColumnConfig } from "../api/types"; export type TableOptions = { /** * Declares the list of columns to include in the table. * * The order of columns in this list determines the order of columns when rendering the * table. Each column can optionally specify a human-readable name that will be used when * rendering the table. The name defaults to the slug. * * Columns found in `rows` that are not included in `columns` will not be rendered. * * If not specified, columns are inferred automatically from the provided rows: * - The set of columns is the union of all keys across all rows. * - The column order is inferred from the key order of the first row. All other columns * not present in the first row are ordered after. * - Columns are named by their slug. * @example * await table([ * // ... * ], { * columns: [ "username", "email" ] * }) * @example * await table([ * // ... * ], { * columns: [ * { name: "Username", slug: "name" }, * { name: "Email", slug: "email" }, * ] * }) */ columns?: readonly Column[]; }; type Column = TColumnSlug | DisplayTableColumnConfig; type Rows = readonly Partial>[]; /** * Appends a display to the run that renders a table. * * Each row should be an object mapping header slugs to values. Columns that are not * specified will default to `null`. The selection, ordering, and naming of columns * can be customized via `opts.columns`. * @example * await table([ * { "name": "Lilo", age: 6 }, * { "name": "Stitch" }, * ]) * @param rows The list of rows to render in the table * @param opts Additional configuration options */ export declare const table: (rows: Rows, opts?: TableOptions) => Promise; export declare const columnsFromRows: (rows: readonly Partial>[]) => DisplayTableColumnConfig[]; export declare const filterRowsByColumns: (rows: readonly Record[], columns: readonly DisplayTableColumnConfig[]) => readonly Partial>[]; export {};