@juzi/wechaty-puppet-whatsapp
Version:
Wechaty Puppet for WhatsApp
156 lines • 6.79 kB
TypeScript
/**
* Wechaty - https://github.com/chatie/wechaty
*
* @copyright 2016-2018 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import * as PUPPET from '@juzi/wechaty-puppet';
import type { MemoryCard } from 'memory-card';
import Manager from './manager.js';
import type { RequestManagerAPIs } from './request/request-manager.js';
import type { ClientOptions } from './schema/whatsapp-type.js';
import { contactSelfQRCode, contactSelfName, contactSelfSignature } from './puppet-mixin/contact-self.js';
import { contactAlias, contactPhone, contactCorporationRemark, contactDescription, contactList, contactAvatar, contactRawPayloadParser, contactRawPayload } from './puppet-mixin/contact.js';
import { conversationReadMark } from './puppet-mixin/conversation.js';
import { friendshipRawPayload, friendshipRawPayloadParser, friendshipSearchPhone, friendshipSearchWeixin, friendshipAdd, friendshipAccept, friendshipSearchHandle } from './puppet-mixin/friendship.js';
import { messageContact, messageImage, messageRecall, messageFile, messageUrl, messageMiniProgram, messageSendText, messageSendFile, messageSendContact, messageSendUrl, messageSendMiniProgram, messageForward, messageRawPayloadParser, messageRawPayload, messagePost, messageSendChannel, messageChannel, messageSendLocation, messageLocation } from './puppet-mixin/message.js';
import { roomRawPayloadParser, roomRawPayload, roomList, roomDel, roomAvatar, roomAdd, roomTopic, roomCreate, roomQuit, roomQRCode, roomMemberList, roomMemberRawPayload, roomMemberRawPayloadParser, roomAnnounce, roomInvitationAccept, roomInvitationRawPayload, roomInvitationRawPayloadParser } from './puppet-mixin/room.js';
import { tagContactTagAdd, tagContactTagList, tagContactTagRemove, tagGroupAdd, tagGroupDelete, tagGroupList, tagGroupTagList, tagTagAdd, tagTagContactList, tagTagDelete, tagTagList } from './puppet-mixin/tag.js';
type ManagerWithRequestManager = Manager & RequestManagerAPIs;
export type PuppetWhatsAppOptions = PUPPET.PuppetOptions & {
memory?: MemoryCard;
puppeteerOptions?: ClientOptions;
};
declare class PuppetWhatsapp extends PUPPET.Puppet {
options: PuppetWhatsAppOptions;
static readonly VERSION: string;
manager: ManagerWithRequestManager;
constructor(options?: PuppetWhatsAppOptions);
version(): string;
onStart(): Promise<void>;
private startManager;
onStop(): Promise<void>;
private stopManager;
/**
* Event section: onXXX
*/
private onLogin;
private onLogout;
private onMessage;
private onScan;
private onError;
private onReset;
private onFriendship;
private onRoomJoin;
private onRoomLeave;
private onRoomTopic;
private onRoomInvite;
private onReady;
/**
* Override Methods
*/
logout(): Promise<void>;
ding(data?: string): void;
/**
* ContactSelf
*/
contactSelfQRCode: typeof contactSelfQRCode;
contactSelfName: typeof contactSelfName;
contactSelfSignature: typeof contactSelfSignature;
/**
* Contact
*/
contactAlias: typeof contactAlias;
contactPhone: typeof contactPhone;
contactCorporationRemark: typeof contactCorporationRemark;
contactDescription: typeof contactDescription;
contactList: typeof contactList;
contactAvatar: typeof contactAvatar;
contactRawPayloadParser: typeof contactRawPayloadParser;
contactRawPayload: typeof contactRawPayload;
/**
* Conversation
*/
conversationReadMark: typeof conversationReadMark;
/**
* Message
*/
messagePost: typeof messagePost;
messageContact: typeof messageContact;
messageImage: typeof messageImage;
messageRecall: typeof messageRecall;
messageFile: typeof messageFile;
messageUrl: typeof messageUrl;
messageMiniProgram: typeof messageMiniProgram;
messageChannel: typeof messageChannel;
messageSendText: typeof messageSendText;
messageSendFile: typeof messageSendFile;
messageSendContact: typeof messageSendContact;
messageSendUrl: typeof messageSendUrl;
messageSendMiniProgram: typeof messageSendMiniProgram;
messageSendChannel: typeof messageSendChannel;
messageSendLocation: typeof messageSendLocation;
messageLocation: typeof messageLocation;
messageForward: typeof messageForward;
messageRawPayloadParser: typeof messageRawPayloadParser;
messageRawPayload: typeof messageRawPayload;
/**
* Room
*/
roomRawPayloadParser: typeof roomRawPayloadParser;
roomRawPayload: typeof roomRawPayload;
roomList: typeof roomList;
roomDel: typeof roomDel;
roomAvatar: typeof roomAvatar;
roomAdd: typeof roomAdd;
roomTopic: typeof roomTopic;
roomCreate: typeof roomCreate;
roomQuit: typeof roomQuit;
roomQRCode: typeof roomQRCode;
roomMemberList: typeof roomMemberList;
roomMemberRawPayload: typeof roomMemberRawPayload;
roomMemberRawPayloadParser: typeof roomMemberRawPayloadParser;
roomAnnounce: typeof roomAnnounce;
roomInvitationAccept: typeof roomInvitationAccept;
roomInvitationRawPayload: typeof roomInvitationRawPayload;
roomInvitationRawPayloadParser: typeof roomInvitationRawPayloadParser;
/**
* Friendship
*/
friendshipRawPayload: typeof friendshipRawPayload;
friendshipRawPayloadParser: typeof friendshipRawPayloadParser;
friendshipSearchPhone: typeof friendshipSearchPhone;
friendshipSearchWeixin: typeof friendshipSearchWeixin;
friendshipSearchHandle: typeof friendshipSearchHandle;
friendshipAdd: typeof friendshipAdd;
friendshipAccept: typeof friendshipAccept;
/**
* Tag
*/
tagContactTagAdd: typeof tagContactTagAdd;
tagContactTagRemove: typeof tagContactTagRemove;
tagContactTagList: typeof tagContactTagList;
tagGroupAdd: typeof tagGroupAdd;
tagGroupDelete: typeof tagGroupDelete;
tagGroupList: typeof tagGroupList;
tagGroupTagList: typeof tagGroupTagList;
tagTagAdd: typeof tagTagAdd;
tagTagDelete: typeof tagTagDelete;
tagTagList: typeof tagTagList;
tagTagContactList: typeof tagTagContactList;
}
export { PuppetWhatsapp };
export default PuppetWhatsapp;
//# sourceMappingURL=puppet-whatsapp.d.ts.map