import type { PdfPageContent } from '../../models/PdfPageContent.js'; export type ContentType = 'cover' | 'image' | 'article' | 'mixed'; export interface ContinuationMarkers { toPage: number | null; fromPage: number | null; } /** * The current page's main body ends mid-sentence, i.e. it looks like a clause cut * across the page break. Two conditions must both hold: * - no terminal sentence punctuation, AND * - the tail ends on a word or comma (a clause genuinely running on). * A tail that ends on a separator / number / symbol is NOT a hanging sentence: * ad legal fine print ("... | Chromos | -"), a stat callout, or a caption fragment * would otherwise read as "hanging" and wrongly glue an ad or a standalone page * onto its neighbour. */ export declare function mainBodyEndsHanging(page: PdfPageContent): boolean; /** The next page begins mid-sentence: its first text element is body starting lowercase. */ export declare function nextStartsMidSentence(page: PdfPageContent): boolean; /** The page opens a new section/article (large display title or a section-marker word). */ export declare function startsNewSection(page: PdfPageContent): boolean; /** * The next page's first body paragraph opens with a discourse connective * ("Meanwhile, ..."): continuation evidence even when the previous page ended * on a sentence boundary. */ export declare function nextStartsWithConnective(page: PdfPageContent): boolean; /** * Distinct normalized tokens of the page's running head / kicker (stashed by * the clean composer in metadata.runningHeadText before the margin filter * discards those elements). "BUSINESS stable fly" -> [business, stable, fly]. */ export declare function runningHeadTokens(page: PdfPageContent): string[]; /** * Parse "continued on/from page N" markers from a page's text. */ export declare function parseContinuationMarkers(page: PdfPageContent): ContinuationMarkers; /** * The two pages are the left and right halves of the SAME physical spread page * (adjacent by construction: the splitter emits left then right). */ export declare function isSpreadMatePair(currentPage: PdfPageContent, nextPage: PdfPageContent): boolean; /** * An "artwork half": a spread half whose content is imagery belonging to its * mate's article, not an article of its own. Evidence: it has image content, * no article opening of its own, and at most caption-level text in few boxes * (ads scatter promo copy across 5+ boxes; editorial artwork carries 0-3). * For halves already collapsed to a screenshot, the collapse reason separates * editorial artwork (single-large-image / tiled-images / cover) from ads. */ export declare function isSpreadArtworkHalf(page: PdfPageContent): boolean; /** * Spread-mate attachment: exactly one half is artwork and the other carries * the article text. Direction-agnostic (artwork may sit left or right). * Evaluated BEFORE the screenshot guard in hasContentContinuity: within a * spread, a full-page editorial image belongs to its mate's article, unlike a * portrait document where an image-only page is a standalone ad/insert. */ export declare function spreadMateContinuity(currentPage: PdfPageContent, nextPage: PdfPageContent): boolean; /** * A page that has been (or should be) collapsed to a single full-page screenshot * is standalone and must never merge with a neighbour. Primary signal is the * metadata the screenshot stage writes; the structural fallback covers ads that * the per-document screenshot cap left un-converted. */ export declare function isScreenshotPage(page: PdfPageContent): boolean; export declare function isCoverPage(page: PdfPageContent): boolean; export declare function analyzeContentType(page: PdfPageContent): ContentType; /** * Decide whether content flows continuously from currentPage into nextPage. * * `sharedRunningHead` is document-level evidence the caller computes (see * PdfPageComposer): both pages carry the same RARE running-head kicker (an * article subject line such as "stable fly", not a section label). It covers * continuations whose pages each end on a clean sentence boundary, which the * text-flow signals below cannot see. */ export declare function hasContentContinuity(currentPage: PdfPageContent, nextPage: PdfPageContent, sharedRunningHead?: boolean): boolean; //# sourceMappingURL=pageContinuity.d.ts.map