import * as _angular_core from '@angular/core';
import { OnInit, OnDestroy, AfterViewInit, ElementRef, TemplateRef, EventEmitter } from '@angular/core';
import { FormGroup, FormControl, FormGroupDirective, NgForm } from '@angular/forms';
import { MatAutocompleteTrigger } from '@angular/material/autocomplete';
import { ErrorStateMatcher } from '@angular/material/core';
import { MatFormFieldAppearance } from '@angular/material/form-field';
import { SdItemDefDefDirective, SdViewDefDirective } from '@sdcorejs/angular/forms/directives';
import { SdSearch, SdViewed, SdViewedInput, SdCustomValidator, SdSelectionData, SdFormControl } from '@sdcorejs/angular/forms/models';
import { Size } from '@sdcorejs/utils/models';

declare class SdAutocompleteErrotStateMatcher implements ErrorStateMatcher {
    private formControl;
    constructor(formControl: FormControl);
    isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean;
}
declare class SdAutocomplete<T = any> implements OnInit, OnDestroy, AfterViewInit {
    #private;
    id: string;
    inputRef: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
    autocompleteTrigger: _angular_core.Signal<MatAutocompleteTrigger | undefined>;
    sdLabelTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
    sdValueTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
    itemDef: _angular_core.Signal<SdItemDefDefDirective<any> | undefined>;
    sdViewDef: _angular_core.Signal<SdViewDefDirective<any, any> | undefined>;
    private ref;
    private formConfig;
    autoIdInput: _angular_core.InputSignal<string | null | undefined>;
    autoId: _angular_core.Signal<string | undefined>;
    readonly dataDisabled: _angular_core.Signal<"true" | "false">;
    readonly dataInvalid: _angular_core.Signal<"true" | "false">;
    readonly dataEmpty: _angular_core.Signal<"true" | "false">;
    readonly dataValue: _angular_core.Signal<string>;
    readonly dataLoading: _angular_core.Signal<"true" | "false">;
    readonly dataRequired: _angular_core.Signal<"true" | "false">;
    readonly dataErrorMessage: _angular_core.Signal<string | null>;
    name: _angular_core.InputSignal<string>;
    size: _angular_core.InputSignal<Size>;
    form: _angular_core.InputSignalWithTransform<FormGroup<any> | undefined, any>;
    label: _angular_core.InputSignal<string | undefined>;
    helperText: _angular_core.InputSignal<string | undefined>;
    placeholder: _angular_core.InputSignal<string | undefined>;
    valueField: _angular_core.InputSignal<string | undefined>;
    displayField: _angular_core.InputSignal<string | undefined>;
    disabledField: _angular_core.InputSignal<string>;
    limit: _angular_core.InputSignal<number>;
    cacheChecksum: _angular_core.InputSignal<any>;
    hyperlink: _angular_core.InputSignal<string | null | undefined>;
    items: _angular_core.InputSignal<SdSearch<T> | T[] | null | undefined>;
    hideInlineError: _angular_core.InputSignalWithTransform<boolean, unknown>;
    addable: _angular_core.InputSignalWithTransform<boolean, unknown>;
    required: _angular_core.InputSignalWithTransform<boolean, unknown>;
    disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /** Display mode: `false` edit · `true` static view · `'inline'` view + click-to-edit (autocomplete panel). */
    viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
    /** In `viewed='inline'`, show a hover clear-× on the text face. Set `false` when the host owns removal (chips). */
    clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /** `true` when `viewed === 'inline'`. */
    readonly isInline: _angular_core.Signal<boolean>;
    /** `true` when `viewed === true` (static view, no editor). */
    readonly isViewed: _angular_core.Signal<boolean>;
    /** Open the autocomplete panel from the inline text face. No-op unless `viewed='inline'`. */
    enterInlineEdit: () => void;
    /** View display template: `sdViewDef` overrides the projected `#sdValue` (unified). */
    readonly viewTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
    validator: _angular_core.InputSignal<SdCustomValidator | undefined>;
    inlineError: _angular_core.InputSignal<string | undefined>;
    /**
     * Tổng hợp error message để hiển thị trong tooltip khi hideInlineError = true.
     */
    readonly errorMessage: _angular_core.Signal<string | undefined>;
    appearanceInput: _angular_core.InputSignal<MatFormFieldAppearance | undefined>;
    appearance: _angular_core.Signal<MatFormFieldAppearance>;
    valueModel: _angular_core.ModelSignal<string | number | null | undefined>;
    sdChange: _angular_core.OutputEmitterRef<string | number | null>;
    sdSelection: _angular_core.OutputEmitterRef<SdSelectionData<any>>;
    sdAdd: EventEmitter<void>;
    loading: _angular_core.WritableSignal<boolean>;
    isFocused: boolean;
    isTyping: _angular_core.WritableSignal<boolean>;
    inputControl: SdFormControl;
    formControl: SdFormControl;
    matcher: SdAutocompleteErrotStateMatcher;
    filteredItems: _angular_core.WritableSignal<any[]>;
    selected: _angular_core.WritableSignal<any>;
    display: _angular_core.WritableSignal<string>;
    controlPlaceHolder: _angular_core.WritableSignal<string>;
    normalizedValue: _angular_core.Signal<string | number | null | undefined>;
    getNestedValue: (obj: any, path: string | undefined) => any;
    constructor();
    ngOnInit(): void;
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    onSelect: (item: T) => void;
    onFocus: () => void;
    onBlur: () => void;
    onClick: () => void;
    blur: () => void;
    focus: () => void;
    /** Open the autocomplete panel programmatically (anchors to the field input). Used by inline mode. */
    open: () => void;
    clear: ($event?: any) => void;
    onAdd: ($event: Event) => void;
    reValidate: () => void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdAutocomplete<any>, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdAutocomplete<any>, "sd-autocomplete", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "valueField": { "alias": "valueField"; "required": false; "isSignal": true; }; "displayField": { "alias": "displayField"; "required": false; "isSignal": true; }; "disabledField": { "alias": "disabledField"; "required": false; "isSignal": true; }; "limit": { "alias": "limit"; "required": false; "isSignal": true; }; "cacheChecksum": { "alias": "cacheChecksum"; "required": false; "isSignal": true; }; "hyperlink": { "alias": "hyperlink"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "addable": { "alias": "addable"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "validator": { "alias": "validator"; "required": false; "isSignal": true; }; "inlineError": { "alias": "inlineError"; "required": false; "isSignal": true; }; "appearanceInput": { "alias": "appearance"; "required": false; "isSignal": true; }; "valueModel": { "alias": "model"; "required": false; "isSignal": true; }; }, { "valueModel": "modelChange"; "sdChange": "sdChange"; "sdSelection": "sdSelection"; "sdAdd": "sdAdd"; }, ["sdLabelTemplate", "sdValueTemplate", "itemDef", "sdViewDef"], ["[sdLabel]"], true, never>;
}

export { SdAutocomplete };
