@openim/client-sdk
Version:
JavaScript/TypeScript Client SDK for OpenIM
311 lines (310 loc) • 9.09 kB
TypeScript
import { CbEvents } from '../constant/callback';
export type AppPlatform = 'unknow' | 'web' | 'uni' | 'wx' | 'my';
export declare enum ErrorCode {
NetworkError = 10000,
NetworkTimeoutError = 10001,
ArgsError = 10002,// Invalid input parameters
CtxDeadlineExceededError = 10003,// Context deadline exceeded
ResourceLoadNotCompleteError = 10004,// Resource initialization incomplete
UnknownCode = 10005,// Unrecognized code
SdkInternalError = 10006,// SDK internal error
NoUpdateError = 10007,// No updates available
UserIDNotFoundError = 10100,// UserID not found or not registered
LoginOutError = 10101,// User has logged out
LoginRepeatError = 10102,// User logged in repeatedly
FileNotFoundError = 10200,// Record not found
MsgDeCompressionError = 10201,// Message decompression failed
MsgDecodeBinaryWsError = 10202,// Message decoding failed
MsgBinaryTypeNotSupportError = 10203,// Message type not supported
MsgRepeatError = 10204,// Message repeated
MsgContentTypeNotSupportError = 10205,// Message content type not supported
MsgHasNoSeqError = 10206,// Message does not have a sequence number
NotSupportOptError = 10301,// Operation not supported
NotSupportTypeError = 10302,// Type not supported
UnreadCountError = 10303,// Unread count is zero
GroupIDNotFoundError = 10400,// GroupID not found
GroupTypeErr = 10401
}
export declare enum ReqIdentifier {
GetNewestSeq = 1001,
PullMsgByRange = 1002,
SendMsg = 1003,
SendSignalMsg = 1004,
PullMsgBySeqList = 1005,
GetConvMaxReadSeq = 1006,
PushMsg = 2001,
KickOnlineMsg = 2002,
LogoutMsg = 2003,
SetBackgroundStatus = 2004,
WsSubUserOnlineStatus = 2005,
WSServerConfigMsg = 2100,
WSDataError = 3001
}
export declare enum InternalContentType {
Text = 101,
Picture = 102,
Sound = 103,
Video = 104,
File = 105,
AtText = 106,
Merger = 107,
Card = 108,
Location = 109,
Custom = 110,
Typing = 113,
Quote = 114,
Face = 115,
AdvancedText = 117,
CustomMsgNotTriggerConversation = 119,
CustomMsgOnlineOnly = 120,
ReactionMessageModifier = 121,
ReactionMessageDeleter = 122
}
export declare enum NotificationType {
NotificationBegin = 1000,
FriendNotificationBegin = 1200,
FriendApplicationApprovedNotification = 1201,// add_friend_response
FriendApplicationRejectedNotification = 1202,// add_friend_response
FriendApplicationNotification = 1203,// add_friend
FriendAddedNotification = 1204,
FriendDeletedNotification = 1205,// delete_friend
FriendRemarkSetNotification = 1206,// set_friend_remark?
BlackAddedNotification = 1207,// add_black
BlackDeletedNotification = 1208,// remove_black
FriendInfoUpdatedNotification = 1209,
FriendsInfoUpdateNotification = 1210,
FriendNotificationEnd = 1299,
ConversationChangeNotification = 1300,
UserNotificationBegin = 1301,
UserInfoUpdatedNotification = 1303,// SetSelfInfoTip = 204
UserStatusChangeNotification = 1304,
UserCommandAddNotification = 1305,
UserCommandDeleteNotification = 1306,
UserCommandUpdateNotification = 1307,
UserNotificationEnd = 1399,
OANotification = 1400,
GroupNotificationBegin = 1500,
GroupCreatedNotification = 1501,
GroupInfoSetNotification = 1502,
JoinGroupApplicationNotification = 1503,
MemberQuitNotification = 1504,
GroupApplicationAcceptedNotification = 1505,
GroupApplicationRejectedNotification = 1506,
GroupOwnerTransferredNotification = 1507,
MemberKickedNotification = 1508,
MemberInvitedNotification = 1509,
MemberEnterNotification = 1510,
GroupDismissedNotification = 1511,
GroupMemberMutedNotification = 1512,
GroupMemberCancelMutedNotification = 1513,
GroupMutedNotification = 1514,
GroupCancelMutedNotification = 1515,
GroupMemberInfoSetNotification = 1516,
GroupMemberSetToAdminNotification = 1517,
GroupMemberSetToOrdinaryUserNotification = 1518,
GroupInfoSetAnnouncementNotification = 1519,
GroupInfoSetNameNotification = 1520,
GroupNotificationEnd = 1599,
SignalingNotificationBegin = 1600,
SignalingNotification = 1601,
RoomParticipantsConnectedNotification = 1602,
RoomParticipantsDisconnectedNotification = 1603,
StreamChangedNotification = 1604,
CustomSignalNotification = 1605,
SignalingNotificationEnd = 1649,
SuperGroupNotificationBegin = 1650,
SuperGroupUpdateNotification = 1651,
MsgDeleteNotification = 1652,
ReactionMessageModifierNotification = 1653,
ReactionMessageDeleteNotification = 1654,
SuperGroupNotificationEnd = 1699,
ConversationPrivateChatNotification = 1701,
ConversationUnreadNotification = 1702,
ClearConversationNotification = 1703,
WorkMomentNotificationBegin = 1900,
WorkMomentNotification = 1901,
BusinessNotificationBegin = 2000,
BusinessNotification = 2001,
BusinessNotificationEnd = 2099,
RevokeNotification = 2101,
HasReadReceiptNotification = 2150,
GroupHasReadReceiptNotification = 2155,
DeleteMsgsNotification = 2102,
HasReadReceipt = 2200,
HasGroupReadReceipt = 2300,
NotificationEnd = 5000
}
export declare enum MsgFrom {
UserMsgType = 100,
SysMsgType = 200
}
export declare enum InternalMessageStatus {
MsgStatusDefault = 0,
MsgStatusSending = 1,
MsgStatusSendSuccess = 2,
MsgStatusSendFailed = 3,
MsgStatusHasDeleted = 4,
MsgStatusFiltered = 5
}
export declare enum MessageOptionsKey {
IsHistory = "history",
IsPersistent = "persistent",
IsUnreadCount = "unreadCount",
IsConversationUpdate = "conversationUpdate",
IsOfflinePush = "offlinePush",
IsSenderSync = "senderSync",
IsNotPrivate = "notPrivate",
IsSenderConversationUpdate = "senderConversationUpdate"
}
export declare enum GroupStatus {
GroupOk = 0,
GroupBanChat = 1,
GroupStatusDismissed = 2,
GroupStatusMuted = 3
}
export declare enum WorkMomentSdkNotificationType {
WorkMomentCommentNotification = 0,
WorkMomentLikeNotification = 1,
WorkMomentAtUserNotification = 2
}
export declare enum WsErrorCode {
TokenExpiredError = 1501,
TokenInvalidError = 1502,
TokenMalformedError = 1503,
TokenNotValidYetError = 1504,
TokenUnknownError = 1505,
TokenKickedError = 1506,
TokenNotExistError = 1507
}
export declare const WsErrorEventMap: Record<number, CbEvents | undefined>;
export declare enum MessageReceiveOptType {
Nomal = 0,
NotReceive = 1,
NotNotify = 2
}
export declare enum AllowType {
Allowed = 0,
NotAllowed = 1
}
export declare enum GroupType {
Group = 2,
WorkingGroup = 2
}
export declare enum GroupJoinSource {
Invitation = 2,
Search = 3,
QrCode = 4
}
export declare enum GroupMemberRole {
Nomal = 20,
Admin = 60,
Owner = 100
}
export declare enum GroupVerificationType {
ApplyNeedInviteNot = 0,
AllNeed = 1,
AllNot = 2
}
export declare enum MessageStatus {
Sending = 1,
Succeed = 2,
Failed = 3
}
export declare enum Platform {
iOS = 1,
Android = 2,
Windows = 3,
MacOSX = 4,
Web = 5,
Linux = 7,
AndroidPad = 8,
iPad = 9
}
export declare enum LogLevel {
Silent = 5,
Error = 4,
Warn = 3,
Info = 2,
Debug = 1,
Trace = 0
}
export declare enum ApplicationHandleResult {
Unprocessed = 0,
Agree = 1,
Reject = -1
}
export declare enum MessageType {
TextMessage = 101,
PictureMessage = 102,
VoiceMessage = 103,
VideoMessage = 104,
FileMessage = 105,
AtTextMessage = 106,
MergeMessage = 107,
CardMessage = 108,
LocationMessage = 109,
CustomMessage = 110,
TypingMessage = 113,
QuoteMessage = 114,
FaceMessage = 115,
FriendAdded = 1201,
OANotification = 1400,
GroupCreated = 1501,
MemberQuit = 1504,
GroupOwnerTransferred = 1507,
MemberKicked = 1508,
MemberInvited = 1509,
MemberEnter = 1510,
GroupDismissed = 1511,
GroupMemberMuted = 1512,
GroupMemberCancelMuted = 1513,
GroupMuted = 1514,
GroupCancelMuted = 1515,
GroupAnnouncementUpdated = 1519,
GroupNameUpdated = 1520,
BurnMessageChange = 1701,
RevokeMessage = 2101
}
export declare enum SessionType {
Single = 1,
Group = 3,
Notification = 4
}
export declare enum GroupStatus {
Nomal = 0,
Baned = 1,
Dismissed = 2,
Muted = 3
}
export declare enum GroupAtType {
AtNormal = 0,
AtMe = 1,
AtAll = 2,
AtAllAtMe = 3,
AtGroupNotice = 4
}
export declare enum GroupMemberFilter {
All = 0,
Owner = 1,
Admin = 2,
Nomal = 3,
AdminAndNomal = 4,
AdminAndOwner = 5
}
export declare enum Relationship {
isBlack = 0,
isFriend = 1
}
export declare enum LoginStatus {
Logout = 1,
Logging = 2,
Logged = 3
}
export declare enum OnlineState {
Online = 1,
Offline = 0
}
export declare enum ViewType {
ViewHistory = 0,
ViewSearch = 1
}