/** * Document-level spread detection. * * Aspect ratio alone cannot identify a spread: an A4 spread (1.41) has the * same aspect as a single A4 landscape page, and 16:9 slide decks (1.78) sit * between Letter spreads (1.55) and square-page spreads (2.0). The reliable * signal is CONTENT evidence: a true spread has an empty vertical gutter at * the midline (elements do not cross it) and often carries a folio pair * (adjacent page numbers printed on the two halves, e.g. 736|737). * * The decision is made once per document, not per page, so evidence-free * pages (a full-bleed cover photo) follow the document verdict instead of * being left unsplit in an otherwise split document. */ import { type SpreadCandidateElement, type SpreadCandidatePage, type SpreadDetectionResult, type SpreadPageEvidence } from './types.js'; /** A page is a spread candidate only when clearly landscape. */ export declare function isLandscapePage(page: { width: number; height: number; }): boolean; /** * True when the element extends beyond the vertical midline by more than the * slack margin on BOTH sides. Touching the centerline is not crossing. */ export declare function crossesMidline(element: SpreadCandidateElement, pageWidth: number): boolean; /** * Folio pair: two numeric-only text elements inside the top or bottom margin * band, one on each half, with adjacent values (left = right - 1 in LTR * publications, either order accepted). Strong direct evidence that the two * halves are distinct numbered pages. */ export declare function hasFolioPair(page: SpreadCandidatePage): boolean; /** Gather per-page spread evidence. Exported for the orchestrator's logging. */ export declare function collectPageEvidence(page: SpreadCandidatePage): SpreadPageEvidence; /** * Decide once for the whole document whether landscape pages are spreads. * Requires a clear majority of eligible landscape pages voting spread, with * an absolute minimum of votes so one odd page cannot flip a document. */ export declare function detectSpreadDocument(pages: SpreadCandidatePage[]): SpreadDetectionResult; //# sourceMappingURL=spreadDetection.d.ts.map