import { FlexyBaseComponent } from '../base'; type VALID_PLACEMENT = 'above' | 'below' | 'left' | 'right'; export declare class FlexyMenuComponent extends FlexyBaseComponent { items: HTMLElement[]; submenus: WeakMap; parentMenu: FlexyMenuComponent | undefined; anchor: Element | undefined; private _ownerDoc; private _isOpened; private _cursor; constructor(host: HTMLElement); /** Initialize basic accessibility attributes of the menu's host element */ private _initHostAttribute; /** Find the anchor element and bind required events to it */ private _initAnchor; /** Collect valid menu items and bind events to them */ private _initItems; private _initSubmenus; get placement(): VALID_PLACEMENT; set placement(placement: VALID_PLACEMENT); /** Reset all items' tabIndex so none are focusable. */ resetItemsTabIndex(): void; /** * Focus the item at the given index, wrapping around if needed. * Used for arrow-key navigation. */ focusItem(index: number): void; /** Return focus to the menu's trigger element. */ focusAnchor(): void; /** * Compute the position of the menu relative to its anchor. * Can be overridden to customize layout behavior. */ getPosition(options: { anchor: Element; anchorRect: DOMRect; container: Element; containerRect: DOMRect; cursor?: { x: number; y: number; } | undefined; margin: number; placement: 'above' | 'below' | 'left' | 'right'; viewportWidth: number; viewportHeight: number; }): { x: number; y: number; }; /** * Update the menu's transform position relative to its trigger element. * Called on open, scroll, or resize events. If you want to apply custom * position, override getPosition() method. */ updatePosition(): void; /** Update ARIA attributes (`aria-expanded`, `aria-controls`) when toggled. */ updateAriaAttributes(): void; isContextMenu(): boolean; isOpened(): boolean; /** Open this menu and dispatch related lifecycle events */ open(): void; /** Close this menu and all of its nested submenus */ close(): void; /** * Recursively close all child submenus. * This method doesn't close the current menu */ closeAllSubmenus(): void; /** Close all ancestor menus (useful for nested submenu exit). */ closeAllParentMenus(): void; toggle(): void; onItemClick(event: Event): void; /** * Handle keyboard navigation and interaction within the menu. * Supports Enter/Space for selection, arrows for navigation, and Escape to close. */ onItemKeyDown(event: KeyboardEvent): void; /** * Global click handler to close the menu when the user clicks outside. * Ignores clicks on the anchor or within the menu itself. */ globalClickHandler(event: PointerEvent): void; } export {};