import { MetaObject } from "@metaobjectsdev/metadata"; import { Format, type ExtractOptions, type ExtractSchema, type ExtractionResult } from "@metaobjectsdev/render"; /** * Maximum nested-object recursion depth. Mirrors the render OutputFormatRenderer.MAX_NEST_DEPTH * (and FR-012) — must stay identical cross-port (Java MetaObjectExtractor.MAX_NEST_DEPTH = 8). At or * beyond this depth a nested OBJECT field becomes an opaque STRING leaf instead of recursing. */ export declare const MAX_NEST_DEPTH = 8; /** * Extract `text` into a typed object graph described by `mo`. * * Pipeline: build a ExtractSchema from `mo` (driven entirely by metadata), run the engine to get * a forgiving record/array tree + report, then assemble that tree into a populated object graph. * * @param mo the object describing the expected shape (the single source of truth) * @param text the dirty model output * @param format JSON (default) or XML — drives the engine's locate/parse * @param opts bounded runtime overrides (aliases/normalizers/onField/tolerance) * @returns the assembled object (a ValueObject unless a type is bound for the FQN) + report. * NEVER throws. */ export declare function extractObject(mo: MetaObject, text: string | null | undefined, format?: Format, opts?: Partial | null): ExtractionResult; /** * Build a ExtractSchema for `mo` by walking its effective fields and mapping each MetaField to a * FieldSpec. Recurses into nested OBJECT fields via `@objectRef`, guarded against cycles/over-depth * by an identity visited-set keyed on MetaObject + a depth counter bounded by {@link MAX_NEST_DEPTH}. */ export declare function extractSchemaFor(mo: MetaObject, format?: Format): ExtractSchema; /** * Assemble a extracted `Record` (the engine's forgiving tree) into a populated * object graph described by `mo`. * * `mo.newInstance()` yields the bound type (or a ValueObject) with the back-ref already set. Each * field's value is written via the MetaField setValue SPI: * • scalar / enum / scalar-array / enum-array → setValue (engine already coerced; arrays arrive * as a list); * • OBJECT non-array → recursively assemble the child record, then setValue; * • OBJECT array → recursively assemble each element record into a list, then setValue. * * Cycle/depth-guarded identically to extractSchemaFor. NEVER throws on lost/malformed data — those * were classified in the report during the engine pass. */ export declare function assemble(mo: MetaObject, data: Record | null | undefined): object; //# sourceMappingURL=extract-object.d.ts.map