import type { MenuItemDef } from 'ag-grid-community'; import { inheritThemeTokens as inheritThemeTokensImpl } from '@libregrid/core'; import type { MenuActionParams } from './menuItemRegistry'; /** Sentinel name used for separator rows inside a menu item list. */ export declare const SEPARATOR_NAME = "__separator__"; /** * Normalise the `'separator'` string tokens produced by the mapper into * `MenuItemDef` sentinel objects every renderer understands. */ export declare function normalizeSeparators(items: (MenuItemDef | 'separator')[]): MenuItemDef[]; /** Defaults a custom menu item component can opt in or out of. */ export interface MenuConfigDefaults { suppressTooltip?: boolean; suppressClick?: boolean; suppressMouseDown?: boolean; suppressMouseOver?: boolean; suppressKeyboardSelect?: boolean; suppressTabIndex?: boolean; suppressAria?: boolean; suppressRootStyles?: boolean; suppressFocus?: boolean; } /** The custom menu item component contract (IMenuItemComp). */ export interface MenuItemInstance { agInit?(params: object): void; configureDefaults?(): boolean | MenuConfigDefaults; setActive?(active: boolean): void; setExpanded?(expanded: boolean): void; select?(): void; getGui(): HTMLElement; destroy?(): void; } export interface MenuDomOptions { /** Closes this level (a submenu) and returns focus to the parent item. */ closeLevel?: () => void; /** Closes the whole popup. */ closeAll: () => void; /** * Instantiates a custom menu item component (MenuItemDef.menuItem) through * the grid's component factory. Absent in unit tests without a grid. */ resolveComponent?: (component: unknown, initParams: object) => MenuItemInstance | undefined; } export interface MenuDom { readonly element: HTMLElement; focusFirst(): void; destroy(): void; } /** * Framework-neutral DOM menu with theme-native rows, icons, shortcuts, * separators, working submenus, and ARIA keyboard navigation. Used as the * fallback renderer by both the column menu and the context menu. */ export declare function createMenuDom(kind: 'context' | 'column', items: (MenuItemDef | 'separator' | string)[], params: MenuActionParams, options: MenuDomOptions, depth?: number): MenuDom; /** * Instantiate a custom menu item component through the grid's component * factory (JS classes or framework components). Best-effort: returns * undefined when the factory is absent or the component does not resolve. */ export declare function instantiateMenuItemComponent(userCompFactory: unknown, component: unknown, initParams: object): MenuItemInstance | undefined; /** Re-exported from core so the menu package keeps a single public entry. */ export { inheritThemeTokensImpl as inheritThemeTokens };