@openim/client-sdk
Version:
JavaScript/TypeScript Client SDK for OpenIM
220 lines (219 loc) • 5.13 kB
TypeScript
import { CbEvents } from '../constant/callback';
import type { AtUsersInfoItem, GroupItem, MessageItem, PicBaseInfo } from './entity';
import type { GroupAtType, GroupJoinSource, GroupMemberFilter, GroupMemberRole, LogLevel, MessageReceiveOptType, ReqIdentifier, ViewType } from './enum';
import { GroupProto, SdkWsProto } from '@openim/protocol';
export type SendWsReqParams = {
data: Uint8Array;
reqIdentifier: ReqIdentifier;
operationID: string;
};
export type TriggerEventParams = {
event: CbEvents;
data?: any;
errCode?: number;
errMsg?: string;
operationID?: string;
};
export type LoginParams = {
userID: string;
token: string;
wsAddr: string;
apiAddr: string;
platformID: number;
logLevel?: LogLevel;
};
export type OffsetParams = {
offset: number;
count: number;
};
export type GetOneConversationParams = {
sourceID: string;
sessionType: number;
};
export type SetConversationParams = {
conversationID: string;
recvMsgOpt?: MessageReceiveOptType;
groupAtType?: GroupAtType;
burnDuration?: number;
msgDestructTime?: number;
isPinned?: boolean;
isPrivateChat?: boolean;
isMsgDestruct?: boolean;
ex?: string;
};
export type ChangeInputStatesParams = {
conversationID: string;
focus: boolean;
};
export type GetInputstatesParams = {
conversationID: string;
userID: string;
};
export type AccessFriendParams = {
toUserID: string;
handleMsg: string;
};
export type AddBlackParams = {
toUserID: string;
ex?: string;
};
export type AddFriendParams = {
toUserID: string;
reqMsg: string;
ex?: string;
};
export type UpdateFriendsParams = {
friendUserIDs: string[];
isPinned?: boolean;
remark?: string;
ex?: string;
};
export type CreateGroupParams = {
memberUserIDs: string[];
groupInfo: Partial<GroupItem>;
adminUserIDs?: string[];
ownerUserID?: string;
};
export type JoinGroupParams = {
groupID: string;
reqMsg: string;
joinSource: GroupJoinSource;
ex?: string;
};
export type OpreateGroupParams = {
groupID: string;
reason: string;
userIDList: string[];
};
export type SetGroupInfoParams = Partial<GroupProto.SetGroupInfoExReq> & {
groupID: string;
};
export type AccessGroupParams = {
groupID: string;
fromUserID: string;
handleMsg: string;
};
export declare type GetGroupMemberParams = {
groupID: string;
filter: GroupMemberFilter;
offset: number;
count: number;
};
export type getGroupMembersInfoParams = {
groupID: string;
userIDList: string[];
};
export type UpdateMemberInfoParams = {
groupID: string;
userID: string;
nickname?: string;
faceURL?: string;
roleLevel?: GroupMemberRole;
ex?: string;
};
export type ChangeGroupMemberMuteParams = {
groupID: string;
userID: string;
mutedSeconds: number;
};
export type ChangeGroupMuteParams = {
groupID: string;
isMute: boolean;
};
export type TransferGroupParams = {
groupID: string;
newOwnerUserID: string;
};
export type AtMsgParams = {
text: string;
atUserIDList: string[];
atUsersInfo?: AtUsersInfoItem[];
message?: MessageItem;
};
export type ImageMsgParams = {
sourcePicture: PicBaseInfo;
bigPicture: PicBaseInfo;
snapshotPicture: PicBaseInfo;
sourcePath: string;
};
export type SoundMsgParams = {
uuid: string;
soundPath: string;
sourceUrl: string;
dataSize: number;
duration: number;
soundType?: string;
};
export type VideoMsgParams = {
videoPath: string;
duration: number;
videoType: string;
snapshotPath: string;
videoUUID: string;
videoUrl: string;
videoSize: number;
snapshotUUID: string;
snapshotSize: number;
snapshotUrl: string;
snapshotWidth: number;
snapshotHeight: number;
snapShotType?: string;
};
export type FileMsgParams = {
filePath: string;
fileName: string;
uuid: string;
sourceUrl: string;
fileSize: number;
fileType?: string;
};
export type MergerMsgParams = {
messageList: MessageItem[];
title: string;
summaryList: string[];
};
export type LocationMsgParams = {
description: string;
longitude: number;
latitude: number;
};
export type QuoteMsgParams = {
text: string;
message: string;
};
export type CustomMsgParams = {
data: string;
extension: string;
description: string;
};
export type FaceMessageParams = {
index: number;
data: string;
};
export type SendMsgParams = {
recvID: string;
groupID: string;
offlinePushInfo?: SdkWsProto.OfflinePushInfo;
message: MessageItem;
isOnlineOnly?: boolean;
};
export type TypingUpdateParams = {
recvID: string;
msgTip: string;
};
export type OpreateMessageParams = {
conversationID: string;
clientMsgID: string;
};
export type GetAdvancedHistoryMsgParams = {
viewType?: ViewType;
count: number;
startClientMsgID: string;
conversationID: string;
};
export type UploadFileParams = {
name?: string;
contentType?: string;
uuid?: string;
file: File;
};