/** * Content validator for ContentUnit integrity checking * @module content/validator/ContentValidator */ import type { IValidator, ValidationResult } from './IValidator.js'; import type { ContentUnit } from '../types.js'; /** * Validates ContentUnit for structural integrity * * Checks for: * - Balanced indexed tags (`<1>...`) * - Valid tag indices (no invalid/malformed tags) * - Style references (styles referenced by tags exist) * - Orphan styles (styles defined but not used) * - Basic ICU brace balance validation * * @example * ```typescript * const validator = new ContentValidator(); * * // Valid unit * const valid = validator.validate({ * text: 'Hello <1>world', * styles: { '1': ['raw:'] } * }); * // → { valid: true, errors: [], warnings: [] } * * // Unbalanced tags * const invalid = validator.validate({ * text: 'Hello <1>world', * styles: { '1': ['raw:'] } * }); * // → { valid: false, errors: [{ code: 'UNBALANCED_TAGS', ... }], ... } * ``` */ export declare class ContentValidator implements IValidator { /** * Validate a ContentUnit for structural integrity * * @param unit - ContentUnit to validate * @returns Validation result with errors and warnings */ validate(unit: ContentUnit): ValidationResult; /** * Validate that all indexed tags are properly balanced and correctly nested */ private validateTagBalance; /** * Validate style references - check that used tags have styles and vice versa */ private validateStyleReferences; /** * Validate ICU MessageFormat brace balance */ private validateICUBraces; } //# sourceMappingURL=ContentValidator.d.ts.map