SDK 公开面与文档覆盖

本页回答一个具体问题:这个平台导出的每个公开方法、事件、枚举与数据类型,在文档中心的哪一页被说明?页面由 SDK 制品公开面(api-surface 快照)与 IDL 绑定声明生成,逐项给出签名与文档位置;差异(多余/缺失的方法)如实标注,不做静默补齐。

口径

契约(IDL 语义操作)是语义权威:方法名、参数、返回、错误码、示例都以功能页为准。

制品快照用于确认该平台是否真的导出了该方法;快照与实现不一致时,页面标注差异而不是猜测。

本页只做索引与核对,不重复功能页的参数表与示例。

来源与口径​

项内容
制品公开面该平台未随包导出 api-surface 快照,改用 IDL 绑定声明
契约语义IDL 1.0.0 的 103 个语义操作 + 16 个事件
绑定签名来自 IDL 绑定声明的方法签名(各平台语言风格)
口径说明macOS 与 Electron 共用绑定(bindings.macos.inherits = electron):本页以 IDL 绑定声明(62 个语义操作 + 10 个 IMKit 组件)为准,mac 专属的构建 / 签名 / 公证 / 分发见 macOS 文档分区。

覆盖摘要​

类别数量文档承载位置
IDL 语义操作103功能页(每操作:说明 + 参数表 + 返回值 + 错误码 + 示例)
绑定便捷方法0—
事件16本页事件表 + 连接监听
枚举 / 常量14API 参考「枚举」各页
数据类型58API 参考「类」各页 + 方法参数/返回值表

公开方法索引​

下表逐项列出本平台导出的公开方法(IDL 语义操作在前,绑定便捷方法在后),并给出承载页面。功能页内的每个操作都有独立的参数表、返回值、错误码与可运行示例。

方法本平台签名 / 形态文档位置
initinit(options: IMClientOptions): IMClient建立连接
connectconnect(token: string, opts?: {kickOtherDevice?: boolean}): Promise<RcResult<{userId: string; sessionId?: string}>>建立连接
disconnectdisconnect(opts?: {closeDb?: boolean; disablePush?: boolean}): Promise<RcResult<null>>建立连接
getConnectionStatusgetConnectionStatus(): ConnectionStatus建立连接
getCurrentUserIdgetCurrentUserId(): string连接监听
addEventListeneraddEventListener(event: Events, handler: (payload: unknown) => void): () => void连接监听
removeEventListenerremoveEventListener(event: Events, handler: Function): void连接监听
sendMessagesendMessage(conversationType: ConversationType, targetId: string, content: MessageContent, options?: SendOptions): Promise<RcResult<Message>>发送消息
sendTextMessagesendTextMessage(conversationType: ConversationType, targetId: string, text: string, options?: SendOptions): Promise<RcResult<Message>>发送消息
sendImageMessagesendImageMessage(conversationType: ConversationType, targetId: string, content: {url: string; width?: number; height?: number; size?: number; localPath?: string}, options?: SendOptions): Promise<RcResult<Message>>发送消息
sendFileMessagesendFileMessage(conversationType: ConversationType, targetId: string, content: {url: string; name: string; size?: number; mime?: string; localPath?: string}, options?: SendOptions): Promise<RcResult<Message>>发送消息
sendVoiceMessagesendVoiceMessage(conversationType: ConversationType, targetId: string, content: {url: string; duration: number; localPath?: string}, options?: SendOptions): Promise<RcResult<Message>>发送消息
sendLocationMessagesendLocationMessage(conversationType: ConversationType, targetId: string, content: {latitude: number; longitude: number; address?: string}, options?: SendOptions): Promise<RcResult<Message>>发送消息
sendTypingStatussendTypingStatus(conversationType: ConversationType, targetId: string, typing: boolean): Promise<RcResult<null>>输入状态
recallMessagerecallMessage(messageId: string | number): Promise<RcResult<Message>>消息管理
sendReadReceiptsendReadReceipt(conversationType: ConversationType, targetId: string, messageIds: string[]): Promise<RcResult<{messageIds: string[]; readCounts?: Record<string, number>; totalMembers?: number}>>已读回执
getMessageReadCountgetMessageReadCount(messageId: string | number): Promise<RcResult<{messageId: string; readCount: number; totalMembers: number}>>已读回执
getMessageReadUsersgetMessageReadUsers(messageId: string | number, options?: {offset?: number; limit?: number}): Promise<RcResult<{messageId: string; readCount: number; totalMembers: number; readers: UserProfile[]}>>已读回执
getMessageReadDetailgetMessageReadDetail(messageId: string | number, options?: {offset?: number; limit?: number; filter?: string}): Promise<RcResult<{messageId: string; readCount: number; unreadCount: number; totalMembers: number; items: MessageReadDetailItem[]; hasMore: boolean}>>API 参考索引
searchMessagessearchMessages(options: {keyword: string; limit?: number; conversationType?: ConversationType; targetId?: string; range?: {start?: number; end?: number}}): Promise<RcResult<{messages: Message[]; total: number}>>消息管理
getConversationListgetConversationList(options?: {limit?: number; beforeTime?: number; topPriority?: boolean}): Promise<RcResult<Conversation[]>>会话列表
getConversationgetConversation(conversationType: ConversationType, targetId: string): Promise<RcResult<Conversation>>会话列表
getHistoryMessagesgetHistoryMessages(conversationType: ConversationType, targetId: string, options?: {limit?: number; beforeSeq?: number; beforeTime?: number; order?: 0 | 1; source?: 'local' | 'remote' | 'auto'}): Promise<RcResult<{messages: Message[]; hasMore: boolean}>>历史消息
clearUnreadCountclearUnreadCount(conversationType: ConversationType, targetId: string, options?: {untilTime?: number}): Promise<RcResult<null>>未读数
setConversationToTopsetConversationToTop(conversationType: ConversationType, targetId: string, isTop: boolean): Promise<RcResult<null>>置顶与免打扰
saveTextMessageDraftsaveTextMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<RcResult<null>>草稿
getTextMessageDraftgetTextMessageDraft(conversationType: ConversationType, targetId: string): Promise<RcResult<string>>草稿
clearTextMessageDraftclearTextMessageDraft(conversationType: ConversationType, targetId: string): Promise<RcResult<null>>草稿
setConversationNotificationLevelsetConversationNotificationLevel(conversationType: ConversationType, targetId: string, level: NotificationLevel): Promise<RcResult<null>>置顶与免打扰
getUserProfilegetUserProfile(userId: string): Promise<RcResult<UserProfile>>用户资料
updateMyUserProfileupdateMyUserProfile(profile: {name?: string; avatarUrl?: string}): Promise<RcResult<UserProfile>>用户资料
getOnlineStatusgetOnlineStatus(userId: string): Promise<RcResult<{userId: string; online: boolean; sessionCount: number}>>在线状态
getOnlineStatusBatchgetOnlineStatusBatch(userIds: string[]): Promise<RcResult<{items: Array<{userId: string; online: boolean; sessionCount: number}>}>>在线状态
searchUserssearchUsers(keyword: string, options?: {limit?: number}): Promise<RcResult<{users: Array<{userId: string; name: string; isFriend: boolean; blacklisted: boolean}>; total: number}>>好友列表
sendFriendRequestsendFriendRequest(toUserId: string, message?: string): Promise<RcResult<FriendRequest>>好友请求
getFriendRequestsgetFriendRequests(options?: {type?: 'incoming' | 'outgoing'; status?: 'pending' | 'all'}): Promise<RcResult<FriendRequest[]>>好友请求
acceptFriendRequestacceptFriendRequest(requestId: string): Promise<RcResult<FriendRequest>>好友请求
rejectFriendRequestrejectFriendRequest(requestId: string): Promise<RcResult<FriendRequest>>好友请求
getFriendsgetFriends(): Promise<RcResult<Array<{userId: string; name?: string; avatarUrl?: string; remark?: string; online?: boolean; blacklisted?: boolean}>>>好友列表
deleteFrienddeleteFriend(friendId: string): Promise<RcResult<null>>好友列表
setFriendRemarksetFriendRemark(friendId: string, remark: string): Promise<RcResult<null>>好友列表
getBlacklistgetBlacklist(): Promise<RcResult<Array<{userId: string; name?: string}>>>黑名单
addToBlacklistaddToBlacklist(userId: string): Promise<RcResult<null>>黑名单
removeFromBlacklistremoveFromBlacklist(userId: string): Promise<RcResult<null>>黑名单
createGroupcreateGroup(options: {groupId?: string; name: string; owner?: string; members?: string[]; groupType?: GroupType}): Promise<RcResult<Group>>创建群组
getGroupsInfogetGroupsInfo(groupIds: string[]): Promise<RcResult<Group[]>>创建群组
getGroupMembersgetGroupMembers(groupId: string): Promise<RcResult<GroupMember[]>>群成员
addGroupMembersaddGroupMembers(groupId: string, userIds: string[]): Promise<RcResult<{added: string[]; group: Group}>>群成员
removeGroupMembersremoveGroupMembers(groupId: string, userIds: string[]): Promise<RcResult<{removed: string[]}>>群成员
quitGroupquitGroup(groupId: string): Promise<RcResult<null>>群成员
updateGroupNameupdateGroupName(groupId: string, name: string): Promise<RcResult<Group>>群管理
updateGroupNoticeupdateGroupNotice(groupId: string, notice: string): Promise<RcResult<Group>>群管理
transferGroupOwnertransferGroupOwner(groupId: string, newOwner: string): Promise<RcResult<Group>>群管理
addGroupAdminaddGroupAdmin(groupId: string, userId: string): Promise<RcResult<Group>>群管理
removeGroupAdminremoveGroupAdmin(groupId: string, userId: string): Promise<RcResult<Group>>群管理
muteGroupMembermuteGroupMember(groupId: string, userId: string, mutedUntil: number): Promise<RcResult<{groupId: string; userId: string; mutedUntil: number; group: Group}>>群管理
createChatroomcreateChatroom(options: {chatroomId?: string; name: string; owner?: string}): Promise<RcResult<Chatroom>>加入与退出
joinChatroomjoinChatroom(chatroomId: string): Promise<RcResult<Chatroom>>加入与退出
leaveChatroomleaveChatroom(chatroomId: string): Promise<RcResult<null>>加入与退出
getChatroomInfogetChatroomInfo(chatroomId: string): Promise<RcResult<Chatroom>>聊天室信息
getChatroomMembersgetChatroomMembers(chatroomId: string, options?: {offset?: number; limit?: number}): Promise<RcResult<{members: ChatroomMember[]; total: number}>>聊天室信息
getSystemMessagesgetSystemMessages(options?: {limit?: number; beforeSeq?: number}): Promise<RcResult<{messages: Message[]; hasMore: boolean}>>系统通知
uploadFileuploadFile(data: Uint8Array | Blob | {path: string}, name: string, mime?: string, options?: {onProgress?: (percent: number) => void; signal?: AbortSignal}): Promise<RcResult<{url: string; name: string; size: number; mime: string; fullUrl?: string}>>文件上传
updateMessageExpansionupdateMessageExpansion(messageId: string, expansion: Record<string, string>): Promise<RcResult<MessageExpansion>>消息进阶
removeMessageExpansionremoveMessageExpansion(messageId: string, keys: string[]): Promise<RcResult<MessageExpansion>>消息进阶
addMessageReactionaddMessageReaction(params: UpdateMessageReactionParam): Promise<RcResult<MessageReaction>>消息进阶
removeMessageReactionremoveMessageReaction(params: UpdateMessageReactionParam): Promise<RcResult<{ messageId: string; reactionId: string; removed: boolean }>>消息进阶
batchGetMessageReactionSummariesbatchGetMessageReactionSummaries(params: MessageReactionSummaryQuery): Promise<RcResult<Record<string, MessageReactionSummary[]>>>消息进阶
getMessageReactionsgetMessageReactions(params: GetMessageReactionsParam): Promise<RcResult<MessageReactionPage>>消息进阶
getMessageReactionUsersgetMessageReactionUsers(params: GetMessageReactionUsersParam): Promise<RcResult<MessageReactionUserPage>>消息进阶
createConversationTagcreateConversationTag(params: CreateConversationTagParam): Promise<RcResult<ConversationTag>>会话标签与分组
updateConversationTagupdateConversationTag(tagId: string, tagName: string): Promise<RcResult<ConversationTag>>会话标签与分组
deleteConversationTagdeleteConversationTag(tagId: string): Promise<RcResult<null>>会话标签与分组
getConversationTagsgetConversationTags(): Promise<RcResult<ConversationTag[]>>会话标签与分组
addConversationsToTagaddConversationsToTag(tagId: string, conversations: ConversationRef[]): Promise<RcResult<ConversationTagMembershipResult>>会话标签与分组
removeConversationsFromTagremoveConversationsFromTag(tagId: string, conversations: ConversationRef[]): Promise<RcResult<ConversationTagMembershipResult>>会话标签与分组
getConversationsFromTagByPagegetConversationsFromTagByPage(tagId: string, options?: ConversationTagPageOptions): Promise<RcResult<ConversationTagPage>>会话标签与分组
getTagsFromConversationgetTagsFromConversation(conversationType: ConversationTypeValue, targetId: string): Promise<RcResult<ConversationTag[]>>会话标签与分组
getUnreadCountByTaggetUnreadCountByTag(tagId: string): Promise<RcResult<ConversationTagUnread>>会话标签与分组
setConversationToTopInTagsetConversationToTopInTag(tagId: string, conversationType: ConversationTypeValue, targetId: string, top: boolean): Promise<RcResult<null>>会话标签与分组
deleteConversationdeleteConversation(conversationType: ConversationTypeValue, targetId: string): Promise<RcResult<{ removed: boolean }>>会话删除与类型免打扰
getConversationTypeNotificationgetConversationTypeNotification(conversationType: ConversationTypeValue): Promise<RcResult<{ conversationType: number; level: number }>>会话删除与类型免打扰
setConversationTypeNotificationsetConversationTypeNotification(conversationType: ConversationTypeValue, level: 0 | 1 | 2): Promise<RcResult<{ conversationType: number; level: number }>>会话删除与类型免打扰
startStreamMessagestartStreamMessage(params: StartStreamMessageParams): Promise<RcResult<StreamMessage>>消息进阶
appendStreamMessageappendStreamMessage(streamId: string, delta: string, options?: AppendStreamMessageOptions): Promise<RcResult<StreamMessage>>消息进阶
completeStreamMessagecompleteStreamMessage(streamId: string): Promise<RcResult<{ messageId: string; text: string }>>消息进阶
getStreamMessagegetStreamMessage(streamId: string): Promise<RcResult<StreamMessage>>消息进阶
getMessageExpansiongetMessageExpansion(messageId: string | number): Promise<RcResult<MessageExpansion>>消息进阶
combineMessagescombineMessages(messages: Message[], options?: CombineMessagesOptions): Promise<RcResult<CombineContent>>消息进阶
subscribePresencesubscribePresence(userIds: string[]): Promise<RcResult<{subscribed: string[]}>>在线状态订阅与推送令牌
unsubscribePresenceunsubscribePresence(userIds: string[]): Promise<RcResult<{subscribed: string[]}>>在线状态订阅与推送令牌
getPresenceSubscriptionsgetPresenceSubscriptions(): Promise<RcResult<{userId: string, subscribed: string[]}>>在线状态订阅与推送令牌
registerPushTokenregisterPushToken(options: RegisterPushTokenOptions): Promise<RcResult<PushToken>>在线状态订阅与推送令牌
unregisterPushTokenunregisterPushToken(tokenId: string): Promise<RcResult<UnregisterPushTokenResult>>在线状态订阅与推送令牌
getPushTokensgetPushTokens(): Promise<RcResult<PushTokenListResult>>在线状态订阅与推送令牌
createSupergroupChannelcreateSupergroupChannel(params: CreateSupergroupChannelParams): Promise<RcResult<SupergroupChannel>>超级群频道与用户组
listSupergroupChannelslistSupergroupChannels(groupId: string): Promise<RcResult<SupergroupChannelListResult>>超级群频道与用户组
joinSupergroupChanneljoinSupergroupChannel(channelId: string, options?: SupergroupChannelOptions): Promise<RcResult<JoinSupergroupChannelResult>>超级群频道与用户组
leaveSupergroupChannelleaveSupergroupChannel(channelId: string, options?: SupergroupChannelOptions): Promise<RcResult<LeaveSupergroupChannelResult>>超级群频道与用户组
bindUserGroupToChannelbindUserGroupToChannel(channelId: string, userGroupId: string, options?: SupergroupChannelOptions): Promise<RcResult<BindUserGroupToChannelResult>>超级群频道与用户组
createUserGroupcreateUserGroup(params: CreateUserGroupParams): Promise<RcResult<UserGroup>>超级群频道与用户组
listUserGroupslistUserGroups(groupId: string): Promise<RcResult<UserGroupListResult>>超级群频道与用户组
getUserGroupsByUsergetUserGroupsByUser(userId: string, options?: SupergroupChannelOptions): Promise<RcResult<UserGroupListResult>>超级群频道与用户组

事件索引​

事件名在所有 GA 平台一致(Web 为小写下划线常量值,原生平台为枚举成员)。事件订阅方式见连接监听页;载荷字段来自 IDL 事件定义。

事件载荷本平台导出文档位置
CONNECTING{attempt:int}—API 参考 · 事件载荷
CONNECTED{userId:string, sessionId?:string}—API 参考 · 事件载荷
DISCONNECT{code:int, reason:string}—API 参考 · 事件载荷
SUSPEND{code:int, reason:string}—API 参考 · 事件载荷
MESSAGES{messages:Message[]}—API 参考 · 事件载荷
CONVERSATION{conversation:Conversation}—API 参考 · 事件载荷
MESSAGE_RECALLED{message:Message}—API 参考 · 事件载荷
READ_RECEIPTReadReceipt—API 参考 · 事件载荷
TYPING{conversationType:ConversationType,targetId:string,userId:string,typing:bool,timestamp:int64}—API 参考 · 事件载荷
MESSAGE_REACTION_CHANGED{messageId:string,conversationType:ConversationType,targetId:string,reactionId:string,operation:added|removed|cleared,userId:string,reactionTime:int64,totalCount:uint32,users:string[]?}—API 参考 · 事件载荷
MESSAGE_EXPANSION_CHANGED{messageId:string,conversationType:ConversationType,targetId:string,updated:Record<string,string>?,removed:string[]?,timestamp:int64}—API 参考 · 事件载荷
STREAM_MESSAGE_CHANGED{streamId:string,messageId:string,conversationType:ConversationType,targetId:string,senderId:string,delta:string,seq:uint32,text:string,status:streaming|ended,complete:bool,timestamp:int64}—API 参考 · 事件载荷
PRESENCE_CHANGED{userId:string,online:bool,lastSeenAt:int64,timestamp:int64,reason:connect|disconnect|kick|deactivate}—API 参考 · 事件载荷
FRIEND_EVENT{kind:FriendEventKind,request?:FriendRequest,fromUserId?:string,toUserId?:string,timestamp:int64}—API 参考 · 事件载荷
CHATROOM_EVENT{chatroomId:string,kind:ChatroomEventKind,userId?:string,onlineCount?:uint32,chatroom?:Chatroom,timestamp:int64}—API 参考 · 事件载荷
KICKED{code:int,reason:string}—API 参考 · 事件载荷

枚举与常量索引​

枚举取值在 API 参考的「枚举」页逐项列出(名称、取值、语义),错误码另有状态码页。

该平台未导出常量快照;枚举取值以 IDL 语义为准,见 API 参考「枚举」各页。

数据类型索引​

公开数据类型分两类:有独立页面的核心结构(消息、会话、群组、内容联合体等),以及只作为参数/返回结构出现的选项与结果对象(字段在对应方法的参数表与返回值中说明)。

随方法说明的类型​

ChannelType、CombineContent、Config、Content、ConversationRef、ConversationTag、ConversationTagConversation、Conversations、Count、Counts、CurrentUserReacted、GroupId、Groups、IMClient、Id、Ids、Inactive、Indexed、Info、JoinPolicy、Joined、MaxChars、Member、Members、MentionedInfo、MessageReadDetailItem、More、Ms、MsgId、Names、Policy、PushToken、Quote、ReactionSummary、Seq、StreamMessage、SupergroupChannel、Time、Token、Total、Type、Until、Url、UserGroup、Version

如何反馈差异​

  • 方法语义与签名:以 功能列表 与各功能页为准;
  • 错误码与重试:见 状态码;
  • 若发现“制品导出但文档未说明”或“文档说明但制品未导出”,请提交到文档反馈渠道,会按版本更新日志同步。