@uimkit/uikit-react
Version:
<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>
46 lines (43 loc) • 1.96 kB
TypeScript
import React__default, { RefObject, PropsWithChildren } from 'react';
import { ChatConfigWithInfo } from '../types/index.js';
import { UIMessageProps } from '../components/UIMessage/UIMessage.js';
import { OperateMessageParams } from '../components/UIChat/hooks/useHandleMessage.js';
import { UIMessageInputBasicProps } from '../components/UIMessageInput/UIMessageInput.js';
import { UIMessageListProps } from '../components/UIMessageList/UIMessageList.js';
import { Message, GroupMember, Conversation } from '../types/models.js';
type ChatState = {
messages: Message[];
hasMore: boolean;
loadingMore: boolean;
hasMoreNewer: boolean;
loadingMoreNewer: boolean;
/** 禁止自动滚动 */
suppressAutoscroll?: boolean;
/** 高亮消息的 ID */
highlightedMessageId?: string;
/** 群成员列表, 会话是群类型时会用到 */
members?: GroupMember[];
};
type ChatStateContextValue = ChatState & {
conversation?: Conversation;
chatConfig?: ChatConfigWithInfo | undefined;
init?: boolean;
lastMessageID?: string;
isSameLastMessageID?: boolean;
messageListRef?: RefObject<HTMLDivElement>;
operateData?: OperateMessageParams;
messageConfig?: UIMessageProps;
cloudCustomData?: string;
UIMessageInputConfig?: UIMessageInputBasicProps;
audioSource?: HTMLAudioElement;
vidoeSource?: HTMLVideoElement;
UIMessageListConfig?: UIMessageListProps;
uploadPenddingMessageList?: Array<Message>;
};
declare const ChatStateContext: React__default.Context<ChatStateContextValue>;
declare function ChatStateContextProvider({ children, value }: PropsWithChildren<{
value: ChatStateContextValue;
}>): React__default.ReactElement;
declare function useChatStateContext(componentName?: string): ChatStateContextValue;
export { ChatState, ChatStateContext, ChatStateContextProvider, ChatStateContextValue, useChatStateContext };
//# sourceMappingURL=ChatStateContext.d.ts.map