/**
 * Shared types for node config renderers
 */

import type { ApiRequestFunction } from '../../../../api/workflowApi';

/** input.form / trigger.form field row. `clickup_tasks` needs connection + list id; value at runtime is `{ add: [taskId], rem: [] }` (ClickUp relationship). */
export type FormField = {
  name?: string;
  type?: string;
  label?: string;
  required?: boolean;
  clickupConnectionId?: string;
  clickupListId?: string;
  /** ClickUp list status names from GET /list/{id} — only for type `clickup_status`. */
  clickupStatusOptions?: Array<{ value: string; label: string }>;
};

export interface NodeConfigRendererProps {
  params: Record<string, unknown>;
  updateParam: (key: string, value: unknown) => void;
  /** For Email/SharePoint: fetch connections and browse */
  instanceId?: string;
  request?: ApiRequestFunction;
  nodeType?: string;
  /** Merge into another node's parameters (e.g. sync form from ClickUp list). */
  mergeNodeParameters?: (nodeId: string, patch: Record<string, unknown>) => void;
}
