UNPKG

@foblex/drag-toolkit

Version:

A TypeScript library providing foundational classes and utilities for implementing drag-and-drop functionality in Angular applications, with support for both mouse and touch events, and designed to work with or without Angular’s NgZone (zoneless applicati

39 lines (38 loc) 1.45 kB
import { ICanRunOutsideAngular } from './i-can-run-outside-angular'; import { IPointerEvent } from './pointer-events'; export declare const MOUSE_EVENT_IGNORE_TIME = 800; export declare abstract class DragAndDropBase { protected ngZone: ICanRunOutsideAngular | undefined; abstract hostElement: HTMLElement; private document; private mouseListeners; private touchListeners; private startListeners; isSyntheticEvent(event: MouseEvent): boolean; private lastTouchEventTime; isDragStarted: boolean; private dragStartThreshold; private dragStartDelay; private dragStartTime; private dragStartPosition; abstract disabled: boolean; private moveHandler; private pointerDownElement; protected constructor(ngZone: ICanRunOutsideAngular | undefined); private onMouseDown; private onTouchDown; private onSelectStart; private onMouseMove; private onTouchMove; private checkDragSequenceToStart; protected abstract prepareDragSequence(event: IPointerEvent): void; private onPointerUpEvent; private endDragSequence; protected abstract finalizeDragSequence(): void; protected abstract onSelect(event: Event): void; abstract onPointerDown(event: IPointerEvent): boolean; abstract onPointerMove(event: IPointerEvent): void; abstract onPointerUp(event: IPointerEvent): void; subscribe(fDocument: Document): void; unsubscribe(): void; }