import * as i0 from '@angular/core';
import { InjectionToken, TemplateRef, OnInit, OnChanges, OnDestroy, AfterViewInit, ElementRef, EventEmitter, QueryList, ViewContainerRef, Injector, SimpleChanges, PipeTransform } from '@angular/core';
import { MobileMode, MobileModeBase, MobileModeConfig } from '@fundamental-ngx/core/mobile-mode';
import { Subject, Observable } from 'rxjs';
import { FocusableOption, LiveAnnouncer } from '@angular/cdk/a11y';
import { Direction } from '@angular/cdk/bidi';
import { DynamicComponentService } from '@fundamental-ngx/cdk/utils';
import * as i2 from '@fundamental-ngx/core/content-density';
import { ContentDensityObserver } from '@fundamental-ngx/core/content-density';
import { PopoverComponent } from '@fundamental-ngx/core/popover';
import { SearchComponent } from '@fundamental-ngx/core/shared';
import { BaseComponent, SearchFieldDataSource } from '@fundamental-ngx/platform/shared';

declare const SEARCH_FIELD_COMPONENT: InjectionToken<string[]>;
interface SearchFieldMobileInterface extends MobileMode {
    inputText: string;
    isOpenChange: Subject<boolean>;
    isOpen: boolean;
    dialogApprove(): void;
    dialogDismiss(): void;
}
interface SearchFieldChildContent {
    inputFieldTemplate: TemplateRef<any>;
    suggestionMenuTemplate: TemplateRef<any>;
}

declare class SearchFieldMobileComponent extends MobileModeBase<SearchFieldMobileInterface> implements OnInit {
    /** @hidden */
    dialogTemplate: TemplateRef<any>;
    /** @hidden */
    childContent: SearchFieldChildContent | null;
    /** @hidden */
    constructor(searchFieldComponent: SearchFieldMobileInterface);
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    listenChanges(): void;
    /** @hidden */
    _handleDismiss(): void;
    /** @hidden */
    _handleApprove(): void;
    /** @hidden */
    private _open;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchFieldMobileComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SearchFieldMobileComponent, "fdp-search-field-mobile", never, {}, {}, never, never, true, never>;
}

interface SearchInput {
    text: string;
    category: string | null;
}
interface SuggestionItem {
    value: string;
    isHistorical?: string;
    data?: any;
}
interface ValueLabelItem {
    value: string;
    label: string;
}
declare class SearchFieldSuggestionDirective implements FocusableOption {
    private element;
    /** @hidden */
    constructor(element: ElementRef);
    /** @hidden */
    focus(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchFieldSuggestionDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<SearchFieldSuggestionDirective, "[fdpSearchFieldSuggestion]", never, {}, {}, never, never, true, never>;
}
type Appearance = SearchComponent['appearance'] | undefined;
declare class SearchFieldComponent extends BaseComponent implements OnInit, OnChanges, OnDestroy, SearchFieldMobileInterface, SearchComponent, AfterViewInit {
    elementRef: ElementRef<HTMLElement>;
    private readonly _viewContainerRef;
    private readonly _injector;
    private readonly _document;
    private readonly _liveAnnouncer;
    readonly _dynamicComponentService: DynamicComponentService;
    readonly contentDensityObserver: ContentDensityObserver;
    /** Type of component used to render the categories dropdown. */
    categoryMode: 'menu' | 'select';
    /** Additional appearance configuration. */
    set appearance(value: Appearance);
    get appearance(): Appearance;
    /** Placeholder text for search input field. */
    placeholder: string;
    /** Set Mobile Mode */
    mobile: boolean;
    /** Search Field Mobile configuration */
    mobileConfig: MobileModeConfig;
    /** Whether display Refresh button */
    disableRefresh: boolean;
    /** Whether display search button */
    disableSearch: boolean;
    /** List of string values to populate suggestion dropdown selection. */
    set suggestions(value: SuggestionItem[] | Observable<SuggestionItem[]>);
    get suggestions(): SuggestionItem[] | Observable<SuggestionItem[]>;
    /** Datasource for suggestion list */
    set dataSource(value: SearchFieldDataSource<any>);
    get dataSource(): SearchFieldDataSource<any>;
    /** Initial input text. */
    inputText: string;
    /** List of categories. */
    set categories(value: ValueLabelItem[]);
    get categories(): ValueLabelItem[];
    /** Current category, value should be present in categories array */
    currentCategory: ValueLabelItem;
    /** Set label for category dropdown button. */
    categoryLabel: string;
    /** Hide display of category label */
    hideCategoryLabel: boolean;
    /** Toggle "loading" mode. */
    isLoading: boolean;
    /** Whether to always show search button. */
    forceSearchButton: boolean;
    /** Whether to disable the "suggestions found" live announcer. */
    disableSuggestionsFoundAnnouncer: boolean;
    /** Input change event. */
    inputChange: EventEmitter<SearchInput>;
    /** Search submit event. */
    searchSubmit: EventEmitter<SearchInput>;
    /** Cancel search event. */
    cancelSearch: EventEmitter<SearchInput>;
    /** Open mobile mode event. */
    isOpenChange: EventEmitter<boolean>;
    /** @hidden */
    categoryDropdown: PopoverComponent;
    /** @hidden */
    inputGroup: ElementRef<HTMLElement>;
    /** @hidden */
    inputField: ElementRef<HTMLElement>;
    /** @hidden */
    inputFieldTemplate: TemplateRef<any>;
    /** @hidden */
    suggestionMenuTemplate: TemplateRef<any>;
    /** @hidden */
    suggestionItems: QueryList<SearchFieldSuggestionDirective>;
    /** @hidden */
    get searchFieldValue(): SearchInput;
    /** @hidden Focus state */
    _isFocused: boolean;
    /**
     * Observable list of string values taken from `suggestions` to populate dropdown menu.
     * @hidden
     */
    _dropdownValues$: Observable<string[]>;
    /**
     * Currently set category.
     * @hidden
     */
    _currentCategory?: ValueLabelItem;
    /**
     * Whether or not to show category dropdown. This is dependent on length of `categoryValues` property.
     * @hidden
     */
    _showCategoryDropdown: boolean;
    /** @hidden */
    _inputId: string;
    /** @hidden */
    _submitId: string;
    /** @hidden */
    _menuId: string;
    /** @hidden */
    _refreshId: string;
    /** @hidden */
    _clearId: string;
    /** @hidden */
    isOpen: boolean;
    /** @hidden */
    _isRefresh: boolean;
    /** @hidden */
    _isSearchDone: boolean;
    /** @hidden */
    _isOpen$: i0.WritableSignal<boolean>;
    /** @hidden */
    protected readonly dir: i0.Signal<Direction>;
    /** @hidden */
    private _suggestions;
    /** @hidden */
    private _dataSource;
    /** @hidden */
    private _categories;
    /** @hidden */
    private _currentSearchSuggestionAnnouncementMessage;
    /** @hidden */
    private _suggestionkeyManager;
    /** @hidden */
    private resolveTranslation;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    private readonly _dataSourceChanged$;
    /** @hidden */
    private _appearance;
    /** hidden */
    private readonly _rtlService;
    /** @hidden */
    constructor(elementRef: ElementRef<HTMLElement>, _viewContainerRef: ViewContainerRef, _injector: Injector, _document: Document, _liveAnnouncer: LiveAnnouncer, _dynamicComponentService: DynamicComponentService, contentDensityObserver: ContentDensityObserver);
    /** @hidden */
    handleKeydown(event: KeyboardEvent): void;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngOnChanges(changes: SimpleChanges): void;
    /** @hidden */
    ngOnDestroy(): void;
    /**
     * Focuses the search input field.
     */
    focus(): void;
    /** Capturing onKeydown of input element */
    onKeydown(event: KeyboardEvent): void;
    /**
     * Capturing value change in input text field of combobox.
     * @hidden
     */
    onValueChange(event: string): void;
    /**
     * Capturing item selection from dropdown menu of combobox.
     * @hidden
     */
    onItemClick(event: string): void;
    /**
     * Callback function which gets executed on keyboard enter of input text field.
     * @hidden
     */
    onSearchSubmit(event?: Event): void;
    /**
     * Sets current category.
     * @hidden
     */
    setCurrentCategory(currentCategory: ValueLabelItem): void;
    /**
     * Open suggestion menu
     */
    openSuggestionMenu(): void;
    /** @hidden */
    openMobileMode(): void;
    /** @hidden */
    dialogApprove(): void;
    /** @hidden */
    dialogDismiss(): void;
    /** @hidden */
    showDialog(isOpen: boolean): void;
    /** @hidden */
    closeSuggestionMenu(focus?: boolean): void;
    /** @hidden */
    clearTextInput(): void;
    /** @hidden */
    _initializeDataSource(dataSource: SearchFieldDataSource<any>): void;
    /**
     * @hidden return count for matching suggestion with input text
     * @returns number
     */
    private _getSuggestionsLength;
    /** @hidden */
    private _updateSearchAnnouncementText;
    /** @hidden */
    private _setUpMobileMode;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchFieldComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SearchFieldComponent, "fdp-search-field", never, { "categoryMode": { "alias": "categoryMode"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "mobile": { "alias": "mobile"; "required": false; }; "mobileConfig": { "alias": "mobileConfig"; "required": false; }; "disableRefresh": { "alias": "disableRefresh"; "required": false; }; "disableSearch": { "alias": "disableSearch"; "required": false; }; "suggestions": { "alias": "suggestions"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "inputText": { "alias": "inputText"; "required": false; }; "categories": { "alias": "categories"; "required": false; }; "currentCategory": { "alias": "currentCategory"; "required": false; }; "categoryLabel": { "alias": "categoryLabel"; "required": false; }; "hideCategoryLabel": { "alias": "hideCategoryLabel"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "forceSearchButton": { "alias": "forceSearchButton"; "required": false; }; "disableSuggestionsFoundAnnouncer": { "alias": "disableSuggestionsFoundAnnouncer"; "required": false; }; }, { "inputChange": "inputChange"; "searchSubmit": "searchSubmit"; "cancelSearch": "cancelSearch"; "isOpenChange": "isOpenChange"; }, never, never, true, never>;
}
declare class SuggestionMatchesPipe implements PipeTransform {
    /** @hidden */
    transform(values: string[] | null, match: string): string[];
    static ɵfac: i0.ɵɵFactoryDeclaration<SuggestionMatchesPipe, never>;
    static ɵpipe: i0.ɵɵPipeDeclaration<SuggestionMatchesPipe, "suggestionMatches", true>;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class PlatformSearchFieldModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<PlatformSearchFieldModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<PlatformSearchFieldModule, never, [typeof SearchFieldComponent, typeof SearchFieldSuggestionDirective, typeof SuggestionMatchesPipe, typeof i2.ContentDensityModule], [typeof SearchFieldComponent, typeof SearchFieldSuggestionDirective, typeof SuggestionMatchesPipe, typeof i2.ContentDensityModule]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<PlatformSearchFieldModule>;
}

export { PlatformSearchFieldModule, SEARCH_FIELD_COMPONENT, SearchFieldComponent, SearchFieldMobileComponent, SearchFieldSuggestionDirective, SuggestionMatchesPipe };
export type { SearchFieldChildContent, SearchFieldMobileInterface, SearchInput, SuggestionItem, ValueLabelItem };
