import Point from '../geo/Point'; import type { Geometry } from '../geometry'; import type { Map } from '../map'; import UIComponent, { UIComponentOptionsType } from './UIComponent'; /** * @classdesc * Class for context menu, useful for interactions with right clicks on the map. * @category ui * @extends ui.UIComponent * @memberOf ui */ declare class Menu extends UIComponent { options: MenuOptionsType; /** * Menu items is set to options.items or by setItems method.
*
* Normally items is a object array, containing:
* 1. item object: {'item': 'This is a menu text', 'click': function() {alert('oops! You clicked!');)}}
* 2. minus string "-", which will draw a splitor line on the menu.
*
* If options.custom is set to true, the menu is considered as a customized one. Then items is the customized html codes or HTMLElement.
* @param {Object} options - options defined in [ui.Menu]{@link ui.Menu#options} */ constructor(options: MenuOptionsType); addTo(owner: Geometry | Map): any; /** * Set the items of the menu. * @param {Object[]|String|HTMLElement} items - items of the menu * return {ui.Menu} this * @example * menu.setItems([ * //return false to prevent event propagation * {'item': 'Query', 'click': function() {alert('Query Clicked!'); return false;}}, * '-', * {'item': 'Edit', 'click': function() {alert('Edit Clicked!')}}, * {'item': 'About', 'click': function() {alert('About Clicked!')}} * ]); */ setItems(items: Array): this; /** * Get items of the menu. * @return {Object[]|String|HTMLElement} - items of the menu */ getItems(): MenuItem[]; /** * Create the menu DOM. * @protected * @return {HTMLElement} menu's DOM */ buildOn(): HTMLElement; /** * Offset of the menu DOM to fit the click position. * @return {Point} offset * @private */ getOffset(): Point; getTransformOrigin(): string; getEvents(): { '_zoomstart _zoomend _movestart _dblclick _click': () => void; }; } export default Menu; export type MenuItem = { name?: string; click?: () => void; }; export type MenuOptionsType = { containerClass?: string; animationDelay?: number; animationOnHide?: boolean; autoPan?: boolean; width?: number; maxHeight?: number; custom?: boolean; items?: Array; } & UIComponentOptionsType; //# sourceMappingURL=Menu.d.ts.map