/** * BatchValidator — Batch validation of multiple XML files * ───────────────────────────────────────────────────────── * Validates one or more XML files (or strings) against a schema in one call. * Supports parallel execution, progress callbacks, and aggregated reporting. * * Usage * ───── * import { BatchValidator } from 'xml-xsd-engine'; * * const bv = new BatchValidator('schema.xsd'); * const report = await bv.validateFiles(['a.xml', 'b.xml', 'c.xml']); * * console.log(report.summary); * for (const [file, result] of report.results) { * if (!result.valid) console.log(file, result.errors); * } */ import { ValidationOptions } from '../validator/ValidationEngine'; import { SchemaModel } from '../schema/SchemaModel'; import { ValidationResult } from '../validator/ValidationResult'; export interface BatchValidationOptions extends ValidationOptions { /** * Maximum number of files to validate in parallel. * Default: 4 */ concurrency?: number; /** * Called after each file completes validation. */ onProgress?: (filePath: string, result: ValidationResult, index: number, total: number) => void; /** * When true, stops processing on the first file that contains errors. * Default: false */ failFast?: boolean; } export interface BatchValidationReport { /** Per-file results, keyed by the file path as supplied. */ results: Map; /** Total number of files processed. */ total: number; /** Number of files that passed validation. */ passed: number; /** Number of files that failed validation (had at least one error). */ failed: number; /** Whether all files passed. */ allValid: boolean; /** Wall-clock time in milliseconds for the entire batch. */ durationMs: number; /** Aggregated summary string. */ summary: string; } export declare class BatchValidator { private validationOptions; private schemaSource; private schemaPath; private cachedSchema; private cache; constructor(schema: string | SchemaModel, validationOptions?: ValidationOptions); /** * Validate an array of XML file paths. */ validateFiles(filePaths: string[], options?: BatchValidationOptions): Promise; /** * Validate an array of raw XML strings. * @param entries Array of { key, xml } pairs. key is used in the report. */ validateStrings(entries: Array<{ key: string; xml: string; }>, options?: BatchValidationOptions): Promise; /** * Validate a single XML string synchronously (schema must already be loaded). */ validateString(xml: string, _key?: string): ValidationResult; private _loadSchema; private _runBatch; } /** * Convenience function: validate multiple XML files against a single XSD file. */ export declare function batchValidateFiles(xmlPaths: string[], xsdPath: string, options?: BatchValidationOptions): Promise; /** * Convenience function: validate multiple XML strings against a single XSD string. */ export declare function batchValidateStrings(entries: Array<{ key: string; xml: string; }>, xsdSource: string, options?: BatchValidationOptions): Promise; //# sourceMappingURL=BatchValidator.d.ts.map