import * as i0 from '@angular/core';
import { TemplateRef, OnInit, EventEmitter, AfterContentInit, AfterViewInit, OnChanges, AnimationCallbackEvent, QueryList, ElementRef, SimpleChanges } from '@angular/core';
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
import { NzSafeAny, CompareWith, OnChangeType, OnTouchedType } from 'ng-zorro-antd/core/types';
import { ControlValueAccessor } from '@angular/forms';

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

declare class NzAutocompleteOptgroupComponent {
    nzLabel?: string | TemplateRef<void>;
    static ɵfac: i0.ɵɵFactoryDeclaration<NzAutocompleteOptgroupComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<NzAutocompleteOptgroupComponent, "nz-auto-optgroup", ["nzAutoOptgroup"], { "nzLabel": { "alias": "nzLabel"; "required": false; }; }, {}, never, ["nz-auto-option"], true, never>;
}

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

declare class NzOptionSelectionChange {
    source: NzAutocompleteOptionComponent;
    isUserInput: boolean;
    constructor(source: NzAutocompleteOptionComponent, isUserInput?: boolean);
}
declare class NzAutocompleteOptionComponent implements OnInit {
    private ngZone;
    private changeDetectorRef;
    private element;
    private destroyRef;
    nzValue: NzSafeAny;
    nzLabel?: string;
    nzDisabled: boolean;
    readonly selectionChange: EventEmitter<NzOptionSelectionChange>;
    readonly mouseEntered: EventEmitter<NzAutocompleteOptionComponent>;
    active: boolean;
    selected: boolean;
    nzAutocompleteOptgroupComponent: NzAutocompleteOptgroupComponent | null;
    ngOnInit(): void;
    select(emit?: boolean): void;
    deselect(): void;
    /** Git display label */
    getLabel(): string;
    /** Set active (only styles) */
    setActiveStyles(): void;
    /** Unset active (only styles) */
    setInactiveStyles(): void;
    scrollIntoViewIfNeeded(): void;
    selectViaInteraction(): void;
    private emitSelectionChangeEvent;
    static ɵfac: i0.ɵɵFactoryDeclaration<NzAutocompleteOptionComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<NzAutocompleteOptionComponent, "nz-auto-option", ["nzAutoOption"], { "nzValue": { "alias": "nzValue"; "required": false; }; "nzLabel": { "alias": "nzLabel"; "required": false; }; "nzDisabled": { "alias": "nzDisabled"; "required": false; }; }, { "selectionChange": "selectionChange"; "mouseEntered": "mouseEntered"; }, never, ["*"], true, never>;
    static ngAcceptInputType_nzDisabled: unknown;
}

interface AutocompleteDataSourceItem {
    value: string;
    label: string;
}
type AutocompleteDataSource = Array<AutocompleteDataSourceItem | string | number>;
declare class NzAutocompleteComponent implements AfterContentInit, AfterViewInit, OnChanges {
    private readonly cdr;
    private readonly destroyRef;
    private readonly afterNextRender$;
    private readonly noAnimation;
    protected readonly dir: i0.WritableSignal<_angular_cdk_bidi.Direction>;
    nzWidth?: number;
    nzOverlayClassName: string;
    nzOverlayStyle: Record<string, string>;
    nzDefaultActiveFirstOption: boolean;
    nzBackfill: boolean;
    compareWith: CompareWith;
    nzDataSource?: AutocompleteDataSource;
    readonly selectionChange: EventEmitter<NzAutocompleteOptionComponent>;
    showPanel: boolean;
    isOpen: boolean;
    activeItem: NzAutocompleteOptionComponent | null;
    normalizedDataSource: AutocompleteDataSourceItem[];
    animationStateChange: EventEmitter<AnimationCallbackEvent>;
    /**
     * Options accessor, its source may be content or dataSource
     */
    get options(): QueryList<NzAutocompleteOptionComponent>;
    /** Provided by content */
    fromContentOptions: QueryList<NzAutocompleteOptionComponent>;
    /** Provided by dataSource */
    fromDataSourceOptions: QueryList<NzAutocompleteOptionComponent>;
    /** cdk-overlay */
    template?: TemplateRef<{}>;
    panel?: ElementRef;
    content?: ElementRef;
    private activeItemIndex;
    private selectionChangeSubscription;
    private optionMouseEnterSubscription;
    private dataSourceChangeSubscription;
    /** Options changes listener */
    private readonly optionSelectionChanges;
    private readonly optionMouseEnter;
    protected readonly autoCompleteAnimationEnter: i0.Signal<string>;
    protected readonly autoCompleteAnimationLeave: i0.Signal<string>;
    protected readonly animationEnabled: i0.Signal<boolean>;
    constructor();
    ngOnChanges(changes: SimpleChanges): void;
    onAnimationEvent(event: AnimationCallbackEvent): void;
    ngAfterContentInit(): void;
    ngAfterViewInit(): void;
    setVisibility(): void;
    setActiveItem(index: number): void;
    setNextItemActive(): void;
    setPreviousItemActive(): void;
    getOptionIndex(value: NzSafeAny): number;
    getOption(value: NzSafeAny): NzAutocompleteOptionComponent | null;
    private optionsInit;
    /**
     * Clear the status of options
     */
    clearSelectedOptions(skip?: NzAutocompleteOptionComponent | null, deselect?: boolean): void;
    private subscribeOptionChanges;
    static ɵfac: i0.ɵɵFactoryDeclaration<NzAutocompleteComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<NzAutocompleteComponent, "nz-autocomplete", ["nzAutocomplete"], { "nzWidth": { "alias": "nzWidth"; "required": false; }; "nzOverlayClassName": { "alias": "nzOverlayClassName"; "required": false; }; "nzOverlayStyle": { "alias": "nzOverlayStyle"; "required": false; }; "nzDefaultActiveFirstOption": { "alias": "nzDefaultActiveFirstOption"; "required": false; }; "nzBackfill": { "alias": "nzBackfill"; "required": false; }; "compareWith": { "alias": "compareWith"; "required": false; }; "nzDataSource": { "alias": "nzDataSource"; "required": false; }; }, { "selectionChange": "selectionChange"; }, ["fromContentOptions"], ["*"], true, never>;
    static ngAcceptInputType_nzWidth: unknown;
    static ngAcceptInputType_nzDefaultActiveFirstOption: unknown;
    static ngAcceptInputType_nzBackfill: unknown;
}

declare class NzAutocompleteTriggerDirective implements AfterViewInit, ControlValueAccessor {
    private readonly injector;
    private readonly ngZone;
    private readonly elementRef;
    private readonly viewContainerRef;
    private readonly destroyRef;
    private readonly document;
    /** Bind nzAutocomplete component */
    nzAutocomplete: NzAutocompleteComponent;
    onChange: OnChangeType;
    onTouched: OnTouchedType;
    panelOpen: boolean;
    /** Current active option */
    get activeOption(): NzAutocompleteOptionComponent | null;
    private overlayRef;
    private portal;
    private positionStrategy;
    private previousValue;
    private selectionChangeSubscription;
    private optionsChangeSubscription;
    private overlayOutsideClickSubscription;
    constructor();
    ngAfterViewInit(): void;
    writeValue(value: NzSafeAny): void;
    registerOnChange(fn: (value: {}) => {}): void;
    registerOnTouched(fn: () => {}): void;
    setDisabledState(isDisabled: boolean): void;
    openPanel(): void;
    closePanel(): void;
    handleKeydown(event: KeyboardEvent): void;
    handleInput(event: KeyboardEvent): void;
    handleFocus(): void;
    handleClick(): void;
    handleBlur(): void;
    /**
     * Subscription data source changes event
     */
    private subscribeOptionsChange;
    /**
     * Subscription option changes event and set the value
     */
    private subscribeSelectionChange;
    private subscribeOverlayOutsideClick;
    private attachOverlay;
    private updateStatus;
    private destroyPanel;
    private getOverlayPosition;
    private getHostWidth;
    private resetActiveItem;
    private setValueAndClose;
    private setTriggerValue;
    private doBackfill;
    private canOpen;
    static ɵfac: i0.ɵɵFactoryDeclaration<NzAutocompleteTriggerDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<NzAutocompleteTriggerDirective, "input[nzAutocomplete], textarea[nzAutocomplete]", ["nzAutocompleteTrigger"], { "nzAutocomplete": { "alias": "nzAutocomplete"; "required": false; }; }, {}, never, never, true, never>;
}

declare class NzAutocompleteModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<NzAutocompleteModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<NzAutocompleteModule, never, [typeof NzAutocompleteComponent, typeof NzAutocompleteOptionComponent, typeof NzAutocompleteTriggerDirective, typeof NzAutocompleteOptgroupComponent], [typeof NzAutocompleteComponent, typeof NzAutocompleteOptionComponent, typeof NzAutocompleteTriggerDirective, typeof NzAutocompleteOptgroupComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<NzAutocompleteModule>;
}

export { NzAutocompleteComponent, NzAutocompleteModule, NzAutocompleteOptgroupComponent, NzAutocompleteOptionComponent, NzAutocompleteTriggerDirective, NzOptionSelectionChange };
export type { AutocompleteDataSource, AutocompleteDataSourceItem };
