react-moveable
Version:
A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.
50 lines (49 loc) • 3.35 kB
TypeScript
import MoveableManager from "../MoveableManager";
import { Renderer, SnappableProps, SnappableState, SnapInfo } from "../types";
import { OnDrag } from "@daybrush/drag";
import { directionCondition } from "../groupUtils";
export declare function hasGuidelines(moveable: MoveableManager<any, any>, ableName: string): moveable is MoveableManager<SnappableProps, SnappableState>;
export declare function checkSnapPoses(moveable: MoveableManager<SnappableProps, SnappableState>, posesX: number[], posesY: number[], isSnapCenter?: boolean, customSnapThreshold?: number): {
vertical: SnapInfo;
horizontal: SnapInfo;
};
export declare function checkSnaps(moveable: MoveableManager<SnappableProps, SnappableState>, rect: {
left?: number;
top?: number;
bottom?: number;
right?: number;
center?: number;
middle?: number;
}, isCenter: boolean, customSnapThreshold?: number): {
vertical: SnapInfo;
horizontal: SnapInfo;
};
export declare function getSize(x: number, y: number): number;
export declare function checkOneWayPos(moveable: MoveableManager<any, any>, poses: number[][], reversePoses: number[][], isDirectionVertical: boolean, datas: any): number;
export declare function checkOneWayDist(moveable: MoveableManager<any, any>, poses: number[][], direction: number[], datas: any): number[];
export declare function checkTwoWayDist(moveable: MoveableManager<any, any>, poses: number[][], direction: number[], datas: any, matrix: number[], width: number, height: number, fixedPos: number[], is3d: boolean): number[];
export declare function checkSizeDist(moveable: MoveableManager<any, any>, matrix: number[], width: number, height: number, direction: number[], snapDirection: number[], datas: any, is3d: boolean): number[];
export declare function checkSnapSize(moveable: MoveableManager<any, any>, width: number, height: number, direction: number[], datas: any): number[];
export declare function checkSnapScale(moveable: MoveableManager<any, any>, scale: number[], direction: number[], snapDirection: number[], datas: any): number[];
export declare function solveEquation(pos1: number[], pos2: number[], snapOffset: number, isVertical: boolean): number[] | undefined;
export declare function getSnapInfosByDirection(moveable: MoveableManager<SnappableProps, SnappableState>, poses: number[][], snapDirection: number[] | true): {
vertical: SnapInfo;
horizontal: SnapInfo;
};
declare const _default: {
name: string;
render(moveable: MoveableManager<SnappableProps, SnappableState>, React: Renderer): any[];
dragStart(moveable: MoveableManager<SnappableProps, SnappableState>, e: any): void;
drag(moveable: MoveableManager<SnappableProps, SnappableState>, e: OnDrag): false | undefined;
dragEnd(moveable: MoveableManager<SnappableProps, SnappableState>): void;
dragControlCondition: typeof directionCondition;
dragControlStart(moveable: MoveableManager<SnappableProps, SnappableState>, e: any): void;
dragControlEnd(moveable: MoveableManager<SnappableProps, SnappableState>): void;
dragGroupStart(moveable: any, e: any): void;
dragGroup(moveable: any, e: any): void;
dragGroupEnd(moveable: any): void;
dragGroupControlStart(moveable: any, e: any): void;
dragGroupControlEnd(moveable: any): void;
unset(moveable: any): void;
};
export default _default;