/** * * AutoCompleteOption is a single option item in the AutoComplete dropdown list. * * [Live Demo](https://www.primereact.org/autocomplete/) * * @module AutoCompleteOption * @group components * */ import type { ComponentInstance } from '@primereact/types/core'; import type { UseListboxInstance, UseListboxOptionInstance } from '@primereact/types/headless/listbox'; import type { BaseComponentProps, PassThroughType } from '../..'; import type { AutoCompleteRootInstance } from './AutoCompleteRoot.types'; /** * Defines passthrough(pt) options type in AutoCompleteOption component. */ export type AutoCompleteOptionPassThroughType = PassThroughType; /** * Defines passthrough(pt) options of AutoCompleteOption component. */ export interface AutoCompleteOptionPassThrough { /** * Used to pass attributes to the root's DOM element. */ root?: AutoCompleteOptionPassThroughType>; } /** * Defines valid properties in AutoCompleteOption component. */ export interface AutoCompleteOptionProps extends BaseComponentProps { /** * The option data. */ option?: unknown; /** * The index of the option. */ index?: number; /** * Whether the option is selected. * @default false */ selected?: boolean; /** * Whether the option is focused. * @default false */ focused?: boolean; /** * Whether the option is disabled. * @default false */ disabled?: boolean; } /** * Defines valid state in AutoCompleteOption component. */ export interface AutoCompleteOptionState { } /** * Defines the methods and properties exposed by AutoCompleteOption component. */ export interface AutoCompleteOptionExposes { /** * The AutoComplete component instance. */ autocomplete: AutoCompleteRootInstance | undefined | null; /** * The Listbox component instance. */ listbox: UseListboxInstance | undefined; /** * The useListboxOption hook instance. */ listboxOption: UseListboxOptionInstance; /** * The option data object. */ option: unknown; /** * The index of the option. */ index: number | undefined; /** * Whether this option is a group header. */ group: boolean | undefined; /** * Whether this option is currently selected. */ selected: boolean | undefined; } /** * Instance of AutoCompleteOption component. */ export type AutoCompleteOptionInstance = ComponentInstance;