import React from 'react'; import type { FileLike } from '../../ReactFileUtilities'; import type { Attachment, Message, UserResponse } from 'open-chat-js'; import type { MessageInputProps } from '../MessageInput'; import type { CustomTrigger, DefaultStreamChatGenerics, SendMessageOptions } from '../../../types/types'; import { EnrichURLsController } from './useLinkPreviews'; import type { FileUpload, ImageUpload, LinkPreviewMap } from '../types'; import { SetLinkPreviewMode } from '../types'; export type MessageInputState = { attachments: Attachment[]; fileOrder: string[]; fileUploads: Record; imageOrder: string[]; imageUploads: Record; linkPreviews: LinkPreviewMap; mentioned_users: UserResponse[]; setText: (text: string) => void; text: string; }; type SetTextAction = { getNewText: (currentStateText: string) => string; type: 'setText'; }; type ClearAction = { type: 'clear'; }; type SetImageUploadAction = { id: string; type: 'setImageUpload'; file?: File | FileLike; previewUri?: string; state?: string; url?: string; }; type SetFileUploadAction = { id: string; type: 'setFileUpload'; file?: File; state?: string; thumb_url?: string; url?: string; }; type SetLinkPreviewsAction = { linkPreviews: LinkPreviewMap; mode: SetLinkPreviewMode; type: 'setLinkPreviews'; }; type RemoveImageUploadAction = { id: string; type: 'removeImageUpload'; }; type RemoveFileUploadAction = { id: string; type: 'removeFileUpload'; }; type AddMentionedUserAction = { type: 'addMentionedUser'; user: UserResponse; }; export type MessageInputReducerAction = SetTextAction | ClearAction | SetImageUploadAction | SetFileUploadAction | SetLinkPreviewsAction | RemoveImageUploadAction | RemoveFileUploadAction | AddMentionedUserAction; export type MessageInputHookProps = EnrichURLsController & { handleChange: React.ChangeEventHandler; handleSubmit: (event: React.BaseSyntheticEvent, customMessageData?: Partial>, options?: SendMessageOptions) => void; insertText: (textToInsert: string) => void; isUploadEnabled: boolean; maxFilesLeft: number; numberOfUploads: number; onPaste: (event: React.ClipboardEvent) => void; onSelectUser: (item: UserResponse) => void; removeFile: (id: string) => void; removeImage: (id: string) => void; textareaRef: React.MutableRefObject; uploadFile: (id: string) => void; uploadImage: (id: string) => void; uploadNewFiles: (files: FileList | File[]) => void; }; export type CommandsListState = { closeCommandsList: () => void; openCommandsList: () => void; showCommandsList: boolean; }; export type MentionsListState = { closeMentionsList: () => void; openMentionsList: () => void; showMentionsList: boolean; }; /** * hook for MessageInput state */ export declare const useMessageInputState: (props: MessageInputProps) => MessageInputState & EnrichURLsController & { handleChange: React.ChangeEventHandler; handleSubmit: (event: React.BaseSyntheticEvent, customMessageData?: Partial> | undefined, options?: SendMessageOptions) => void; insertText: (textToInsert: string) => void; isUploadEnabled: boolean; maxFilesLeft: number; numberOfUploads: number; onPaste: (event: React.ClipboardEvent) => void; onSelectUser: (item: UserResponse) => void; removeFile: (id: string) => void; removeImage: (id: string) => void; textareaRef: React.MutableRefObject; uploadFile: (id: string) => void; uploadImage: (id: string) => void; uploadNewFiles: (files: FileList | File[]) => void; } & CommandsListState & MentionsListState; export {}; //# sourceMappingURL=useMessageInputState.d.ts.map