import type { ActionsRendererOptions } from '../../../types/cell-action.types'; import type { IconRenderer } from '../../../icons/icon-renderer'; import type { ResolvedAction } from './action-resolver'; /** * The dropdown an actions cell's overflow trigger opens. * * ### Why a module singleton * At most one menu is open at a time — opening a second implicitly closes the * first — so one panel is created lazily, reused, and kept out of the DOM until * something asks for it. A panel per cell would mean thousands of detached * subtrees in a scrolled grid. `long-text-overlay.ts` and * `avatar-group-overlay.ts` use the same shape for the same reason. * * ### Why `position: fixed` on `document.body` * A panel positioned inside the grid would be clipped by the scroll container * it sits in, and would scroll away from its own trigger. * * @packageDocumentation */ /** What the grid hands over when a trigger is pressed. */ export interface ActionsMenuRequest { /** The overflow trigger. Toggles the menu and receives focus back on close. */ readonly trigger: HTMLElement; /** Actions to offer, already resolved against the row. */ readonly items: readonly ResolvedAction[]; readonly options: ActionsRendererOptions; /** Icon renderer, so menu icons resolve through the same registry as the cell's. */ readonly icons: IconRenderer | null; /** Invoked when an item is activated. Closing is the caller's decision. */ readonly onSelect: (item: ResolvedAction, itemEl: HTMLElement, event: MouseEvent) => void; } /** Opens the menu for one cell, replacing any menu already showing. */ export declare function openActionsMenu(request: ActionsMenuRequest): void; /** Closes the menu, if one is open. */ export declare function closeActionsMenu(opts?: { restoreFocus?: boolean; }): void; /** `true` when this trigger's menu is the one currently showing. */ export declare function isActionsMenuOpenFor(trigger: HTMLElement): boolean; /** The element an open menu is anchored to, or `null`. */ export declare function getActionsMenuTrigger(): HTMLElement | null; /** Tears the menu out of the document entirely. */ export declare function destroyActionsMenu(): void; //# sourceMappingURL=actions-menu.d.ts.map