import { MenuSeparator } from '@infinite-table/infinite-react';
import { AdaptableContextMenuItemName, AdaptableMenuItem, AgGridMenuItem, ContextMenuContext } from '../AdaptableState/Common/Menu';
import { AdaptableIcon } from '../types';
/**
 * Options for managing menus in AdapTable – provided using 2 collections
 */
export interface ContextMenuOptions<TData = any> {
    /**
     * Customises Context Menu (default context menu items are available in provided context)
     */
    customContextMenu?: (menuContext: CustomContextMenuContext<TData>) => CustomContextMenuItem[];
}
/**
 * Context info provided when building Custom Context Menus
 */
export interface CustomContextMenuContext<TData = any> extends ContextMenuContext<TData> {
    /**
     * Flat list of all available AdapTable Menu Items
     */
    defaultAdaptableMenuItems: AdaptableSystemContextMenuItem<AdaptableContextMenuItemName>[];
    /**
     * Flat list of all available AG Grid Menu Items
     */
    defaultAgGridMenuItems: AgGridMenuItem<AgGridContextMenuItemType>[];
    /**
     * Default structure of Adaptable Menu Items
     */
    defaultAdaptableMenuStructure: DefaultAdaptableMenuStructure;
    /**
     * Default structure of AG Grid Menu Items
     */
    defaultAgGridMenuStructure: DefaultAgGridMenuStructure;
}
/**
 * Custom Context Menu Item
 */
export type CustomContextMenuItem = AgGridMenuItem<AgGridContextMenuItemType> | AdaptableSystemContextMenuItem<AdaptableContextMenuItemName> | UserContextMenuItem | MenuSeparator | CustomGroupContextMenuItem;
/**
 * Defines a Grouped Menu Item in the Context Menu
 */
export type CustomGroupContextMenuItem = {
    menuType: 'Group';
    label: string;
    subMenuItems: CustomContextMenuItem[];
    disabled?: boolean;
    icon?: AdaptableIcon;
};
/**
 * System Menu Item that is provided by AdapTable
 */
export interface AdaptableSystemContextMenuItem<MENU_TYPE_NAME extends AdaptableContextMenuItemName> extends AdaptableMenuItem<MENU_TYPE_NAME> {
    /**
     * Type of Menu - always 'Adaptable'
     */
    menuType: 'Adaptable';
}
/**
 * Context Menu Item that is provided by User
 */
export interface UserContextMenuItem {
    /**
     * Type of Menu - always 'User'
     */
    menuType: 'User';
    /**
     * Text to appear in the Menu Item
     */
    label: string;
    /**
     * Function invoked when the Menu Item is clicked
     */
    onClick?: (menuContext: ContextMenuContext) => void;
    /**
     * Whether menu item is disabled
     */
    disabled?: boolean;
    /**
     * Whether menu item is hidden
     */
    hidden?: boolean;
    /**
     * Optional icon to display
     */
    icon?: AdaptableIcon;
    /**
     * Array of Menu Items, enabling limitless levels of menus
     */
    subMenuItems?: CustomContextMenuItem[];
}
/**
 * Defines AG Grid Context Menu Items
 */
export type AgGridContextMenuItemType = 'autoSizeAll' | 'expandAll' | 'contractAll' | 'copy' | 'copyWithHeaders' | 'copyWithGroupHeaders' | 'cut' | 'paste' | 'resetColumns' | 'export' | 'csvExport' | 'excelExport' | 'chartRange' | 'pivotChart' | 'separator';
/**
 * The Context Menu provided by AadapTable by default
 */
export type DefaultAdaptableMenuStructure = (AdaptableSystemContextMenuItem<AdaptableContextMenuItemName> | MenuSeparator)[];
/**
 * AG Grid section of Context Menu provided by AadapTable by default
 */
export type DefaultAgGridMenuStructure = (AgGridMenuItem<AgGridContextMenuItemType> | {
    menuType: 'Group';
    label: string;
    subMenuItems: AgGridMenuItem<AgGridContextMenuItemType>[];
    disabled?: boolean;
    icon?: AdaptableIcon;
})[];
