import { OverlayMetrics } from "./geometry";
import type { DragObject } from "../../client/editContext";
export type OverlayInvalidationReason = "viewport" | "layout" | "text" | "adornment-data";
type OverlayMode = "scrolling" | "static";
type OverlayBleed = number | Partial<Record<"top" | "right" | "bottom" | "left", number>>;
export declare const IFRAME_OVERLAY_BRIDGE_SCROLL_EVENT = "parhelia:iframe-overlay-bridge-scroll";
export declare const IFRAME_OVERLAY_BRIDGE_GEOMETRY_EVENT = "parhelia:iframe-overlay-bridge-geometry";
export type IframeOverlayBridgeScrollDetail = {
    scrollLeft: number;
    scrollTop: number;
};
export type IframeOverlayBridgeGeometryDetail = Partial<Pick<OverlayMetrics, "scrollLeft" | "scrollTop" | "viewportWidth" | "viewportHeight" | "scrollWidth" | "scrollHeight">>;
export declare const IFRAME_OVERLAY_BRIDGE_DRAG_GESTURE_EVENT = "parhelia:iframe-overlay-bridge-drag-gesture";
export type IframeOverlayBridgeDragGestureSpace = "host" | "client";
export type IframeOverlayBridgeDragGestureDetail = {
    phase: "start";
    pointerId: number;
    elementKey?: string;
    componentId?: string;
    dragObject?: DragObject;
    clientX: number;
    clientY: number;
    space?: IframeOverlayBridgeDragGestureSpace;
} | {
    phase: "move";
    pointerId: number;
    clientX: number;
    clientY: number;
    space?: IframeOverlayBridgeDragGestureSpace;
} | {
    phase: "end";
    pointerId: number;
    clientX: number;
    clientY: number;
    canceled?: boolean;
    space?: IframeOverlayBridgeDragGestureSpace;
} | {
    phase: "snapshot";
    elementKey: string;
    dataUrl: string;
    width: number;
    height: number;
};
type MeasurementCallback = (metrics: OverlayMetrics, reasons: ReadonlySet<OverlayInvalidationReason>) => void;
type ScrollCallback = (metrics: OverlayMetrics) => void;
type IframeOverlayContextValue = {
    iframe: HTMLIFrameElement | null;
    getMetrics: () => OverlayMetrics;
    invalidateGeometry: (reason: OverlayInvalidationReason | OverlayInvalidationReason[]) => void;
    subscribeMeasurement: (callback: MeasurementCallback, interests?: Iterable<OverlayInvalidationReason>) => () => void;
    subscribeScroll: (callback: ScrollCallback) => () => void;
};
export declare function useIframeOverlay(): IframeOverlayContextValue;
export declare function IframeOverlayProvider({ iframe, scrollScale, visualScale, invalidationKey, deferredInvalidationMs, mode, bleed, children, }: {
    iframe: HTMLIFrameElement | null;
    scrollScale?: number;
    visualScale?: number;
    invalidationKey?: unknown;
    deferredInvalidationMs?: number;
    mode?: OverlayMode;
    bleed?: OverlayBleed;
    children: React.ReactNode;
}): import("react/jsx-runtime").JSX.Element;
export {};
