Skip to content

Commit 520faca

Browse files
authored
feat(typescript): Improve mixins type definitions (#514)
feat(typescript): Improve mixins type definitions
2 parents f64e8b9 + 2a6eb7b commit 520faca

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

types/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { BaseChart } from './components'
2+
import { ReactiveDataMixin, ReactivePropMixin } from './mixins'
23

34
declare module 'vue-chartjs' {
45
export function generateChart(chartId: string, chartType: string): any;
@@ -12,8 +13,8 @@ declare module 'vue-chartjs' {
1213
export class Bubble extends BaseChart {}
1314
export class Scatter extends BaseChart {}
1415
export const mixins: {
15-
reactiveData: any
16-
reactiveProp: any
16+
reactiveData: typeof ReactiveDataMixin
17+
reactiveProp: typeof ReactivePropMixin
1718
}
1819
}
1920

types/mixins.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Vue from 'vue'
2+
3+
export declare class ReactiveDataMixin extends Vue {
4+
chartData: any;
5+
}
6+
7+
export declare class ReactivePropMixin extends Vue {
8+
readonly chartData: any;
9+
}

0 commit comments

Comments
 (0)