import type { Graph, Node } from '@antv/x6'
import type { Dnd } from '@antv/x6-plugin-dnd'

import type { ClipboardPlugin, ClipboardPluginOptions } from './plugins/clipboard/type'
import type { DnDPlugin, DnDPluginOptions } from './plugins/dnd/type'
import type { KeyboardPlugin, KeyboardPluginOptions } from './plugins/keyboard/type'
import type { ScrollerPlugin, ScrollerPluginOptions } from './plugins/scroller/type'
import type { SelectionPlugin, SelectionPluginOptions } from './plugins/selection/type'
import type { SnaplinePlugin, SnaplinePluginOptions } from './plugins/snapline/type'
import type { TransformPlugin, TransformPluginOptions } from './plugins/transform/type'

import type { RouePlugin, RouePluginOptions } from './plugins/$route/type'
import type { ExportJsonPlugin, ExportJsonPluginOptions } from './plugins/$export-json/type'
import type { CenterPlugin, CenterPluginOptions } from './plugins/$center/type'
import type { ClearPlugin, ClearPluginOptions } from './plugins/$clear/type'
import type { HistoryPlugin, HistoryPluginOptions } from './plugins/$history/type'
import type { SizePlugin, SizePluginOptions } from './plugins/$size/type'
import type { DrawPlugin, DrawPluginOptions } from './plugins/$draw/type'
import type { ContextMenuPlugin, ContextMenuPluginOptions } from './plugins/$context-menu/type'
import type { RulePlugin, RulePluginOptions } from './plugins/$rule/type'
import type { BackgroundPlugin, BackgroundPluginOptions } from './plugins/$background/type'
import type { TextPlugin, TextPluginOptions } from './plugins/$text/type'
import type { TooltipPlugin, TooltipPluginOptions } from './plugins/$tooltip/type'
import type { SvgPlugin, SvgPluginOptions } from './plugins/$svg/type'

export type DimpleLayoutCanvasNode = Node & {}
export type DimpleLayoutCanvasNodeOptions = Node.Config & {}

export type DimpleLayoutCanvas = Graph & {
  
  $rootContainer: HTMLDivElement | null
} & ClipboardPlugin &
  DnDPlugin &
  KeyboardPlugin &
  ScrollerPlugin &
  SelectionPlugin &
  SnaplinePlugin &
  TransformPlugin &
  RouePlugin &
  ExportJsonPlugin &
  CenterPlugin &
  ClearPlugin &
  HistoryPlugin &
  SizePlugin &
  DrawPlugin &
  ContextMenuPlugin &
  RulePlugin &
  BackgroundPlugin &
  TextPlugin &
  TooltipPlugin & 
  SvgPlugin

export type DimpleLayoutEditorPluginsOptions = ClipboardPluginOptions &
  DnDPluginOptions &
  KeyboardPluginOptions &
  ScrollerPluginOptions &
  SelectionPluginOptions &
  SnaplinePluginOptions &
  TransformPluginOptions &
  RouePluginOptions &
  ExportJsonPluginOptions &
  CenterPluginOptions &
  ClearPluginOptions &
  HistoryPluginOptions &
  SizePluginOptions &
  DrawPluginOptions &
  ContextMenuPluginOptions &
  RulePluginOptions &
  BackgroundPluginOptions &
  TextPluginOptions &
  TooltipPluginOptions &
  SizePluginOptions

export type DimpleLayoutEditorOptions = Graph.Options & {
  plugins?: DimpleLayoutEditorPluginsOptions
}
