import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough, MenuItem } from 'primeng/api'; import { ButtonPassThrough } from 'primeng/types/button'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link SpeedDial.pt} * @group Interface */ interface SpeedDialPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the Button component. * @see {@link ButtonPassThrough} */ pcButton?: ButtonPassThrough; /** * Used to pass attributes to the list's DOM element. */ list?: PassThroughOption; /** * Used to pass attributes to the item's DOM element. */ item?: PassThroughOption; /** * Used to pass attributes to the action's Button component. * @see {@link ButtonPassThrough} */ pcAction?: ButtonPassThrough; /** * Used to pass attributes to the action icon's DOM element. */ actionIcon?: PassThroughOption; /** * Used to pass attributes to the mask's DOM element. */ mask?: PassThroughOption; } /** * Defines valid pass-through options in SpeedDial component. * @see {@link SpeedDialPassThroughOptions} * * @template I Type of instance. */ type SpeedDialPassThrough = PassThrough>; /** * Custom button template context. * @group Interface */ interface SpeedDialButtonTemplateContext { /** * Callback to toggle the speed dial visibility. */ toggleCallback: (event: MouseEvent) => void; } /** * Custom item template context. * @group Interface */ interface SpeedDialItemTemplateContext { /** * Menu item instance. */ $implicit: MenuItem; /** * Index of the item. */ index: number; /** * Callback to handle item click. */ toggleCallback: (event: Event, item: MenuItem) => void; } /** * Defines valid templates in SpeedDial. * @group Templates */ interface SpeedDialTemplates { /** * Custom button template. * @param {SpeedDialButtonTemplateContext} context - button context. */ button(context: SpeedDialButtonTemplateContext): TemplateRef; /** * Custom icon template. */ icon(): TemplateRef; /** * Custom item template. * @param {SpeedDialItemTemplateContext} context - item context. */ item(context: SpeedDialItemTemplateContext): TemplateRef; } export type { SpeedDialButtonTemplateContext, SpeedDialItemTemplateContext, SpeedDialPassThrough, SpeedDialPassThroughOptions, SpeedDialTemplates };