@types/highchart Add support for fontMetrics method on RendererObject.

This commit is contained in:
Nicholas Rahn
2018-02-16 09:56:52 +01:00
parent 423ace8fe7
commit ceef045943

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;
}