import { Hooks } from './hooks'; import { ResizeObserver } from 'resize-observer'; import { ECharts, EChartOption } from 'echarts'; import { isHook, ServerData, isChartisan, Chartisan as Base } from '@chartisan/chartisan'; export { Hooks as ChartisanHooks }; /** * Used as an alias. */ export declare type CC = EChartOption; /** * Base chart class for Echarts. */ export declare class Chartisan extends Base { /** * The chart canvas. */ div?: HTMLDivElement; /** * Stores the chart instance. */ chart?: ECharts; /** * Stores the resize observer. */ observer?: ResizeObserver; /** * Observes the chart division for changes to resize * the chart to the new division dimensions. */ protected observe(): void; /** * Renews the division where the chart lives. */ protected renewDiv(): void; /** * Formats the data of the request to match the data that * the chart needs (acording to the desired front-end). */ protected formatData(response: ServerData): CC; /** * Handles a successfull response of the chart data. */ protected onUpdate(data: CC): void; /** * Handles a successfull response of the chart data * in the background (possibly, updating the values * of the chart without creating a new one). */ protected onBackgroundUpdate(data: CC): void; /** * Destroys the chart instance if any. */ protected onDestroy(): void; } declare global { /** * Extends the Window interface. */ interface Window { /** * The chartisan class to initiate it as a global variable * bound to the window var. */ Chartisan: isChartisan; /** * Determines the hooks of the chart. */ ChartisanHooks: isHook; } }