import type { MenuItemDef, AgProvidedColumnGroup, Column, IRowNode, GridApi } from 'ag-grid-community'; /** Parameters passed to a menu item factory when resolving an item. */ export interface MenuActionParams { /** The menu target: a column, or a column group (group-header menu). */ column: Column | AgProvidedColumnGroup | null; node: IRowNode | null; value: unknown; api: GridApi; context?: unknown; } /** * Factory that produces a MenuItemDef, a list of MenuItemDefs, or null to hide * the item. Returning a list lets one token expand to several flat items based * on state (e.g. the `note` token yields Add Note / Edit Note + Remove Note). */ export type MenuItemFactory = (params: MenuActionParams) => MenuItemDef | MenuItemDef[] | null; /** A contribution to the menu-item registry. */ export interface MenuItemContribution { /** Unique name, e.g. 'copy', 'rowGroup', 'separator'. */ name: string; /** Factory that produces the MenuItemDef. */ factory: MenuItemFactory; /** Sort order (lower = earlier). Default 0. */ order?: number; } /** @internal — used by the registry. */ export declare function _readGlobalStore(): ReadonlyMap; /** * Menu-item registry — the extensibility point for LibreGrid menus. * * NOT a bean (the name 'menuItemRegistry' is not in Community's BeanName * union). Instead, it is a plain class owned by the MenuItemMapper bean. * * Later phases register their items here without editing this package. */ export declare class MenuItemRegistry { private items; constructor(); /** Register a single item. Overwrites any existing item with the same name. */ register(contribution: MenuItemContribution): void; /** * Resolve a single item by name. Returns null if not found or the factory * returns null. The factory may return one item or a list of items. */ getItem(name: string, params: MenuActionParams): MenuItemDef | MenuItemDef[] | null; /** * Build a list of MenuItemDefs from names, in registry order. A factory that * returns a list contributes each item in the list's own order. */ buildItems(names: string[], params: MenuActionParams): MenuItemDef[]; /** Check if an item is registered. */ has(name: string): boolean; /** Get all registered item names. */ getRegisteredNames(): string[]; }