import type { ScaffoldError, ScaffoldWarning } from '../../types/index.js'; import type { OutputContext } from './context.js'; import { ExitCode } from '../../types/enums.js'; /** * Format a single ScaffoldError as a multi-line string. * Format: "✗ error [CODE]: message\n File: \n Line: \n Fix: " */ export declare function formatError(error: ScaffoldError): string; /** * Format a single ScaffoldWarning as a single-line string. * Format: "⚠ warning [CODE]: message" */ export declare function formatWarning(warning: ScaffoldWarning): string; /** * Format a batch of errors and warnings. * Errors appear before warnings. * Returns an array of formatted strings (one per error/warning). */ export declare function formatBatch(errors: ScaffoldError[], warnings: ScaffoldWarning[]): string[]; /** * Format an error with a fuzzy match suggestion appended to the message line. * If error.context.value is a string and a close match is found among candidates, * appends " Did you mean ''?" to the first line. */ export declare function formatErrorWithSuggestion(error: ScaffoldError, candidates: string[]): string; /** * Display a batch of errors and warnings using an OutputContext. * Calls output.error() for each error and output.warn() for each warning. * The OutputContext implementations handle their own formatting. */ export declare function displayErrors(errors: ScaffoldError[], warnings: ScaffoldWarning[], output: OutputContext): void; /** * Terminal variant of {@link displayErrors}: renders the warnings for humans * and emits the failure envelope carrying every error. * * `displayErrors` routes through the stderr-only `output.error()`, so a * command that called it and then exited non-zero produced empty stdout under * `--format json` — the same defect the envelope sweep removed from the * `output.error(` call sites, surviving one indirection deeper. Six terminal * sites across `run`, `build`, and `rework` were still doing that after the * sweep claimed CLI-wide coverage. * * Sets `process.exitCode` and returns rather than exiting, so a buffered * stdout write is never truncated. */ export declare function failWithErrors(errors: ScaffoldError[], warnings: ScaffoldWarning[], output: OutputContext, fallbackRecovery: string, exitCode?: ExitCode): void; //# sourceMappingURL=error-display.d.ts.map