forked from apertureless/vue-chartjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript): Add basic typescript definitions
Adds basic type definitions - Fixes apertureless#376
- Loading branch information
1 parent
ca9c1f4
commit 184be5c
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Vue from 'vue' | ||
|
||
/** vue-chartjs component common definition */ | ||
export declare class BaseChart extends Vue { | ||
addPlugin (plugin?: string[]): void | ||
renderChart (chartData: any, options?: any): void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { BaseChart } from './components' | ||
|
||
declare module 'vue-chartjs' { | ||
export function generateChart(chartId: string, chartType: string): any; | ||
export class Bar extends BaseChart {} | ||
export class HorizontalBar extends BaseChart {} | ||
export class Doughnut extends BaseChart {} | ||
export class Line extends BaseChart {} | ||
export class Pie extends BaseChart {} | ||
export class PolarArea extends BaseChart {} | ||
export class Radar extends BaseChart {} | ||
export class Bubble extends BaseChart {} | ||
export class Scatter extends BaseChart {} | ||
export const mixins: { | ||
reactiveData: any | ||
reactiveProp: any | ||
} | ||
} | ||
|