import type { Exporting, ExportingFormats, ExportingTypes } from "./Exporting"; import { Entity, IEntitySettings, IEntityPrivate, IEntityEvents } from "../../core/util/Entity"; export interface IExportingMenuItem { /** * Type of the item: * * `"format"`: exports in `format` when clicked. * * `"separator"`: a divider, with `label` as a heading if set. * * `"custom"`: calls `callback` when clicked. */ type: "format" | "separator" | "custom"; /** * Format to export in, for a `"format"` item. `"print"` prints the chart. */ format?: ExportingFormats; /** * Export type of the item: `"image"`, `"data"` or `"print"`. An item whose * type is not available, such as `"data"` without data, is left out. */ exportType?: ExportingTypes; /** * Text of the item. */ label?: string; /** * Smaller text after the label, such as `"Image"`. */ sublabel?: string; /** * Function to call when a `"custom"` item is clicked. */ callback?: (menuItem?: any) => any; /** * `this` inside `callback`; the menu if not set. */ callbackTarget?: any; /** * The item's DOM element. * * @readonly */ element?: HTMLAnchorElement; } export interface IExportingMenuSettings extends IEntitySettings { /** * Horizontal alignment of the menu. * * @default "right" */ align?: "left" | "right"; /** * Vertical alignment of the menu. * * @default "top" */ valign?: "top" | "bottom"; /** * Element in the document to place the menu in. If not set, the menu goes * into the chart's own element. */ container?: HTMLElement; /** * Items of the menu. By default, all image and data formats and print. */ items?: IExportingMenuItem[]; /** * The [[Exporting]] the menu exports with. */ exporting?: Exporting; /** * Loads the menu's default CSS. Set to `false` to style the menu with * your own CSS. * * @default true */ useDefaultCSS?: boolean; /** * Closes the menu when an export starts from it. * * @default true */ autoClose?: boolean; /** * Disables interaction with the chart while the menu is open or the * pointer is over it. * * @default true */ deactivateRoot?: boolean; /** * ARIA label for the menu. * * @since 5.14.4 */ ariaLabel?: string; } export interface IExportingMenuPrivate extends IEntityPrivate { /** * The `
` element that holds the menu's icon and list. */ menuElement?: HTMLDivElement; /** * The `