@tsingroc/tsingroc-components 4.4.0 → 4.4.1

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.
@@ -1 +1,47 @@
1
- export { default } from "echarts-for-react";
1
+ import type { ECharts, EChartsOption, init } from "echarts";
2
+ import type { EChartsReactProps as OrigEChartsReactProps } from "echarts-for-react/lib/types";
3
+ import type {
4
+ ECElementEvent,
5
+ ZRElementEventName,
6
+ } from "echarts/types/src/util/types.js";
7
+ import type { PureComponent } from "react";
8
+
9
+ export declare type ECEventDefinition = {
10
+ [K in ZRElementEventName]: (params: ECElementEvent) => boolean | undefined;
11
+ } & {
12
+ rendered: (params: { elapsedTime: number }) => boolean | undefined;
13
+ finished: () => boolean | undefined;
14
+ } & {
15
+ [key: string]: (...args: unknown[]) => boolean | undefined;
16
+ };
17
+
18
+ export declare type EChartsInitOpts = typeof init extends (
19
+ dom?: infer _,
20
+ theme?: infer _,
21
+ opts?: infer Opts,
22
+ ) => unknown
23
+ ? Opts
24
+ : never;
25
+
26
+ export declare interface StrictEChartsProps
27
+ extends Omit<OrigEChartsReactProps, "opts" | "shouldSetOption"> {
28
+ readonly option: EChartsOption;
29
+ readonly onEvents?: ECEventDefinition;
30
+ readonly onChartReady?: (instance: ECharts) => void;
31
+ readonly opts?: EChartsInitOpts;
32
+ readonly shouldSetOption?: (
33
+ prevProps: StrictEChartsProps,
34
+ props: StrictEChartsProps,
35
+ ) => boolean;
36
+ }
37
+
38
+ /**
39
+ * 类型更加严格的 `EChartsReact`,在运行时只是 `EChartsReact` 的别名。
40
+ */
41
+ declare class StrictECharts extends PureComponent<StrictEChartsProps> {
42
+ constructor(props: StrictEChartsProps);
43
+ ele: HTMLElement;
44
+ getEchartsInstance(): ECharts;
45
+ }
46
+
47
+ export default StrictECharts;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsingroc/tsingroc-components",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "author": "",
5
5
  "license": "ISC",
6
6
  "description": "",
@@ -24,7 +24,7 @@
24
24
  "dev": "rsbuild dev",
25
25
  "lint": "eslint .",
26
26
  "format": "prettier . -w && eslint . --fix",
27
- "build": "tsc -b --force",
27
+ "build": "tsc -b --force && copyfiles -u 1 src/**/*.d.ts dist",
28
28
  "prepublishOnly": "npm run build",
29
29
  "docs:dev": "rspress",
30
30
  "docs:build": "rspress build",
@@ -62,6 +62,7 @@
62
62
  "@types/react-dom": "^18.3.7",
63
63
  "antd": "^5.26.3",
64
64
  "antd-style": "^3.7.1",
65
+ "copyfiles": "^2.4.1",
65
66
  "echarts": "^5.6.0",
66
67
  "echarts-for-react": "^3.0.2",
67
68
  "echarts-gl": "^2.0.9",