UNPKG

easemob-chat-uikit

Version:

![Static Badge](https://img.shields.io/badge/platform-React-green) ![Static Badge](https://img.shields.io/badge/language-typescript-green) ![GitHub commit activity](https://img.shields.io/github/commit-activity/y/easemob/Easemob-UIKit-web) ![GitHub last c

93 lines (92 loc) 2.72 kB
import React, { ReactNode } from 'react'; import { HeaderProps } from '../header'; import { MessageInputProps } from '../messageInput'; import { MsgListProps } from './MessageList'; import { CurrentConversation } from 'module/store/ConversationStore'; import { ChatSDK } from 'module/SDK'; export interface RtcRoomInfo { callId: string; calleeDevId?: string; calleeIMName: string; callerDevId?: string; callerIMName: string; channel: string; confrName: string; groupId: string; groupName: string; token?: string; type: number; joinedMembers: { agoraUid: number; imUserId: string; }[]; } export interface ChatProps { prefix?: string; className?: string; style?: React.CSSProperties; renderHeader?: (cvs: { chatType: 'singleChat' | 'groupChat'; conversationId: string; name?: string; unreadCount?: number; }) => ReactNode; renderMessageList?: () => ReactNode; renderMessageInput?: () => ReactNode; renderEmpty?: () => ReactNode; renderRepliedMessage?: (repliedMessage: ChatSDK.MessageBody | null) => ReactNode; headerProps?: Omit<HeaderProps, 'suffixIcon'> & { suffixIcon?: ('PIN' | 'THREAD' | 'AUDIO' | 'VIDEO' | ReactNode)[]; }; messageListProps?: MsgListProps; messageInputProps?: MessageInputProps; rtcConfig?: { appId: string; agoraUid: string | number; onInvite?: (data: { channel: string; conversation: CurrentConversation; type: 'audio' | 'video'; }) => Promise<[{ name: string; id: string; avatarurl?: string; }]>; onAddPerson?: (data: RtcRoomInfo) => Promise<[{ id: string; }]>; getIdMap?: (data: { userId: string; channel: string; }) => Promise<{ [key: string]: string; }>; onStateChange?: (data: { type: string; confr: any; }) => void; getRTCToken?: (data: { channel: number | string; chatUserId: string; }) => Promise<{ agoraUid: string | number; accessToken: string; }>; groupAvatar?: string; onRing?: (data: { channel: string; }) => void; }; onOpenThread?: (data: { id: string; }) => void; onOpenThreadList?: () => void; onVideoCall?: (data: { channel: string; }) => void; onAudioCall?: (data: { channel: string; }) => void; } declare let Chat: React.ForwardRefExoticComponent<ChatProps & React.RefAttributes<unknown>>; export { Chat };