import { TemplateRef } from '@angular/core'; import { PassThrough, PassThroughOption } from 'primeng/api'; import { MenuPassThrough } from 'primeng/types/menu'; /** * Defines valid pass-through options in CommandMenu component. * @template I Type of instance. * * @see {@link CommandMenu.pt} * @group Interface */ interface CommandMenuPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the header's DOM element. */ header?: PassThroughOption; /** * Used to pass attributes to the input's DOM element. */ input?: PassThroughOption; /** * Used to pass attributes to the Menu component. */ pcMenu?: MenuPassThrough; /** * Used to pass attributes to the empty message's DOM element. */ emptyMessage?: PassThroughOption; /** * Used to pass attributes to the footer's DOM element. */ footer?: PassThroughOption; } /** * Defines valid pass-through options in CommandMenu component. * @see {@link CommandMenuPassThroughOptions} * * @template I Type of instance. */ type CommandMenuPassThrough = PassThrough>; /** * Custom item select event. * @group Events */ interface CommandMenuItemSelectEvent { /** * Browser event. */ originalEvent: Event; /** * Selected menu item. */ item: any; } /** * Custom search change event. * @group Events */ interface CommandMenuSearchChangeEvent { /** * Browser event. */ originalEvent: Event; /** * Search query value. */ query: string; } /** * Custom item template context. * @group Interface */ interface CommandMenuItemTemplateContext { /** * Data of the option. */ $implicit: T; } /** * Custom header template context. * @group Interface */ interface CommandMenuHeaderTemplateContext { /** * Current search value. */ $implicit: string; } /** * Custom footer template context. * @group Interface */ interface CommandMenuFooterTemplateContext { /** * Current search value. */ $implicit: string; } /** * Custom empty template context. * @group Interface */ interface CommandMenuEmptyMessageTemplateContext { /** * Current search value. */ $implicit: string; } /** * Defines valid templates in CommandMenu. * @group Templates */ interface CommandMenuTemplates { /** * Custom item template. * @param {Object} context - item data. */ item(context: CommandMenuItemTemplateContext): TemplateRef; /** * Custom header template. * @param {Object} context - header context. */ header(context: CommandMenuHeaderTemplateContext): TemplateRef; /** * Custom footer template. * @param {Object} context - footer context. */ footer(context: CommandMenuFooterTemplateContext): TemplateRef; /** * Custom empty message template. * @param {Object} context - empty message context. */ emptyMessage(context: CommandMenuEmptyMessageTemplateContext): TemplateRef; } /** * Defines context options for CommandMenu passthrough. * @group Interface */ interface CommandMenuContext { /** * Whether the option is focused. */ focused?: boolean; /** * Whether the option is disabled. */ disabled?: boolean; } export type { CommandMenuContext, CommandMenuEmptyMessageTemplateContext, CommandMenuFooterTemplateContext, CommandMenuHeaderTemplateContext, CommandMenuItemSelectEvent, CommandMenuItemTemplateContext, CommandMenuPassThrough, CommandMenuPassThroughOptions, CommandMenuSearchChangeEvent, CommandMenuTemplates };