import { ActiveDescendantKeyManager } from '@angular/cdk/a11y'; import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, QueryList, TemplateRef } from '@angular/core'; import { OuiOption } from '../core/option/option'; import { OuiOptgroup } from '../core/option/optgroup'; import * as i0 from "@angular/core"; /** Event object that is emitted when an autocomplete option is selected. */ export declare class OuiAutocompleteSelectedEvent { /** Reference to the autocomplete panel that emitted the event. */ source: OuiAutocomplete; /** Option that was selected. */ option: OuiOption; constructor( /** Reference to the autocomplete panel that emitted the event. */ source: OuiAutocomplete, /** Option that was selected. */ option: OuiOption); } /** Default `oui-autocomplete` options that can be overridden. */ export interface OuiAutocompleteDefaultOptions { /** Whether the first option should be highlighted when an autocomplete panel is opened. */ autoActiveFirstOption?: boolean; } /** Injection token to be used to override the default options for `oui-autocomplete`. */ export declare const OUI_AUTOCOMPLETE_DEFAULT_OPTIONS: InjectionToken; /** @docs-private */ export declare function OUI_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY(): OuiAutocompleteDefaultOptions; export declare class OuiAutocomplete implements AfterContentInit { private _changeDetectorRef; private _elementRef; /** Manages active item in option list based on key events. */ _keyManager: ActiveDescendantKeyManager; /** Whether the autocomplete panel should be visible, depending on option length. */ showPanel: boolean; /** Whether the autocomplete panel is open. */ get isOpen(): boolean; _isOpen: boolean; /** @docs-private */ template: TemplateRef; /** Element for the panel containing the autocomplete options. */ panel: ElementRef; /** @docs-private */ options: QueryList; /** @docs-private */ optionGroups: QueryList; /** Function that maps an option's control value to its display value in the trigger. */ displayWith: ((value: any) => string) | null; /** * Whether the first option should be highlighted when the autocomplete panel is opened. * Can be configured globally through the `OUI_AUTOCOMPLETE_DEFAULT_OPTIONS` token. */ get autoActiveFirstOption(): boolean; set autoActiveFirstOption(value: boolean); private _autoActiveFirstOption; /** * Specify the width of the autocomplete panel. Can be any CSS sizing value, otherwise it will * match the width of its host. */ panelWidth: string | number; /** Event that is emitted whenever an option from the list is selected. */ readonly optionSelected: EventEmitter; /** Event that is emitted when the autocomplete panel is opened. */ readonly opened: EventEmitter; /** Event that is emitted when the autocomplete panel is closed. */ readonly closed: EventEmitter; /** * Takes classes set on the host oui-autocomplete element and applies them to the panel * inside the overlay container to allow for easy styling. */ set classList(value: string); _classList: { [key: string]: boolean; }; /** Unique ID to be used by autocomplete trigger's "aria-owns" property. */ id: string; constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, defaults: OuiAutocompleteDefaultOptions); ngAfterContentInit(): void; /** * Sets the panel scrollTop. This allows us to manually scroll to display options * above or below the fold, as they are not actually being focused when active. */ _setScrollTop(scrollTop: number): void; /** Returns the panel's scrollTop. */ _getScrollTop(): number; /** Panel should hide itself when the option list is empty. */ _setVisibility(): void; /** Emits the `select` event. */ _emitSelectEvent(option: OuiOption): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } //# sourceMappingURL=autocomplete.d.ts.map