react-use-echarts 0.0.11 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,131 +1,32 @@
1
- import { ECharts } from 'echarts';
2
- import { EChartsOption } from 'echarts';
3
- import { SetOptionOpts } from 'echarts';
4
-
5
- /**
6
- * Event configuration interface for ECharts
7
- * ECharts 事件配置接口
8
- * @example
9
- * ```typescript
10
- * const events: EChartsEvents = {
11
- * 'click': {
12
- * handler: (params) => console.log('clicked', params),
13
- * query: '.series-name',
14
- * context: this
15
- * }
16
- * }
17
- * ```
18
- */
19
- export declare interface EChartsEvents {
20
- /**
21
- * Event name as key
22
- * 事件名称作为键
23
- */
24
- [eventName: string]: {
25
- /**
26
- * Event handler function
27
- * 事件处理函数
28
- */
29
- handler: (params: unknown) => void;
30
- /**
31
- * Query condition for the event
32
- * 事件的查询条件
33
- */
34
- query?: string | object;
35
- /**
36
- * Context for the event handler
37
- * 事件处理函数的上下文
38
- */
39
- context?: object;
40
- };
41
- }
42
-
43
- /**
44
- * Theme type for ECharts
45
- * ECharts 的主题类型
46
- */
47
- export declare type Theme = string | object | null;
48
-
49
- /**
50
- * React hook for Apache ECharts integration
51
- * @param options Configuration object
52
- * @param options.option Chart configuration
53
- * @param options.theme Chart theme name
54
- * @param options.notMerge Skip merging with previous options
55
- * @param options.lazyUpdate Enable lazy update mode
56
- * @param options.showLoading Display loading animation
57
- * @param options.loadingOption Loading animation config
58
- * @param options.onEvents Event handlers map
59
- * @returns Chart control methods and ref
60
- */
61
- export declare const useEcharts: ({ option, theme, notMerge, lazyUpdate, showLoading, loadingOption, onEvents, }: UseEchartsOptions) => UseEchartsReturn;
62
-
63
- /**
64
- * Configuration options for useEcharts hook
65
- * useEcharts hook 的配置选项
66
- */
67
- export declare interface UseEchartsOptions {
68
- /**
69
- * ECharts configuration options
70
- * ECharts 的配置项
71
- */
72
- option: EChartsOption;
73
- /**
74
- * Theme to be applied
75
- * 要应用的主题
76
- */
77
- theme?: Theme;
78
- /**
79
- * Whether to not merge with previous options
80
- * 是否不合并之前的配置项
81
- * @default false
82
- */
83
- notMerge?: boolean;
84
- /**
85
- * Whether to update chart in lazy mode
86
- * 是否在懒加载模式下更新图表
87
- * @default false
88
- */
89
- lazyUpdate?: boolean;
90
- /**
91
- * Whether to show loading state
92
- * 是否显示加载状态
93
- * @default false
94
- */
95
- showLoading?: boolean;
96
- /**
97
- * Loading options
98
- * 加载配置项
99
- */
100
- loadingOption?: object;
101
- /**
102
- * Event configurations
103
- * 事件配置
104
- */
105
- onEvents?: EChartsEvents;
106
- }
107
-
108
- /**
109
- * Return type for useEcharts hook
110
- * useEcharts hook 的返回类型
111
- */
112
- export declare interface UseEchartsReturn {
113
- /**
114
- * Reference to the chart container element
115
- * 图表容器元素的引用
116
- */
117
- chartRef: React.RefObject<HTMLDivElement | null>;
118
- /**
119
- * Function to update chart options
120
- * 更新图表配置的函数
121
- */
122
- setOption: (option: EChartsOption, opts?: SetOptionOpts) => void;
123
- /**
124
- * Function to get the ECharts instance
125
- * 获取 ECharts 实例的函数
126
- * @returns Returns the current ECharts instance, or undefined if not initialized
127
- */
128
- getInstance: () => ECharts | undefined;
129
- }
130
-
131
- export { }
1
+ /**
2
+ * react-use-echarts
3
+ * A React hook library for Apache ECharts with TypeScript support
4
+ * 基于 TypeScript 的 Apache ECharts React Hook 库
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ /**
9
+ * Main hook for using ECharts in React components
10
+ * React 组件中使用 ECharts 的主要 Hook
11
+ */
12
+ export { default as useEcharts } from './hooks/use-echarts';
13
+ /**
14
+ * Lazy initialization hook
15
+ * 懒加载初始化 Hook
16
+ */
17
+ export { useLazyInit } from './hooks/use-lazy-init';
18
+ /**
19
+ * Type definitions for the library
20
+ * 库的类型定义
21
+ */
22
+ export type { UseEchartsOptions, UseEchartsReturn, EChartsEvents, BuiltinTheme, } from './types';
23
+ /**
24
+ * Theme utilities
25
+ * 主题工具函数
26
+ */
27
+ export { registerBuiltinThemes, getBuiltinTheme, isBuiltinTheme, registerCustomTheme, getAvailableThemes, } from './themes';
28
+ /**
29
+ * Utility functions for ECharts
30
+ * ECharts 工具函数
31
+ */
32
+ export * from './utils';