/*!
 * Copyright 2020-2021 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { ChangeDetectorRef, ElementRef, EventEmitter, OnInit } from '@angular/core';
import { TranslationService } from '@vcd/i18n';
import { SubscriptionTracker } from '../common/subscription/subscription-tracker';
import { IdGenerator } from '../utils';
import { AriaActiveDescendantService } from '../lib/directives';
import { QuickSearchResultItem } from './quick-search-result';
import { GroupedSearchSections, QuickSearchFilter, QuickSearchFilterOption, QuickSearchService, SearchSection } from './quick-search.service';
import * as i0 from "@angular/core";
/**
 * This interface describes the event emitted when a result item is activated,
 * i.e. its event handler has been called.
 */
export interface ResultActivatedEvent {
    itemDisplayText: string;
    sectionTitle: string;
    eventSource: 'MouseEvent' | 'KeyboardEvent';
}
/**
 * The Quick Search component is inspired by the Spotlight Search in Mac OSX (cmd+space)
 * and the Search Everywhere in IntelliJ (shift+shift)
 *
 * This VCD Quick Search does not provide any search by itself. It is not also a single component
 * but rather a group of objects that work together in order to allow the developer to build a might search experience
 * for the end user.
 *
 * Basically the VCD Quick Search consists of:
 * <ul>
 *     <li>QuickSearchComponent - the visual component that you should include in your template</li>
 *     <li>{@link QuickSearchService}<a href="/compodoc/injectables/QuickSearchService.html">QuickSearchService</a>
 *     - the service that you should register your own providers with</li>
 *     <li>{@link QuickSearchProvider}<a href="/compodoc/interfaces/QuickSearchProvider.html">QuickSearchProvider</a>
 *     - the interface your search provider should implement.
 *     It can return either an array of {@link QuickSearchResults} or a promise for lazy loading of results</li>
 * </ul>
 *
 * QuickSearchComponent:
 *
 *    <vcd-quick-search
 *        [(open)]="quickSearchOpen"
 *        [placeholder]="'Search ...'"
 *    ></vcd-quick-search>
 *
 *
 * {@link QuickSearchService}:
 *
 * This service works along with the component in order to provide search results displayed. Those results are grouped
 * in sections based on the registered provider {@link QuickSearchProvider}.
 *
 * You can provide order of the search providers, hence the order of the displayed sections
 *
 * If there is just one search provider no section title is displayed.
 *
 * In case of multiple search providers the Quick Search can be configured to hide the entire section if it contains no data.
 *
 *
 * For a complete end-to-end running example please take a look at the `Examples` tab of the live-docs
 */
export declare class QuickSearchComponent implements OnInit {
    searchService: QuickSearchService;
    translationService: TranslationService;
    ariaActivedescendantService: AriaActiveDescendantService;
    private changeDetectorRef;
    private el;
    private subscriptionTracker;
    private idGenerator;
    /**
     * Placeholder for the search input. Default is empty string;
     */
    placeholder: string;
    /**
     * A helper text that will be placed below the search input.
     */
    helper: string;
    /**
     * This property alongside with `openChange` provide two-way binding [(open)] for controlling the visibility state
     * of the quick search component
     */
    set open(open: boolean);
    get open(): boolean;
    /**
     * Visually hidden title adds dialog label for screen readers.
     */
    accessibilityTitle: string;
    /**
     * This method along with `open` property provide two-way binding [(open)] for controlling the visibility state
     * of the quick search component
     */
    openChange: EventEmitter<boolean>;
    /**
     * Event dispatched when item has been activated, i.e. its event handler is called.
     * This happens when item is clicked or 'Enter' is pressed when there is a selection.
     */
    resultActivated: EventEmitter<ResultActivatedEvent>;
    DataUi: {
        modalBody: string;
        searchResultSectionTitles: string;
        searchResultItems: string;
        spinner: string;
        noResults: string;
        searchInput: string;
        searchResultAlerts: string;
        filterDropdownItem: string;
        filterButton(id: string): string;
    };
    activeDescendantId: string;
    resultsGridId: string;
    constructor(searchService: QuickSearchService, translationService: TranslationService, ariaActivedescendantService: AriaActiveDescendantService, changeDetectorRef: ChangeDetectorRef, el: ElementRef, subscriptionTracker: SubscriptionTracker, idGenerator: IdGenerator);
    private _searchCriteria;
    get searchCriteria(): string;
    set searchCriteria(value: string);
    private _open;
    _groupedSearchSections: GroupedSearchSections[];
    _ungroupedSearchSections: SearchSection[];
    _filterValues: Map<string, QuickSearchFilterOption[]>;
    searchInput: ElementRef;
    /**
     * The selected result in the results section.
     */
    selectedItem: QuickSearchResultItem;
    ngOnInit(): void;
    itemClicked(item: QuickSearchResultItem): void;
    onArrowDown(event: KeyboardEvent): void;
    onArrowUp(event: KeyboardEvent): void;
    onEnterKey(event: any): void;
    togglePinned(): void;
    /**
     * Searches all the providers given the search term and the active filters.
     *
     * @param force runs the search even if the active filters and search term has not changed.
     */
    private doSearch;
    /**
     * Try to select the first item in the compound search result.
     * @param ensureFirstSectionIsLoaded if true and if the topmost section is still loading then do not select an item
     */
    private selectFirst;
    private selectNext;
    private genericSelectNext;
    /**
     * Handle showing / hiding of the Quick Search.
     * @param open true when opening, false when closing
     */
    private handleOpen;
    private handleItem;
    private getFlattenedSearchSections;
    getFilterOptionValue(filterId: string, optionKey: string): boolean;
    showParentSectionTitle(parentSection: GroupedSearchSections): boolean;
    groupSectionTrackBy(_index: number, groupedSection: GroupedSearchSections): string;
    sectionTrackBy(_index: number, searchSection: SearchSection): string;
    filterOptionTrackBy(_index: number, filterOption: QuickSearchFilterOption): string;
    filterTrackBy(_index: number, filterOption: QuickSearchFilter): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<QuickSearchComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<QuickSearchComponent, "vcd-quick-search", never, { "placeholder": "placeholder"; "helper": "helper"; "open": "open"; "accessibilityTitle": "accessibilityTitle"; }, { "openChange": "openChange"; "resultActivated": "resultActivated"; }, never, [".top-of-results", ".bottom-of-results"], false, never>;
}
