/** * Generic schema-driven XML parser. * * Interprets a {@link Producer} schema against a document — recursing through * nested objects, arrays, unions and custom decoders — and produces typed * output. The same interpreter drives every data type (CPT, Bore, ...) and the * public {@link BROParser.parseCustom} surface. */ import type { XMLAdapter, Namespaces } from "../types/index.js"; import type { ObjectProducer } from "./producer.js"; export declare class SchemaParser { private adapter; private namespaces; constructor(adapter: XMLAdapter, namespaces: Namespaces); /** * Interpret a {@link Producer} schema against a document, recursing through * nested objects, arrays, unions and custom decoders. * * The top-level producer must be an object (a registration object's fields). * Warnings from the absence model (dropped array items) are returned rather * than logged, so callers can fold them into `meta.warnings`. * * @throws {BROParseError} `MISSING_REQUIRED_FIELD` when a `required` field is * missing at the document root (nested required failures null their object * instead — see the absence model). */ produce(doc: Document, root: ObjectProducer, rootPath?: string): { value: T; warnings: Array; }; /** * Resolve the schema root: the first child of `rootPath` (the registration * object under `dispatchDocument`), or the document itself when unspecified. */ private resolveRoot; private get nsResolver(); private xpath; private xpathAll; /** Run one producer against `node` (the enclosing context node). */ private run; /** * Build an object by running each field. Applies the presence + absence model: * a missing `required` field nulls the whole object (or throws at the root); a * missing `omit` field drops its key; a missing `optional` field keeps its * empty value. */ private runObject; /** Run a discriminated union: base fields once, then the first matching branch. */ private runOneOf; /** The "empty" value a producer yields when its node is absent. */ private emptyValue; /** A relative-only lens over `node` for custom producers. */ private makeLens; } //# sourceMappingURL=schema-parser.d.ts.map