New

docx-editor 1.x has shipped. Vue support, i18n, agents. Read the migration guide →

API Referencev1.0.2

@eigenpal/docx-editor-core/prosemirror/utils/PointerEventHandler

Pointer Event Handler

Centralized input handling for all pointer events. Provides single source of truth for click, drag, and focus management.

Classes(1)

PointerEventHandler handles all pointer input for the paged editor. It provides: - Single/double/triple click detection - Drag selection with anchor tracking - Coordinate normalization for zoom - Focus management

declare class PointerEventHandler
MemberTypeSummary
(constructor)Constructs a new instance of the `PointerEventHandler` class
attachAttach event listeners to a container element.
cancelDragCancel any ongoing drag.
detachDetach event listeners from the container.
getDragAnchorGet drag anchor position.
isDraggingGet current drag state.
MULTI_CLICK_DELAY
setPositionResolverUpdate the position resolver reference.

Interfaces(2)

Interface for the editor that the handler controls.

interface EditorInterface
MemberTypeSummary
focusFocus the editor
getSelectionGet current selection
setSelectionSet selection to a position (collapsed)
setSelectionRangeSet selection range

Options for PointerEventHandler.

interface PointerEventHandlerOptions
MemberTypeSummary
editorEditorInterfaceThe editor to control
onInput?InputEventCallbackCallback for input events
positionResolverClickPositionResolverPosition resolver for click mapping

Type aliases(1)

Callback for input events.

type InputEventCallback = (event: {
    type: 'click' | 'doubleClick' | 'tripleClick' | 'dragStart' | 'drag' | 'dragEnd';
    position?: number;
    from?: number;
    to?: number;
}) => void;