import Event from "./Event"; import InteractiveObject from "../display/InteractiveObject"; declare namespace openfl.events { /** * An InteractiveObject dispatches a ContextMenuEvent object when the user * opens or interacts with the context menu. There are two types of * ContextMenuEvent objects: * * * `ContextMenuEvent.MENU_ITEM_SELECT` * * `ContextMenuEvent.MENU_SELECT` * * _OpenFL target support:_ Not currently supported, except when targeting AIR. * * @see `InteractiveObject.contextMenu` * */ export class ContextMenuEvent extends Event { /** * Creates an Event object that contains specific information about menu * events. Event objects are passed as parameters to event listeners. * * @param type The type of the event. Possible values are: * * `ContextMenuEvent.MENU_ITEM_SELECT` * * `ContextMenuEvent.MENU_SELECT` * @param bubbles Determines whether the Event object * participates in the bubbling stage of the * event flow. Event listeners can access this * information through the inherited `bubbles` * property. * @param cancelable Determines whether the Event object can be * canceled. Event listeners can access this * information through the inherited `cancelable` * property. * @param mouseTarget The display list object on which the user * right-clicked to display the context menu. * This could be the `contextMenuOwner` or one of * its display list descendants. * @param contextMenuOwner The display list object to which the menu is * attached. This could be the `mouseTarget` or * one of its ancestors in the display list. * */ constructor(type: string, bubbles?: boolean, cancelable?: boolean, mouseTarget?: InteractiveObject, contextMenuOwner?: InteractiveObject); /** * Defines the value of the `type` property of a `menuItemSelect` event * object. * This event has the following properties: * * | Property | Value | * | --- | --- | * | `bubbles` | `false` | * | `cancelable` | `false`; there is no default behavior to cancel. | * | `contextMenuOwner` | The display list object to which the menu is attached. | * | `currentTarget` | The object that is actively processing the Event object with an event listener. | * | `mouseTarget` | The display list object on which the user right-clicked to display the context menu. | * | `target` | The ContextMenuItem object that has been selected. The target is not always the object in the display list that registered the event listener. Use the `currentTarget` property to access the object in the display list that is currently processing the event. | * */ static readonly MENU_ITEM_SELECT = "menuItemSelect"; /** * Defines the value of the `type` property of a `menuSelect` event * object. * This event has the following properties: * * | Property | Value | * | --- | --- | * | `bubbles` | `false` | * | `cancelable` | `false`; there is no default behavior to cancel. | * | `contextMenuOwner` | The display list object to which the menu is attached. | * | `currentTarget` | The object that is actively processing the Event object with an event listener. | * | `mouseTarget` | The display list object on which the user right-clicked to display the context menu. | * | `target` | The ContextMenu object that is about to be displayed. The target is not always the object in the display list that registered the event listener. Use the `currentTarget` property to access the object in the display list that is currently processing the event. | * */ static readonly MENU_SELECT = "menuSelect"; /** * The display list object to which the menu is attached. This could be * the mouse target (`mouseTarget`) or one of its ancestors in the * display list. * */ contextMenuOwner: InteractiveObject; /** * The display list object on which the user right-clicked to display the * context menu. This could be the display list object to which the menu * is attached (`contextMenuOwner`) or one of its display list * descendants. * The value of this property can be `null` in two circumstances: if * there no mouse target, for example when you mouse over something from * the background; or there is a mouse target, but it is in a security * sandbox to which you don't have access. Use the * `isMouseTargetInaccessible()` property to determine which of these * reasons applies. * */ mouseTarget: InteractiveObject; override clone(): ContextMenuEvent; override toString(): string; } } export default openfl.events.ContextMenuEvent;