/** * Output formatter for odoo-cli. * * Formats: json | table | csv | ndjson * * Conventions: * - stdout = data only (all formats write to stdout) * - stderr = decorative messages, warnings (caller's responsibility) * - Many2one fields [id, name]: expanded to two columns in table/csv * - table warns above 5000 rows and suggests ndjson * - ndjson: streams one JSON object per line */ export type OutputFormat = 'json' | 'table' | 'csv' | 'ndjson'; /** Disable ANSI colors in table/CLI output. Called from cli.ts preAction hook. */ export declare function setNoColor(v: boolean): void; /** Suppress stderr progress and warnings. Called from cli.ts preAction hook. */ export declare function setQuiet(v: boolean): void; /** Whether quiet mode is active (used by other output modules). */ export declare function isQuiet(): boolean; /** Whether no-color mode is active. */ export declare function isNoColor(): boolean; /** * Detect the default output format. * TTY → table, pipe → json. */ export declare function detectFormat(): OutputFormat; /** * Resolve the format from option string, falling back to auto-detect. */ export declare function resolveFormat(fmt: string | undefined): OutputFormat; /** * Flatten many2one fields for table/csv output. * * Input record: { id: 1, partner_id: [7, "Marc"] } * Output record: { id: 1, partner_id: 7, partner_id_name: "Marc" } * * For boolean false (no relation): partner_id → null, partner_id_name → "" */ export declare function flattenRecord(record: Record): Record; /** * Get column headers for a set of records, expanding many2one fields. */ export declare function getColumns(records: Record[]): string[]; /** * Write JSON array to stdout. */ export declare function formatJson(records: Record[]): Promise; /** * Write ndjson to stdout — one JSON object per line. */ export declare function formatNdjson(records: Record[]): Promise; /** * Write table to stdout. * Warns at >5000 rows and suggests --format ndjson. */ export declare function formatTable(records: Record[]): Promise; /** * Write CSV to stdout. * Expands many2one fields to two columns. */ export declare function formatCsv(records: Record[]): Promise; /** * Master render function — routes to the appropriate formatter. */ export declare function render(records: Record[], format: OutputFormat): Promise; /** * Render a single record (e.g., `records get`). * JSON outputs an object (not array). Table shows key/value pairs. */ export declare function renderSingle(record: Record, format: OutputFormat): Promise; /** * Render a simple key/value config-style object (for `config show`). */ export declare function renderKeyValue(data: Record, format: OutputFormat): Promise; /** * Paged search-read generator — fetches from Odoo in pages. * Used by `records search --all`. */ export declare function pagedSearchRead(searchFn: (offset: number, limit: number) => Promise[]>, pageSize?: number): AsyncGenerator[]>; //# sourceMappingURL=formatter.d.ts.map