import { TemplateRef } from '@angular/core'; import { MotionOptions } from '@primeuix/motion'; import { MenuItem, PassThrough, PassThroughOption } from 'primeng/api'; /** * Expansion state map where each key matches a toggleable submenu item's `key` field, * or falls back to its index-derived DOM id when no `key` is provided. * @group Interface */ interface MenuExpandedKeys { [key: string]: boolean; } /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link Menu.pt} * @group Interface */ interface MenuPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the start's DOM element. */ start?: PassThroughOption; /** * Used to pass attributes to the list's DOM element. */ list?: PassThroughOption; /** * Used to pass attributes to the submenu label's DOM element (non-toggleable group headers). */ submenuLabel?: PassThroughOption; /** * Used to pass attributes to the nested submenu list's DOM element. */ submenuList?: 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 item submenu toggle icon's DOM element (toggleable items). */ itemSubmenuIcon?: PassThroughOption; /** * Used to pass attributes to the end's DOM element. */ end?: PassThroughOption; /** * Used to pass options to the motion component/directive. */ motion?: MotionOptions; } /** * Defines valid pass-through options in Menu. * @see {@link MenuPassThroughOptions} * * @template I Type of instance. */ type MenuPassThrough = PassThrough>; /** * Custom item template context. * @group Interface */ interface MenuItemTemplateContext { /** * Menu item instance. */ $implicit: MenuItem; } /** * Custom submenu header template context. * @group Interface */ interface MenuSubmenuHeaderTemplateContext { /** * Submenu item instance. */ $implicit: MenuItem; } /** * Defines valid templates in Menu. * @group Templates */ interface MenuTemplates { /** * Custom template of start. */ start(): TemplateRef; /** * Custom template of end. */ end(): TemplateRef; /** * Custom template of item. * @param {Object} context - item context. */ item(context: MenuItemTemplateContext): TemplateRef; /** * Custom template of submenu header. * @param {Object} context - submenu header context. */ submenuheader(context: MenuSubmenuHeaderTemplateContext): TemplateRef; /** * Custom template of submenu toggle icon. * @param {Object} context - submenu header context. */ submenuicon(context: MenuSubmenuHeaderTemplateContext): TemplateRef; } export type { MenuExpandedKeys, MenuItemTemplateContext, MenuPassThrough, MenuPassThroughOptions, MenuSubmenuHeaderTemplateContext, MenuTemplates };