@atlaskit/editor-plugin-selection-extension
Version:
editor-plugin-selection-extension plugin for @atlaskit/editor-core
13 lines (12 loc) • 744 B
TypeScript
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
import type { SelectionExtensionCoords, BoundingBoxOffset } from '../types';
/**
* Calculates the bounding box coordinates of a text selection within an editor view.
*
* @param view - The editor view instance.
* @param from - The starting position of the selection.
* @param to - The ending position of the selection.
* @param offset - Optional offset to adjust the top and bottom coordinates of the bounding box.
* @returns An object containing the top, left, bottom, and right coordinates of the bounding box.
*/
export declare const getBoundingBoxFromSelection: (view: EditorView, from: number, to: number, offset?: BoundingBoxOffset) => SelectionExtensionCoords;