forked from cameronhimself/vue-drag-drop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
52 lines (40 loc) · 1.35 KB
/
index.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
43
44
45
46
47
48
49
50
51
52
import Vue, { PluginObject, VueConstructor } from 'vue';
export type DropEffect = 'copy' | 'move' | 'link' | 'none';
export type EffectsAllowed = 'none' | 'copy' | 'copyLink' | 'copyMove' | 'link' | 'linkMove' | 'move' | 'all' | 'uninitialized';
export type DragEventName = 'drag' | 'dragend' | 'dragenter' | 'dragleave' | 'dragstart' | 'dragover' | 'drop';
export type DragEventObject = { [s: string]: DragEventName };
declare class Drag extends Vue {
// props
draggable: boolean;
transferData: Record<string, any>;
dropEffect: { validator: (value: DropEffect) => boolean };
effectAllowed: { validator: (value: EffectsAllowed) => boolean };
image: string;
imageXOffset: number;
imageYOffset: number;
hideImageHtml: boolean;
tag: string;
// data
dragging: boolean;
// computed
events: DragEventObject;
scopedData: Record<string, any> | boolean;
hideImageStyle: Record<string, string>;
// methods
emitEvent: (name: DragEventName, event: DragEvent) => void;
}
declare class Drop extends Vue {
// props
tag: string;
// data
transferData: Record<string, any> | undefined;
isDraggingOver: boolean;
// computed
events: DragEventObject;
scopedData: Record<string, any> | boolean;
// methods
emitEvent: (name: DragEventName, event: DragEvent) => void;
}
declare const VueDragDrop: PluginObject<any>;
export { Drag, Drop };
export default VueDragDrop;