Interface.ts 651 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import type { Node, DefaultEdge } from '@vue-flow/core'
  2. export type CanvasConnectionPort = {
  3. node?: string
  4. type: string
  5. index: number
  6. required?: boolean
  7. maxConnections?: number
  8. label?: string
  9. [key: string]: any
  10. }
  11. export interface IWorkflowNode extends Node {
  12. data: {
  13. inputs: CanvasConnectionPort[]
  14. outputs: CanvasConnectionPort[]
  15. // 定义节点数据
  16. [key: string]: any
  17. }
  18. }
  19. export type IWorkflowEdge = DefaultEdge<{
  20. // 定义边数据
  21. [key: string]: any
  22. }>
  23. export interface IWorkflow {
  24. id: string
  25. nodes: IWorkflowNode[]
  26. edges: IWorkflowEdge[]
  27. [key: string]: any
  28. }
  29. export interface XYPosition {
  30. x: number
  31. y: number
  32. }