import React from 'react'; import type { CommandResponse, UserResponse } from 'open-chat-js'; import type { TriggerSettings } from '../MessageInput/DefaultTriggerProvider'; import type { CustomTrigger, DefaultStreamChatGenerics, UnknownType } from '../../types/types'; import { EmojiSearchIndex } from 'components/MessageInput'; type ObjectUnion = T[keyof T]; export type SuggestionCommand = CommandResponse; export type SuggestionUser = UserResponse; export type SuggestionItemProps = { className: string; component: React.ComponentType<{ entity: Awaited['search']>> | SuggestionUser | SuggestionCommand; selected: boolean; }>; item: Awaited['search']>> | SuggestionUser | SuggestionCommand; key: React.Key; onClickHandler: (event: React.BaseSyntheticEvent) => void; onSelectHandler: (item: Awaited['search']>> | SuggestionUser | SuggestionCommand) => void; selected: boolean; style: React.CSSProperties; value: string; }; export interface SuggestionHeaderProps { currentTrigger: string; value: string; } export type SuggestionListProps = ObjectUnion<{ [key in keyof TriggerSettings]: { component: TriggerSettings[key]['component']; currentTrigger: string; dropdownScroll: (element: HTMLDivElement) => void; getSelectedItem: ((item: Parameters[key]['output']>[0]) => void) | null; getTextToReplace: (item: Parameters[key]['output']>[0]) => { caretPosition: 'start' | 'end' | 'next' | number; text: string; key?: string; }; Header: React.ComponentType; onSelect: (newToken: { caretPosition: 'start' | 'end' | 'next' | number; text: string; }) => void; selectionEnd: number; SuggestionItem: React.ComponentType; values: Parameters[key]['dataProvider']>[2]>[0]; className?: string; itemClassName?: string; itemStyle?: React.CSSProperties; style?: React.CSSProperties; value?: string; }; }>; export type ChatAutoCompleteProps = { /** Function to override the default submit handler on the underlying `textarea` component */ handleSubmit?: (event: React.BaseSyntheticEvent) => void; /** Function to run on blur of the underlying `textarea` component */ onBlur?: React.FocusEventHandler; /** Function to override the default onChange behavior on the underlying `textarea` component */ onChange?: React.ChangeEventHandler; /** Function to run on focus of the underlying `textarea` component */ onFocus?: React.FocusEventHandler; /** Function to override the default onPaste behavior on the underlying `textarea` component */ onPaste?: (event: React.ClipboardEvent) => void; /** Placeholder for the underlying `textarea` component */ placeholder?: string; /** The initial number of rows for the underlying `textarea` component */ rows?: number; /** The text value of the underlying `textarea` component */ value?: string; /** Function to override the default emojiReplace behavior on the `wordReplace` prop of the `textarea` component */ wordReplace?: (word: string, emojiIndex?: EmojiSearchIndex) => string; }; export declare const ChatAutoComplete: (props: ChatAutoCompleteProps) => React.JSX.Element; export {}; //# sourceMappingURL=ChatAutoComplete.d.ts.map