import React from 'react'; import { FileUpload, ImageUpload } from './hooks/useMessageInputState'; import { OneChatMessage } from '../../context/ChannelStateContext'; import type { SearchQueryParams } from '../ChannelSearch/hooks/useChannelSearch'; import type { MessageToSend } from '../../context/ChannelActionContext'; import type { Channel, CustomTrigger, DefaultOneChatGenerics, Message, SendFileAPIResponse } from '../../types'; export declare type MessageInputProps = { /** Additional props to be passed to the underlying `AutoCompleteTextarea` component, [available props](https://www.npmjs.com/package/react-textarea-autosize) */ additionalTextareaProps?: React.TextareaHTMLAttributes; /** Function to clear the editing state while editing a message */ clearEditingState?: () => void; /** If true, picking an emoji from the `EmojiPicker` component will close the picker */ closeEmojiPickerOnClick?: boolean; /** If true, disables the text input */ disabled?: boolean; /** If true, the suggestion list will not display and autocomplete @mentions. Default: false. */ disableMentions?: boolean; /** Function to override the default file upload request */ doFileUploadRequest?: (file: FileUpload['file'], channel: Channel) => Promise; /** Function to override the default image upload request */ doImageUploadRequest?: (file: ImageUpload['file'], channel: Channel) => Promise; /** Custom error handler function to be called with a file/image upload fails */ errorHandler?: (error: Error, type: string, file: (FileUpload | ImageUpload)['file'] & { id?: string; }) => void; /** If true, focuses the text input on component mount */ focus?: boolean; /** Generates the default value for the underlying textarea element. The function's return value takes precedence before additionalTextareaProps.defaultValue. */ getDefaultValue?: () => string | string[]; /** If true, expands the text input vertically for new lines */ grow?: boolean; /** If true, enable voice input. Default: false */ voice?: boolean; /** Max duration in seconds of the voice input. */ maxVoiceDuration?: number; /** Custom UI component handling how the message input is rendered, defaults to and accepts the same props as [MessageInputFlat](https://github.com/botaas/aibot-uikit/blob/master/src/components/MessageInput/MessageInputFlat.tsx) */ Input?: React.ComponentType>; /** Max number of rows the underlying `textarea` component is allowed to grow */ maxRows?: number; /** If true, the suggestion list will search all app users for an @mention, not just current channel members/watchers. Default: false. */ mentionAllAppUsers?: boolean; /** Object containing filters/sort/options overrides for an @mention user query */ mentionQueryParams?: SearchQueryParams['userFilters']; /** If provided, the existing message will be edited on submit */ message?: OneChatMessage; /** If true, disables file uploads for all attachments except for those with type 'image'. Default: false */ noFiles?: boolean; /** Function to override the default submit handler */ overrideSubmitHandler?: (message: MessageToSend, channelCid: string, customMessageData?: Partial>) => Promise | void; /** When replying in a thread, the parent message object */ parent?: OneChatMessage; /** If true, triggers typing events on text input keystroke */ publishTypingEvent?: boolean; /** * Currently, `Enter` is the default submission key and `Shift`+`Enter` is the default combination for the new line. * If specified, this function overrides the default behavior specified previously. * * Example of default behaviour: * ```tsx * const defaultShouldSubmit = (event) => event.key === "Enter" && !event.shiftKey; * ``` */ shouldSubmit?: (event: KeyboardEvent) => boolean; useMentionsTransliteration?: boolean; }; /** * A high level component that has provides all functionality to the Input it renders. */ export declare const MessageInput: (props: MessageInputProps) => JSX.Element; //# sourceMappingURL=MessageInput.d.ts.map