Skip to content

Commit c312485

Browse files
committed
Improvement - Types - Improve config.events types
1 parent ef7b65b commit c312485

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

types/vue-data-ui.d.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,6 +3288,8 @@ declare module "vue-data-ui" {
32883288
VueUiXyExpose
32893289
>;
32903290

3291+
export type VueUiDonutEvent = null | (({datapoint, seriesIndex }: { datapoint: VueUiDonutDatapoint; seriesIndex: number }) => void);
3292+
32913293
export type VueUiDonutConfig = {
32923294
type?: "classic" | "polar";
32933295
responsive?: boolean;
@@ -3296,10 +3298,10 @@ declare module "vue-data-ui" {
32963298
useBlurOnHover?: boolean;
32973299
useCssAnimation?: boolean;
32983300
events?: {
3299-
datapointEnter?: null | ((data: any) => void),
3300-
datapointLeave?: null | ((data: any) => void),
3301-
datapointClick?: null | ((data: any) => void)
3302-
},
3301+
datapointEnter?: VueUiDonutEvent;
3302+
datapointLeave?: VueUiDonutEvent;
3303+
datapointClick?: VueUiDonutEvent;
3304+
};
33033305
serieToggleAnimation?: {
33043306
show?: boolean;
33053307
durationMs?: number;
@@ -4698,16 +4700,18 @@ declare module "vue-data-ui" {
46984700
children?: VueUiVerticalBarDatasetChild[];
46994701
};
47004702

4703+
export type VueUiVerticalBarEvent = null | (({ datapoint, seriesIndex }: { datapoint: VueUiVerticalBarDatapoint; seriesIndex: number }) => void);
4704+
47014705
export type VueUiVerticalBarConfig = {
47024706
responsive?: boolean;
47034707
theme?: Theme;
47044708
customPalette?: string[];
47054709
useCssAnimation?: boolean;
47064710
events?: {
4707-
datapointEnter?: null | ((data: any) => void),
4708-
datapointLeave?: null | ((data: any) => void),
4709-
datapointClick?: null | ((data: any) => void)
4710-
},
4711+
datapointEnter?: VueUiVerticalBarEvent;
4712+
datapointLeave?: VueUiVerticalBarEvent;
4713+
datapointClick?: VueUiVerticalBarEvent;
4714+
};
47114715
style?: {
47124716
fontFamily?: string;
47134717
chart?: {

0 commit comments

Comments
 (0)