import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough, ScrollerOptions } from 'primeng/api'; import { ChipPassThrough } from 'primeng/types/chip'; import { InputTextPassThrough } from 'primeng/types/inputtext'; import { OverlayPassThrough } from 'primeng/types/overlay'; import { VirtualScrollerPassThrough } from 'primeng/types/scroller'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link AutoComplete.pt} * @group Interface */ interface AutoCompletePassThroughOptions { /** * 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 InputText component. * @see {@link InputTextPassThrough} */ pcInputText?: InputTextPassThrough; /** * Used to pass attributes to the input multiple's DOM element. */ inputMultiple?: PassThroughOption; /** * Used to pass attributes to the chip item's DOM element. */ chipItem?: PassThroughOption; /** * Used to pass attributes to the Chip component. * @see {@link ChipPassThrough} */ pcChip?: ChipPassThrough; /** * Used to pass attributes to the chip icon's DOM element. */ chipIcon?: PassThroughOption; /** * Used to pass attributes to the input chip's DOM element. */ inputChip?: PassThroughOption; /** * Used to pass attributes to the clear icon's DOM element. */ clearIcon?: PassThroughOption; /** * Used to pass attributes to the loader's DOM element. */ loader?: PassThroughOption; /** * Used to pass attributes to the dropdown button's DOM element. */ dropdown?: PassThroughOption; /** * Used to pass attributes to the Overlay component. * @see {@link OverlayPassThrough} */ pcOverlay?: OverlayPassThrough; /** * Used to pass attributes to the overlay's DOM element. */ overlay?: PassThroughOption; /** * Used to pass attributes to the list container's DOM element. */ listContainer?: PassThroughOption; /** * Used to pass attributes to the Scroller component. * @see {@link VirtualScrollerPassThrough} */ pcScroller?: VirtualScrollerPassThrough; /** * Used to pass attributes to the list's DOM element. */ list?: PassThroughOption; /** * Used to pass attributes to the option group's DOM element. */ optionGroup?: PassThroughOption; /** * Used to pass attributes to the option's DOM element. */ option?: PassThroughOption; /** * Used to pass attributes to the empty message's DOM element. */ emptyMessage?: PassThroughOption; } /** * Defines valid pass-through options in AutoComplete. * @see {@link AutoCompletePassThroughOptions} * * @template I Type of instance. */ type AutoCompletePassThrough = PassThrough>; /** * Custom complete event. * @see {@link AutoComplete.completeMethod} * @group Events */ interface AutoCompleteCompleteEvent { /** * Browser event. */ originalEvent: Event; /** * Selected option value. */ query: string; } /** * Custom click event. * @see {@link AutoComplete.onDropdownClick} * @group Events */ interface AutoCompleteDropdownClickEvent { /** * Browser event. */ originalEvent: Event; /** * Selected option value. */ query?: string; } /** * Custom select event. * @see {@link AutoComplete.onSelect} * @group Events */ interface AutoCompleteSelectEvent { /** * Browser event. */ originalEvent: Event; /** * Selected value. */ value: any; } /** * Custom unselect event. * @see {@link AutoComplete.onUnSelect} * @group Events */ interface AutoCompleteUnselectEvent { /** * Browser event. */ originalEvent: Event; /** * Removed value. */ value: any; } /** * Custom add event. * @see {@link AutoComplete.onAdd} * @group Events */ interface AutoCompleteAddEvent { /** * Browser event. */ originalEvent: Event; /** * Added value. */ value: any; } /** * Custom lazy load event. * @see {@link AutoComplete.onLazyLoad} * @group Events */ interface AutoCompleteLazyLoadEvent { /** * First element in viewport. */ first: any; /** * Last element in viewport. */ last: any; } /** * Custom item template context. * @group Interface */ interface AutoCompleteItemTemplateContext { /** * Data of the option. */ $implicit: T; /** * Index of the option. */ index: number; } /** * Custom group template context. * @group Interface */ interface AutoCompleteGroupTemplateContext { /** * Group option. */ $implicit: T; } /** * Custom selected item template context. * @group Interface */ interface AutoCompleteSelectedItemTemplateContext { /** * Selected option value. */ $implicit: T; } /** * Custom loader template context. * @group Interface */ interface AutoCompleteLoaderTemplateContext { /** * Virtual scroller options. */ options: ScrollerOptions; } /** * Custom remove icon template context. * @group Interface */ interface AutoCompleteRemoveIconTemplateContext { /** * Style class of the icon. */ class: string; /** * Callback to remove the item. */ removeCallback: (event: Event, index: number) => void; /** * Index of the item. */ index: number; } /** * Defines valid templates in AutoComplete. * @group Templates */ interface AutoCompleteTemplates { /** * Custom item template. * @param {Object} context - option data. */ item(context: AutoCompleteItemTemplateContext): TemplateRef>; /** * Custom group template. * @param {Object} context - group data. */ group(context: AutoCompleteGroupTemplateContext): TemplateRef>; /** * Custom selected item template, only supported in multiple mode. * @param {Object} context - selected item data. */ selecteditem(context: AutoCompleteSelectedItemTemplateContext): TemplateRef>; /** * Custom header template. */ header(): TemplateRef; /** * Custom empty template. */ empty(): TemplateRef; /** * Custom footer template. */ footer(): TemplateRef; /** * Custom loader template. * @param {Object} context - scroller options. */ loader(context: AutoCompleteLoaderTemplateContext): TemplateRef; /** * Custom remove icon template. * @param {Object} context - icon context. */ removeicon(context: AutoCompleteRemoveIconTemplateContext): TemplateRef; /** * Custom loading icon template. */ loadingicon(): TemplateRef; /** * Custom clear icon template. */ clearicon(): TemplateRef; /** * Custom dropdown icon template. */ dropdownicon(): TemplateRef; } export type { AutoCompleteAddEvent, AutoCompleteCompleteEvent, AutoCompleteDropdownClickEvent, AutoCompleteGroupTemplateContext, AutoCompleteItemTemplateContext, AutoCompleteLazyLoadEvent, AutoCompleteLoaderTemplateContext, AutoCompletePassThrough, AutoCompletePassThroughOptions, AutoCompleteRemoveIconTemplateContext, AutoCompleteSelectEvent, AutoCompleteSelectedItemTemplateContext, AutoCompleteTemplates, AutoCompleteUnselectEvent };