| 1 |
import type PrivateChart from '../core/core.controller.js'; |
| 2 |
import type { Chart, ChartEvent } from '../types.js'; |
| 3 |
/** |
| 4 |
* @private |
| 5 |
*/ |
| 6 |
export declare function _isDomSupported(): boolean; |
| 7 |
/** |
| 8 |
* @private |
| 9 |
*/ |
| 10 |
export declare function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement; |
| 11 |
export declare function getStyle(el: HTMLElement, property: string): string; |
| 12 |
/** |
| 13 |
* Gets an event's x, y coordinates, relative to the chart area |
| 14 |
* @param event |
| 15 |
* @param chart |
| 16 |
* @returns x and y coordinates of the event |
| 17 |
*/ |
| 18 |
export declare function getRelativePosition(event: Event | ChartEvent | TouchEvent | MouseEvent, chart: Chart | PrivateChart): { |
| 19 |
x: number; |
| 20 |
y: number; |
| 21 |
}; |
| 22 |
export declare function getMaximumSize(canvas: HTMLCanvasElement, bbWidth?: number, bbHeight?: number, aspectRatio?: number): { |
| 23 |
width: number; |
| 24 |
height: number; |
| 25 |
}; |
| 26 |
/** |
| 27 |
* @param chart |
| 28 |
* @param forceRatio |
| 29 |
* @param forceStyle |
| 30 |
* @returns True if the canvas context size or transformation has changed. |
| 31 |
*/ |
| 32 |
export declare function retinaScale(chart: Chart | PrivateChart, forceRatio: number, forceStyle?: boolean): boolean | void; |
| 33 |
/** |
| 34 |
* Detects support for options object argument in addEventListener. |
| 35 |
* https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support |
| 36 |
* @private |
| 37 |
*/ |
| 38 |
export declare const supportsEventListenerOptions: boolean; |
| 39 |
/** |
| 40 |
* The "used" size is the final value of a dimension property after all calculations have |
| 41 |
* been performed. This method uses the computed style of `element` but returns undefined |
| 42 |
* if the computed style is not expressed in pixels. That can happen in some cases where |
| 43 |
* `element` has a size relative to its parent and this last one is not yet displayed, |
| 44 |
* for example because of `display: none` on a parent node. |
| 45 |
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value |
| 46 |
* @returns Size in pixels or undefined if unknown. |
| 47 |
*/ |
| 48 |
export declare function readUsedSize(element: HTMLElement, property: 'width' | 'height'): number | undefined; |