/** * Parser diagnostics, translated into things a Mango user can act on. * * The mapping keys on the parser's stable codes rather than its message text, * which is the whole reason the codes exist: a reworded parser message must not * silently stop matching, and a Mango message must not have to be a paraphrase * of a specification sentence. Codes with no Mango-facing meaning fall back to * the parser's own message in the advanced panel rather than inventing one. */ import type { Diagnostic, DiagnosticCode, DiagnosticSeverity } from '@mango-iiif/w3c-parser'; /** Where a diagnostic surfaces. Determines which panel shows it. */ export type DiagnosticCategory = 'loading' | 'validation' | 'editing' | 'export'; export type MangoDiagnostic = { code: DiagnosticCode; severity: DiagnosticSeverity; category: DiagnosticCategory; path: string; /** i18n key, or undefined when only the parser's own message is available. */ messageKey?: string; /** The parser's message. Always kept, for the advanced panel and bug reports. */ detail: string; }; export declare const toMangoDiagnostics: (diagnostics: readonly Diagnostic[], category: DiagnosticCategory) => MangoDiagnostic[]; /** * Collapses a diagnostic list for display. * * A page of a thousand annotations parsed from one legacy export produces a * thousand identical `selector.legacy-point-fragment` entries, and a list of a * thousand identical lines is a list nobody reads. One entry per code with a * count is the same information at a size that gets looked at. */ export declare const summariseDiagnostics: (diagnostics: readonly MangoDiagnostic[]) => Array;