import type { ReactElement, Ref, ReactNode } from 'react'; import React from 'react'; import { type Props as BaseProps } from '../Input'; import * as EmptyModule from './Empty'; import * as OptionsModule from './Option'; import * as PanelModule from './Panel'; import * as SuggestionsModule from './Suggestions'; import type { Subscribable, Suggestion } from './types'; type TSuggestion = Suggestion; export declare function SearchInput({ inputRef, getSuggestions, invalidateSuggestions, renderAddon, renderEmpty, renderSuggestion, renderSuggestions, query, onClear, onKeyDown, onSelect, ...attributes }: SearchInput.Props): React.JSX.Element; export declare namespace SearchInput { type Suggestion = TSuggestion; interface Props extends Omit { inputRef?: Ref; getSuggestions: (query: string) => Suggestion[] | Promise[]>; invalidateSuggestions?: Subscribable; onClear?: () => void; renderAddon?: () => ReactNode; renderEmpty?: (props: Props.Empty) => ReactElement | null; renderSuggestion?: (props: Props.Option) => ReactElement | null; renderSuggestions?: (props: Props.Suggestions) => ReactElement | null; query: string; onSelect: (suggestion: Suggestion) => void; } namespace Props { interface Empty { query: string; loading: boolean; onClose: () => void; } interface Option { ref: Ref; active: boolean; disabled: boolean; query: string; suggestion: Suggestion; onClose: () => void; onSelect: () => void; } interface Suggestions { children?: ReactNode; activeElement: HTMLElement | undefined; activeSuggestion: Suggestion | undefined; loading: boolean; origin: HTMLElement | null; query: string; suggestions: Suggestion[]; onClose: () => void; onSelect: (suggestion: Suggestion) => void; } } const Empty: typeof EmptyModule.Empty; const Option: typeof OptionsModule.Option; const Panel: React.ForwardRefExoticComponent>; const Suggestions: typeof SuggestionsModule.Suggestions; } export {};