1 | import { DrakeWithModels } from './DrakeWithModels';
|
2 | import { EventTypes } from './EventTypes';
|
3 | import { DragulaOptions } from './DragulaOptions';
|
4 | import { DrakeFactory } from './DrakeFactory';
|
5 | import { Drake } from 'dragula';
|
6 | export declare const MockDrakeFactory: DrakeFactory;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | export declare class MockDrake implements DrakeWithModels {
|
24 | containers: Element[];
|
25 | options: DragulaOptions;
|
26 | models?: any[][] | undefined;
|
27 | private emitter$;
|
28 | private subs;
|
29 | |
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | constructor(containers?: Element[], options?: DragulaOptions, models?: any[][] | undefined);
|
36 | on(event: 'drag', listener: (el: Element, source: Element) => void): Drake;
|
37 | on(event: 'dragend', listener: (el: Element) => void): Drake;
|
38 | on(event: 'drop', listener: (el: Element, target: Element, source: Element, sibling: Element) => void): Drake;
|
39 | on(event: 'cancel' | 'remove' | 'shadow' | 'over' | 'out', listener: (el: Element, container: Element, source: Element) => void): Drake;
|
40 | on(event: 'cloned', listener: (clone: Element, original: Element, type: 'copy' | 'mirror') => void): Drake;
|
41 | on(event: 'dropModel', listener: ([el, target, source, sibling, item, sourceModel, targetModel, sourceIndex, targetIndex,]: [Element, Element, Element, Element, any, any[], any[], number, number]) => void): Drake;
|
42 | on(event: 'removeModel', listener: ([el, container, source, item, sourceModel, sourceIndex]: [Element, Element, Element, any, any[], number]) => void): Drake;
|
43 | dragging: boolean;
|
44 | start(item: Element): any;
|
45 | end(): any;
|
46 | cancel(revert: boolean): any;
|
47 | cancel(): any;
|
48 | canMove(item: Element): boolean;
|
49 | remove(): any;
|
50 | destroy(): any;
|
51 | /**
|
52 | * This is the most useful method. You can use it to manually fire events that would normally
|
53 | * be fired by a real drake.
|
54 | *
|
55 | * You're likely most interested in firing `drag`, `remove` and `drop`, the three events
|
56 | * DragulaService uses to implement [dragulaModel].
|
57 | *
|
58 | * See https://github.com/bevacqua/dragula#drakeon-events for what you should emit (and in what order).
|
59 | *
|
60 | * (Note also, firing dropModel and removeModel won't work. You would have to mock DragulaService for that.)
|
61 | */
|
62 | emit(eventType: EventTypes, ...args: any[]): void;
|
63 | }
|