import Matrix2D from './matrix'; import { Point2d } from './Point2d'; /** * 指定的 DOM 元素, 通过接收当前元素的pointer\pointermove事件, 计算出当前元素的旋转角度, 并更新元素的transform属性 * @param element 旋转按钮元素 * @param target * @param centerPoint 旋转的中心点, 坐标必须相对于pageX, pageY */ export interface RotatableOptions { /** 需要旋转的目标元素(需要设置 position 为 absolute 或 relative) */ target: HTMLDivElement; /** 旋转的中心点, 坐标必须相对于容器左上角 */ getRotateCenterPoint: () => Point2d; /** 获取目标元素的transform属性 */ getMatrix: () => Matrix2D; /** 旋转开始时触发 */ onRotateStart?: (angle: number) => void; /** 旋转结束时触发 */ onRotateEnd: (matrix: Matrix2D) => void; /** 旋转过程中触发 */ onRotateChange?: (angle: number) => void; } export declare function makeRotatable(element: HTMLDivElement, options: RotatableOptions): { destroy: () => void; };