import type { InlineDataPart } from '@ai-services/ai/types'; import type { StoreConfig, Action, ThunkArgs } from '../../utils/store-types'; import type { AiPlaygroundMessage, AiPlaygroundMessageAdditionalData, WordPressAttachment } from '../types'; export declare enum ActionType { Unknown = "REDUX_UNKNOWN", ReceiveMessage = "RECEIVE_MESSAGE", ReceiveMessagesFromCache = "RECEIVE_MESSAGES_FROM_CACHE", ResetMessages = "RESET_MESSAGES", SetActiveMessage = "SET_ACTIVE_MESSAGE", SetMessageAttachment = "SET_MESSAGE_ATTACHMENT", LoadStart = "LOAD_START", LoadFinish = "LOAD_FINISH" } type UnknownAction = Action; type ReceiveMessageAction = Action; type ReceiveMessagesFromCacheAction = Action; type ResetMessagesAction = Action; type SetActiveMessageAction = Action; type SetMessageAttachmentAction = Action; type LoadStartAction = Action; type LoadFinishAction = Action; export type CombinedAction = UnknownAction | ReceiveMessageAction | ReceiveMessagesFromCacheAction | ResetMessagesAction | SetActiveMessageAction | SetMessageAttachmentAction | LoadStartAction | LoadFinishAction; export type State = { messages: AiPlaygroundMessage[] | undefined; loading: boolean; activeMessage: AiPlaygroundMessage | null; }; export type ActionCreators = typeof actions; export type Selectors = typeof selectors; type DispatcherArgs = ThunkArgs; declare const actions: { /** * Sends a message. * * @since 0.4.0 * @since 0.6.0 Now expects an array of attachments instead of a single attachment. * * @param prompt - Message prompt. * @param attachments - Optional array of attachment objects. * @param includeHistory - Whether to include the message history before the prompt. Default false. * @returns Action creator. */ sendMessage(prompt: string, attachments?: WordPressAttachment[], includeHistory?: boolean): ({ registry, dispatch, select }: DispatcherArgs) => Promise; /** * Uploads inline data of a specific message to the media library. * * @since 0.5.0 * * @param index - The index of the message. * @param partIndex - The index of the part within the message. * @param inlineData - The inline data object. * @returns Action creator. */ uploadAttachment(index: number, partIndex: number, inlineData: InlineDataPart["inlineData"]): ({ dispatch, registry, select }: DispatcherArgs) => Promise; /** * Receives new content to append to the list of messages. * * @since 0.4.0 * * @param type - Message type. Either 'user', 'model', or 'error'. * @param content - Message content. * @param additionalData - Additional data to include with the message. * @returns Action creator. */ receiveMessage(type: AiPlaygroundMessage["type"], content: AiPlaygroundMessage["content"], additionalData?: AiPlaygroundMessageAdditionalData): ({ dispatch }: DispatcherArgs) => void; /** * Receives messages from cache to restore the session. * * @since 0.4.0 * * @param messages - Messages to restore. * @returns Action creator. */ receiveMessagesFromCache(messages: AiPlaygroundMessage[]): ({ dispatch }: DispatcherArgs) => void; /** * Resets all messages, effectively deleting them to start a new session. * * @since 0.4.0 * * @returns Action creator. */ resetMessages(): ({ dispatch }: DispatcherArgs) => void; /** * Sets the active message (to display a modal for it). * * @since 0.6.0 * * @param message - Message to display. * @returns Action creator. */ setActiveMessage(message: AiPlaygroundMessage): ({ dispatch }: DispatcherArgs) => void; /** * Sets the attachment for a message. * * @since 0.5.0 * * @param index - The index of the message. * @param partIndex - The index of the part within the message. * @param attachment - The attachment object. * @returns Action creator. */ setMessageAttachment(index: number, partIndex: number, attachment: WordPressAttachment): ({ dispatch }: DispatcherArgs) => void; }; declare const selectors: { getMessages: (state: State) => AiPlaygroundMessage[]; isLoading: (state: State) => boolean; getActiveMessage: (state: State) => AiPlaygroundMessage | null; }; declare const storeConfig: StoreConfig; export default storeConfig; //# sourceMappingURL=messages.d.ts.map