// 节点类型
export type NodeType = 'START_EVENT' | 'END_EVENT' | 'USER_TASK' | 'SERVICE_TASK' | 'SCRIPT_TASK' | 'GATEWAY_NODE' | 'SUB_PROCESS' | 'CALL_ACTIVITY';

// 节点分类
export type NodeCategory = 'EVENT' | 'TASK' | 'GATEWAY' | 'CONTAINER';

// 条件类型
export type ConditionType = 'EXPRESSION' | 'SCRIPT' | 'DEFAULT';

// 边的条件配置
export interface EdgeCondition {
    type: ConditionType;
    expression?: string;
    script?: string;
    priority: number;
}

// 边的配置
export interface EdgeConfig {
    type: 'sequence';
    condition?: EdgeCondition;
}

// 节点定义
export interface NodeDefinition {
    id: number;
    type: NodeType;
    name: string;
    description: string;
    category: NodeCategory;
    graphConfig: {
        code: string;
        name: string;
        description: string;
        details: {
            description: string;
            features: string[];
            scenarios: string[];
        };
        configSchema: {
            type: string;
            properties: Record<string, any>;
            required: string[];
        };
        uiSchema: {
            shape: 'circle' | 'rectangle' | 'diamond';
            size: {
                width: number;
                height: number;
            };
            style: {
                fill: string;
                stroke: string;
                strokeWidth: number;
                icon: string;
                iconColor: string;
            };
            ports: {
                groups: {
                    in?: {
                        position: string;
                        attrs: {
                            circle: {
                                r: number;
                                fill: string;
                                stroke: string;
                            };
                        };
                    };
                    out?: {
                        position: string;
                        attrs: {
                            circle: {
                                r: number;
                                fill: string;
                                stroke: string;
                            };
                        };
                    };
                };
            };
        };
    };
    orderNum: number;
    enabled: boolean;
}
