import { ContextMenuDivElement, IContextMenuOptions, IContextMenuValue } from './interfaces'; export interface ContextMenu { constructor: new (...args: ConstructorParameters>) => ContextMenu; } /** * ContextMenu from LiteGUI */ export declare class ContextMenu { options: IContextMenuOptions; parentMenu?: ContextMenu; root: ContextMenuDivElement; current_submenu?: ContextMenu; lock?: boolean; controller: AbortController; /** * @todo Interface for values requires functionality change - currently accepts * an array of strings, functions, objects, nulls, or undefined. * @param values (allows object { title: "Nice text", callback: function ... }) * @param options [optional] Some options:\ * - title: title to show on top of the menu * - callback: function to call when an option is clicked, it receives the item information * - ignore_item_callbacks: ignores the callback inside the item, it just calls the options.callback * - event: you can pass a MouseEvent, this way the ContextMenu appears in that position */ constructor(values: readonly (string | IContextMenuValue | null)[], options: IContextMenuOptions); /** * Checks if {@link node} is inside this context menu or any of its submenus * @param node The {@link Node} to check * @param visited A set of visited menus to avoid circular references * @returns `true` if {@link node} is inside this context menu or any of its submenus */ containsNode(node: Node, visited?: Set): boolean; addItem(name: string | null, value: string | IContextMenuValue | null, options: IContextMenuOptions): HTMLElement; close(e?: MouseEvent, ignore_parent_menu?: boolean): void; /** @deprecated Likely unused, however code search was inconclusive (too many results to check by hand). */ static trigger(element: HTMLDivElement, event_name: string, params: MouseEvent): CustomEvent; getTopMenu(): ContextMenu; getFirstEvent(): MouseEvent | undefined; /** @deprecated Unused. */ static isCursorOverElement(event: MouseEvent, element: HTMLDivElement): boolean; }