UNPKG

@vue-dnd-kit/core

Version:

Core functionality for Vue DnD Kit - a lightweight Vue 3 library for building performant and accessible drag and drop interfaces

16 lines (15 loc) 855 B
import { ICoordinates } from '../../external'; /** Distance from pointer to element center */ export declare const getDistanceFromPointerToElement: (pointer: ICoordinates, element: HTMLElement) => number; /** * Get element center coordinates from DOMRect * Utility for inline calculations without getBoundingClientRect call */ export declare const getCenterFromRect: (rect: DOMRect) => ICoordinates; /** Calculate distance between pointer and rect center */ export declare const getDistanceToRectCenter: (pointer: ICoordinates, rect: DOMRect) => number; /** Pick closest to pointer among zone and element (by distance to center). Returns { zone?, element? } */ export declare const pickClosestToPointer: (pointer: ICoordinates, zone: HTMLElement | undefined, element: HTMLElement | undefined) => { zone?: HTMLElement; element?: HTMLElement; };