/// import ezTooltip = require("./tooltip"); export interface MenuItem { id?: string; text?: string; iconCls?: string; href?: string; disabled?: boolean; onclick?: () => void; target?: Element; parent?: Element; separator?: boolean; title?: string; additionalCssClass?: string; tooltipOptions?: ezTooltip.TooltipOptions; attrs?: object; } export interface MenuOptions { zIndex?: number; left?: number; top?: number; align?: string; minWidth?: number; itemHeight?: number; duration?: number; hideOnUnhover?: boolean; inline?: boolean; fit?: boolean; onShow?: () => void; onHide?: () => void; onClick?: (item: MenuItem) => void; } export declare class Menu { selector: string | JQuery | HTMLElement; private func; $menu: JQuery; constructor(selector: string | JQuery | HTMLElement, options?: MenuOptions); /** * Return options property. */ options(): MenuOptions; /** * Show a menu on specified position **/ show(pos: { left: number; top: number; }): this; /** * Hide a menu **/ hide(): this; /** * Destroy a menu **/ destroy(): void; /** * Get the menu item properties that include a 'target' property indication the item DOM element. **/ getItem(elem: Element): MenuItem; /** * Set the specified menu item text. **/ setText(param: { target: Element; text: string; }): this; /** * Set the specified menu item icon. **/ setIcon(param: { target: Element; iconCls: string; }): this; /** * Find the specified menu item, the return object is same as the getItem method **/ findItem(text: string): MenuItem; /** * Append a new menu item, the 'options' parameter indicate the new item properties. By default the added item will become a top menu item. To append a sub menu item, a 'parent' property should be set to specify the parent item element that already has sub items **/ appendItem(item: MenuItem): this; /** * Remove the specified menu item **/ removeItem(elem: Element): this; /** * Enable the menu item **/ enableItem(elem: Element): this; /** * Disable the menu item **/ disableItem(elem: Element): this; /** * Show the menu item **/ showItem(elem: Element): this; /** * Hide the menu item **/ hideItem(elem: Element): this; /** * Resize the special menu. **/ resize(elem: Element): this; removeAllItems(): this; getAllItems(): JQuery; appendSeparator(): this; enableNav(enabled: boolean, keybindSelector?: string, parent?: any): this; }