import { GraphicNode } from "../node/GraphicNode";
import { BorderProps } from "../props/BorderProps";
import type { OolongNode } from "../OolongNode";
import { IBaseProps, ICapInfo, IConnectEnd, IPoint, ITextProps, NodeInfo, NodeType } from "../../idl";
import { PropType } from "../props/PropType";
import { AbsProps } from "../props/AbsProps";
import { BaseProps } from "../props/BaseProps";
import { InteractiveEvent, IRect, IRectNode, Point, Rect, RectNode, StretchType } from "../../common";
import { NodeConnectEndType } from "../base/NodeConnectEndType";
import type { OolongLine } from "../line/OolongLine";
import { AppEventContext } from "../../app";
import { ShapeCategoryType } from "../../config/ShapeCategoryType";
import { RotateType } from "../../idl/common/RotateType";
import { UpdateNodeInfo } from "../../action";
import { TextBlock } from "../../renderText/TextBlock";
import { RenderText, TextLine } from "../../renderText";
import { TextParagraphProps } from "../props/TextParagraphProps";
import { IParagraphStyle } from "../../idl/capInfo/ITextParagraphProps";
import { BezierCurve } from "../../plugin-pointer/interact/default/curveControlPoint/BezierCurve";
import { OolongSlideContainer } from "../OolongSlideContainer";
import { OolongSection } from "../OolongSection";
import { SlideCoverInfo } from "../../ability/slide/SlideCoverInfo";
import { NodeManager } from "../../application";
import { MindMapAnchorPoint } from "@/idl/MindmapLayoutType";
import { LineArcUnit } from "@/idl/RoundPolyLineTypes";
import { OolongMindmapNode } from "@/graphics";
/**
 * 基本utils类
 */
export declare class GraphicUtils {
    /**
     * 判断节点是否为 DocContainer 内的可编辑文本节点（纯文本或 CheckboxText）
     * @param node 要判断的节点
     * @returns 是否为可编辑文本节点
     */
    static isDocContainerEditableText(node: GraphicNode): boolean;
    static judgeNodeCanExpandShape(node: GraphicNode): node is OolongNode;
    static computeShapeCategory(nodeType: NodeType, shapeType?: number): ShapeCategoryType;
    static makeSortGraphic(g: GraphicNode): {
        graphics: GraphicNode[];
    };
    static sortGraphics(node: GraphicNode[]): GraphicNode[];
    static setDashLine(borderProps: BorderProps, ctx: CanvasRenderingContext2D): void;
    static convertPropsToCapInfo(props: Map<PropType, Partial<AbsProps>>): ICapInfo;
    static convertCapInfoToProps(capInfo: ICapInfo): AbsProps[];
    /**
     * 获取中心点
     */
    static centerPoint(node: GraphicNode): Point;
    /**
     * 获取矩形上方中点
     */
    static topPoint(node: GraphicNode): Point;
    /**
     * 获取图形右方中点
     */
    static rightPoint(node: GraphicNode): Point;
    /**
     * 获取图形下方中点
     */
    static bottomPoint(node: GraphicNode): Point;
    /**
     * 获取图形左方中点
     */
    static leftPoint(node: GraphicNode): Point;
    /**
     * 获取外接矩形形上方左角点
     */
    static topLeft(node: GraphicNode): Point;
    /**
     * 获取外接矩形形上方右角点
     */
    static topRight(node: GraphicNode): Point;
    /**
     * 获取外接矩形形下方左角点
     */
    static bottomLeft(node: GraphicNode): Point;
    /**
     * 获取外接矩形形下方右角点
     */
    static bottomRight(node: GraphicNode): Point;
    /**
     * 计算折线中间路径点方法
     * 折线只折一次情况
     * A----
     *     ｜
     *     ｜
     *     B
     */
    static middleInsertPoint(start: Point, end: Point, points: Point[]): void;
    /**
     * 计算折线中间路径点方法
     * 折线只折2次情况
     * A----
     *     ｜
     *     ｜
     *      -----B
     */
    static doubleMiddleInsertPoint(start: Point, end: Point, points: Point[]): void;
    /**
     * 判断点在矩形中的方法
     */
    static rectContains(point: IPoint, rect: IRect | BaseProps): boolean;
    /**
     * 判断在矩形方法。入参为rect node
     * @param point
     * @param node
     */
    static rectContains2(point: IPoint, node: IRectNode | RectNode): boolean;
    static circleContains(point: IPoint, center: IPoint, r?: number): boolean;
    /**
     * 判断两矩形是否相交
     * @param rect1
     * @param rect2
     */
    static overlapRect(rect1: IRectNode, rect2: IRectNode): boolean;
    /**
     * 判断rect1>rect2内,rect2在1内
     * @param rect1
     * @param rect2
     */
    static containRect(rect1: IRectNode, rect2: IRectNode): boolean;
    /**
     * 计算亮点之间距离
     */
    static distance(a: IPoint, b: IPoint): number;
    /**
     * 计算两点连接的直线的角度
     */
    static lineAngle(a: IPoint, b: IPoint): number;
    /**
     * 计算箭头坐标
     */
    static basicGetArrowPoint(start: IPoint, end: IPoint, p1: IPoint, p2: IPoint): {
        a: Point;
        b: Point;
    };
    /**
     * 获取左边箭头坐标点
     */
    static getLArrowPoint(start: IPoint, end: IPoint, l?: number): {
        a: Point;
        b: Point;
    };
    /**
     * 获取右边箭头点
     */
    static getRArrowPoint(start: Point, end: Point, l?: number): {
        a: Point;
        b: Point;
    };
    static getNodeBounds(nodes: GraphicNode[]): Rect;
    static cloneIRectNode(rectNode: IRectNode): IRectNode;
    static cloneIPoint(point: IPoint): IPoint;
    static getBoundsByBaseProps(baseProps: BaseProps): RectNode;
    static getBoundsByBasePropsList(basePropsList: IBaseProps[]): RectNode;
    /**
     * 获取外接矩形
     */
    static getBounds(nodes: IRectNode[], id?: string): RectNode;
    /**
     * 根据传入点获取外接矩形
     */
    static getBoundsByPoints(points: IPoint[]): RectNode;
    static calcFont(fontSize: number, fontFamily: string, bold?: boolean, italic?: boolean): string;
    static calcFontByTextProps(textProps: ITextProps): string;
    static measureText(glCtx: CanvasRenderingContext2D, text: string): {
        width: number;
        height: number;
        boxAscent: number;
    };
    static measureTextByFont(glCtx: CanvasRenderingContext2D, text: string, fontSize: number, fontFamily: string, bold: boolean, italic: boolean): {
        width: number;
        height: number;
        boxAscent: number;
    };
    static judgeHorizon(p1: IPoint, p2: IPoint, delta?: number): boolean;
    static judgeVertical(p1: IPoint, p2: IPoint, delta?: number): boolean;
    static computePolyLinePoints(start: IPoint, end: IPoint): IPoint[];
    static normalizePolyLinePoints(points: IPoint[], delta?: number): IPoint[];
    static normalizeAngle(angle: number): number;
    static computeOriginNodeConnectEnd(relativePos: IPoint): NodeConnectEndType;
    static computeNodeConnectEnd(relativePos: IPoint, nodeAngle: number): NodeConnectEndType;
    static inDistance(p: number, start: number, width: number): boolean;
    /**
     * 对折线端点拖动时候提供对齐修正效果，对点进行清理
     * @param points
     * @param scale
     * @param end
     */
    static dealWithEndPolyPointsInUp(points: IPoint[], scale: number, end: boolean): IPoint[];
    /**
     * 拖动折线端点时候提供对齐吸附效果，对点进行矫正
     * @param points
     * @param scale
     * @param end
     */
    static dealWithEndPolyPoints(points: IPoint[], scale: number, end: boolean): IPoint[];
    static acrPolyDraw(ctx: CanvasRenderingContext2D, points: IPoint[]): void;
    static dealArcPoly(points: IPoint[]): LineArcUnit[];
    static dealWithPolyPoints(points: IPoint[], scale: number): IPoint[];
    static computePointByT(node: OolongLine, t: number): IPoint;
    static computeNodeConnectAnchor(node: GraphicNode, scale: number): IPoint[];
    /**
     * 计算思维导图节点的连接锚点位置
     * 根据节点类型（根节点/子节点）和布局方式显示不同位置的锚点
     */
    static computeMindmapNodeConnectAnchor(node: GraphicNode, scale: number): MindMapAnchorPoint[];
    static computeSelectNode(ctx: AppEventContext, selectNode: GraphicNode): Set<GraphicNode>;
    private static filterChildInSet;
    static computeSelectNodes(selectGraphicsSet: Set<GraphicNode>): GraphicNode[];
    static filterToGroupNodes(nodes: GraphicNode[]): GraphicNode[];
    static detectRectBounds(rect: Rect, localPoint: IPoint, offset: number): {
        type: StretchType;
    } | null;
    static computeShiftPoint(originPos: IPoint, globalPoint: IPoint): Point;
    static dealWithShiftLineInteractEvent(originEvent: InteractiveEvent, line: OolongLine, isDragEnd?: boolean): InteractiveEvent;
    static getMockEventModifierInit(event: KeyboardEvent): EventModifierInit;
    static judgeParentInset(node: GraphicNode, parentSet: Set<GraphicNode>): boolean;
    static computeRelatedSlideSectionChildrenNode(node: GraphicNode, ctx: {
        nodeManager: NodeManager;
    }): Set<GraphicNode>;
    static judgeSlideSectionChildren(originNode: GraphicNode, slideContainer: OolongSlideContainer): GraphicNode | null;
    static judgeSlideSectionRelatedNode(originNode: GraphicNode, slideContainer: OolongSlideContainer, ctx: {
        nodeManager: NodeManager;
    }): GraphicNode | null;
    static filterContainerFromNodes(nodes: GraphicNode[]): Set<GraphicNode>;
    /**
     * 判断节点是否在 DocContainer 内（是 DocContainer 的子节点）
     * @param node 要检查的节点
     * @returns 如果节点是 DocContainer 的子节点则返回 true
     */
    static isNodeInDocContainer(node: GraphicNode): boolean;
    /**
     * 检查节点列表中是否有任何节点在 DocContainer 内
     * @param nodes 节点列表
     * @returns 如果任何节点在 DocContainer 内则返回 true
     */
    static hasNodeInDocContainer(nodes: GraphicNode[]): boolean;
    /**
     * 判断线条的起始端点是否在容器外
     * @param line
     * @param res
     * @param connectEnd
     * @param ctx
     * @param containerSet
     */
    static judgeEndNode(line: OolongLine, res: Set<GraphicNode>, connectEnd: IConnectEnd | null, ctx: AppEventContext, containerSet: Set<GraphicNode>): void;
    static getViewportBoundCenter(ctx: AppEventContext): IPoint;
    static computeRotateAngle(nodes: GraphicNode[], deltaAngle: number): number;
    static computeRotateDeltaAngle(rotateType: RotateType): number;
    static computeRelationChangeUpdateNodeInfo(node: GraphicNode, container: GraphicNode, zIndex?: number, parentId?: string): UpdateNodeInfo;
    private static computeRelationChangeLineTextRectProps;
    static computeStretchAngle(nodes: GraphicNode[], type: StretchType): number;
    /**
     * 修正节点数组中的 zIndex，确保没有重复值
     * 如果有重复的 zIndex，根据数组顺序进行调整，靠前的 zIndex 较小，靠后的较大
     * @param nodes 需要修正的节点数组
     * @returns 修正后的节点数组
     */
    static correctZIndex(nodes: NodeInfo[]): NodeInfo[];
    /**
     * 判断换行点，-1代表没有换行点，还需要逐字符排版
     * @param breakIndexList
     * @param textBlock
     * @param line
     * @param width
     */
    static judgeLineBreak(breakIndexList: number[], textBlock: TextBlock, line: TextLine, width: number): number;
    static getParaStyle(paragraphStyleProp: TextParagraphProps, paraIndex: number): IParagraphStyle | null;
    static computeNotUnOrderParas(renderText: RenderText): Set<number>;
    static computeNotOrderParas(renderText: RenderText): Set<number>;
    static computeNotNormalParas(renderText: RenderText): Set<number>;
    static computeNotQuoteParas(renderText: RenderText): Set<number>;
    static drawControlPoints(ctx: CanvasRenderingContext2D, node: OolongLine): void;
    static computeBezierCurves(curve: OolongLine): BezierCurve[];
    static computeBezierCurvesByPoints(points: IPoint[]): BezierCurve[];
    static computeCurveControlPoints(line: OolongLine): IPoint[];
    static computeCurveEndPoints(curve: OolongLine): IPoint[];
    static pressMeta(event: InteractiveEvent): boolean;
    static addAllMindMapChildren(node: OolongMindmapNode, nodeSet: Set<OolongMindmapNode>): void;
    static filterMindMapRoots(mindmapNodes: Set<OolongMindmapNode>): Set<OolongMindmapNode>;
    static getAllChildren(node: GraphicNode, childrenSet: Set<GraphicNode>): void;
    /** 收集需要导出的节点 */
    static collectExportNodes(nodes: Iterable<GraphicNode>): Set<GraphicNode>;
    static judgeNodeCanBeStretch(node: GraphicNode): boolean;
    static getSlideContainerChildNode(slideContainer: OolongSlideContainer, index: number, ctx: AppEventContext): OolongSection | null;
    static filterSlideContainerNodes(ctx: AppEventContext, nodeList: GraphicNode[]): GraphicNode[];
    static filterDocContainerNodes(ctx: AppEventContext, nodeList: GraphicNode[]): GraphicNode[];
    static getSlideInfo(node: GraphicNode, ctx: AppEventContext): Promise<SlideCoverInfo>;
    static computeBrokenLineControlPoints(node: OolongLine): IPoint[];
    static transformToLocalPoint(point: IPoint, baseProps: IBaseProps): IPoint;
    static transformToGlobalPoint(point: IPoint, baseProps: IBaseProps): IPoint;
}
//# sourceMappingURL=GraphicUtils.d.ts.map