/** * SchemaPreflight (G42 — v1.5.0) * ────────────────────────────────── * Public API: validateSchema(xsdSource) → SchemaIssue[] * * Checks the XSD schema itself for internal consistency BEFORE it is used * for instance validation. Surfaces errors at schema-load time rather than * at first validation call. * * Checks performed * ──────────────── * 1. Undefined type references (element/attribute typeName not in schema) * 2. Circular type definitions (type A extends B extends A) * 3. Invalid derivations (extending a 'final' type) * 4. Conflicting element declarations (same qualified name, different types) * 5. xs:keyref → xs:key linkage (keyref references a non-existent key) * 6. Undefined element/attribute ref="" references * * Usage * ───── * import { validateSchema } from 'xml-xsd-engine'; * const issues = validateSchema(xsdSource); * // [{ severity: 'error', code: 'SCHEMA_UNDEFINED_REF', message: '...' }] */ import { SchemaModel } from '../schema/SchemaModel'; import { XmlErrorCode } from '../errors/XmlError'; export type SchemaSeverity = 'error' | 'warning' | 'info'; export interface SchemaIssue { severity: SchemaSeverity; /** Stable error code (G37) */ code: XmlErrorCode; /** Human-readable description */ message: string; /** The schema component name involved (element, type, constraint…) */ component?: string; } /** * Parse and validate a schema source string, returning a list of schema-level * issues. Returns an empty array if the schema is self-consistent. * * Throws only if the source cannot be parsed at all (i.e. is not valid XML). */ export declare function validateSchema(xsdSource: string): SchemaIssue[]; /** * Run preflight checks on an already-parsed SchemaModel. * Useful when you have loaded the schema via parseXsdAsync or from cache. */ export declare function checkSchema(model: SchemaModel): SchemaIssue[]; //# sourceMappingURL=SchemaPreflight.d.ts.map