// TypeScript 类型声明文件
declare module '@datawise/hyper-markdown' {
  import { Component } from 'vue'
  
  // 主题配置类型
  interface ThemeColors {
    [key: string]: string
  }
  
  interface Theme {
    light?: ThemeColors
    dark?: ThemeColors
  }
  
  // MarkdownEditor 组件类型
  interface MarkdownEditorProps {
    content?: string
    editable?: boolean
    defaultShowEditor?: boolean
    datasource?: Record<string, any>
    dark?: 'auto' | boolean
    theme?: Theme
  }
  
  // 导出结果类型
  interface ExportResult {
    success: boolean
    message: string
  }
  
  // MarkdownEditor 组件实例方法
  interface MarkdownEditorMethods {
    exportToWord(filename?: string): Promise<ExportResult>
    getErrors(): Array<any>
  }
  
  // 导出主组件
  export const MarkdownEditor: Component<MarkdownEditorProps> & MarkdownEditorMethods
  
  // 导出工具函数
  export function createMarkdownItInstance(options?: any): any
  
  // 导出插件
  export const markdownItDataset: any
  export const markdownItEcharts: any
  export const markdownItMermaid: any
  export const markdownItEditable: any
  export const markdownItContainer: any
  
  // 默认导出
  export default MarkdownEditor
}

// 全局声明
declare global {
  interface Window {
    HyperMarkdown: any
  }
}