import BaseFoundation, { DefaultAdapter } from '../base/foundation';
interface KeyboardAdapter
, S = Record> extends DefaultAdapter {
registerKeyDown: (callback: (event: any) => void) => void;
unregisterKeyDown: (callback: (event: any) => void) => void;
updateFocusIndex: (focusIndex: number) => void;
notifyKeyDown: (e: any) => void;
}
export interface DataItem {
[x: string]: any;
value?: string | number;
label?: any;
}
export interface StateOptionItem extends DataItem {
show?: boolean;
key?: string | number;
}
export type AutoCompleteData = Array;
export interface AutoCompleteAdapter, S = Record> extends KeyboardAdapter {
getTriggerWidth: () => number | undefined;
setOptionWrapperWidth: (width: number) => void;
updateInputValue: (inputValue: string | number) => void;
toggleListVisible: (isShow: boolean) => void;
updateOptionList: (optionList: Array) => void;
updateScrollTop: (index: number) => void;
updateSelection: (selection: Map) => void;
notifySearch: (inputValue: string) => void;
notifyChange: (value: string | number) => void;
notifySelect: (option: StateOptionItem | string | number) => void;
notifyDropdownVisibleChange: (isVisible: boolean) => void;
notifyClear: () => void;
notifyFocus: (event?: any) => void;
notifyBlur: (event?: any) => void;
rePositionDropdown: () => void;
persistEvent: (event: any) => void;
registerClickOutsideHandler: (cb: (e: any) => void) => void;
unregisterClickOutsideHandler: () => void;
}
declare class AutoCompleteFoundation, S = Record> extends BaseFoundation, P, S> {
private _keydownHandler;
constructor(adapter: AutoCompleteAdapter);
isPanelOpen: boolean;
init(): void;
destroy(): void;
_setDropdownWidth(): void;
handleInputClick(e?: MouseEvent): void;
openDropdown(): void;
closeDropdown(e?: any): void;
_generateList(data: AutoCompleteData): Array;
handleSearch(inputValue: string): void;
handleSelect(option: StateOptionItem, optionIndex?: number): void;
updateSelection(option: StateOptionItem): void;
notifySelect(option: StateOptionItem): void;
_backwardLabelInValue(): any;
handleDataChange(newData: any[]): void;
handleValueChange(propValue: any): void;
_modifyFocusIndex(searchValue: any): void;
_modifyFocusIndexOnPanelOpen(): void;
_getRenderSelectedItem(): any;
handleClear(): void;
bindKeyBoardEvent(): void;
_handleKeyDown(event: KeyboardEvent): void;
_getEnableFocusIndex(offset: number): void;
_handleArrowKeyDown(offset: number): void;
_handleEnterKeyDown(): void;
handleOptionMouseEnter(optionIndex: number): void;
handleFocus(e: FocusEvent): void;
handleBlur(e: any): void;
}
export default AutoCompleteFoundation;