/** * Translates a `SDDiagnosticRecord`-shaped object (package-open / unzip * stage) into a public diagnostic payload, or `null` if out of scope. * * @param {{code?: string, severity?: string, message?: string}} record * @param {DiagnosticTranslationContext} [ctx] * @returns {SuperDocExceptionDiagnosticPayload | null} */ export function translateUnzipDiagnostic(record: { code?: string; severity?: string; message?: string; }, ctx?: DiagnosticTranslationContext): SuperDocExceptionDiagnosticPayload | null; /** * Translates a `V2RenderReadinessDiagnostic`-shaped object (render stage) * into a public diagnostic payload, or `null` if out of scope. * * @param {{code?: string, reason?: string, severity?: string}} diag * @param {DiagnosticTranslationContext} [ctx] * @returns {SuperDocExceptionDiagnosticPayload | null} */ export function translateRenderReadinessDiagnostic(diag: { code?: string; reason?: string; severity?: string; }, ctx?: DiagnosticTranslationContext): SuperDocExceptionDiagnosticPayload | null; /** * Translates a boot/open failure into a public diagnostic payload, or * `null` if out of scope. * * `bootErrorName`, when present, takes precedence over `reason` — several * `boot()` catch sites in `V2SuperEditor.vue` hardcode `reason: 'open-failed'` * regardless of which error was actually thrown, so `reason` alone is not a * reliable signal once a real caught-error name is available. * * @param {string} reason * @param {string|null} [detail] * @param {DiagnosticTranslationContext & {bootErrorName?: string}} [ctx] * @returns {SuperDocExceptionDiagnosticPayload | null} */ export function translateBootFailureReason(reason: string, detail?: string | null, ctx?: DiagnosticTranslationContext & { bootErrorName?: string; }): SuperDocExceptionDiagnosticPayload | null; export type SuperDocDiagnosticCode = "PARSE_ERROR" | "RENDER_ERROR" | "UNSUPPORTED_FEATURE" | "PERFORMANCE_ERROR"; export type SuperDocDiagnosticStage = "unzip" | "parse" | "layout" | "render"; export type SuperDocExceptionDiagnosticPayload = { error: unknown; diagnosticCode: SuperDocDiagnosticCode; diagnosticStage: SuperDocDiagnosticStage; severity: "warn" | "error"; internalCode: string; documentId?: string | null | undefined; editor?: unknown; message: string; }; export type DiagnosticTranslationContext = { documentId?: string | null | undefined; editor?: unknown; };