/** * ValidationResult * Carries the outcome of a validation run. * * v1.4 additions (G2, G37) * ───────────────────────── * • ValidationIssue now carries `category` (G37 stable classification) * • ValidationIssue now carries `code` (stable XmlErrorCode) * • ValidationIssue now carries `offset` (G2 source offset for code frames) * • ValidationIssue now carries `endLine`/`endCol` for range highlighting * • ValidationResult exposes `byCategory()` for filtering * • ValidationResult exposes `summary` for quick overview */ import type { ValidationErrorCategory, XmlErrorCode } from '../errors/XmlError'; import type { PsviMap } from './Psvi'; export type Severity = 'error' | 'warning' | 'info'; export interface ValidationIssue { severity: Severity; message: string; /** XPath-like location string, e.g. /root/child[1]/name */ path: string; /** 1-based line number (G2: source-mapped) */ line?: number; /** 1-based column number (G2: source-mapped) */ col?: number; /** G2: 0-based character offset in the source string */ offset?: number; /** G2: end line for range highlighting */ endLine?: number; /** G2: end column for range highlighting */ endCol?: number; /** * G37: Stable category — use this for routing/filtering rather than * parsing the message string. */ category?: ValidationErrorCategory; /** * G37: Stable machine-readable error code. * Guaranteed not to change within a major version. */ code?: XmlErrorCode; /** * G34: Pipeline stage that produced this issue. */ stage?: string; } export interface ValidationSummary { errorCount: number; warningCount: number; infoCount: number; /** Breakdown by category */ byCategory: Partial>; } export declare class ValidationResult { readonly issues: ValidationIssue[]; /** Internal dedup set — prevents identical errors from accumulating */ private _seenErrors; /** * P1 fix: cached counts avoid repeated O(n) filter calls in hot paths * (e.g. `result.valid` checked per-element in batch validation). */ private _errorCount; private _warningCount; /** * G29: Post-Schema-Validation Infoset. * Populated when ValidationOptions.psvi === true. * Maps each validated XmlElement to its type annotation. */ psvi?: PsviMap; get valid(): boolean; get errors(): ValidationIssue[]; get warnings(): ValidationIssue[]; get infos(): ValidationIssue[]; /** G37: Filter issues by category */ byCategory(category: ValidationErrorCategory): ValidationIssue[]; /** G37: Quick summary with counts per category */ get summary(): ValidationSummary; addError(message: string, path: string, line?: number, col?: number, opts?: { code?: XmlErrorCode; category?: ValidationErrorCategory; stage?: string; offset?: number; endLine?: number; endCol?: number; }): void; addWarning(message: string, path: string, opts?: { code?: XmlErrorCode; category?: ValidationErrorCategory; stage?: string; }): void; addInfo(message: string, path: string): void; /** Merge another result into this one */ merge(other: ValidationResult): void; toString(): string; } //# sourceMappingURL=ValidationResult.d.ts.map