/// <reference types="react" />
import { EChartsOption } from 'echarts';
import { SWRConfiguration } from 'swr';
import { JsonResponse } from './query';
export type QueryConfig = {
    endpoint?: string;
    token?: string;
    refreshInterval?: SWRConfiguration['refreshInterval'];
    fetcher?: SWRConfiguration['fetcher'];
    onError?: SWRConfiguration['onError'];
    onSuccess?: SWRConfiguration['onSuccess'];
};
export interface QueryState {
    data?: JsonResponse;
    loading: boolean;
    error?: string;
}
export type StylesProps = {
    backgroundColor?: string;
    borderColor?: string;
    borderRadius?: number | string;
    boxShadow?: string;
    colorPalette?: string[];
    fontFamily?: string;
    fontSize?: number | string;
    padding?: number | string;
    textColor?: string;
};
export type ChartConfigProps = StylesProps & {
    title?: string;
    description?: string;
    showLegend?: boolean;
    options?: EChartsOption;
};
export type BaseProps = {
    height?: number | string;
    width?: number | string;
};
export type ChartProps = ChartConfigProps & BaseProps & QueryConfig & QueryState & {
    categories: string[];
    xAxisValue?: string;
    isStacked?: boolean;
    groupBy?: string;
};
export type FallbackProps = {
    fallbackLoading?: JSX.Element;
    fallbackError?: ({ error }: {
        error: string;
    }) => JSX.Element;
};
