UNPKG

@uimkit/uikit-react

Version:

<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>

75 lines (72 loc) 3.49 kB
import React__default from 'react'; import { TriggerSettings } from '../UIMessageInput/DefaultTriggerProvider.js'; type ObjectUnion<T> = T[keyof T]; type SuggestionCommand = any; type SuggestionUser = any; type SuggestionItemProps = { className: string; component: React__default.ComponentType<{ entity: any | SuggestionUser | SuggestionCommand; selected: boolean; }>; item: any | SuggestionUser | SuggestionCommand; key: React__default.Key; onClickHandler: (event: React__default.BaseSyntheticEvent) => void; onSelectHandler: (item: any | SuggestionUser | SuggestionCommand) => void; selected: boolean; style: React__default.CSSProperties; value: string; }; interface SuggestionHeaderProps { currentTrigger: string; value: string; } type SuggestionListProps = ObjectUnion<{ [key in keyof TriggerSettings]: { component: TriggerSettings[key]['component']; currentTrigger: string; dropdownScroll: (element: HTMLDivElement) => void; getSelectedItem: ((item: Parameters<TriggerSettings[key]['output']>[0]) => void) | null; getTextToReplace: (item: Parameters<TriggerSettings[key]['output']>[0]) => { caretPosition: 'start' | 'end' | 'next' | number; text: string; key?: string; }; Header: React__default.ComponentType<SuggestionHeaderProps>; onSelect: (newToken: { caretPosition: 'start' | 'end' | 'next' | number; text: string; }) => void; selectionEnd: number; SuggestionItem: React__default.ComponentType<SuggestionItemProps>; values: Parameters<Parameters<TriggerSettings[key]['dataProvider']>[2]>[0]; className?: string; itemClassName?: string; itemStyle?: React__default.CSSProperties; style?: React__default.CSSProperties; value?: string; }; }>; type UIChatAutoCompleteProps = { /** Function to override the default submit handler on the underlying `textarea` component */ handleSubmit?: (event: React__default.BaseSyntheticEvent) => void; /** Function to run on blur of the underlying `textarea` component */ onBlur?: React__default.FocusEventHandler<HTMLTextAreaElement>; /** Function to override the default onChange behavior on the underlying `textarea` component */ onChange?: React__default.ChangeEventHandler<HTMLTextAreaElement>; /** Function to run on focus of the underlying `textarea` component */ onFocus?: React__default.FocusEventHandler<HTMLTextAreaElement>; /** Function to override the default onPaste behavior on the underlying `textarea` component */ onPaste?: (event: React__default.ClipboardEvent<HTMLTextAreaElement>) => 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) => string; }; declare const UIChatAutoComplete: (props: UIChatAutoCompleteProps) => JSX.Element; export { SuggestionCommand, SuggestionHeaderProps, SuggestionItemProps, SuggestionListProps, SuggestionUser, UIChatAutoComplete, UIChatAutoCompleteProps }; //# sourceMappingURL=UIChatAutoComplete.d.ts.map