Skip to content

Commit 22fb8d1

Browse files
authored
feat: Add @types/chart.js types in typescript definitions (#536)
use @types/chart.js types in typescript definitions
2 parents 722b1db + 024adf1 commit 22fb8d1

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"@babel/core": "^7.0.0-beta.42",
6969
"@babel/preset-env": "^7.0.0-beta.42",
7070
"@babel/preset-stage-2": "^7.0.0-beta.42",
71+
"@types/chart.js": "^2.7.55",
7172
"babel-loader": "8.0.0-beta.0",
7273
"chai": "^3.5.0",
7374
"chart.js": "^2.8.0",

types/components.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import Vue from 'vue'
2+
import { ChartData, ChartOptions } from 'chart.js';
23

34
/** vue-chartjs component common definition */
45
export declare class BaseChart extends Vue {
56
addPlugin (plugin?: string[]): void
6-
renderChart (chartData: any, options?: any): void
7+
renderChart (chartData: ChartData, options?: ChartOptions): void
78
}

types/mixins.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import Vue from 'vue'
1+
import Vue from 'vue';
2+
import { ChartData } from 'chart.js';
23

34
export declare class ReactiveDataMixin extends Vue {
4-
chartData: any;
5+
chartData: ChartData;
56
}
67

78
export declare class ReactivePropMixin extends Vue {
8-
readonly chartData: any;
9+
readonly chartData: ChartData;
910
}

0 commit comments

Comments
 (0)