
import { NodeData } from '@/models/node-types';
export enum Type {
  DOWN = 'down',
  UP = 'up',
}
export type StreamList = {
  id: string;
  eventName: string;
  nodeId: string;
  source: string;
  sourceNode: string;
  target: string;
  targetNode: string;
};
export type Stream = {
  list: StreamList[];
  config: {
    id: string;
    text: string;
  };
};
export interface EventList {
  downStream: Stream[];
  upStream: Stream[];
}

export enum LayersType {
  REF = 'ref', // 引用面板
  PANEL = 'panel', // 动态面板
  PANEL_CARD = 'panelCard', //组卡片
  SCREEN = 'screen', // 大屏
  COMPONENT = 'component', // 组件
  GROUP = 'group', // 组
  GROUP_CARD = 'groupCard', //组卡片
  STATE = 'state', // 状态
  STATE_CARD = 'stateCard',
  CONDITION = 'condition', //条件
  UNKNOWN = 'unknown', // 未知
}

export const Colors = {
  引用面板: '#7BA232', // 引用面板
  动态面板: '#B35234', //动态面板
  组: '#1D4AC8', //组
  条件: '#385EC8', // 条件

  地图: '#B7414B', //地图
  文字: '#2D9696', // 文字
  辅助图形: '#5C37EB', // 辅助
  交互: '#098A4C', // 交互

  常规图表: '#BA6B33', // 常规
  指标: '#AE9C40', // 指标
  其他: '#9C2A61', // 其他
  第三方: '#B58620', //第三方
  我的: '#7F2A82', //我的
  定制组件: '#7F2A82', // 定制
  下架: '#7F2A82', // 下架
  默认: '#7F2A82',
};

export type ByIdType = Record<string, any>;

export type FindNodeParams = {
  id: number;
  nodeData: NodeData;
  type: Type;
  callbackData?: {
    nodes: Array<any>;
    edges: Array<any>;
  };
};
export type FindNod = (params: FindNodeParams) => {
  nodes: Array<any>;
  edges: Array<any>;
};
