forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dragula.d.ts
46 lines (41 loc) · 1.42 KB
/
dragula.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
// Type definitions for dragula v2.1.2
// Project: http://bevacqua.github.io/dragula/
// Definitions by: Paul Welter <https://github.com/pwelter34/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace dragula {
interface DragulaOptions {
containers?: Element[];
isContainer?: (el?: Element) => boolean;
moves?: (el?: Element, container?: Element, handle?: Element) => boolean;
accepts?: (el?: Element, target?: Element, source?: Element, sibling?: Element) => boolean;
invalid?: (el?: Element, target?: Element) => boolean;
direction?: string;
copy?: boolean;
revertOnSpill?: boolean;
removeOnSpill?: boolean;
delay?: boolean | number;
mirrorContainer?: Element;
}
interface Drake {
containers: Element[];
dragging: boolean;
start(item:Element): void;
end(): void;
cancel(revert:boolean): void;
cancel(): void;
remove(): void;
on(events: string, callback: Function): void;
destroy(): void;
}
interface Dragula {
(containers: Element[], options: DragulaOptions): Drake;
(containers: Element, options: DragulaOptions): Drake;
(containers: Element[]): Drake;
(options: DragulaOptions): Drake;
(): Drake;
}
}
declare var dragula: dragula.Dragula;
declare module "dragula" {
export = dragula;
}