import { TElement } from "@udecode/slate"; import { Action, Dispatch } from "redux"; import * as ConversationState from "./ConversationState"; /** * @typedef {object} MessageState * @property {string} inputText="" Text of the message * @property {number} selectionStart=0 Start index of the cursor selection * @property {number} selectionEnd=0 End index of the cursor selection * @property {Array} [attachedFiles] Files attached to the message * @memberof AppState */ export interface MessageState { inputText: string; selectionStart: number; selectionEnd: number; attachedFiles?: Array; isReplyModeActive?: boolean; } /** * @private * @property {Descendant[]} [htmlValue] Array of HTML nodes */ export interface EmailState extends MessageState { htmlValue?: TElement[]; } /** * @typedef {object} ChatState.ChatChannelInputState * @property {MessageState} sid Message state for a sid * @memberof AppState */ export interface ConversationInputState { [sid: string]: Readonly; } export interface ChatChannelInputAction extends Action { payload?: any; meta: { conversationSid: string; }; } export declare const ACTION_UPDATE_CONVERSATION_INPUT = "CONVERSATION_INPUT_UPDATE"; export declare const ACTION_ATTACH_CONVERSATION_FILES = "CONVERSATION_FILES_ATTACH"; export declare const ACTION_DETACH_CONVERSATION_FILES = "CONVERSATION_FILES_DETACH"; export declare const ACTION_TOGGLE_REPLY_MODE = "TOGGLE_REPLY_MODE"; export declare function reduce(state: ConversationInputState, action: ChatChannelInputAction): ConversationInputState; export declare class Actions { private static _dispatcher; static get dispatcher(): Dispatch; static set dispatcher(dispatcher: Dispatch); static setInputText(conversation: ConversationState.ConversationState, body: string, selectionStart?: number, selectionEnd?: number, htmlValue?: any[]): void; static attachFiles(conversation: ConversationState.ConversationState, files: File[]): void; static detachFile(conversation: ConversationState.ConversationState, file: File): void; static toggleReplyStateActivation(conversation: ConversationState.ConversationState, activate: boolean): void; }