import { AfterViewInit, ChangeDetectorRef, Injector, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
import { NgControl } from '@angular/forms';
import { BaseDataSource, BaseDataSourceMetadata, BaseDataSourceViewer, DataSourceLoader } from '@rxap/data-source';
import { RxapFormControl } from '@rxap/forms';
import { ControlOption, ControlOptions } from '@rxap/utilities';
import { Subscription } from 'rxjs';
import { MatFormField } from '@angular/material/form-field';
import { MatAutocomplete } from '@angular/material/autocomplete';
import { ExtractOptionsDataSourceMixin, UseOptionsDataSourceSettings } from '../mixins/extract-options-data-source.mixin';
import * as i0 from "@angular/core";
export interface InputSelectOptionsTemplateContext {
    $implicit: ControlOption;
}
export interface InputSelectOptionsSettings<Source> extends UseOptionsDataSourceSettings<Source> {
    /**
     * true - the selected value is not send to the data source with the viewChange event.
     * Instead an empty object {} is send to trigger a data source refresh.
     *
     * The OpenApiDataSource expects a Paramters Object in the viewChange event. This
     * can couse issue if the select value object as a property that is also a parameter for
     * the open-api operation. For instaed the select object has the property company and
     * the open-api operation has a query parameter company. Then the BuildOptions method
     * in the OpenApiDataSource would create a HttpParams object with the param company and the
     * value from the select object property company. This will result in unpredictable behaviors.
     */
    ignoreSelectedValue?: boolean;
    /**
     * true - the options list is filtered by the current control value if the
     * control value is of type string. Then the display value of each option is
     * compared to the control value. If the display value of an option includes
     * the control value, then the option is used. This comprehensions it not type
     * sensitive
     */
    filteredOptions?: boolean;
    /**
     * true - the options list is only loaded once and not refreshed on each value change
     */
    loadOnce?: boolean;
}
export interface InputSelectOptionsDirective extends OnDestroy, AfterViewInit, ExtractOptionsDataSourceMixin {
}
export declare class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
    protected readonly template: TemplateRef<InputSelectOptionsTemplateContext>;
    protected readonly dataSourceLoader: DataSourceLoader;
    protected readonly viewContainerRef: ViewContainerRef;
    protected readonly injector: Injector;
    protected readonly cdr: ChangeDetectorRef;
    protected ngControl: NgControl | null;
    protected matFormField: MatFormField | null;
    viewer: BaseDataSourceViewer;
    metadata?: BaseDataSourceMetadata;
    matAutocomplete?: MatAutocomplete;
    protected readonly subscription: Subscription;
    protected control: RxapFormControl;
    protected dataSource: BaseDataSource<ControlOptions | Record<string, any>>;
    protected options: ControlOptions | Record<string, any> | null;
    protected settings?: InputSelectOptionsSettings<any>;
    /**
     * This flag is used to prevent the setValue is called for each refresh
     * of the options list. This is needed because the setValue method will
     * trigger a new refresh of the options list. This results in an endless
     * call stack. This flag is set to true if the setValue method is called
     * once.
     */
    private isAutocompleteToDisplayTriggered;
    constructor(template: TemplateRef<InputSelectOptionsTemplateContext>, dataSourceLoader: DataSourceLoader, viewContainerRef: ViewContainerRef, injector: Injector, cdr: ChangeDetectorRef, ngControl?: NgControl | null, matFormField?: MatFormField | null);
    ngAfterViewInit(): void;
    toDisplay(value: any): string;
    ngOnDestroy(): void;
    private loadOptions;
    protected renderTemplate(options?: ControlOptions | Record<string, any> | null): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<InputSelectOptionsDirective, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<InputSelectOptionsDirective, "[rxapInputSelectOptions]", never, { "viewer": { "alias": "rxapInputSelectOptionsViewer"; "required": false; }; "metadata": { "alias": "rxapInputSelectOptionsMetadata"; "required": false; }; "matAutocomplete": { "alias": "rxapInputSelectOptionsMatAutocomplete"; "required": false; }; }, {}, never, never, true, never>;
}
