/** * Output formatting for CLI commands — the ONE formatter (issue #383). * * Every command's machine-readable output flows through {@link formatOutput}: * the `getFormat`-style commands (repos/stats/workflows/channels/activity) * call it directly, and {@link emit} — the boolean-flag front door the * `pr`/`issue`/loop commands use — is a thin adapter onto it. There is no * second serialization path. * * Compatibility contract: the per-command `--json` byte shapes are LOCKED * (src/__tests__/json-shape-lock.test.ts). The formatOutput family prints * pretty JSON (2-space); emit prints compact JSON unless `{ pretty: true }`. * Each command keeps its historical flavor — never change a default here. */ export type OutputFormat = "table" | "json" | "yaml"; /** The boolean output flags commander collects from `--json` / `--yaml`. */ export interface FormatFlags { json?: boolean; yaml?: boolean; } /** Map `--json`/`--yaml` flags to a format. `--json` wins when both are * passed — the historical `getFormat` precedence, kept everywhere. */ export declare function resolveFormat(flags: FormatFlags): OutputFormat; export declare function printJson(data: unknown, pretty?: boolean): void; /** Serialize to YAML (single implementation — used by printYaml and the * log-injected printers, e.g. `regression --wait`). */ export declare function toYamlString(data: unknown): string; export declare function printYaml(data: unknown): void; /** Print a simple ASCII table. */ export declare function printTable(headers: string[], rows: string[][]): void; /** Format data according to the chosen format. For json/yaml, prints raw; for * table, caller provides formatter. `prettyJson` defaults to true — the * historical formatOutput flavor; {@link emit} passes its own. */ export declare function formatOutput(format: OutputFormat, data: unknown, tableFormatter: () => void, { prettyJson }?: { prettyJson?: boolean; }): void; /** Print a command's result once, honoring `--json` / `--yaml`. In JSON mode, * serializes `jsonValue` (compact by default; pretty-printed with 2-space * indent when `pretty`); in YAML mode serializes the same value as YAML; * otherwise runs `humanPrint`. The boolean-flag adapter onto * {@link formatOutput} — JSON output stays byte-identical to the historical * hand-rolled `JSON.stringify` branches (shape-locked in * json-shape-lock.test.ts). */ export declare function emit(opts: FormatFlags, jsonValue: unknown, humanPrint: () => void, { pretty }?: { pretty?: boolean; }): void; //# sourceMappingURL=output.d.ts.map