export interface Rect { left: number; top: number; width: number; height: number; } export interface CaptureTransform { left: number; top: number; scaleX: number; scaleY: number; } export declare function captureTransform(region: Rect, canvasWidth: number, canvasHeight: number): CaptureTransform; export declare function toCanvasX(transform: CaptureTransform, x: number): number; export declare function toCanvasY(transform: CaptureTransform, y: number): number; export declare function rectToCanvas(transform: CaptureTransform, rect: Rect): Rect; export interface ScrollOffset { x: number; y: number; } /** * The capture region: the visual viewport, and nothing else. html-to-image * renders document.body shifted by the page scroll so the on-screen region * lands at the canvas origin — which makes this rect both the capture request * and the deliverable. There is no crop step: cropping a clone-space bitmap * was only ever needed when the capture was the whole document. */ export declare function viewportCaptureRect(): Rect; /** * How far an anchored annotation must move to land in a capture's frame. * * The anchor is the annotation's scroll debt at creation (page + nested * scrollers); the capture's pageScroll is the page half of that debt at capture * time. Adding the anchor lifts the annotation into clone space, subtracting * the capture scroll brings it back down into the viewport bitmap. */ export declare function anchorScreenshotOffset(anchor: ScrollOffset, pageScroll: ScrollOffset): ScrollOffset; export declare function nestedScrollOffset(target: Element | null): ScrollOffset; export declare function parentElement(element: Element): Element | null; /** * The full offset from a viewport measurement to clone space, page scroll * included — the anchor an annotation records so that later scrolling cannot * move it. * * nestedScrollOffset stops at the body because the capture's own metrics carry * the page scroll for anything measured at capture time. An annotation is not * measured at capture time, so it has to carry that half itself. */ export declare function captureAnchorOffset(target: Element | null): ScrollOffset; //# sourceMappingURL=geometry.d.ts.map