{"version":3,"file":"typeahead.d.ts","sources":["typeahead.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA","sourcesContent":["import { ChangeDetectorRef, ComponentFactoryResolver, ElementRef, EventEmitter, Injector, NgZone, OnDestroy, OnInit, Renderer2, TemplateRef, ViewContainerRef, ApplicationRef } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { Observable } from 'rxjs';\nimport { Live } from '../util/accessibility/live';\nimport { PlacementArray } from '../util/positioning';\nimport { NgbTypeaheadConfig } from './typeahead-config';\nimport { ResultTemplateContext } from './typeahead-window';\n/**\n * An event emitted right before an item is selected from the result list.\n */\nexport interface NgbTypeaheadSelectItemEvent {\n /**\n * The item from the result list about to be selected.\n */\n item: T;\n /**\n * Calling this function will prevent item selection from happening.\n */\n preventDefault: () => void;\n}\n/**\n * A directive providing a simple way of creating powerful typeaheads from any text input.\n */\nexport declare class NgbTypeahead implements ControlValueAccessor, OnInit, OnDestroy {\n private _elementRef;\n private _renderer;\n private _live;\n private _document;\n private _ngZone;\n private _changeDetector;\n private _popupService;\n private _subscription;\n private _closed$;\n private _inputValueBackup;\n private _valueChanges;\n private _resubscribeTypeahead;\n private _windowRef;\n private _zoneSubscription;\n /**\n * The value for the `autocomplete` attribute for the `` element.\n *\n * Defaults to `\"off\"` to disable the native browser autocomplete, but you can override it if necessary.\n *\n * @since 2.1.0\n */\n autocomplete: string;\n /**\n * A selector specifying the element the typeahead popup will be appended to.\n *\n * Currently only supports `\"body\"`.\n */\n container: string;\n /**\n * If `true`, model values will not be restricted only to items selected from the popup.\n */\n editable: boolean;\n /**\n * If `true`, the first item in the result list will always stay focused while typing.\n */\n focusFirst: boolean;\n /**\n * The function that converts an item from the result list to a `string` to display in the `` field.\n *\n * It is called when the user selects something in the popup or the model value changes, so the input needs to\n * be updated.\n */\n inputFormatter: (item: any) => string;\n /**\n * The function that converts a stream of text values from the `` element to the stream of the array of items\n * to display in the typeahead popup.\n *\n * If the resulting observable emits a non-empty array - the popup will be shown. If it emits an empty array - the\n * popup will be closed.\n *\n * See the [basic example](#/components/typeahead/examples#basic) for more details.\n *\n * Note that the `this` argument is `undefined` so you need to explicitly bind it to a desired \"this\" target.\n */\n ngbTypeahead: (text: Observable) => Observable;\n /**\n * The function that converts an item from the result list to a `string` to display in the popup.\n *\n * Must be provided, if your `ngbTypeahead` returns something other than `Observable`.\n *\n * Alternatively for more complex markup in the popup you should use `resultTemplate`.\n */\n resultFormatter: (item: any) => string;\n /**\n * The template to override the way resulting items are displayed in the popup.\n *\n * See the [ResultTemplateContext](#/components/typeahead/api#ResultTemplateContext) for the template context.\n *\n * Also see the [template for results demo](#/components/typeahead/examples#template) for more details.\n */\n resultTemplate: TemplateRef;\n /**\n * If `true`, will show the hint in the `` when an item in the result list matches.\n */\n showHint: boolean;\n /**\n * The preferred placement of the typeahead.\n *\n * Possible values are `\"top\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom\"`, `\"bottom-left\"`,\n * `\"bottom-right\"`, `\"left\"`, `\"left-top\"`, `\"left-bottom\"`, `\"right\"`, `\"right-top\"`,\n * `\"right-bottom\"`\n *\n * Accepts an array of strings or a string with space separated possible values.\n *\n * The default order of preference is `\"bottom-left bottom-right top-left top-right\"`\n *\n * Please see the [positioning overview](#/positioning) for more details.\n */\n placement: PlacementArray;\n /**\n * An event emitted right before an item is selected from the result list.\n *\n * Event payload is of type [`NgbTypeaheadSelectItemEvent`](#/components/typeahead/api#NgbTypeaheadSelectItemEvent).\n */\n selectItem: EventEmitter>;\n activeDescendant: string | null;\n popupId: string;\n private _onTouched;\n private _onChange;\n constructor(_elementRef: ElementRef, viewContainerRef: ViewContainerRef, _renderer: Renderer2, injector: Injector, componentFactoryResolver: ComponentFactoryResolver, config: NgbTypeaheadConfig, ngZone: NgZone, _live: Live, _document: any, _ngZone: NgZone, _changeDetector: ChangeDetectorRef, applicationRef: ApplicationRef);\n ngOnInit(): void;\n ngOnDestroy(): void;\n registerOnChange(fn: (value: any) => any): void;\n registerOnTouched(fn: () => any): void;\n writeValue(value: any): void;\n setDisabledState(isDisabled: boolean): void;\n /**\n * Dismisses typeahead popup window\n */\n dismissPopup(): void;\n /**\n * Returns true if the typeahead popup window is displayed\n */\n isPopupOpen(): boolean;\n handleBlur(): void;\n handleKeyDown(event: KeyboardEvent): void;\n private _openPopup;\n private _closePopup;\n private _selectResult;\n private _selectResultClosePopup;\n private _showHint;\n private _formatItemForInput;\n private _writeInputValue;\n private _subscribeToUserInput;\n private _unsubscribeFromUserInput;\n}\n"]}