/** * Menu Registry * * A simple registry that allows menus to register themselves by ID, * enabling buttons with aria-controls to automatically find and toggle them. */ interface MenuInstance { /** `anchor` overrides the element the popup positions against. */ toggle: (event: Event, anchor?: HTMLElement) => void; show: (event: Event, anchor?: HTMLElement) => void; hide: () => void; } /** * Register a menu instance by ID * @param id - The menu's ID (used in aria-controls) * @param instance - The menu instance with toggle/show/hide methods */ export declare function registerMenu(id: string, instance: MenuInstance): void; /** * Unregister a menu instance by ID * @param id - The menu's ID to remove from registry */ export declare function unregisterMenu(id: string): void; /** * Get a menu instance by ID * @param id - The menu's ID (from aria-controls) * @returns The menu instance or undefined if not found */ export declare function getMenu(id: string): MenuInstance | undefined; /** * Toggle a menu by its ID * @param id - The menu's ID (from aria-controls) * @param event - The triggering event * @returns true if menu was found and toggled, false otherwise */ export declare function toggleMenuById(id: string, event: Event): boolean; export {};