/** * Phase 2 (legacy flat pages) normalization. * * Converts the loose `PdfDocumentPhase2` shape — pages with `text` / * `texts` / `graphics` arrays and a meta block — into a strict * `NormalizedPdfDocument` ready for `renderPdfPages`. Performs all * runtime validation that the Zod schema would catch in strict mode, * but throws structured `PdfError("SCHEMA_REJECTED")` errors carrying * the failing JSON path in `details.path`. * * Extracted from `engine.ts` during M3.b. No behavior changes. */ import type { PdfDocumentPhase2, PdfMetaPhase1 } from "./engine.js"; import type { PdfEmbeddedFontInput, PdfFontInput } from "./font-embedding.js"; import type { PdfGraphic } from "./phase4-types.js"; export interface NormalizedPdfText { direction: "auto" | "ltr" | "rtl"; font: PdfFontInput; fallbackFonts?: PdfEmbeddedFontInput[]; fontSize: number; value: string; x: number; y: number; } export interface NormalizedPdfPage { graphics: PdfGraphic[]; height: number; texts: NormalizedPdfText[]; width: number; } export interface NormalizedPdfDocument { meta: PdfMetaPhase1; pages: NormalizedPdfPage[]; } export declare function normalizeDocument(document: PdfDocumentPhase2): NormalizedPdfDocument; //# sourceMappingURL=phase2-normalize.d.ts.map