import { ConversationItem, MessageItem } from "@droppii-org/wasm-client-sdk"; import { ChatCategory, PeerType, type ConversationExtra } from "../types/conversation"; export declare const parseConversationExtra: (ex: string | undefined) => ConversationExtra; export declare const resolveConversationChatCategory: (item: ConversationItem) => ChatCategory; export declare const resolveConversationBotId: (item: ConversationItem) => string; type SupportSessionSource = { conversationID?: string; conversationType?: number; ex?: string; } | null; export declare const BOT_SESSION_CONVERSATION_PREFIX = "sg_bot_"; export declare const resolveSupportSessionOwnerId: (item?: SupportSessionSource) => string; /** * True when the viewer handles a support session someone else owns (e.g. a * PDP CS agent). The owner — BIZ/Mall/Obefe customer — keeps the bot view. */ export declare const isSupportSessionAgentView: (item: SupportSessionSource | undefined, viewerUserID?: string) => boolean; type SessionOwnerProfile = { fullName?: string | null; username?: string | null; avatar?: string | null; } | null; /** * An agent sees a bot thread as its session owner, "fullName (username)"; * the owner themself, or a missing profile, keeps the bot view (null). */ export declare const resolveBotSessionOwnerIdentity: (item: (NonNullable & { peerType?: string; }) | null | undefined, owner: SessionOwnerProfile | undefined, viewerUserID?: string) => { displayName: string; avatarUrl?: string; } | null; export declare const isBotPeer: (item: ConversationItem) => boolean; export declare const isCustomerPeer: (item: ConversationItem) => boolean; export declare const isGroupChat: (item: ConversationItem) => boolean; export declare const resolveConversationDisplayName: (item: ConversationItem, t: (key: string) => string) => string; export declare const resolveConversationAvatarUrl: (item: ConversationItem) => string | null; export declare const resolvePeerBadgeLabel: (peerType: PeerType, t: (key: string) => string) => string; export declare const resolvePeerBadgeColor: (peerType: PeerType) => "" | "bg-[var(--dc-color-mall-badge)]" | "bg-[var(--dc-color-bot-badge)]"; /** * Group conversationIds are formatted as "sg_" — derive the groupID * straight from the id when a full ConversationItem isn't available yet (e.g. * a non-member previewing a public group via deeplink has no synced * conversation object to read groupID off of). * * Returns "" for anything else, including 1:1 ids ("si__"): * those have no group, so callers must treat "" as "not a group", never as * "group unknown". */ export declare const getGroupIdFromConversationId: (conversationId?: string) => string; export declare const getConversationIdFromMessage: (message: MessageItem) => string; /** * Pulls the OTHER participant out of a 1:1 conversation id * ("si__"), which is what getOneConversation wants as its * sourceID — passing the viewer's own id would resolve a thread with * themselves. The id does not record which side is which, so the peer is * whichever half is not selfUserId. * * Returns "" when the id is not a 1:1 id, is malformed, or when neither half * matches selfUserId — guessing a peer there would open the wrong thread. */ export declare const getPeerUserIdFromConversationId: (conversationId?: string, selfUserId?: string) => string; export {}; //# sourceMappingURL=conversation.d.ts.map