// 全局echarts变量声明
declare global {
  interface Window {
    echarts: any;
  }
}

declare const echarts: any;

declare namespace echarts {
  interface EChartsOption {
    [key: string]: any;
  }
  
  interface ECharts {
    setOption: (option: EChartsOption, notMerge?: boolean, lazyUpdate?: boolean) => void;
    resize: (options?: any) => void;
    dispatchAction: (payload: any) => void;
    showLoading: (type?: string, opts?: any) => void;
    hideLoading: () => void;
    clear: () => void;
    dispose: () => void;
  }
  
  function init(dom: HTMLElement, theme?: string, options?: any): ECharts;
  function registerTheme(name: string, theme: any): void;
  function registerMap(mapName: string, geoJSON: any, specialAreas?: any): void;
}