import { BaseGridPlugin } from '../../core/plugin/base-plugin';
import { ContextMenuConfig, ContextMenuParams } from './types';
/**
 * Context Menu Plugin for tbw-grid
 *
 * Adds a customizable right-click menu to grid cells. Build anything from simple
 * copy/paste actions to complex nested menus with conditional visibility, icons,
 * and keyboard shortcuts.
 *
 * ## Installation
 *
 * ```ts
 * import { ContextMenuPlugin } from '@toolbox-web/grid/plugins/context-menu';
 * ```
 *
 * ## Menu Item Structure
 *
 * | Property | Type | Description |
 * |----------|------|-------------|
 * | `id` | `string` | Unique item identifier |
 * | `name` | `string` | Display label |
 * | `icon` | `string` | Icon class or HTML |
 * | `shortcut` | `string` | Keyboard shortcut hint |
 * | `action` | `(params) => void` | Click handler |
 * | `disabled` | `boolean \| (params) => boolean` | Disable condition |
 * | `visible` | `boolean \| (params) => boolean` | Visibility condition |
 * | `items` | `MenuItem[]` | Submenu items |
 * | `separator` | `boolean` | Create a divider line |
 *
 * ## Menu Context (params)
 *
 * | Property | Type | Description |
 * |----------|------|-------------|
 * | `rowIndex` | `number` | Clicked row index |
 * | `colIndex` | `number` | Clicked column index |
 * | `field` | `string` | Column field name |
 * | `value` | `any` | Cell value |
 * | `row` | `any` | Full row data |
 * | `column` | `ColumnConfig` | Column configuration |
 *
 * ## CSS Custom Properties
 *
 * | Property | Default | Description |
 * |----------|---------|-------------|
 * | `--tbw-context-menu-bg` | `var(--tbw-color-panel-bg)` | Menu background |
 * | `--tbw-context-menu-fg` | `var(--tbw-color-fg)` | Menu text color |
 * | `--tbw-context-menu-hover` | `var(--tbw-color-row-hover)` | Item hover background |
 *
 * @example Basic Context Menu
 * ```ts
 * import '@toolbox-web/grid';
 * import { ContextMenuPlugin } from '@toolbox-web/grid/plugins/context-menu';
 *
 * grid.gridConfig = {
 *   plugins: [
 *     new ContextMenuPlugin({
 *       items: [
 *         { id: 'copy', name: 'Copy', shortcut: 'Ctrl+C', action: (ctx) => navigator.clipboard.writeText(ctx.value) },
 *         { separator: true, id: 'sep1', name: '' },
 *         { id: 'delete', name: 'Delete', action: (ctx) => removeRow(ctx.rowIndex) },
 *       ],
 *     }),
 *   ],
 * };
 * ```
 *
 * @example Conditional Menu Items
 * ```ts
 * new ContextMenuPlugin({
 *   items: [
 *     { id: 'edit', name: 'Edit', visible: (ctx) => ctx.column.editable === true },
 *     { id: 'delete', name: 'Delete', disabled: (ctx) => ctx.row.locked === true },
 *   ],
 * })
 * ```
 *
 * @see {@link ContextMenuConfig} for configuration options
 * @see {@link ContextMenuItem} for menu item structure
 * @see {@link ContextMenuParams} for action callback parameters
 *
 * @internal Extends BaseGridPlugin
 */
export declare class ContextMenuPlugin extends BaseGridPlugin<ContextMenuConfig> {
    /** @internal */
    readonly name = "contextMenu";
    /** @internal */
    protected get defaultConfig(): Partial<ContextMenuConfig>;
    private isOpen;
    private position;
    private params;
    private menuElement;
    /** @internal */
    attach(grid: import('../../core/plugin/base-plugin').GridElement): void;
    /** @internal */
    detach(): void;
    /**
     * CSS variables to copy from the grid element to the context menu.
     * Includes both base variables and context-menu specific overrides.
     */
    private static readonly CSS_VARS_TO_COPY;
    /**
     * Copy CSS custom properties from the grid element to the menu element.
     * This allows the context menu (appended to document.body) to inherit
     * theme variables set on tbw-grid.
     */
    private copyGridStyles;
    private installGlobalHandlers;
    /**
     * Clean up global handlers when the last instance detaches.
     * Uses reference counting to ensure handlers persist while any grid uses the plugin.
     */
    private uninstallGlobalHandlers;
    /** @internal */
    afterRender(): void;
    /**
     * Programmatically show the context menu at the specified position.
     * @param x - X coordinate
     * @param y - Y coordinate
     * @param params - Partial context menu parameters
     */
    showMenu(x: number, y: number, params: Partial<ContextMenuParams>): void;
    /**
     * Hide the context menu.
     */
    hideMenu(): void;
    /**
     * Check if the context menu is currently open.
     * @returns Whether the menu is open
     */
    isMenuOpen(): boolean;
}
//# sourceMappingURL=ContextMenuPlugin.d.ts.map