UNPKG

1.01 kBTypeScriptView Raw
1import { State } from '../reducers/dragOffset';
2import { XYCoord } from '..';
3/**
4 * Coordinate addition
5 * @param a The first coordinate
6 * @param b The second coordinate
7 */
8export declare function add(a: XYCoord, b: XYCoord): XYCoord;
9/**
10 * Coordinate subtraction
11 * @param a The first coordinate
12 * @param b The second coordinate
13 */
14export declare function subtract(a: XYCoord, b: XYCoord): XYCoord;
15/**
16 * Returns the cartesian distance of the drag source component's position, based on its position
17 * at the time when the current drag operation has started, and the movement difference.
18 *
19 * Returns null if no item is being dragged.
20 *
21 * @param state The offset state to compute from
22 */
23export declare function getSourceClientOffset(state: State): XYCoord | null;
24/**
25 * Determines the x,y offset between the client offset and the initial client offset
26 *
27 * @param state The offset state to compute from
28 */
29export declare function getDifferenceFromInitialOffset(state: State): XYCoord | null;