import { PluginKey } from 'prosemirror-state'; import { Extension } from '../../core/Extension.js'; /** * Resolves the PM position at a given goalX within a line's position range. * * Uses binary search with computeCaretLayoutRect to find the position within * [pmStart, pmEnd] whose layout X is closest to goalX. This avoids relying on * screen-space hit testing, which fails when the target line is outside the * visible viewport (e.g., after crossing a page boundary). * * @param {Object} editor * @param {number} pmStart - Start PM position of the target line. * @param {number} pmEnd - End PM position of the target line. * @param {number} goalX - Target X coordinate in layout space. * @param {boolean} [isRtl=false] - Whether the target line is RTL. In RTL lines, * X decreases as PM position increases, so the binary search must be inverted. * @returns {{ pos: number } | null} */ export function resolvePositionAtGoalX(editor: Object, pmStart: number, pmEnd: number, goalX: number, isRtl?: boolean): { pos: number; } | null; export const VerticalNavigationPluginKey: PluginKey; /** * Enables vertical caret navigation in presentation mode by preserving a goal X * column and translating Up/Down arrow presses into layout-engine hit tests. * This keeps the caret aligned across wrapped lines, fragments, and pages while * respecting selection extension and avoiding non-text selections. */ export const VerticalNavigation: Extension, Record>; //# sourceMappingURL=vertical-navigation.d.ts.map