UNPKG

2.5 kBTypeScriptView Raw
1export interface DragSourceOptions {
2 /**
3 * Optional. A string. By default, 'move'. In the browsers that support this feature, specifying 'copy'
4 * shows a special “copying” cursor, while 'move' corresponds to the “move” cursor. You might want to use
5 * this option to provide a hint to the user about whether an action is destructive.
6 */
7 dropEffect?: string;
8}
9export interface DragPreviewOptions {
10 /**
11 * Optional. A boolean. By default, false. If true, the component will learn that it is being dragged immediately as the drag
12 * starts instead of the next tick. This means that the screenshotting would occur with monitor.isDragging() already being true,
13 * and if you apply any styling like a decreased opacity to the dragged element, this styling will also be reflected on the
14 * screenshot. This is rarely desirable, so false is a sensible default. However, you might want to set it to true in rare cases,
15 * such as if you want to make the custom drag layers work in IE and you need to hide the original element without resorting to
16 * an empty drag preview which IE doesn't support.
17 */
18 captureDraggingState?: boolean;
19 /**
20 * Optional. A number between 0 and 1. By default, 0.5. Specifies how the offset relative to the drag source node is translated
21 * into the horizontal offset of the drag preview when their sizes don't match. 0 means “dock the preview to the left”, 0.5 means
22 * “interpolate linearly” and 1 means “dock the preview to the right”.
23 */
24 anchorX?: number;
25 /**
26 * Optional. A number between 0 and 1. By default, 0.5. Specifies how the offset relative to the drag source node is translated into
27 * the vertical offset of the drag preview when their sizes don't match. 0 means “dock the preview to the top, 0.5 means “interpolate
28 * linearly” and 1 means “dock the preview to the bottom.
29 */
30 anchorY?: number;
31 /**
32 * Optional. A number or null if not needed. By default, null. Specifies the vertical offset between the cursor and the drag preview
33 * element. If offsetX has a value, anchorX won't be used.
34 */
35 offsetX?: number;
36 /**
37 * Optional. A number or null if not needed. By default, null. Specifies the vertical offset between the cursor and the drag
38 * preview element. If offsetY has a value, anchorY won't be used.
39 */
40 offsetY?: number;
41}
42export declare type DropTargetOptions = any;