import type { CSSProperties, HtmlHTMLAttributes } from 'vue'
import type { Node } from '@antv/x6'

export type TextOptions = {
  
  width?: number

  
  height?: number

  
  text?: string

  
  style?: CSSProperties

  
  inputStyle?: CSSProperties

  
  inputAttrs?: HtmlHTMLAttributes

  
  nodeOptions?: Node.Config
}

export type TextPlugin = {
  
  $text: {
    
    add: (TextOptions?: TextOptions) => any

    
    dnd: (e: any, TextOptions?: TextOptions) => any

    
    enableDblClickEdit: () => void

    
    disabledDblClickEdit: () => void

    
    addEventListener: (type: 'blur', cb: (cell: any, text: string) => any) => any

    
    saveImage: () => Promise<any>
  }
}

export type TextPluginOptions = {
  
  $text?: TextOptions
}
