/** * DOM-based pointer-to-position mapping for the v1 editor. * * Maps viewport click coordinates to ProseMirror document positions by reading * the rendered DOM produced by the painter (`data-pm-start`, `data-pm-end`). * This is more accurate than geometry-based mapping because it uses the * browser's actual rendering and correctly handles PM position gaps that occur * after document edits (e.g. paragraph joins). * * @module dom-observer/DomPointerMapping */ /** * Maps a click coordinate to a ProseMirror document position using DOM data * attributes. * * Resolution strategy: * 1. Find the page element containing the click via `elementsFromPoint`. * 2. Find the fragment (or table-cell line) in the hit chain. * 3. Find the line at the Y coordinate within the fragment. * 4. Find the span at the X coordinate within the line. * 5. Use the browser caret API (or binary-search fallback) to resolve the * exact character boundary. * * Returns `null` when the DOM does not contain enough data to resolve a * position — the caller should fall back to geometry-based mapping. */ export declare function clickToPositionDom(domContainer: HTMLElement, clientX: number, clientY: number): number | null; /** * Finds the page element containing the given viewport coordinates. * * Tries `elementsFromPoint` first, then falls back to bounding-rect checks * on all page elements, and finally returns the first page as a last resort. */ export declare function findPageElement(domContainer: HTMLElement, clientX: number, clientY: number): HTMLElement | null; /** * Reads the layout epoch from DOM `data-layout-epoch` attributes at the given * viewport point. Returns the newest (highest) epoch in the hit chain so that * stale descendants don't block mapping. */ export declare function readLayoutEpochFromDom(domContainer: HTMLElement, clientX: number, clientY: number): number | null; //# sourceMappingURL=DomPointerMapping.d.ts.map