/** * Shared helpers for output-format-aware behavior. * * `compact`, `raw`, and `csv` are consumed by jq / CSV parsers, so any * human-readable chatter must go to stderr there to keep stdout a clean * data stream. `table` and `pretty` are for humans and can keep chatter * on stdout. */ export declare const OUTPUT_FORMATS: readonly ["table", "csv", "pretty", "raw", "compact"]; export type OutputFormat = (typeof OUTPUT_FORMATS)[number]; /** Env var that overrides every command's built-in default output format. */ export declare const OUTPUT_FORMAT_ENV = "GREPR_OUTPUT_FORMAT"; export declare function isMachineReadable(format: string | undefined): boolean; /** * Validate an output format, resolving aliases. Throws on anything else so a * mistyped or invented value fails loudly instead of silently falling through * to an undocumented shape. */ export declare function parseOutputFormat(value: string): OutputFormat; /** * Resolve a command's default format, letting {@link OUTPUT_FORMAT_ENV} override * it. An explicit `-f` flag still wins, because commander only applies this * value when the flag is absent. */ export declare function resolveDefaultFormat(commandDefault: OutputFormat): OutputFormat; /** Parse a comma-separated `--fields` list into ordered, de-duplicated paths. */ export declare function parseFieldsArg(value: string): string[]; /** * Narrow rows to the requested field paths, keeping the caller's order. A * nested path is emitted under its full dotted name so the projection stays * flat and predictable for a downstream parser. */ export declare function projectFields(rows: Record[], fields: string[]): Record[]; /** * Log a human-readable footer / status line, routing to stderr in * machine-readable formats so the stdout stream stays parseable. */ export declare function logHumanFooter(format: string | undefined, message: string): void; //# sourceMappingURL=output-format.d.ts.map