generated from hchiam/convenience
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakeDraggableShared.d.ts
42 lines (40 loc) · 1.31 KB
/
makeDraggableShared.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
export class SnapPoint {
x: number;
y: number;
}
export class DraggableElementOrEvent extends HTMLElement {
mouseX?: number;
mouseY?: number;
disableStyleReset?: boolean;
snapPoints?: SnapPoint[];
disableEditing?: boolean;
detectAsClickToEdit?: boolean;
startedTyping?: boolean;
}
export class DraggableSettings {
disableKeyboardMovement?: boolean; // false;
disableStyleReset?: boolean; // false;
disableEditing?: boolean; // false;
snapPoints?: SnapPoint[];
snapGridSize?: number;
snapThreshold?: number;
snapWithinElements?: HTMLElement[];
handleSelector?: string;
mouseDownCallback?: (element: DraggableElementOrEvent) => void;
touchStartCallback?: (element: DraggableElementOrEvent) => void;
mouseMoveCallback?: (element: DraggableElementOrEvent) => void;
touchMoveCallback?: (element: DraggableElementOrEvent) => void;
mouseUpCallback?: (element: DraggableElementOrEvent) => void;
touchEndCallback?: (element: DraggableElementOrEvent) => void;
snapCallback?: (
left: number,
top: number,
containerElement?: HTMLElement
) => void;
keyboardMoveCallback?: (element: DraggableElementOrEvent) => void;
blurCallback?: (element: DraggableElementOrEvent) => void;
customAriaLabel?: (
element: DraggableElementOrEvent,
settings: DraggableSettings
) => string;
}