///
import * as PUPPET from '@juzi/wechaty-puppet';
import type { FileBoxInterface, FileBox } from 'file-box';
import { GrpcManager } from './grpc-manager.js';
import { PayloadStore } from './payload-store.js';
import type { MessageBroadcastTargets } from '@juzi/wechaty-puppet/dist/esm/src/schemas/message.js';
import type { Contact } from '@juzi/wechaty-puppet/types';
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 _payloadStore: PayloadStore;
private timeoutMilliseconds;
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
*/
fastDirty({ payloadType, payloadId, }: PUPPET.payloads.EventDirty): Promise;
enterVerifyCode(id: string, code: string): Promise;
cancelVerifyCode(id: string): Promise;
refreshQRCode(): Promise;
/**
*
* 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;
batchContactRawPayload(contactIdList: string[]): Promise