UNPKG

@ant-design/x-sdk

Version:

placeholder for @ant-design/x-sdk

21 lines (20 loc) 881 B
import { AnyObject } from '../_util/type'; export interface ConversationData extends AnyObject { key: string; } interface XConversationConfig { defaultConversations?: ConversationData[]; defaultActiveConversationKey?: string; } export default function useXConversations(config: XConversationConfig): { conversations: ConversationData[]; activeConversationKey: string; setActiveConversationKey: (key: string) => boolean; addConversation: (conversation: ConversationData, placement?: "prepend" | "append" | undefined) => boolean; removeConversation: (key: string) => boolean; setConversation: (key: string, conversation: ConversationData) => boolean; getConversation: (key: string) => ConversationData | undefined; setConversations: (list: ConversationData[]) => boolean; getMessages: (key: string) => any[] | undefined; }; export {};