/** * Adapters — pure TypeScript, no React. Map raw engine outputs * (codex, lint-pdf, callas, pitstop) to the types lens-pdf accepts * as props. Import from `@printwithsynergy/lens-pdf/adapters`. * * Zero custom glue code needed in demos: pass raw engine responses * to `` and lens handles the mapping. */ import type { OverlayItem } from "../plugin/types"; import type { DielineResult } from "../types"; /** * Raw engine outputs. Pass to `` and lens * maps them internally — no host-side adapter code required. * * @public */ export interface LensPDFDataConfig { /** Raw codex `ExtractResponse.summary` object. */ codexSummary?: Record | null; /** Raw codex `ExtractResponse.findings` array. */ codexFindings?: ReadonlyArray> | null; /** Raw lint-pdf engine findings array. */ lintFindings?: ReadonlyArray> | null; /** Raw callas PDF Toolbox / pdfaPilot hits array. */ callasFindings?: ReadonlyArray> | null; /** Raw Enfocus PitStop results array. */ pitstopFindings?: ReadonlyArray> | null; /** Raw artwork-pdf preflight issues array. */ artworkFindings?: ReadonlyArray> | null; } /** * Map a raw codex `summary` object to a lens dieline result and spot * palette. Backward-compatible: falls back to `(0, 0)` origin when the * codex version predates the `x0_pt` / `y0_pt` fields, and omits * `page` / `subtype` when the codex version predates schema 1.5.0. * * @public */ export declare function fromCodexSummary(summary: Record): { dieline: DielineResult | null; spotPalette: Record | undefined; }; /** * Map raw codex `findings[]` to `OverlayItem[]`. Codex findings are * already 1-indexed and use the same severity vocabulary as lens tiers, * so this is a direct mapping. * * @public */ export declare function fromCodexFindings(findings: ReadonlyArray>): OverlayItem[]; /** * Map raw lint-pdf engine findings to `OverlayItem[]`. lint-pdf's * `FindingResponse.page_num` is **already 1-indexed** (1 = first page, * matching pdfjs and veraPDF; `0`/`null` = document-level) — see * lint-pdf `src/lintpdf/api/schemas.py:102-110, which states * downstream adapters MUST treat the value as already 1-indexed and * pass it through unchanged. This adapter therefore passes `page_num` * straight through (clamping a `0`/document-level value up to `1`); it * does **not** add one. An earlier version incremented `page_num`, * which landed every overlay one page too high. * * **Preferred path:** lint's `JobResponse.codex_findings` is 1-indexed * `CodexFindingSchema[]` — pass those to {@link fromCodexFindings} * instead. `fromLintFindings` is kept for the raw engine finding shape * and backward compatibility. * * This adapter does not know the document's pageCount and cannot * clamp against it — if an engine version drifts and emits a * `page_num` past the document end, the resulting `page` value * will be out of range. That is caught downstream by ``'s * finding-selection effect, which clamps `currentPage` to * `[1, pageCount]` before driving pdfjs. The adapter itself only * accepts `page_num`s that are finite non-negative integers, so a * stray `NaN` / `-1` / `"3"` can't become a `page: 0` or `page: -2` * overlay item. * * @public */ export declare function fromLintFindings(findings: ReadonlyArray>): OverlayItem[]; /** * Map raw callas PDF Toolbox / pdfaPilot hit objects to `OverlayItem[]`. * Callas shape: `{ severity, message, page, rule, ... }` per hit. * * @public */ export declare function fromCallasFindings(findings: ReadonlyArray>): OverlayItem[]; /** * Map raw Enfocus PitStop result objects to `OverlayItem[]`. * PitStop shape: `{ level, description, pageNumber, checkName, ... }`. * * @public */ export declare function fromPitstopFindings(findings: ReadonlyArray>): OverlayItem[]; /** * Map raw artwork-pdf `PreflightIssue[]` to `OverlayItem[]`. * Remaps legacy severity vocab: `"block"` → `"error"`, `"warn"` → * `"warning"`. Handles missing bbox gracefully (no canvas overlay). * * @public */ export declare function fromArtworkFindings(findings: ReadonlyArray>): OverlayItem[]; //# sourceMappingURL=index.d.ts.map