Skip to content

Commit

Permalink
feat(typescript): Improve mixins type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Djaler committed May 4, 2019
1 parent f64e8b9 commit 2a6eb7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions types/index.d.ts
@@ -1,4 +1,5 @@
import { BaseChart } from './components'
import { ReactiveDataMixin, ReactivePropMixin } from './mixins'

declare module 'vue-chartjs' {
export function generateChart(chartId: string, chartType: string): any;
Expand All @@ -12,8 +13,8 @@ declare module 'vue-chartjs' {
export class Bubble extends BaseChart {}
export class Scatter extends BaseChart {}
export const mixins: {
reactiveData: any
reactiveProp: any
reactiveData: typeof ReactiveDataMixin
reactiveProp: typeof ReactivePropMixin
}
}

9 changes: 9 additions & 0 deletions types/mixins.d.ts
@@ -0,0 +1,9 @@
import Vue from 'vue'

export declare class ReactiveDataMixin extends Vue {
chartData: any;
}

export declare class ReactivePropMixin extends Vue {
readonly chartData: any;
}

0 comments on commit 2a6eb7b

Please sign in to comment.