import type { IRectNodeProperties, Model, RectNodeModel } from '@logicflow/core';
import type { LogicFlowNode } from '@/libs/logic-flow';

import __FlowNode_component from './FlowNode.vue';
import __FlowNodeInlay_component from './FlowNodeInlay.vue';
import __FlowNode_model from './FlowNode.model';

export {
  __FlowNode_component as FlowNodeView,
  __FlowNode_model as FlowNodeViewModel,
  __FlowNodeInlay_component as FlowNodeComponent,
};

export * as Node from './config';

export interface FlowNodeProperties extends IRectNodeProperties {
  icon?: 'start' | 'finish' | 'config' | 'report' | 'pulse' | 'tongue' | 'questionnaire';
  iconBackground?: string;
  iconColor?: string;

  forbidDirectSource?: string[];
  forbidDirectTarget?: string[];
  forbidSource?: string[];
  onlySource?: string[];
  onlyTarget?: string[];

  quickNodes?: {id: string; text: string}[];

  configurable?: boolean;
  requestData?: Record<string, any>;
}
export type FlowNodeProps = LogicFlowNode<FlowNodeProperties>;
export type FlowNodeModel = RectNodeModel<FlowNodeProperties>;
export type FlowNodeAnchor = Model.AnchorConfig & { type?: 'outgoing' | 'incoming'};
export type FlowNodeConnectRuleResult  = Model.ConnectRuleResult;
