/** * Alignment specification for table columns: 'l' for left, 'r' for right. */ export type ColumnAlignment = 'l' | 'r'; /** * Renders a table with optional per-column alignment. * * Computes column widths from the widest value in each column (including header), * then formats all rows using two-space separators between columns. * * @param header - Column header labels * @param rows - 2D array of string cell values * @param align - Per-column alignment ('l' for left, 'r' for right). Defaults to 'l' for unspecified columns. * @returns Formatted table string with two-space column separators * * @example * renderAlignedTable(['Name', 'Count'], [['Alpha', '42'], ['Beta', '1,234']], ['l', 'r']) * // 'Name Count\nAlpha 42\nBeta 1,234' */ export declare function renderAlignedTable(header: string[], rows: string[][], align?: ColumnAlignment[]): string; /** * Column definition for type-safe table column specifications. * * Declares a table column with a key mapping to a data property, a display name * for the column header, and an optional formatter for pre-processing values * before rendering. * * @typeParam T - The row data type whose keys are valid column keys */ export type ColumnDef = { /** Property key from the row data type. */ readonly key: keyof T & string; /** Column header display name. */ readonly name: string; /** Optional formatter for pre-processing cell values before display. */ readonly format?: (value: T[keyof T & string]) => string; }; /** * Converts an array of `ColumnDef` definitions to oclif's table column format. * * Strips the `format` property and returns plain `{ key, name }` objects suitable * for passing directly to oclif v4's `ux.table()` API. * * @typeParam T - The row data type * @param defs - Array of column definitions * @returns Array of `{ key, name }` objects for oclif table rendering * * @example * buildColumns([{ key: 'name', name: 'Object Name' }, { key: 'count', name: 'Records' }]) */ export declare function buildColumns>(defs: ReadonlyArray>): Array<{ key: string; name: string; }>; /** * Creates a column definition for numeric values. * * The returned `ColumnDef` includes a `format` function that applies locale-aware * number formatting via `formatNumber()`. Handles null, undefined, NaN, and * Infinity by returning '--'. * * @typeParam T - The row data type * @param key - Property key on the row data type * @param name - Column header display name * @returns A `ColumnDef` with a number formatting function * * @example * type Row = { name: string; recordCount: number }; * numberColumn('recordCount', 'Records'); * // { key: 'recordCount', name: 'Records', format: [Function] } */ export declare function numberColumn>(key: keyof T & string, name: string): ColumnDef; /** * Creates a column definition for boolean values. * * The returned `ColumnDef` includes a `format` function that converts boolean * values to 'Yes' or 'No' strings. Non-boolean values (null, undefined, or * other types) are rendered as '--'. * * @typeParam T - The row data type * @param key - Property key on the row data type * @param name - Column header display name * @returns A `ColumnDef` with a boolean formatting function * * @example * type Row = { name: string; isActive: boolean }; * booleanColumn('isActive', 'Active'); * // { key: 'isActive', name: 'Active', format: [Function] } */ export declare function booleanColumn>(key: keyof T & string, name: string): ColumnDef;