From 024adf1dc1fcd81f85162a0c24f8bf032e26831e Mon Sep 17 00:00:00 2001 From: Robert Lin Date: Wed, 17 Jul 2019 21:23:05 -0700 Subject: [PATCH] use chart.js types --- package.json | 1 + types/components.d.ts | 3 ++- types/mixins.d.ts | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 82139ad2..b3a5b9d6 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "@babel/core": "^7.0.0-beta.42", "@babel/preset-env": "^7.0.0-beta.42", "@babel/preset-stage-2": "^7.0.0-beta.42", + "@types/chart.js": "^2.7.55", "babel-loader": "8.0.0-beta.0", "chai": "^3.5.0", "chart.js": "^2.8.0", diff --git a/types/components.d.ts b/types/components.d.ts index acf2ea8e..d1e5fbf5 100644 --- a/types/components.d.ts +++ b/types/components.d.ts @@ -1,7 +1,8 @@ import Vue from 'vue' +import { ChartData, ChartOptions } from 'chart.js'; /** vue-chartjs component common definition */ export declare class BaseChart extends Vue { addPlugin (plugin?: string[]): void - renderChart (chartData: any, options?: any): void + renderChart (chartData: ChartData, options?: ChartOptions): void } diff --git a/types/mixins.d.ts b/types/mixins.d.ts index 35115f00..1b0bae5e 100644 --- a/types/mixins.d.ts +++ b/types/mixins.d.ts @@ -1,9 +1,10 @@ -import Vue from 'vue' +import Vue from 'vue'; +import { ChartData } from 'chart.js'; export declare class ReactiveDataMixin extends Vue { - chartData: any; + chartData: ChartData; } export declare class ReactivePropMixin extends Vue { - readonly chartData: any; + readonly chartData: ChartData; }