import * as React from 'react'; import { TextFieldProps } from '../TextField'; import { InputChangeEvent, Omit } from '../../common'; export interface AutosuggestItem { key: string; content?: React.ReactChild; } export interface AutosuggestSelectEvent { value: T; } export interface AutocompleteInputProps { onChange(e: InputChangeEvent): void; clearable: boolean; inputRef?(instance: HTMLElement | null): void; value: string; error: any; [index: string]: any; } export interface AutocompleteProps extends TextFieldProps { /** * The optional message to show in case tehre are no suggestions to display. */ noSuggestionsMessage?: React.ReactChild; /** * The current value of the text field, leading to a controlled text field. */ suggestions?: Array; /** * How to render each suggestion in the InteractiveList */ renderSuggestion?(data: T): AutosuggestItem; /** * Event emitted every time suggestion is selected via mouse or keyboard. */ onSuggestionSelected?(e: AutosuggestSelectEvent): void; /** * Gets the suggestion value. */ getSuggestionValue?(item: T): string; /** * The renderer of input field. */ inputRenderer?(props: AutocompleteInputProps): JSX.Element; /** * Always `true` on Autocomplete components. * @ignore */ clearable?: boolean; /** * @ignore */ inputRef?(instance: HTMLElement | null): void; } export declare type SupportedAutocompleteProps = Omit, 'clearable'>; export interface AutocompleteState { controlled: boolean; listFocus: boolean; focus: boolean; open: boolean; value: string; error?: React.ReactChild; } /** * Extends a TextField with autocompletion capabilities. */ export declare const Autocomplete: React.SFC>;