import type { Exporting, ExportingFormats, ExportingTypes } from "./Exporting"; import { Entity, IEntitySettings, IEntityPrivate, IEntityEvents } from "../../core/util/Entity"; export interface IExportingMenuItem { /** * Indicates type of the menu item: * * `"format"` - indicates export action * * `"separator"` - will show horizontal divider. * * `"custom"` - will invoke custom function when clicked. */ type: "format" | "separator" | "custom"; /** * If `type` is set to `"format"`, clicking item will initiate export in * that format. */ format?: ExportingFormats; /** * Indicates export type: `"image"`, `"data"`, or `"print"`. */ exportType?: ExportingTypes; /** * Menu label. */ label?: string; /** * Additional information. */ sublabel?: string; /** * If `type` is set to `"custom"`, this needs to be set to a function. */ callback?: (menuItem?: any) => any; /** * A target for callback function. */ callbackTarget?: any; /** * A DOM element for the menu item. * * @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"; /** * A reference to an element in the document to place export menu in. * * If not set, will use root element's container. */ container?: HTMLElement; /** * A list of menu items. */ items?: IExportingMenuItem[]; /** * A reference to related [[Exporting]] object. */ exporting?: Exporting; /** * If set to `false` the menu will not load default CSS. * * @default true */ useDefaultCSS?: boolean; /** * If set to `true` the menu will close automatically when export operation * is initiated. * * @default true */ autoClose?: boolean; /** * Menu will disable all interactions for the underlying chart when browsing * the menu. * * @default true */ deactivateRoot?: boolean; /** * ARIA label for the menu. * * @since 5.14.4 */ ariaLabel?: string; } export interface IExportingMenuPrivate extends IEntityPrivate { /** * A `