import { SelectInputProps, Item as SelectItem } from './SelectInput.js'; import { InfoTableProps } from './Prompts/InfoTable.js'; import { InfoMessageProps } from './Prompts/InfoMessage.js'; import { Message } from './Prompts/PromptLayout.js'; import { AbortSignal } from '../../../../public/node/abort.js'; import React, { ReactElement } from 'react'; export interface SearchResults { data: SelectItem[]; meta?: { hasNextPage: boolean; }; } export interface AutocompletePromptProps { message: Message; choices: SelectInputProps['items']; onSubmit: (value: T) => void; infoTable?: InfoTableProps['table']; hasMorePages?: boolean; search: (term: string) => Promise>; abortSignal?: AbortSignal; infoMessage?: InfoMessageProps['message']; groupOrder?: string[]; /** * Throttle window in milliseconds applied to the search callback. Defaults to 400ms, * which is appropriate for remote/paginated backends. In-memory consumers (where the * search callback resolves synchronously) can pass 0 for instant filtering on every * keystroke. */ searchDebounceMs?: number; } declare function AutocompletePrompt({ message, choices, infoTable, onSubmit, search, hasMorePages: initialHasMorePages, abortSignal, infoMessage, groupOrder, searchDebounceMs, }: React.PropsWithChildren>): ReactElement | null; export { AutocompletePrompt };