/** * `cli` — terminal presentation: aligned tables, key/value blocks, trees, a * semantic palette, and live output (pinned region, spinner, progress bar). * Separate from `format` (which is universal value formatting, for every * layer) — this is terminal-scoped output. * * Colors are gated in `cli/text` (TTY + NO_COLOR / FORCE_COLOR) on the `ansi` * vocabulary, so a `table()` renders colored in a terminal and as plain * aligned text in a pipe, log file, or a bot's monospace block. * * Alignment is ANSI-aware: padding is computed on the *visible* width (escape * codes stripped), so colored cells line up. * * @example * import { table, kv, ui, indent } from '@adriangalilea/utils/cli' * * console.log(table( * [['Ada', ui.accent('ada@x.com'), ui.muted('work')], * ['Bo', ui.accent('bo@y.com'), ui.muted('home')]], * { head: ['name', 'email', 'label'] }, * )) */ export * from "./live.js"; export { clip, ui, width } from "./text.js"; export interface TableOpts { /** Column headers (bolded). */ head?: string[]; /** Per-column alignment; default all left. */ align?: ("l" | "r")[]; /** Spaces between columns (default 2). */ gap?: number; /** Left indent for the whole table (default 0). */ indent?: number; } /** * Render rows as aligned columns. Cells may be pre-colored — widths use visible * length so colored columns still line up. The last left-aligned column isn't * right-padded (no trailing whitespace). */ export declare function table(rows: string[][], opts?: TableOpts): string; /** Key/value block (aligned keys), e.g. for a detail view. */ export declare function kv(pairs: [string, string][], opts?: { indent?: number; gap?: number; }): string; /** Indent every line of a (possibly multi-line) string by `n` spaces. */ export declare const indent: (s: string, n: number) => string; /** A labeled node with child lines drawn under it. */ export declare function tree(label: string, children: string[], opts?: { indent?: number; }): string; //# sourceMappingURL=index.d.ts.map