/** * Core viewer types — generic PDF/canvas shapes consumed by the * components in `components/`. * * The shapes here are deliberately host-neutral: page geometry, * sampling-result records, layer entries, and a `ViewerConfig` * surface for feature flags + branding. Anything domain-shaped * (findings, audit verdicts, brand-spec violations, art-size * metadata) lives in plugin packs, not here. * * @public */ /** PDF box in PDF points: lower-left + upper-right corners. */ export interface PageBox { x0: number; y0: number; x1: number; y1: number; } /** Per-page metadata returned by the engine. */ export interface PageInfo { page_num: number; width_pts: number; height_pts: number; media_box: PageBox; crop_box: PageBox | null; trim_box: PageBox | null; bleed_box: PageBox | null; rotation: number; } /** * Build a {@link PageInfo} from just the page number and PDF-point * dimensions returned by a fallback adapter's ``getPageDimensions``. * Sets ``media_box`` to the full page rectangle and leaves optional * boxes null — matching what pdf.js exposes. * * @public */ export declare function pageInfoFromDimensions(pageNum: number, widthPts: number, heightPts: number): PageInfo; /** * Dieline detection verdict. `source`: * - `"name"` — name-match heuristic (CutContour, Dieline, etc.) * - `"vision"` — vision-model spatial-reasoning fallback * - `"missing"` — no dieline found */ export interface DielineResult { source: "name" | "vision" | "missing"; polylines: number[][][]; spot_name: string | null; confidence: number; /** * Per-artwork bboxes extracted from dieline strokes. * * When codex reports multiple **imprints** (schema 1.9.0+ — a file with a * front and a back, or several SKUs ganged on one sheet), this carries one * entry per imprint, each with its OWN size + an optional neutral * `position` hint and a display `label` (`"Imprint 1"`, …). Codex numbers * imprints in a deterministic geometric order and never guesses front/back; * `position` is a presentation aid, not a front/back claim. Older codex * output (single union size) yields exactly one entry with no `label` / * `position` — backward-compatible. */ regions?: Array<{ x0: number; y0: number; x1: number; y1: number; width_mm: number; height_mm: number; /** * Display label for this region, set when the region is one of codex's * multi-imprint entries (`"Imprint 1"`, `"Imprint 2"`, …). Absent for the * single-dieline union region. */ label?: string; /** * Neutral geometric position hint from codex (`summary.dieline.imprints[].position`): * where the imprint sits on the page. A presentation aid only — NOT a * front/back assertion. Absent for the single-dieline union region. */ position?: "upper" | "lower" | "left" | "right" | "center"; }>; /** True when the dieline layer paints in more than one colour. */ multi_color?: boolean; /** * 1-based page the dieline geometry was measured on, sourced from * codex's `summary.dieline.size.page` (schema 1.5.0+). When set, the * `DielineOverlay` only draws on this page; when absent (older codex * output), the overlay falls back to drawing on whatever page is * currently shown — backward-compatible. */ page?: number; /** * ISO 19593 dieline class for the chosen candidate, sourced from * codex's `summary.dieline.candidates[].subtype` (schema 1.5.0+): * `cut` / `crease` / `perf` / `score` / `kiss_cut` / `fold` / `bleed` * / `emboss`. `null` / absent when codex couldn't classify the line. * Surfaced in the dieline overlay/panel so operators see the class. */ subtype?: string | null; } /** Optional Content Group entry surfaced by the layer panel. */ export interface LayerInfo { name: string; ocg_index: number; default_on: boolean; /** * True when this row is synthesized by the UI rather than sourced from * PDF `/OCProperties` OCG data (e.g. flat PDFs with no optional content * groups still get a single "Artwork" row so Layers mode doesn't look * broken to non-technical users). */ synthetic?: boolean; /** * Layer-row provenance: * - `ocg` — real optional-content group from the PDF * - `flattened-artwork` — synthetic fallback row for flat PDFs */ kind?: "ocg" | "flattened-artwork"; } export interface ColorSample { x: number; y: number; rgb: [number, number, number]; hex: string; tac: number | null; /** Optional per-ink breakdown — process CMYK + any spot inks the * service was able to detect at this point. Hosts that don't surface * spot data leave this undefined. */ inks?: ColorSampleInk[]; } export interface ColorSampleInk { name: string; percent: number; type: "process" | "spot"; } export interface DensitometerChannel { name: string; percent: number; } export interface DensitometerSample { x: number; y: number; dpi: number; channels: DensitometerChannel[]; tac: number; tac_limit: number; limit_exceeded: boolean; } /** * Capabilities the viewer can request data for. Hosts unaware of a * key can leave it unset; the viewer treats absence as "not * available". */ export type ViewerCapabilityKey = "findings" | "separations" | "tac" | "tac_runs" | "tiles_warmed" | "layers" | "fonts" | "images" | "thumbnails" | "metadata"; /** How the host produced the findings list backing this viewer * session. The viewer never reads this — it's plumbed through so * hosts that mount their own panels can show provenance ("findings * generated by our engine", "imported from an external pipeline", * etc.). Hosts free to ignore or extend the union. */ export type FindingsSourceMode = "engine" | "external" | "minimal"; export interface ViewerConfig { enable_separations: boolean; enable_tac_heatmap: boolean; enable_annotations: boolean; /** Public share-link only: whether anonymous visitors may create annotations. */ allow_annotations?: boolean; enable_measurement: boolean; enable_comparison: boolean; enable_layers: boolean; enable_findings_panel: boolean; enable_page_thumbnails: boolean; enable_zoom: boolean; enable_download: boolean; enable_html_report_link: boolean; verdict_mode: "auto" | "manual" | "disabled"; default_zoom: number; default_dpi: number; default_tac_limit: number; viewer_logo_url: string | null; viewer_accent_color: string | null; toolbar_position: "top" | "bottom"; dark_mode: boolean; /** Resolved branding — null fields when `anonymous` is true. */ brand_name: string | null; brand_logo_url: string | null; brand_primary_color: string | null; brand_accent_color: string | null; /** True when the viewer must hide all tenant + host chrome. */ anonymous: boolean; tenant_name: string | null; support_email: string | null; /** How findings were produced for this job. See {@link FindingsSourceMode}. */ findings_source: FindingsSourceMode; /** Per-capability availability map (true = backed by data). */ capabilities: Partial>; /** Plan-gate: false means the tenant may not invoke on-demand * capability fill-in. */ capability_fillin_enabled: boolean; /** Plan-gate: false means the viewer must hide annotation toolbar. */ annotations_enabled: boolean; /** Plan-gate: empty means report downloads are not available. */ allowed_report_formats: string[]; tile_cdn_base: string | null; } export declare const DEFAULT_VIEWER_CONFIG: ViewerConfig; /** * Severity-keyed fill/stroke palette. The keys mirror * `OverlayItem["tier"]`'s `error` / `warning` / `advisory` values * so canvas renderers can index in directly. */ export declare const SEVERITY_COLORS: { readonly error: { readonly fill: "rgba(239, 68, 68, 0.15)"; readonly stroke: "#ef4444"; }; readonly warning: { readonly fill: "rgba(245, 158, 11, 0.15)"; readonly stroke: "#f59e0b"; }; readonly advisory: { readonly fill: "rgba(59, 130, 246, 0.15)"; readonly stroke: "#3b82f6"; }; }; /** Default render DPI for canvas-backed page tiles. */ export declare const DEFAULT_DPI = 150; /** Default DPI for thumbnail/page-navigator tiles. */ export declare const THUMBNAIL_DPI = 72; //# sourceMappingURL=index.d.ts.map