UNPKG

2.62 kBTypeScriptView Raw
1import { Backend, DragDropManager, Unsubscribe } from 'dnd-core';
2import { HTML5BackendContext } from './types';
3declare global {
4 interface Window {
5 __isReactDndBackendSetUp: boolean | undefined;
6 }
7}
8export declare class HTML5BackendImpl implements Backend {
9 private options;
10 private actions;
11 private monitor;
12 private registry;
13 private enterLeaveCounter;
14 private sourcePreviewNodes;
15 private sourcePreviewNodeOptions;
16 private sourceNodes;
17 private sourceNodeOptions;
18 private dragStartSourceIds;
19 private dropTargetIds;
20 private dragEnterTargetIds;
21 private currentNativeSource;
22 private currentNativeHandle;
23 private currentDragSourceNode;
24 private altKeyPressed;
25 private mouseMoveTimeoutTimer;
26 private asyncEndDragFrameId;
27 private dragOverTargetIds;
28 constructor(manager: DragDropManager, globalContext?: HTML5BackendContext);
29 /**
30 * Generate profiling statistics for the HTML5Backend.
31 */
32 profile(): Record<string, number>;
33 get window(): Window | undefined;
34 get document(): Document | undefined;
35 setup(): void;
36 teardown(): void;
37 connectDragPreview(sourceId: string, node: Element, options: any): Unsubscribe;
38 connectDragSource(sourceId: string, node: Element, options: any): Unsubscribe;
39 connectDropTarget(targetId: string, node: HTMLElement): Unsubscribe;
40 private addEventListeners;
41 private removeEventListeners;
42 private getCurrentSourceNodeOptions;
43 private getCurrentDropEffect;
44 private getCurrentSourcePreviewNodeOptions;
45 private getSourceClientOffset;
46 private isDraggingNativeItem;
47 private beginDragNativeItem;
48 private endDragNativeItem;
49 private isNodeInDocument;
50 private endDragIfSourceWasRemovedFromDOM;
51 private setCurrentDragSourceNode;
52 private clearCurrentDragSourceNode;
53 handleTopDragStartCapture: () => void;
54 handleDragStart(e: DragEvent, sourceId: string): void;
55 handleTopDragStart: (e: DragEvent) => void;
56 handleTopDragEndCapture: () => void;
57 handleTopDragEnterCapture: (e: DragEvent) => void;
58 handleDragEnter(e: DragEvent, targetId: string): void;
59 handleTopDragEnter: (e: DragEvent) => void;
60 handleTopDragOverCapture: () => void;
61 handleDragOver(e: DragEvent, targetId: string): void;
62 handleTopDragOver: (e: DragEvent) => void;
63 handleTopDragLeaveCapture: (e: DragEvent) => void;
64 handleTopDropCapture: (e: DragEvent) => void;
65 handleDrop(e: DragEvent, targetId: string): void;
66 handleTopDrop: (e: DragEvent) => void;
67 handleSelectStart: (e: DragEvent) => void;
68}