import type { Command } from "./index.js"; export type ErrorReportsOption = boolean | { dir?: string; }; export interface ErrorReportContext { argv?: readonly string[]; command?: Command; commandPath?: string; env?: Record; error: unknown; errorReports?: ErrorReportsOption; params?: unknown; projectRoot?: string; secrets?: Record; version?: string; } export interface ErrorReportResult { absolutePath: string; displayPath: string; } export type ErrorReportRenderContext = Omit; export interface ErrorReportRenderResult { content: string; redactedKeys: string[]; } interface HttpErrorLike { name: "HttpError"; message: string; request: { method: string; url: string; headers: Record; body?: unknown; }; response: { status: number; statusText: string; headers: Record; body: unknown; }; } declare function hasHttpContext(error: unknown): error is HttpErrorLike; /** * Renders the exact redacted content used by `writeErrorReport` without checking report enablement * or writing to the filesystem. `redactedKeys` lists every environment variable declared by the * command's secrets in declaration order, including variables that are currently unset. */ export declare function renderErrorReport(context: ErrorReportRenderContext): ErrorReportRenderResult; export declare function writeErrorReport(context: ErrorReportContext): Promise; export { hasHttpContext };