import { AtUsersInfoItem, FileMsgParamsByURL, ImageMsgParamsByURL, MessageType, Platform, SelfUserInfo, VideoMsgParamsByURL } from "@droppii-org/wasm-client-sdk"; export type DChatPlatform = Platform; import { UploadFile } from "antd"; import type { RenderCustomMessage } from "./customMessage"; import type { ICannedMedia } from "./dto"; export declare enum DChatApplicationType { OBEFE = "OBEFE", DROPPII = "DROPPII", MALL = "MALL" } export declare enum ConnectStatus { Disconnected = 0, Connected = 1, Connecting = 2 } export declare enum SyncStatus { Loading = 0, Success = 1, Failed = 2 } export declare enum CustomType { CallingInvite = 200, CallingAccept = 201, CallingReject = 202, CallingCancel = 203, CallingHungup = 204 } export declare enum UrlContentType { URL = 160 } export type DChatMessageType = UrlContentType | MessageType; export declare enum AccountType { Collaborator = "Collaborator", NewAgent = "NewAgent", StandardAgent = "StandardAgent", Staff = "Staff", Trial = "Trial", Customer = "Customer" } export interface GroupAccessModalRenderProps { open: boolean; title: React.ReactNode; message: React.ReactNode; okText: React.ReactNode; onOk: () => void; } export interface ChatContextType { user: SelfUserInfo | null; connectStatus: ConnectStatus; syncStatus: SyncStatus; getSelfUserInfo: () => void; updateConnectStatus: (status: ConnectStatus) => void; updateSyncStatus: (status: SyncStatus) => void; renderCustomMessage?: RenderCustomMessage; onNavigate?: (url: string) => void; useUrlState?: boolean; allowPinMessageWithoutPermission?: boolean; renderGroupAccessModal?: (props: GroupAccessModalRenderProps) => React.ReactNode; } export interface DChatTheme { primary?: string; primaryHover?: string; primaryLight?: string; primaryFocus?: string; botBadge?: string; mallBadge?: string; headerIcon?: string; navIcon?: string; link?: string; composerBg?: string; composerBorder?: string; composerBorderFocus?: string; bubbleMine?: string; bubbleMineText?: string; bubbleOther?: string; bubbleOtherText?: string; highlight?: string; highlightText?: string; highlightWeight?: string; neutralSurface?: string; messageFontSize?: string; messageLineHeight?: string; } export interface CannedMediaPayload { images?: ICannedMedia[]; files?: ICannedMedia[]; } export interface CannedCreateRequest { visibilityScope: "TEAM" | "PRIVATE"; teamId?: string; onCreated?: (content: string, media?: CannedMediaPayload) => void; } export interface ChatProviderProps { children: React.ReactNode; config: DChatInitAndLoginConfig | null; renderCustomMessage?: RenderCustomMessage; onNavigate?: (url: string) => void; useUrlState?: boolean; allowPinMessageWithoutPermission?: boolean; renderGroupAccessModal?: (props: GroupAccessModalRenderProps) => React.ReactNode; theme?: DChatTheme; } export interface UrlMetadataInfo { title?: string; description?: string; image?: string; } export interface BotFlowMeta { groupId: string; childId: string | null; actionId: string | null; } export interface ExtendMessageInfo { messageInfo?: { type: "MESSAGE_INFO"; data: { type: "rich_text"; content: string; }; }; urlMetadata?: UrlMetadataInfo; flow?: BotFlowMeta; sessionId: string; applicationType: DChatApplicationType; mentions?: { offsets: MentionOffset[]; }; stickerId?: string; } export type MentionOffset = { userID: string; offset: number; length: number; }; export type MentionSendPayload = { atUserIDList: string[]; atUsersInfo: AtUsersInfoItem[]; isAtAll: boolean; mentionOffsets: MentionOffset[]; }; export interface MessageFooterContextType { onSendMessage: ({ plainText, richText, type, isInternal, mentions, }: { plainText: string; richText: string; type: "text" | "file"; isInternal: boolean; mentions?: MentionSendPayload; }) => boolean; isInternal: boolean; setIsInternal: (isInternal: boolean) => void; listUploadFiles: UploadFile[]; setListUploadFiles: (files: UploadFile[] | ((prev: UploadFile[]) => UploadFile[])) => void; isOpenCanned: boolean; setIsOpenCanned: (open: boolean) => void; activeCannedIndex: number | null; setActiveCannedIndex: (index: number | null) => void; maxActiveCannedIndex: number; setMaxActiveCannedIndex: (index: number) => void; isMentionMenuOpen: boolean; setIsMentionMenuOpen: (open: boolean) => void; } export interface ImageMsgParamsByFile extends ImageMsgParamsByURL { file: File; } export interface VideoMsgParamsByFile extends VideoMsgParamsByURL { videoFile: File; snapshotFile: File; } export interface FileMsgParamsByFile extends FileMsgParamsByURL { file: File; } export interface ExtendConversationInfo { applicationType?: DChatApplicationType; sessionInfo?: { type: "SESSION_INFO"; data: { ownerId: string; botId: string; }; }; } export interface ExtendPublicUserInfo { userInfo?: { type: "USER_INFO"; data: { username?: string; type?: "USER_INFO"; accountType?: AccountType; }; }; } export interface DChatInitAndLoginConfig { platformID: Platform; apiAddr: string; wsAddr: string; accessToken: string; userID: string; applicationType: DChatApplicationType; isCrm?: boolean; /** * Callback to refresh access token when 401 detected. * Consumer app should call refresh token API and return new accessToken. * If not provided, 401s will trigger authFailed event. */ onTokenRefresh?: () => Promise; /** * Callback when authentication fails (e.g., refresh token expired). * Consumer should handle logout and redirect. */ onAuthError?: (error: Error) => void; } export declare enum SessionStatus { UNASSIGNED = "UNASSIGNED", WAITING_PROCESS = "WAITING_PROCESS", IN_PROCESS = "IN_PROCESS", COMPLETED = "COMPLETED" } export declare enum SessionTag { NONE = "NONE", SLOW_PROCESSING = "SLOW_PROCESSING", AWAITING_REPLY = "AWAITING_REPLY", TEMPORARILY_PAUSED = "TEMPORARILY_PAUSED" } export declare enum BusinessNotificationType { SESSION_STATE_UPDATED = "SESSION_STATE_UPDATED", SESSION_CLOSED = "SESSION_CLOSED", SESSION_CREATED = "SESSION_CREATED", BOT_UPDATED = "BOT_UPDATED" } export declare enum CannedResponseVisibleScope { TEAM = "TEAM", PRIVATE = "PRIVATE" } //# sourceMappingURL=chat.d.ts.map