import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough } from 'primeng/api'; import { ToggleButtonPassThrough } from 'primeng/types/togglebutton'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link SelectButton.pt} * @group Interface */ interface SelectButtonPassThroughOptions { /** * Used to pass attributes to the host's DOM element. */ host?: PassThroughOption; /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the ToggleButton component. * @see {@link ToggleButtonPassThrough} */ pcToggleButton?: ToggleButtonPassThrough; } /** * Custom passthrough attributes for each DOM elements * @group Interface */ type SelectButtonPassThrough = PassThrough>; /** * Custom change event. * @see {@link SelectButton.onChange} * @group Events */ interface SelectButtonChangeEvent { /** * Browser event. */ originalEvent?: Event; /** * Selected option. */ value?: any; } /** * Custom option click event. * @see {@link SelectButton.onOptionClick} * @group Events */ interface SelectButtonOptionClickEvent { /** * Browser event. */ originalEvent?: Event; /** * Selected option. */ option?: any; /** * Index of the selected option. */ index?: number; } /** * Custom item template context. * @group Interface */ interface SelectButtonItemTemplateContext { /** * Option instance. */ $implicit: any; /** * Index of the option. */ index: number; } /** * Defines valid templates in SelectButton. * @group Templates */ interface SelectButtonTemplates { /** * Custom item template. * @param {SelectButtonItemTemplateContext} context - item context. */ item(context: SelectButtonItemTemplateContext): TemplateRef; } export type { SelectButtonChangeEvent, SelectButtonItemTemplateContext, SelectButtonOptionClickEvent, SelectButtonPassThrough, SelectButtonPassThroughOptions, SelectButtonTemplates };