import { Component, JSX } from 'preact'; import { BaseChart, BarChart, LineChart, PieChart, BarChartOptions, LineChartOptions, PieChartOptions, ResponsiveOptions, } from 'chartist'; export type ChartistBaseProps = { data: object; className?: string; listener?: any; style?: string | {[key: string]: string | number}; } export type ChartistBarProps = { options: BarChartOptions; responsiveOptions?: ResponsiveOptions; }; export type ChartistLineProps = { options?: LineChartOptions; responsiveOptions?: ResponsiveOptions; }; export type ChartistPieProps = { options?: PieChartOptions; responsiveOptions?: ResponsiveOptions; }; interface Type extends Function { new (...args: any[]): T; } export default class ChartistBase extends Component { Component: Type; baseCSSClassName: string; render(props: ChartistBaseProps & ChartProps, state: any): JSX.Element; } export class ChartistBarChart extends ChartistBase { type: 'Bar'; Component: Type; }; export class ChartistLineChart extends ChartistBase { type: 'Line'; Component = Type; }; export class ChartistPieChart extends ChartistBase { type: 'Pie'; Component = Type; };