import * as PUPPET from 'wechaty-puppet'; import type { FileBoxInterface, FileBox } from 'file-box'; import { Duck as PuppetDuck } from 'wechaty-redux'; import { Ducks } from 'ducks'; import type { Store } from 'redux'; import { GrpcManager } from './grpc-manager.js'; import { PayloadStore } from './payload-store.js'; export declare type PuppetServiceOptions = PUPPET.PuppetOptions & { authority?: string; tls?: { caCert?: string; serverName?: string; /** * Huan(202108): only for compatible with old clients/servers * for disabling TLS */ disable?: boolean; }; }; declare class PuppetService extends PUPPET.Puppet { options: PuppetServiceOptions; static readonly VERSION: string; protected _cleanupCallbackList: (() => void)[]; protected _payloadStore: PayloadStore; /** * Wechaty Redux */ protected _ducks: Ducks<{ puppet: typeof PuppetDuck; }>; protected _store: Store; protected _grpcManager?: GrpcManager; get grpcManager(): GrpcManager; /** * UUIDify: * We need to clone a FileBox * to set uuid loader/saver with this grpc client */ protected FileBoxUuid: typeof FileBox; constructor(options?: PuppetServiceOptions); protected serializeFileBox(fileBox: FileBoxInterface): Promise; name(): string; version(): string; onStart(): Promise; onStop(): Promise; protected hookPayloadStore(): void; protected bridgeGrpcEventStream(client: GrpcManager): void; private onGrpcStreamEvent; logout(reason?: string): Promise; ding(data: string): void; /** * * Huan(202111) Issue #158 - Refactoring the 'dirty' event, dirtyPayload(), * and XXXPayloadDirty() methods logic & spec * * @see https://github.com/wechaty/puppet/issues/158 * */ dirtyPayload(type: PUPPET.types.Dirty, id: string): Promise; /** * `onDirty()` is called when the puppet emit `dirty` event. * the event listener will be registered in `start()` from the `PuppetAbstract` class */ onDirty({ payloadType, payloadId, }: PUPPET.payloads.EventDirty): void; /** * * Contact * */ contactAlias(contactId: string): Promise; contactAlias(contactId: string, alias: string | null): Promise; contactPhone(contactId: string, phoneList: string[]): Promise; contactCorporationRemark(contactId: string, corporationRemark: string | null): Promise; contactDescription(contactId: string, description: string | null): Promise; contactList(): Promise; contactAvatar(contactId: string): Promise; contactAvatar(contactId: string, file: FileBoxInterface): Promise; contactRawPayload(id: string): Promise; contactRawPayloadParser(payload: PUPPET.payloads.Contact): Promise; contactSelfName(name: string): Promise; contactSelfQRCode(): Promise; contactSelfSignature(signature: string): Promise; /** * * Conversation * */ conversationReadMark(conversationId: string, hasRead?: boolean): Promise; /** * * Message * */ messageMiniProgram(messageId: string): Promise; messageLocation(messageId: string): Promise; messageImage(messageId: string, imageType: PUPPET.types.Image): Promise; messageContact(messageId: string): Promise; messageSendMiniProgram(conversationId: string, miniProgramPayload: PUPPET.payloads.MiniProgram): Promise; messageSendLocation(conversationId: string, locationPayload: PUPPET.payloads.Location): Promise; messageRecall(messageId: string): Promise; messageFile(id: string): Promise; messageForward(conversationId: string, messageId: string): Promise; messageRawPayload(id: string): Promise; messageRawPayloadParser(payload: PUPPET.payloads.Message): Promise; messageSendText(conversationId: string, text: string, mentionIdList?: string[]): Promise; messageSendFile(conversationId: string, fileBox: FileBoxInterface): Promise; messageSendContact(conversationId: string, contactId: string): Promise; messageSendUrl(conversationId: string, urlLinkPayload: PUPPET.payloads.UrlLink): Promise; messageUrl(messageId: string): Promise; /** * * Room * */ roomRawPayload(id: string): Promise; roomRawPayloadParser(payload: PUPPET.payloads.Room): Promise; roomList(): Promise; roomDel(roomId: string, contactId: string): Promise; roomAvatar(roomId: string): Promise; roomAdd(roomId: string, contactId: string, inviteOnly: boolean): Promise; roomTopic(roomId: string): Promise; roomTopic(roomId: string, topic: string): Promise; roomCreate(contactIdList: string[], topic: string): Promise; roomQuit(roomId: string): Promise; roomQRCode(roomId: string): Promise; roomMemberList(roomId: string): Promise; roomMemberRawPayload(roomId: string, contactId: string): Promise; roomMemberRawPayloadParser(payload: PUPPET.payloads.RoomMember): Promise; roomAnnounce(roomId: string): Promise; roomAnnounce(roomId: string, text: string): Promise; roomInvitationAccept(roomInvitationId: string): Promise; roomInvitationRawPayload(id: string): Promise; roomInvitationRawPayloadParser(payload: PUPPET.payloads.RoomInvitation): Promise; /** * * Friendship * */ friendshipSearchPhone(phone: string): Promise; friendshipSearchWeixin(weixin: string): Promise; friendshipRawPayload(id: string): Promise; friendshipRawPayloadParser(payload: PUPPET.payloads.Friendship): Promise; friendshipAdd(contactId: string, options: PUPPET.types.FriendshipAddOptions): Promise; friendshipAccept(friendshipId: string): Promise; /** * * Tag * */ tagContactAdd(id: string, contactId: string): Promise; tagContactRemove(id: string, contactId: string): Promise; tagContactDelete(id: string): Promise; tagContactList(contactId?: string): Promise; /** * @deprecated Will be removed in v2.0 */ private messageSendFileStream; } export { PuppetService, }; export default PuppetService; //# sourceMappingURL=puppet-service.d.ts.map