import { TemplateRef } from '@angular/core'; import { MotionOptions } from '@primeuix/motion'; import { PassThroughOption, PassThrough, MenuItem } from 'primeng/api'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link ContextMenu.pt} * @group Interface */ interface ContextMenuPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the root list's DOM element. */ rootList?: PassThroughOption; /** * Used to pass attributes to the submenu's DOM element. */ submenu?: PassThroughOption; /** * Used to pass attributes to the separator's DOM element. */ separator?: PassThroughOption; /** * Used to pass attributes to the item's DOM element. */ item?: PassThroughOption; /** * Used to pass attributes to the item content's DOM element. */ itemContent?: PassThroughOption; /** * Used to pass attributes to the item link's DOM element. */ itemLink?: PassThroughOption; /** * Used to pass attributes to the item icon's DOM element. */ itemIcon?: PassThroughOption; /** * Used to pass attributes to the item label's DOM element. */ itemLabel?: PassThroughOption; /** * Used to pass attributes to the submenu icon's DOM element. */ submenuIcon?: PassThroughOption; /** * Used to pass options to the motion component/directive. */ motion?: MotionOptions; } /** * Defines valid pass-through options in ContextMenu. * @see {@link ContextMenuPassThroughOptions} * * @template I Type of instance. */ type ContextMenuPassThrough = PassThrough>; /** * Custom item template context. * @group Interface */ interface ContextMenuItemTemplateContext { /** * Menu item instance. */ $implicit: MenuItem; } /** * Custom submenu icon template context. * @group Interface */ interface ContextMenuSubmenuIconTemplateContext { /** * Style class of the submenu icon. */ class: string; } /** * Defines valid templates in ContextMenu. * @group Templates */ interface ContextMenuTemplates { /** * Custom item template. * @param {Object} context - item context. */ item(context: ContextMenuItemTemplateContext): TemplateRef; /** * Custom submenu icon template. * @param {Object} context - icon context. */ submenuicon(context: ContextMenuSubmenuIconTemplateContext): TemplateRef; } export type { ContextMenuItemTemplateContext, ContextMenuPassThrough, ContextMenuPassThroughOptions, ContextMenuSubmenuIconTemplateContext, ContextMenuTemplates };