import { EventEmitter } from 'events'; import { GrpcCheckQRCode, GrpcContactRawPayload, GrpcCreateRoomPayload, GrpcGetA8KeyType, GrpcGetContactQrcodePayload, GrpcGetQRCodeType, GrpcRoomMemberRawPayload, GrpcRoomRawPayload, GrpcSyncMessagePayload } from '../schemas/grpc-schemas'; import { WechatGateway } from '../gateway/wechat-gateway'; import { PadproContactPayload, PadproImageMessagePayload, PadproMessagePayload, PadproVideoMessagePayload, PadproVoiceMessagePayload, SearchContactTypeStatus } from '../schemas'; export declare class PadproGrpc extends EventEmitter { protected userId?: string; protected wechatGateway: WechatGateway; constructor(); protected GrpcSyncMessage(): Promise; GrpcGetQRCode(): Promise; protected GrpcHeartBeat(): Promise; GrpcAutoLogin(): Promise; GrpcQRCodeLogin(userName: string, password: string): Promise; GrpcCheckQRCode(): Promise; protected reset(reason?: string): void; stop(): Promise; /** * This function will fetch contact data for the given contact id(s) * @param contact This is either one wxid or an array of wxid */ protected GrpcGetContactPayload(contact: string, forceCall?: boolean): Promise; protected GrpcGetContactPayload(contact: string[]): Promise; protected GrpcGetRoomPayload(room: string): Promise; protected GrpcGetRoomPayload(room: string[]): Promise; /** * Get room member list for a given room id * @param roomId room id */ GrpcGetChatRoomMember(roomId: string): Promise; /** * Log out wechat */ GrpcLogout(): Promise; /** * Set an alias for a given contact * @param contactId contact id * @param alias new alias */ GrpcSetContactAlias(contactId: string, alias: string): Promise; /** * Get qrcode for given contact. This api is able to get qrcode for self or * rooms that already joined * @param contactId contact id */ GrpcGetContactQrcode(contactId: string): Promise; /** * Set user info for self * @param nickName nick name * @param signature signature * @param sex sex * @param country country * @param province province * @param city city */ GrpcSetUserInfo(nickName: string, signature: string, sex: string, country: string, province: string, city: string): Promise; /** * Add friend with contact's stranger and ticket value * @param stranger stranger, v1_ * @param ticket ticket, v2_ * @param type search contact type status * @param content content used for add friend */ GrpcAddFriend(stranger: string, ticket: string, type: SearchContactTypeStatus, content: string): Promise; /** * Accept friend request * @param stranger stranger, v1_ * @param ticket ticket, v2_ */ GrpcAcceptFriend(stranger: string, ticket: string): Promise; /** * Search contact * @param contactId contact id */ GrpcSearchContact(contactId: string): Promise; /** * Send message * @param contactId contact id * @param content content * @param atUserList at user list */ GrpcSendMessage(contactId: string, content: string, atUserList?: string[]): Promise; /** * Send image, might be really slow when the picture is huge * @param contactId contact id to send image * @param data image data */ GrpcSendImage(contactId: string, data: string): Promise; /** * Send voice message * @param contactId contact id * @param data voice data * @param voiceLength voice length, in millisecond */ GrpcSendVoice(contactId: string, data: string, voiceLength: number, format: number): Promise; /** * Send video message * @param contactId contact id * @param videoPayload video payload */ GrpcSendVideo(contactId: string, videoPayload: PadproVideoMessagePayload): Promise; /** * Send app message * @param contactId contact id * @param content app message xml content */ GrpcSendApp(contactId: string, content: string): Promise; /** * Get image from the message * @param content message content */ GrpcGetMsgImage(message: PadproMessagePayload, imagePayload: PadproImageMessagePayload): Promise; /** * Get video from the message * @param content message content * TODO: This feature is not ready yet */ GrpcGetMsgVideo(content: string): Promise; /** * Get voice from the message * @param content message content */ GrpcGetMsgVoice(message: PadproMessagePayload, voicePayload: PadproVoiceMessagePayload): Promise; /** * Share a contact card to another contact * @param toId contact id that receive this contact card * @param contactId contact that in the contact card * @param title the title of the card */ GrpcShareCard(toId: string, contact: PadproContactPayload): Promise; /** * Get A8 key * @param contactId contact id * @param url url */ GrpcGetA8Key(contactId: string, url: string): Promise; /** * Create room with given members * @param contactIdList room member list */ GrpcCreateRoom(contactIdList: string[]): Promise; /** * Set room name * @param roomId room id * @param name new room name */ GrpcSetRoomName(roomId: string, name: string): Promise; /** * Quit room with id * @param roomId room id */ GrpcQuitRoom(roomId: string): Promise; /** * Add contact(s) into a given room * @param roomId room id * @param contactId contact id or a list of contact ids */ GrpcAddRoomMember(roomId: string, contactId: string | string[]): Promise; /** * Invite a contact into a room * @param roomId room id * @param contactId contact id needs to be invited */ GrpcInviteRoomMember(roomId: string, contactId: string): Promise; /** * Remove a member from a room * @param roomId room id * @param contactId contact id needs to be removed */ GrpcDeleteRoomMember(roomId: string, contactId: string): Promise; /** * Set room announcement * @param roomId room id * @param announcement announcement */ GrpcSetRoomAnnouncement(roomId: string, announcement: string): Promise; GrpcNewInit(): Promise; GrpcGetLabelList(): Promise; GrpcAddLabel(labelName: string): Promise; /** * TODO: not working right now, need to fix this * @param contactId contact id * @param labelIds label ids */ GrpcModifyLabelList(contactId: string, labelIds: number[]): Promise; /** * Underlying function to do contact operations * @param option Contact operation option */ private GrpcContactOperation; } //# sourceMappingURL=padpro-grpc.d.ts.map