
import React from 'react';

// ============== Types ==============

export type NodeCategory = 
  | 'trigger'
  | 'action'
  | 'control'
  | 'integration'
  | 'data'
  | 'notification'
  | 'schedule';

export interface PortDefinition {
  id: string;
  label: string;
  type?: string;
}

export interface NodeDefinition {
  type: string;
  label: string;
  category: NodeCategory;
  icon?: string;
  description?: string;
  inputs?: PortDefinition[];
  outputs?: PortDefinition[];
  configSchema?: Record<string, any>;
}

export interface WorkflowNode {
  id: string;
  type: string;
  position: { x: number; y: number };
  data: {
    label: string;
    config?: Record<string, any>;
    [key: string]: any;
  };
}

export interface WorkflowEdge {
  id: string;
  source: string;
  target: string;
  sourceHandle?: string;
  targetHandle?: string;
}

export interface WorkflowDefinition {
  id: string;
  name: string;
  description?: string;
  nodes: WorkflowNode[];
  edges: WorkflowEdge[];
  variables?: Record<string, any>;
}

// ============== Component Props ==============

export interface WorkflowEditorProps {
  initialWorkflow?: WorkflowDefinition;
  nodeDefinitions?: NodeDefinition[];
  onSave?: (workflow: WorkflowDefinition) => void;
  onBack?: () => void;
  readOnly?: boolean;
}

// ============== Components ==============

export declare const WorkflowEditorWrapper: React.FC<WorkflowEditorProps>;
export default WorkflowEditorWrapper;
