Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

helpers.dom.d.ts 2.3KB

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