import { MemoryCard } from 'memory-card'; import { PadchatContactPayload, PadchatRoomInvitationPayload, PadchatRoomInviteEvent, PadchatRoomMemberPayload, PadchatRoomPayload } from './padchat-schemas'; import { PadchatRpc } from './padchat-rpc'; export interface PadchatMemorySlot { device: { [userId: string]: undefined | { data: string; token: string; }; }; currentUserId?: string; } export interface ManagerOptions { memory: MemoryCard; endpoint: string; token: string; } export declare class PadchatManager extends PadchatRpc { options: ManagerOptions; private memorySlot; private loginScanQrcode?; private loginScanStatus?; private loginScanTimer?; private cacheContactRawPayload?; private cacheRoomMemberRawPayload?; private cacheRoomRawPayload?; private cacheRoomInvitationRawPayload?; private readonly state; private readonly delayQueueExecutor; private delayQueueExecutorSubscription?; private roomNeedsToBeSync; private contactListSynced; constructor(options: ManagerOptions); protected initCache(token: string, userId: string): Promise; protected releaseCache(): Promise; start(): Promise; reconnect(): Promise; stop(): Promise; protected onLogin(userId: string): Promise; logout(): Promise; protected stopCheckScan(): Promise; protected startCheckScan(): Promise; /** * Offline, then relogin * emit qrcode or send login request to the user. */ protected tryAutoLogin(memorySlot: PadchatMemorySlot): Promise; protected emitLoginQrcode(): Promise; protected refreshMemorySlotData(memorySlot: PadchatMemorySlot, userId: string): Promise; protected tryLoad62Data(): Promise; getContactIdList(): string[]; getRoomIdList(): string[]; roomMemberRawPayloadDirty(roomId: string): void; getRoomMemberIdList(roomId: string, dirty?: boolean): Promise; roomRawPayloadDirty(roomId: string): void; roomMemberRawPayload(roomId: string): Promise<{ [contactId: string]: PadchatRoomMemberPayload; }>; syncRoomMember(roomId: string): Promise<{ [contactId: string]: PadchatRoomMemberPayload; }>; syncContactsAndRooms(): Promise; contactRawPayloadDirty(contactId: string): void; contactRawPayload(contactId: string): Promise; roomRawPayload(id: string): Promise; roomInvitationRawPayload(roomInvitationId: string): Promise; roomInvitationRawPayloadDirty(roomInvitationId: string): Promise; saveRoomInvitationRawPayload(roomInvitation: PadchatRoomInviteEvent): Promise; ding(data?: string): void; updateSelfName(newName: string): Promise; updateSelfSignature(signature: string): Promise; } export default PadchatManager;