export interface VisualAtom { /** hard: cutting through it visibly breaks content. soft: looks untidy. */ kind: "text-line" | "replaced" | "box"; /** Document-space vertical span (CSS px scaled to image px by the caller). */ top: number; bottom: number; } export interface SnapSeam { /** Document-space y of the cut. */ y: number; /** Weighted atoms the cut passes through; 0 = clean. */ cost: number; /** Hard atoms (text lines, replaced elements) the cut passes through. */ hard: number; clean: boolean; } export interface SnapOptions { bandHeight: number; /** Overlap applied below a dirty seam (the legacy constant, e.g. 120). */ overlap: number; /** Overlap applied below a clean seam. Default 16. */ cleanOverlap?: number; /** Fraction of bandHeight the seam may move up from its target. Default 0.3. */ slackRatio?: number; /** Minimum band height as a fraction of bandHeight. Default 0.5. */ minBandRatio?: number; } /** Weighted cost of a horizontal cut at document-space y. */ export declare function cutCost(atoms: VisualAtom[], y: number): { cost: number; hard: number; }; /** * Cut the vertical span [top, bottom) into bands whose seams snap into * content gaps. Seams only move UP from their fixed target (never down), so * band height is bounded by `bandHeight` above and `minBandRatio` below. * Returns full-width rects in the caller's coordinate space plus the seam * record for logging/telemetry. */ export declare function snappedBandRects(top: number, bottom: number, x: number, width: number, atoms: VisualAtom[], opts: SnapOptions): { rects: Array<{ index: number; x: number; y: number; width: number; height: number; }>; seams: SnapSeam[]; }; /** * Split one element rect into internally-banded sub-rects when it is taller * than the band budget. Selector-mode tiles previously shipped over-tall * elements as one giant tile that the vision provider downscales; banding * inside the element keeps every sub-tile at full resolution. Elements within * 1.25x of the budget stay whole — a slightly-over tile beats a degenerate * split. */ export declare function bandOversizedRect(rect: { label: string; x: number; y: number; width: number; height: number; }, atoms: VisualAtom[], opts: SnapOptions): Array<{ label: string; x: number; y: number; width: number; height: number; }>; /** * Indices of bands past the kept prefix (`allBands[0..keptCount)`) that * intersect any of `rects`. A tile cap keeps the top of a tall page and drops * the rest; a deterministic gate that already found a defect below the cap * still deserves a tile, so the caller cuts these bands as well and labels * them as hit bands. Pure: the result is deduplicated, ascending, and holds * at most `maxExtra` entries. Rects and bands share one pixel space. */ export declare function bandsCoveringRects(allBands: ReadonlyArray<{ x: number; y: number; width: number; height: number; }>, keptCount: number, rects: ReadonlyArray<{ x: number; y: number; width: number; height: number; }>, maxExtra?: number): number[]; /** All native-pixel candidates, before any per-pack allocation or cropping. */ export declare function reviewCandidateRects(args: { width: number; height: number; bandHeight: number; overlap: number; atoms?: VisualAtom[]; scopes?: Array<{ selector: string; rects: Array<{ label: string; x: number; y: number; width: number; height: number; }>; }>; }): Array<{ id: string; index: number; label: string; rect: { x: number; y: number; width: number; height: number; }; scope?: string; gate_hits: []; }>; //# sourceMappingURL=tiling.d.ts.map