/** * Column-aligned plain-text tables. * * Several commands print tabular output and each used to compute its own column widths * and hand-pad — the same eight lines, re-derived. This is the one implementation they * share; a new table is a call, not another copy. */ /** Column alignment. Numeric columns read right-aligned; everything else left. */ export type ColumnAlign = 'left' | 'right'; export interface TableOptions { /** Per-column alignment, indexed like `headers`. Missing entries default to `left`. */ align?: ColumnAlign[]; /** Draw a `---` rule under the header row. */ separator?: boolean; } /** * Render a table with each column padded to its widest cell. * * Cells are taken as already-printable text: a row shorter than `headers` is padded out, * and a row LONGER than `headers` has its extra cells appended unpadded, since there is no * column to size them against. Callers rendering untrusted text should sanitise it first — * a control character makes `.length` disagree with what the terminal draws, which silently * destroys the alignment this function exists to provide. */ export declare function renderTable(headers: string[], rows: string[][], options?: TableOptions): string; //# sourceMappingURL=table.d.ts.map