Merge pull request #11540 from Mikhus/types-2.0

Font advanced config options added (for v2.0.6+)
This commit is contained in:
Vladimir Matveev
2016-09-27 15:22:55 -07:00
committed by GitHub
2 changed files with 17 additions and 3 deletions
+4 -2
View File
@@ -8,10 +8,12 @@ import {
} from 'canvas-gauges';
let linearOptions: LinearGaugeOptions = {
renderTo: document.createElement('canvas')
renderTo: document.createElement('canvas'),
fontNumbersStyle: 'italic'
};
let radialOptions: RadialGaugeOptions = {
renderTo: 'gauge-id'
renderTo: 'gauge-id',
fontNumbersWeight: 'bold'
};
new LinearGauge(linearOptions);
+13 -1
View File
@@ -4,6 +4,10 @@
// Definitions: https://github.com/Mikhus/DefinitelyTyped
declare namespace CanvasGauges {
export type FontStyle = 'normal' | 'italic' | 'oblique';
export type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' |
'100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
export type RenderTarget = string|HTMLElement;
export interface AnimationRule {
@@ -86,7 +90,15 @@ declare namespace CanvasGauges {
fontTitleSize?: number,
fontValueSize?: number,
fontUnitsSize?: number,
fontNumbersSize?: number
fontNumbersSize?: number,
fontTitleStyle?: FontStyle,
fontValueStyle?: FontStyle,
fontUnitsStyle?: FontStyle,
fontNumbersStyle?: FontStyle,
fontTitleWeight?: FontWeight,
fontValueWeight?: FontWeight,
fontUnitsWeight?: FontWeight,
fontNumbersWeight?: FontWeight
}
export interface RadialGaugeOptions extends GenericOptions {