///
import LRU from 'lru-cache';
import { FileBox, FriendshipPayload, EventRoomLeavePayload, MemoryCard } from 'wechaty-puppet';
import { GrpcEventEmitter } from '../server-manager/grpc-event-emitter';
import { PadplusContactPayload, PadplusMessagePayload, PadplusMessageType, PadplusRoomPayload, PadplusRichMediaData, PadplusMediaData, GrpcSearchContact, PadplusRoomMemberMap, GrpcQrCodeLogin, GetContactSelfInfoGrpcResponse, TagPayload, PadplusRoomInviteEvent, LoginDeviceInfo } from '../schemas';
import { CacheManager } from '../server-manager/cache-manager';
import { EventEmitter } from 'events';
import { PuppetCacheStoreOptions } from 'wechaty-puppet-cache';
export interface PadplusMemorySlot {
qrcodeId: string;
uin: string;
userName: string;
}
export interface ManagerOptions {
token: string;
name: unknown;
endpoint?: string;
cacheOption?: PuppetCacheStoreOptions;
}
export declare type PadplusManagerEvent = 'error' | 'scan' | 'login' | 'logout' | 'contact-list' | 'contact-modify' | 'contact-delete' | 'message' | 'room-member-list' | 'room-member-modify' | 'status-notify' | 'ready' | 'reset' | 'heartbeat' | 'EXPIRED_TOKEN' | 'INVALID_TOKEN' | 'room-leave';
export declare class PadplusManager extends EventEmitter {
options: ManagerOptions;
private grpcGatewayEmitter?;
private readonly state;
private requestClient?;
private padplusUser?;
private padplusMesasge?;
private padplusContact?;
private padplusRoom?;
private padplusFriendship?;
cacheManager?: CacheManager;
private memory?;
private memorySlot;
private qrcodeStatus?;
private loginStatus?;
readonly cachePadplusMessagePayload: LRU;
readonly cachePadplusSearchContactPayload: LRU;
private contactAndRoomData?;
private resetThrottleQueue;
private getContactQueue;
private getRoomMemberQueue;
constructor(options: ManagerOptions);
emit(event: 'scan', qrcode: string, status: number, data?: string): boolean;
emit(event: 'login', data: GrpcQrCodeLogin): boolean;
emit(event: 'logout', reason?: string): boolean;
emit(event: 'contact-list', data: string): boolean;
emit(event: 'contact-modify', data: string): boolean;
emit(event: 'contact-delete', data: string): boolean;
emit(event: 'message', msg: PadplusMessagePayload): boolean;
emit(event: 'room-member-list', data: string): boolean;
emit(event: 'room-leave', data: EventRoomLeavePayload): boolean;
emit(event: 'room-member-modify', data: string): boolean;
emit(event: 'status-notify', data: string): boolean;
emit(event: 'ready'): boolean;
emit(event: 'reset', reason: string): boolean;
emit(event: 'heartbeat', data: string): boolean;
emit(event: 'error', error: Error): boolean;
emit(event: never, listener: never): never;
on(event: 'scan', listener: ((this: PadplusManager, qrcode: string, status: number, data?: string) => void)): this;
on(event: 'login', listener: ((this: PadplusManager, data: GrpcQrCodeLogin) => void)): this;
on(event: 'logout', listener: ((this: PadplusManager, reason?: string) => void)): this;
on(event: 'message', listener: ((this: PadplusManager, msg: PadplusMessagePayload) => void)): this;
on(event: 'status-notify', listener: ((this: PadplusManager, data: string) => void)): this;
on(event: 'ready', listener: ((this: PadplusManager) => void)): this;
on(event: 'reset', listener: ((this: PadplusManager, reason: string) => void)): this;
on(event: 'heartbeat', listener: ((this: PadplusManager, data: string) => void)): this;
on(event: 'error', listener: ((this: PadplusManager, error: Error) => void)): this;
on(event: 'room-leave', listener: ((this: PadplusManager, data: EventRoomLeavePayload) => void)): this;
on(event: never, listener: never): never;
start(): Promise;
stop(): Promise;
logout(selfId: string): Promise;
setMemory(memory: MemoryCard): void;
reconnect(): Promise;
loginDevice(): Promise;
setContactAndRoomData(): Promise;
initGrpcGatewayListener(grpcGatewayEmitter: GrpcEventEmitter): Promise;
/**
* Contact Self Section
*/
contactSelfQrcode(): Promise;
contactSelfName(name: string): Promise;
contactSelfSignature(signature: string): Promise;
contactSelfInfo(): Promise;
/**
* Message Section
*/
loadRichMediaData(mediaData: PadplusRichMediaData): Promise;
sendMessage(selfId: string, receiver: string, text: string, type: PadplusMessageType, mention?: string): Promise;
sendVideo(selfId: string, receiver: string, url: string): Promise;
sendMiniProgram(selfId: string, receiver: string, content: string): Promise;
sendVoice(selfId: string, receiver: string, url: string, fileSize: string): Promise;
sendContact(selfId: string, receiver: string, contentStr: string): Promise;
addFriend(contactId: string, hello: string | undefined, isPhoneNumber: number, strangerV1: string, strangerV2: string): Promise;
generatorFileUrl(file: FileBox): Promise;
sendFile(selfId: string, receiverId: string, url: string, fileName: string, subType: string, fileSize?: number): Promise;
sendUrlLink(selfId: string, receiver: string, content: string): Promise;
private onProcessMessage;
/**
* Contact Section
*/
getOrCreateTag(tagName: string): Promise;
addTag(tagId: string, contactId: string): Promise;
removeTag(tagId: string, contactId: string): Promise;
tags(contactId?: string): Promise;
tagList(): Promise;
modifyTag(tagId: string, name: string): Promise;
deleteTag(tagId: string): Promise;
setContactAlias(selfId: string, contactId: string, alias: string): Promise;
getContactIdList(selfId: string): Promise;
getContact(contactId: string): Promise;
getContactPayload(contactId: string): Promise;
searchContact(contactId: string, save?: boolean): Promise;
syncContacts(): Promise;
/**
* Room Section
*/
setRoomTopic(roomId: string, topic: string): Promise;
getRoomQrcode(roomId: string): Promise;
getRoomIdList(): Promise;
getRoomMemberIdList(roomId: string): Promise;
getRoomInfo(roomId: string): Promise;
getRoom(roomId: string): Promise;
getRoomMembers(roomId: string): Promise;
deleteRoomMember(roomId: string, contactId: string): Promise;
setAnnouncement(roomId: string, announcement: string): Promise;
getAnnouncement(roomId: string): Promise;
roomAddMember(roomId: string, memberId: string): Promise;
createRoom(topic: string, memberIdList: string[]): Promise;
quitRoom(roomId: string): Promise;
saveRoomInvitationRawPayload(roomInvitation: PadplusRoomInviteEvent): Promise;
roomInvitationAccept(roomInvitationId: string): Promise;
/**
*
* room event
*
*/
roomInvitationRawPayload(roomInvitationId: string): Promise;
/**
* Friendship Section
*/
getFriendship(friendshipId: string): Promise;
confirmFriendship(contactId: string, encryptUserName: string, ticket: string, scene: string): Promise;
saveFriendship(friendshipId: string, friendship: FriendshipPayload): Promise;
recallMessage(selfId: string, receiverId: string, messageId: string): Promise;
private generateLeaveEvent;
}
export default PadplusManager;
//# sourceMappingURL=padplus-manager.d.ts.map