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

30 lines (29 loc) 1.47 kB
import { IDragActivation, TPointerState } from '../../external/types'; import { IDnDProviderInternal } from '../types/provider'; /** * Checks if the click target is within the drag handle (if specified) * @param skipHandle - when true (e.g. keyboard drag), bypass handle check */ export declare function checkDragHandle(target: HTMLElement, draggable: HTMLElement, handleSelector?: string, skipHandle?: boolean): boolean; /** * Calculates distance progress (0-1) for activation threshold */ export declare function calculateDistanceProgress(pointer: TPointerState, distanceThreshold: IDragActivation['distance']): number; /** * Returns true if distance threshold is met */ export declare function isDistanceThresholdPassed(pointer: TPointerState, distanceThreshold: IDragActivation['distance']): boolean; /** * Returns true if activation conditions are met (distance + delay, respecting condition) */ export declare function isActivationComplete(distanceProgress: number, delayProgress: number, activation?: IDragActivation): boolean; /** * If activation is complete, starts dragging. Returns true if drag was started */ export declare function tryStartDragIfActivationComplete(provider: IDnDProviderInternal): boolean; /** * Creates RAF-based delay timer that ticks until activation is complete, then calls onComplete */ export declare function createActivationDelayTimer(provider: IDnDProviderInternal, onComplete: () => void): { cancel: () => void; };