import * as i0 from '@angular/core';
import { OnInit, WritableSignal, TemplateRef, EventEmitter } from '@angular/core';
import { MXSelectionValueComponent, AXDataSource, AXEvent, AXListDataSource } from '@acorex/cdk/common';

interface AXListScrollIndexChanged extends AXEvent {
    index: number;
}
/**
 * provides a list control with various input options and events for user interaction.
 *
 * @category Components
 */
declare class AXListComponent extends MXSelectionValueComponent implements OnInit {
    private tooltipRef;
    /**
     * Determines if an item is truncated.
     *
     * @defaultValue true
     */
    isItemTruncated: i0.InputSignal<boolean>;
    /**
     * Determines if a tooltip is shown for an item.
     *
     * @defaultValue false
     */
    showItemTooltip: i0.InputSignal<boolean>;
    /** @ignore */
    private _dataSource;
    /** @ignore */
    private _isInitialized;
    /** @ignore */
    private _onChangedSub?;
    /** @ignore */
    private _onLoadingChangedSub?;
    /**
     * Defines the data source for the list.
     *
     *  @defaultValue convertArrayToDataSource([])
     */
    set dataSource(v: AXDataSource<unknown>);
    get dataSource(): AXDataSource<unknown>;
    /**
     *  @ignore
     */
    itemHeightSignal: WritableSignal<number | 'auto'>;
    /**
     * Sets the height of each item in the list.
     */
    set itemHeight(v: number | 'auto');
    /**
     * Template for rendering individual items in the list.
     */
    itemTemplate: TemplateRef<unknown>;
    /**
     * Template to display when the list is empty.
     */
    emptyTemplate: TemplateRef<unknown>;
    /**
     * Template to show while the list is loading.
     */
    loadingTemplate: TemplateRef<unknown>;
    /**
     * Emitted when the index of the scrolled item changes.
     *
     * @event
     */
    onScrolledIndexChanged: EventEmitter<AXListScrollIndexChanged>;
    /**
     * Specifies whether the checkbox is enabled.
     *
     *  @defaultValue true
     */
    checkbox: boolean;
    /**
     *  @ignore
     */
    protected listDataSource: AXListDataSource<unknown>;
    /**
     *  @ignore
     */
    protected isLoading: WritableSignal<boolean>;
    /**
     *  @ignore
     */
    protected hasItems: boolean;
    /**
     *  @ignore
     */
    private lastIndex;
    /**
     *  @ignore
     */
    private postponeFocus;
    /**
     *  @ignore
     */
    private viewport;
    trackByIdx(i: any): any;
    /**
     *  @ignore
     */
    ngOnInit(): void;
    /**
     *  @ignore
     */
    protected ngOnDestroy(): void;
    /**
     * (Re)creates the internal `AXListDataSource` wrapper used by `cdkVirtualFor`
     * and (re)subscribes to the underlying source's events. This is invoked
     * whenever the `dataSource` input changes so that the list properly reflects
     * the new source.
     * @ignore
     */
    private _setupListDataSource;
    /**
     *  @ignore
     */
    _handleOnItemClick(e: MouseEvent, item: any): void;
    /**
     *  @ignore
     */
    _handleKeydown(e: KeyboardEvent): void;
    /**
     *  @ignore
     */
    private focusItemByNav;
    /**
     *  @ignore
     */
    protected _handleOnscrolledIndexChange(e: number): void;
    /**
     * Retrieves an item from the data source based on the provided key.
     *
     * @param key The key used to identify the item.
     * @ignore
     */
    getItemByKey(key: unknown): Promise<unknown> | unknown;
    /**
     * Renders the component by updating the viewport size, scrolling to the selected item, and optionally focusing the element.
     */
    render(): void;
    /**
     * Scrolls the viewport to the currently selected list item.
     */
    scrollTo(): void;
    /**
     * Resolves the selected item index from values already loaded in the list source.
     * Only considers loaded entries so lazy sources are not scanned by a global index.
     * @ignore
     */
    private resolveSelectedIndex;
    /**
     * @ignore
     */
    private getSelectedKey;
    /**
     * Refreshes the list by clearing the selection cache and reloading the data source.
     * @ignore
     */
    refresh(clearSelection?: boolean): void;
    /**
     * Scrolls the viewport to the specified item index.
     * @param index The index of the item to scroll to.
     * @ignore
     */
    scrollToIndex(index: number): void;
    /**
     * Sets focus to the first selectable list item. If no item is available, postpones focus.
     */
    focus(): void;
    /**
     * Determines whether to show the empty template based on the presence of items and loading state.
     * @ignore
     */
    showEmptyTemplate: i0.Signal<boolean>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXListComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXListComponent, "ax-list", never, { "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "textField": { "alias": "textField"; "required": false; }; "textTemplate": { "alias": "textTemplate"; "required": false; }; "disabledField": { "alias": "disabledField"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "selectionMode": { "alias": "selectionMode"; "required": false; }; "isItemTruncated": { "alias": "isItemTruncated"; "required": false; "isSignal": true; }; "showItemTooltip": { "alias": "showItemTooltip"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; }; "itemHeight": { "alias": "itemHeight"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; }; "loadingTemplate": { "alias": "loadingTemplate"; "required": false; }; "checkbox": { "alias": "checkbox"; "required": false; }; }, { "onValueChanged": "onValueChanged"; "disabledChange": "disabledChange"; "readonlyChange": "readonlyChange"; "onBlur": "onBlur"; "onFocus": "onFocus"; "onItemClick": "onItemClick"; "onItemSelected": "onItemSelected"; "onScrolledIndexChanged": "onScrolledIndexChanged"; }, never, ["ax-header", "ax-footer"], true, never>;
}

declare class AXListModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXListModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXListModule, never, [typeof AXListComponent], [typeof AXListComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXListModule>;
}

export { AXListComponent, AXListModule };
export type { AXListScrollIndexChanged };
