import { IEventEmitter, IEventDetail } from '@breadstone/mosaik-elements';
import type { CustomElement } from '../Components/Abstracts/CustomElement';
import { AutoCompleteTextSearchMode } from '../Types/AutoCompleteTextSearchMode';
import type { ControlBehaviorBase, ControlBehaviorReturn } from './Abstracts/Behavior';
/**
 * Represents the events of the {@link AutoCompletable} mixin.
 *
 * @public
 */
export interface IAutoCompletableEvents {
    populating: IEventEmitter<IAutoCompletePopulatingEventDetail>;
    populated: IEventEmitter<IAutoCompletePopulatedEventDetail>;
}
/**
 * Represents the {@link IAutoCompletable} interface.
 *
 * @public
 */
export interface IAutoCompletable {
    filteredItems: Array<unknown>;
    isPopulating: boolean;
    onFilterCallback?(items: Array<unknown>): void;
    onSelectCallback?(item: unknown): void;
    getDisplayValue(item: unknown): string;
    updateSearchText(searchText: string): void;
    updateSelectedItem(item: unknown): void;
}
/**
 * Describes the detail payload for the populating event.
 *
 * @public
 */
export interface IAutoCompletePopulatingEventDetail extends IEventDetail {
    searchText: string;
    requestId: number;
    signal: AbortSignal;
}
/**
 * Describes the detail payload for the populated event.
 *
 * @public
 */
export interface IAutoCompletePopulatedEventDetail extends IEventDetail {
    searchText: string;
    items: Array<unknown>;
    requestId: number;
}
/**
 * Describes the context passed to asynchronous suggestion providers.
 *
 * @public
 */
export interface IAutoCompleteItemsRequestContext {
    readonly searchText: string;
    readonly requestId: number;
    readonly signal: AbortSignal;
}
/**
 * Represents a delegate that resolves suggestion items.
 *
 * @public
 */
export type AutoCompleteItemsProvider = (context: IAutoCompleteItemsRequestContext) => Array<unknown> | Promise<Array<unknown>>;
/**
 * Represents the {@link IAutoCompleteableProps} interface.
 *
 * @public
 */
export interface IAutoCompleteableProps {
    minimumPrefixLength: number;
    minimumPopulateDelay: number;
    isTextCompletionEnabled: boolean;
    searchMode: AutoCompleteTextSearchMode;
    displayMemberPath: string;
    items: Array<unknown>;
    itemsProvider: AutoCompleteItemsProvider | null;
}
/**
 * @public
 */
export declare const AutoCompleteable: <T extends ControlBehaviorBase<CustomElement>>(base: T) => ControlBehaviorReturn<T, IAutoCompleteableProps & IAutoCompletableEvents & IAutoCompletable>;
declare global {
    interface HTMLElementEventMap {
        populating: CustomEvent<IAutoCompletePopulatingEventDetail>;
        populated: CustomEvent<IAutoCompletePopulatedEventDetail>;
    }
}
//# sourceMappingURL=AutoCompleteable.d.ts.map