katucharts.js 0.2.5 → 0.2.7
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,14 +1,22 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import type { KatuChartsOptions } from '../types/options';
|
|
3
|
+
/**
|
|
4
|
+
* Options accepted by the component. {@link KatuChartsOptions} drives editor
|
|
5
|
+
* autocomplete when an object literal is written inline, while the plain-object
|
|
6
|
+
* arm lets options assembled in a separate `const` be passed straight through
|
|
7
|
+
* without a type annotation or cast.
|
|
8
|
+
*/
|
|
9
|
+
export type KatuChartsReactOptions = KatuChartsOptions | Record<string, unknown>;
|
|
2
10
|
interface KatuChartsStatic {
|
|
3
|
-
chart(container: string | HTMLElement, options:
|
|
11
|
+
chart(container: string | HTMLElement, options: KatuChartsReactOptions): KatuChartInstance;
|
|
4
12
|
}
|
|
5
13
|
interface KatuChartInstance {
|
|
6
|
-
update(options:
|
|
14
|
+
update(options: KatuChartsReactOptions, redraw?: boolean): void;
|
|
7
15
|
destroy(): void;
|
|
8
16
|
}
|
|
9
17
|
export interface KatuChartsReactProps {
|
|
10
18
|
katuCharts: KatuChartsStatic;
|
|
11
|
-
options:
|
|
19
|
+
options: KatuChartsReactOptions;
|
|
12
20
|
callback?: (chart: KatuChartInstance) => void;
|
|
13
21
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
14
22
|
}
|