export interface Node {
    [key: string]: any;
    parent?: Node | null;
    isAncestor?: (node: Node) => boolean;
    getIndexInBrothers?: () => number;
    data?: {
        text: string;                 // 节点文本，支持富文本(html)
        richText?: boolean;          // 是否为富文本模式
        expand?: boolean;            // 节点是否展开
        uid?: string;                // 节点唯一id
        icon?: string[];             // 节点图标
        image?: string;              // 图片URL
        imageTitle?: string;         // 图片标题
        imageSize?: {
            width: number;             // 图片宽度
            height: number;            // 图片高度
            custom?: boolean;          // 是否自定义大小
        };
        hyperlink?: string;          // 超链接地址
        hyperlinkTitle?: string;     // 超链接标题
        note?: string;               // 备注内容
        attachmentUrl?: string;      // 附件URL (v0.9.10+)
        attachmentName?: string;     // 附件名称 (v0.9.10+)
        tag?: Array<string | {       // 标签列表
            text: string;
            style?: object;
        }>;
        generalization?: Array<{     // 节点概要
            text: string;
            richText?: boolean;
            [key: string]: any;        // 支持其他普通节点字段(除children外)
        }>;
        associativeLineTargets?: string[];  // 关联线目标节点uid列表
        associativeLineText?: string;       // 关联线文本
        [key: string]: any;          // 其他样式字段
    };
    children?: Node[];             // 子节点
    nodeData?: {
        children?: any[];
    };
}

export interface DrawOptions {
    sx: number
    sy: number
    swidth: number
    sheight: number
    x: number
    y: number
    width: number
    height: number
}

export interface TreeNode {

    data?: NodeData;
    children?: TreeNode[];
    nodeData?: TreeNode;
    [key: string]: any;
}

export interface NodeData {
    uid?: string;
    isActive?: boolean;
    [key: string]: any;
}

export interface BoundingRect {
    left: number
    top: number
    width: number
    height: number
}