import type { PdfElement } from '../../models/PdfElement.js'; /** * Pure decision logic for whether a page should be collapsed to a single * full-page screenshot element (covers and full-page advertisements) instead of * being decomposed into text + images. * * The key discriminator is the LONGEST continuous text block, not the total text * length: a genuine editorial page has at least one long paragraph, whereas a * full-page ad only has short scattered promo fragments (headline, tagline, * bullets, legal line). The old "total text >= 200 chars" guard fired on those * scattered fragments and wrongly kept text-heavy ads as decomposed pages. */ export interface ScreenshotThresholds { /** Single/aggregate image coverage that marks a full-page visual. Default 0.8. */ coverPageThreshold: number; /** Hero-image coverage that flags an ad even when it also carries text. Default 0.55. */ heroImageCoverageThreshold: number; /** Longest continuous text block that marks real editorial content. Default 300. */ significantTextBlockThreshold: number; /** Max total text for a hero-image ad (above this it is treated as content). Default 600. */ adMaxTextChars: number; /** * Min distinct text elements for the editorial-guard exemption. Ads scatter * their copy across many boxes (headline, body, CTA, legal line, URL); * a photo-editorial page has only a title + caption + credit. Default 5. */ adMinTextFragments: number; } export declare const DEFAULT_SCREENSHOT_THRESHOLDS: ScreenshotThresholds; export interface ScreenshotInput { pageWidth: number; pageHeight: number; elements: PdfElement[]; } export interface ScreenshotDecision { convert: boolean; reason: string; } export declare function decideScreenshot(input: ScreenshotInput, thresholds?: ScreenshotThresholds): ScreenshotDecision; //# sourceMappingURL=screenshotHeuristics.d.ts.map