import { ReactiveController, ReactiveControllerHost, TemplateResult } from 'lit'; /** One entry of an action menu (``, ``). */ export interface MenuItem { /** Sent as `baht-select` `detail.value`. */ value: string; label: string; /** Key combo that picks this item from anywhere (menu open or not), shown as a hint. */ shortcut?: string; disabled?: boolean; /** Destructive action: rendered in the danger color. */ danger?: boolean; /** A setting toggled from the menu: rendered as `menuitemcheckbox` with this state. */ checked?: boolean; /** Muted second line under the label. */ description?: string; /** Extra class on the item (e.g. to show it only at some widths). */ class?: string; /** Language of the label, when it differs from the page (a "ภาษาไทย" switch). */ lang?: string; } type Host = ReactiveControllerHost & HTMLElement & { disabled: boolean; }; interface Options { items: () => MenuItem[]; /** The element that opens the menu, so focus can return to it. */ trigger: () => HTMLElement | null; onPick: (item: MenuItem) => void; } /** * The ARIA menu behind `` and ``: open state, outside click, * APG menu-button keyboard (↓/↑/Enter/Space open on the first/last item; ↑ ↓ wrap and skip * disabled; Home/End; Escape closes back to the trigger and is marked handled so a surrounding * `` stays open; Tab closes), item rendering with shortcut hints, and page-wide * item shortcuts (same scoping as ``). */ export declare class MenuController implements ReactiveController { private readonly host; private readonly opts; open: boolean; private mac; private unbinders; constructor(host: Host, opts: Options); hostConnected(): void; hostDisconnected(): void; /** Re-register item shortcuts — call when `items` changes. */ rebind(): void; private unbindAll; private readonly onDocMousedown; setOpen(open: boolean): void; pick(item: MenuItem): void; private enabledButtons; private openAndFocus; /** Trigger click: keyboard activation (detail 0) lands on the first item, per the APG. */ readonly onTriggerClick: (e: MouseEvent) => void; readonly onTriggerKeydown: (e: KeyboardEvent) => void; private readonly onMenuKeydown; private renderItem; /** The menu panel. `align` picks the edge it lines up with; `heading` is a non-item first line. */ render(id: string, align: 'start' | 'end', label: string, heading?: string): TemplateResult; } export {};