import * as pb from "./proto/padlocal_pb"; import { Bytes } from "./utils/ByteUtils"; import { PadLocalClientPlugin } from "./PadLocalClientPlugin"; import { PadLocalClient } from "./PadLocalClient"; export declare class PadLocalClientApi extends PadLocalClientPlugin { private static readonly FILE_UPLOAD_REQUEST_TIMEOUT; private _revokeMessageSeq; constructor(client: PadLocalClient); login(loginPolicy: pb.LoginPolicy, callback: LoginCallback): Promise; logout(): Promise; sync(scene: pb.SyncRequestScene): Promise; /** * @param toUserName * @param text * @param atList * @param idempotentId: id used to forbidden idempotent problem caused by retry. * @return */ sendTextMessage(idempotentId: string, toUserName: string, text: string, atList?: string[]): Promise; /** * @param toUserName * @param image * @param idempotentId: id used to forbidden idempotent problem caused by retry. * @return */ sendImageMessage(idempotentId: string, toUserName: string, image: Bytes): Promise; /** * * @param idempotentId * @param toUserName * @param voice * @param voiceLength: voice length show to receiver, in milliseconds */ sendVoiceMessage(idempotentId: string, toUserName: string, voice: Bytes, voiceLength: number): Promise; sendVideoMessage(idempotentId: string, toUserName: string, video: Bytes): Promise; sendFileMessage(idempotentId: string, toUserName: string, file: Bytes, fileName: string): Promise; /** * @param idempotentId: id used to forbidden idempotent problem caused by retry. * @param toUserName * @param link * @return */ sendMessageLink(idempotentId: string, toUserName: string, link: pb.AppMessageLink): Promise; sendMessageMiniProgram(idempotentId: string, toUserName: string, miniProgram: pb.AppMessageMiniProgram, thumbImage: Bytes | null): Promise; sendContactCardMessage(idempotentId: string, toUserName: string, contact: pb.Contact): Promise; sendMessageEmoji(idempotentId: string, toUserName: string, md5: string, len: number, type?: number, gameExt?: string): Promise; forwardMessage(idempotentId: string, toUserName: string, messageContent: string, messageType: number, messageToUserName: string): Promise; getMessageImage(messageContent: string, messageToUserName: string, imageType: pb.ImageType): Promise; getMessageVoice(messageId: string, messageContent: string, messageToUserName: string): Promise; getMessageVideoThumb(messageContent: string, messageToUserName: string): Promise; getMessageVideo(messageContent: string, messageToUserName: string): Promise; getMessageAttach(messageContent: string, messageToUserName: string): Promise; getMessageAttachThumb(messageContent: string, messageToUserName: string): Promise; getMessageMiniProgramThumb(messageContent: string, messageToUserName: string): Promise; getEncryptedFile(fileType: pb.EncryptedFileType, fileId: string, fileKey: Bytes, isChatRoomMessage?: boolean): Promise; revokeMessage(msgId: string, fromUserName: string, toUserName: string, messageRevokeInfo: pb.MessageRevokeInfo): Promise; /** * sync contact is very costly, may be last for minutes, so use wisely. * @param callback */ syncContact(callback: SyncContactCallback): Promise; acceptUser(userName: string, ticket: string, stranger: string, scene: number): Promise; addContact(stranger: string, ticket: string, scene: pb.AddContactScene, hello: string, roomId?: string, contactId?: string): Promise; deleteContact(userName: string): Promise; getContact(userName: string, ticket?: string): Promise; getContactQRCode(userName: string, style: number): Promise; searchContact(userName: string): Promise; updateSelfNickName(nickName: string): Promise; updateSelfSignature(signature: string): Promise; zombieTest(userName: string): Promise; updateContactRemark(userName: string, remark: string): Promise; /** * * @param userNameList * @param idempotentId: id used to forbidden idempotent problem caused by retry. * @return */ createChatRoom(idempotentId: string, userNameList: string[]): Promise; getChatRoomMembers(roomId: string): Promise; getChatRoomQrCode(roomId: string): Promise; getChatRoomMember(roomId: string, userName: string): Promise; getChatRoomAnnouncement(roomId: string): Promise; setChatRoomAnnouncement(roomId: string, announcement: string): Promise; addChatRoomMember(roomId: string, userName: string): Promise; deleteChatRoomMember(roomId: string, userName: string): Promise; setChatRoomName(roomId: string, name: string): Promise; quitChatRoom(roomId: string): Promise; acceptChatRoomInvitation(inviterUserName: string, invitationURL: string): Promise; getLabelList(): Promise; addLabel(label: string): Promise; removeLabel(labelId: number): Promise; setContactLabel(userName: string, labelIdList: number[]): Promise; /** * @param maxId: 0 for the first page * @return */ snsGetTimeline(maxId?: string): Promise; snsGetUserPage(userName: string, maxId?: string): Promise; snsGetMoment(momentId: string): Promise; /** * * @param idempotentId: id used to forbidden idempotent problem caused by retry. * @param payload * @param options * @return */ snsSendMoment(idempotentId: string, payload: pb.SnsSendMomentText | pb.SnsSendMomentImages | pb.SnsSendMomentUrl, options?: pb.SnsSendMomentOptions): Promise; snsForwardMoment(idempotentId: string, momentContentXml: string, options?: pb.SnsSendMomentOptions): Promise; /** * * @param momentId * @param idempotentId: id used to forbidden idempotent problem caused by retry. * @param momentOwnerUserName * @param commentText * @param replyTo * @return */ snsSendComment(idempotentId: string, momentId: string, momentOwnerUserName: string, commentText: string, replyTo?: pb.SnsSendCommentReplyTo): Promise; snsUploadImage(image: Bytes, description?: string): Promise; snsLikeMoment(momentId: string, momentOwnerUserName: string): Promise; snsUnlikeMoment(momentId: string): Promise; snsRemoveMomentComment(momentId: string, commentId: string): Promise; snsMakeMomentPrivate(momentId: string): Promise; snsMakeMomentPublic(momentId: string): Promise; snsRemoveMoment(momentId: string): Promise; sendClientStopSignal(): Promise; } export interface LoginCallback { onLoginStart(loginType: pb.LoginType): void; onOneClickEvent(oneClickEvent: pb.QRCodeEvent): void; onQrCodeEvent(qrCodeEvent: pb.QRCodeEvent): void; onLoginSuccess(contact: pb.Contact): void; onSync(syncEvent: pb.SyncEvent): void; } export interface SyncContactCallback { onSync(contactList: pb.Contact[]): void; } export interface GetMessageImageResult { readonly imageType: pb.ImageType; readonly imageData: Bytes; }