import PropTypes from 'prop-types'; import React, { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent, SyntheticEvent } from 'react'; import { noop } from '../utils'; import type { Option, RefElement, SelectEvent, TypeaheadProps, TypeaheadState } from '../types'; declare type Props = TypeaheadProps; export declare function getInitialState(props: Props): TypeaheadState; export declare function clearTypeahead(state: TypeaheadState, props: Props): { isFocused: boolean; selected: never[]; text: string; activeIndex: number; activeItem?: Option | undefined; initialItem?: Option | undefined; showMenu: boolean; shownResults: number; }; export declare function clickOrFocusInput(state: TypeaheadState): { isFocused: boolean; showMenu: boolean; activeIndex: number; activeItem?: Option | undefined; initialItem?: Option | undefined; selected: Option[]; shownResults: number; text: string; }; export declare function hideMenu(state: TypeaheadState, props: Props): { activeIndex: number; activeItem: Option | undefined; initialItem: Option | undefined; showMenu: boolean; shownResults: number; isFocused: boolean; selected: Option[]; text: string; }; export declare function toggleMenu(state: TypeaheadState, props: Props): { showMenu: boolean; activeIndex: number; activeItem?: Option | undefined; initialItem?: Option | undefined; isFocused: boolean; selected: Option[]; shownResults: number; text: string; }; declare class Typeahead extends React.Component { static propTypes: { allowNew: PropTypes.Requireable any)>; autoFocus: PropTypes.Requireable; caseSensitive: (props: TypeaheadProps, propName: keyof TypeaheadProps, componentName: string) => void; defaultInputValue: (props: TypeaheadProps, propName: keyof TypeaheadProps, componentName: string) => void; defaultOpen: PropTypes.Requireable; defaultSelected: (props: TypeaheadProps, propName: keyof TypeaheadProps, componentName: string) => void; filterBy: PropTypes.Requireable any)>; highlightOnlyResult: (props: TypeaheadProps, propName: keyof TypeaheadProps, componentName: string) => void; id: (props: TypeaheadProps, propName: keyof TypeaheadProps, componentName: string) => void; ignoreDiacritics: (props: TypeaheadProps, propName: keyof TypeaheadProps, componentName: string) => void; labelKey: (props: TypeaheadProps, propName: keyof TypeaheadProps, componentName: string) => void; maxResults: PropTypes.Requireable; minLength: PropTypes.Requireable; multiple: PropTypes.Requireable; onBlur: PropTypes.Requireable<(...args: any[]) => any>; onChange: PropTypes.Requireable<(...args: any[]) => any>; onFocus: PropTypes.Requireable<(...args: any[]) => any>; onInputChange: PropTypes.Requireable<(...args: any[]) => any>; onKeyDown: PropTypes.Requireable<(...args: any[]) => any>; onMenuToggle: PropTypes.Requireable<(...args: any[]) => any>; onPaginate: PropTypes.Requireable<(...args: any[]) => any>; open: PropTypes.Requireable; options: PropTypes.Validator<(string | object | null | undefined)[]>; paginate: PropTypes.Requireable; selected: (props: TypeaheadProps, propName: keyof TypeaheadProps, componentName: string) => void; }; static defaultProps: { allowNew: boolean; autoFocus: boolean; caseSensitive: boolean; defaultInputValue: string; defaultOpen: boolean; defaultSelected: never[]; filterBy: never[]; highlightOnlyResult: boolean; ignoreDiacritics: boolean; labelKey: string; maxResults: number; minLength: number; multiple: boolean; onBlur: typeof noop; onFocus: typeof noop; onInputChange: typeof noop; onKeyDown: typeof noop; onMenuToggle: typeof noop; onPaginate: typeof noop; paginate: boolean; }; state: TypeaheadState; inputNode: RefElement; isMenuShown: boolean; items: Option[]; componentDidMount(): void; componentDidUpdate(prevProps: Props, prevState: TypeaheadState): void; render(): JSX.Element; blur: () => void; clear: () => void; focus: () => void; getInput: () => RefElement; inputRef: (inputNode: RefElement) => void; setItem: (item: Option, position: number) => void; hideMenu: () => void; toggleMenu: () => void; _handleActiveIndexChange: (activeIndex: number) => void; _handleActiveItemChange: (activeItem: Option) => void; _handleBlur: (e: FocusEvent) => void; _handleChange: (selected: Option[]) => void; _handleClear: () => void; _handleClick: (e: MouseEvent) => void; _handleFocus: (e: SyntheticEvent) => void; _handleInitialItemChange: (initialItem?: Option | undefined) => void; _handleInputChange: (e: ChangeEvent) => void; _handleKeyDown: (e: KeyboardEvent) => void; _handleMenuItemSelect: (option: Option, e: SelectEvent) => void; _handlePaginate: (e: SelectEvent) => void; _handleSelectionAdd: (option: Option) => void; _handleSelectionRemove: (selection: Option) => void; } export default Typeahead;