UNPKG

1.85 kBTypeScriptView Raw
1import { CSSProperties } from 'react';
2export declare type EChartsOption = any;
3export declare type EChartsInstance = any;
4export declare type Opts = {
5 readonly devicePixelRatio?: number;
6 readonly renderer?: 'canvas' | 'svg';
7 readonly width?: number | null | undefined | 'auto';
8 readonly height?: number | null | undefined | 'auto';
9 readonly locale?: string;
10};
11export declare type EChartsReactProps = {
12 /**
13 * echarts library entry, use it for import necessary.
14 */
15 readonly echarts?: any;
16 /**
17 * `className` for container
18 */
19 readonly className?: string;
20 /**
21 * `style` for container
22 */
23 readonly style?: CSSProperties;
24 /**
25 * echarts option
26 */
27 readonly option: EChartsOption;
28 /**
29 * echarts theme config, can be:
30 * 1. theme name string
31 * 2. theme object
32 */
33 readonly theme?: string | Record<string, any>;
34 /**
35 * notMerge config for echarts, default is `false`
36 */
37 readonly notMerge?: boolean;
38 /**
39 * lazyUpdate config for echarts, default is `false`
40 */
41 readonly lazyUpdate?: boolean;
42 /**
43 * showLoading config for echarts, default is `false`
44 */
45 readonly showLoading?: boolean;
46 /**
47 * loadingOption config for echarts, default is `null`
48 */
49 readonly loadingOption?: any;
50 /**
51 * echarts opts config, default is `{}`
52 */
53 readonly opts?: Opts;
54 /**
55 * when after chart reander, do the callback widht echarts instance
56 */
57 readonly onChartReady?: (instance: EChartsInstance) => void;
58 /**
59 * bind events, default is `{}`
60 */
61 readonly onEvents?: Record<string, Function>;
62 /**
63 * should update echarts options
64 */
65 readonly shouldSetOption?: (prevProps: EChartsReactProps, props: EChartsReactProps) => boolean;
66};