import ChatSession from '../classes/chat-session'; import type { StoreConfig, Action, ThunkArgs } from '../../utils/store-types'; import { Content, Part, ChatConfigOptions, StartChatOptions } from '../types'; export declare enum ActionType { Unknown = "REDUX_UNKNOWN", ReceiveChat = "RECEIVE_CHAT", ReceiveContent = "RECEIVE_CONTENT", RevertContent = "REVERT_CONTENT", LoadChatStart = "LOAD_CHAT_START", LoadChatFinish = "LOAD_CHAT_FINISH" } type UnknownAction = Action; type ReceiveChatAction = Action; type ReceiveContentAction = Action; type RevertContentAction = Action; type LoadChatStartAction = Action; type LoadChatFinishAction = Action; export type CombinedAction = UnknownAction | ReceiveChatAction | ReceiveContentAction | RevertContentAction | LoadChatStartAction | LoadChatFinishAction; export type State = { chatConfigs: Record; chatHistories: Record; chatsLoading: Record; }; export type ActionCreators = typeof actions; export type Selectors = typeof selectors; type DispatcherArgs = ThunkArgs; declare const actions: { /** * Starts a chat session. * * @since 0.1.0 * * @param chatId - Identifier to use for the chat. * @param options - Chat options. * @returns Action creator. */ startChat(chatId: string, options: StartChatOptions): ({ dispatch, registry }: DispatcherArgs) => Promise; /** * Sends a message to the chat. * * @since 0.1.0 * * @param chatId - Identifier of the chat. * @param content - Chat message content. * @returns Action creator. */ sendMessage(chatId: string, content: string | Part[] | Content): ({ dispatch }: DispatcherArgs) => Promise; /** * Sends a message to the chat, streaming the response. * * @since 0.3.0 * * @param chatId - Identifier of the chat. * @param content - Chat message content. * @returns Action creator. */ streamSendMessage(chatId: string, content: string | Part[] | Content): ({ dispatch }: DispatcherArgs) => Promise>; /** * Receives a chat session. * * @since 0.1.0 * * @param chatId - Identifier to use for the chat. * @param session - Chat session. * @param options - Chat options. * @returns Action creator. */ receiveChat(chatId: string, session: ChatSession, options: StartChatOptions): ({ dispatch }: DispatcherArgs) => void; /** * Receives new content to append to a chat. * * @since 0.1.0 * * @param chatId - Identifier of the chat. * @param content - Chat content. * @returns Action creator. */ receiveContent(chatId: string, content: Content): { type: ActionType; payload: { chatId: string; content: Content; }; }; /** * Reverts the last content from a chat. * This is useful for undoing the last message sent. * * @since 0.1.0 * * @param chatId - Identifier of the chat. * @returns Action creator. */ revertContent(chatId: string): { type: ActionType; payload: { chatId: string; }; }; }; declare const selectors: { hasChat: (state: State, chatId: string) => boolean; getChat: (state: State, chatId: string) => Content[]; getChatConfig: (state: State, chatId: string) => ChatConfigOptions | null; isChatLoading: (state: State, chatId: string) => boolean; }; declare const storeConfig: StoreConfig; export default storeConfig; //# sourceMappingURL=chat.d.ts.map