import { Adsorber } from './adsorber'; import { PositionSchema } from '../../common/schema'; import { Rectangle } from '@gedit/math'; export declare enum AlignType { LINE = 0, LINE_BETWEEN = 1, BLOCK_BETWEEN = 2 } export interface AlignInfo { type: AlignType; direction: Adsorber.Direction; startPos: PositionSchema; endPos: PositionSchema; } export declare namespace Align { function calculate(target: Rectangle, refs: Rectangle[], // 参考对象 lines: Adsorber.Line[]): AlignInfo[]; /** * @param target 选中元素 * @param ref 参考元素 * @returns AlignInfo[]; * 计算所有对齐线 * 1. target 在 ref 内部,计算 target 四边到 ref 四边的距离, 有四条线; * 2. target 在 ref 外部: * 1) 在上边, target 下边到 ref 上边的距离,如上下重叠,计算 target 下边到 ref 下边的距离; * 2) 在右边, target 左边到 ref 右边的距离,如左右重叠,计算 target 右边到 ref 右边的距离; * 3) 在下边, target 上边到 ref 下边的距离,如上下重叠,计算 target 上边到 ref 上边的距离; * 4) 在左边, target 右边到 ref 左边的距离,如左右重叠,计算 target 左边到 ref 左边的距离; */ function calculateAll(target: Rectangle, ref: Rectangle): AlignInfo[]; } //# sourceMappingURL=align.d.ts.map