Merge pull request #23696 from transparentech/master

@types/highchart Add support for fontMetrics method on RendererObject.
This commit is contained in:
Benjamin Lichtman
2018-03-01 15:29:47 -08:00
committed by GitHub
+22
View File
@@ -6553,6 +6553,13 @@ declare namespace Highcharts {
* @since 5.0.0
*/
definition(def: object): ElementObject;
/**
* Utility to return the baseline offset and total line height from the font size.
*
* @param fontSize The current font size to inspect. If not given, the font size will be found from the DOM element.
* @param elem The element to inspect for a current font size.
*/
fontMetrics(fontSize: string, elem: ElementObject): FontMetrics;
/**
* Add an SVG/VML group.
* @param [string] name The name of the group. This will be used in the class name, which will be 'highcharts-'+ name.
@@ -6615,6 +6622,21 @@ declare namespace Highcharts {
text(str: string, x: number, y: number): ElementObject;
}
interface FontMetrics {
/**
* The baseline relative to the top of the box.
*/
b: number;
/**
* The font size.
*/
f: number;
/**
* The line height.
*/
h: number;
}
interface Renderer {
new (parentNode: HTMLElement, width: number, height: number): RendererObject;
}