import { Component, FieldDescriptor } from "../../pageModel";
export type OverlayRect = {
    x: number;
    y: number;
    width: number;
    height: number;
};
export type OverlayMetrics = {
    scrollLeft: number;
    scrollTop: number;
    scrollScale: number;
    visualScale: number;
    viewportWidth: number;
    viewportHeight: number;
    scrollWidth: number;
    scrollHeight: number;
};
type DOMRectLike = Pick<DOMRect, "left" | "top" | "width" | "height">;
export declare function getOverlayScrollMetrics(iframe: HTMLIFrameElement | null | undefined, scrollScale: number, visualScale: number): Pick<OverlayMetrics, "scrollLeft" | "scrollTop" | "scrollScale" | "visualScale">;
export declare function getOverlayMetrics(iframe: HTMLIFrameElement | null | undefined, scrollScale: number, visualScale: number): OverlayMetrics;
export declare function toOverlayRect(viewportRect: DOMRectLike, metrics: OverlayMetrics): OverlayRect;
export declare function rectEquals(a: OverlayRect | null | undefined, b: OverlayRect | null | undefined, tolerance?: number): boolean;
export declare function rectListEquals(a: readonly OverlayRect[] | null | undefined, b: readonly OverlayRect[] | null | undefined, tolerance?: number): boolean;
export declare function getTextNodeAtOffset(root: Node, offset: number, affinity?: "forward" | "backward"): {
    node: Text;
    offset: number;
} | null;
export declare function createRangeFromTextOffsets(iframeDocument: Document, root: Node, start: number, end: number): Range | null;
export declare function measureTextRangeRects(iframeDocument: Document, root: Node, start: number, end: number, metrics: OverlayMetrics): OverlayRect[];
export declare function measureCollapsedTextOffsetRect(iframeDocument: Document, root: Node, offset: number, metrics: OverlayMetrics): OverlayRect | null;
export declare function measureElementRect(element: Element | null | undefined, metrics: OverlayMetrics): OverlayRect | null;
export declare function measureFieldElementRect(iframe: HTMLIFrameElement, fieldDescriptor: FieldDescriptor, metrics: OverlayMetrics): OverlayRect | null;
export declare function measureComponentRect(iframe: HTMLIFrameElement, component: Component, metrics: OverlayMetrics): {
    rect: OverlayRect;
    elements: Element[];
} | null;
export {};
