UNPKG

aijinkela-wechaty

Version:

Wechaty is a RPA SDK for Chatbot Makers.

545 lines 43.1 kB
import type * as PUPPET from 'wechaty-puppet'; import type { SayableSayer, Sayable } from '../sayable/mod.js'; import { WechatySkeleton } from './wechaty-skeleton.js'; import type { WechatyInterface } from './wechaty-impl.js'; import type { WechatyOptions } from '../schemas/wechaty-options.js'; import type { PostInterface } from '../user-modules/post.js'; declare const mixinBase: (abstract new (...args: any[]) => { state: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface; __serviceCtlResettingIndicator: import("state-switch/dist/esm/src/busy-indicator.js").BusyIndicator; __serviceCtlLogger: import("brolog/dist/esm/src/logger.js").Loggable; start(): Promise<void>; stop(): Promise<void>; reset(): Promise<void>; onStart(): Promise<void>; onStop(): Promise<void>; emit(..._: any[]): any; }) & { VERSION: string; } & ((abstract new (...args: any[]) => { use(...plugins: (import("../plugin.js").WechatyPlugin | import("../plugin.js").WechatyPlugin[])[]): import("../plugin.js").WechatyPluginUninstaller; readonly log: import("brolog/dist/esm/src/logger.js").Loggable; readonly id: string; __memory?: import("memory-card").MemoryCard | undefined; readonly memory: import("memory-card").MemoryCard; __options: WechatyOptions; init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan", listener: (...args: any[]) => any): any; addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any; once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any; prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any; prependOnceListener<E_3 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_3, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_3]): any; off<E_4 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_4, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_4]): any; removeAllListeners<E_5 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event?: E_5 | undefined): any; removeListener<E_6 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_6, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_6]): any; emit: (<E_7 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_7, ...args: import("typed-emitter").Arguments<import("../schemas/wechaty-events.js").WechatyEventListeners[E_7]>) => boolean) & ((event: any, ...args: any) => boolean); eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[]; listeners<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../schemas/wechaty-events.js").WechatyEventListeners; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; emitError(e: any): void; toString: (() => string) & (() => string); name(): string; version(): string; sleep(milliseconds: number): Promise<void>; ding(data?: string | undefined): void; __puppet?: PUPPET.impls.PuppetInterface | undefined; readonly puppet: PUPPET.impls.PuppetInterface; readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface; __puppetMixinInited: boolean; ready(): Promise<void>; __setupPuppetEvents(puppet: PUPPET.impls.PuppetInterface): void; __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined; __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined; __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined; __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined; __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined; __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined; __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined; __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined; __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined; __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined; __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined; __wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined; __wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined; readonly Contact: import("../user-modules/contact.js").ContactConstructor; readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor; readonly Delay: import("../user-modules/delay.js").DelayConstructor; readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor; readonly Image: import("../user-modules/image.js").ImageConstructor; readonly Location: import("../user-modules/location.js").LocationConstructor; readonly Message: import("../user-modules/message.js").MessageConstructor; readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor; readonly Post: import("../user-modules/post.js").PostConstructor; readonly Room: import("../user-modules/room.js").RoomConstructor; readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor; readonly Tag: import("../user-modules/tag.js").TagConstructor; readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor; __io?: import("../io.js").Io | undefined; readonly io: import("../io.js").Io; __ioToken?: string | undefined; }) & { readonly log: import("brolog/dist/esm/src/logger.js").Loggable; }) & ((abstract new (...args: any[]) => { toString(): string; name(): string; version(): string; sleep(milliseconds: number): Promise<void>; ding(data?: string | undefined): void; readonly log: import("brolog/dist/esm/src/logger.js").Loggable; readonly id: string; __memory?: import("memory-card").MemoryCard | undefined; readonly memory: import("memory-card").MemoryCard; __options: WechatyOptions; init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan", listener: (...args: any[]) => any): any; addListener<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any; once<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any; prependListener<E_13 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_13, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_13]): any; prependOnceListener<E_14 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_14, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_14]): any; off<E_15 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_15, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_15]): any; removeAllListeners<E_16 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event?: E_16 | undefined): any; removeListener<E_17 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_17, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_17]): any; emit: (<E_7 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_7, ...args: import("typed-emitter").Arguments<import("../schemas/wechaty-events.js").WechatyEventListeners[E_7]>) => boolean) & ((event: any, ...args: any) => boolean); eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[]; listeners<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../schemas/wechaty-events.js").WechatyEventListeners; __puppet?: PUPPET.impls.PuppetInterface | undefined; readonly puppet: PUPPET.impls.PuppetInterface; readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface; __puppetMixinInited: boolean; ready(): Promise<void>; __setupPuppetEvents(puppet: PUPPET.impls.PuppetInterface): void; __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined; __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined; __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined; __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined; __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined; __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined; __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined; __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined; __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined; __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined; __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined; __wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined; __wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined; readonly Contact: import("../user-modules/contact.js").ContactConstructor; readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor; readonly Delay: import("../user-modules/delay.js").DelayConstructor; readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor; readonly Image: import("../user-modules/image.js").ImageConstructor; readonly Location: import("../user-modules/location.js").LocationConstructor; readonly Message: import("../user-modules/message.js").MessageConstructor; readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor; readonly Post: import("../user-modules/post.js").PostConstructor; readonly Room: import("../user-modules/room.js").RoomConstructor; readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor; readonly Tag: import("../user-modules/tag.js").TagConstructor; readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; emitError(e: any): void; __io?: import("../io.js").Io | undefined; readonly io: import("../io.js").Io; __ioToken?: string | undefined; }) & { readonly log: import("brolog/dist/esm/src/logger.js").Loggable; }) & ((abstract new (...args: any[]) => { readonly authQrCode: string | undefined; readonly currentUser: import("../user-modules/contact-self.js").ContactSelfInterface; readonly isLoggedIn: boolean; __loginMixinInited: boolean; init(): Promise<void>; logout(): Promise<void>; logonoff(): boolean; userSelf(): import("../user-modules/contact-self.js").ContactSelfInterface; readonly log: import("brolog/dist/esm/src/logger.js").Loggable; readonly id: string; __memory?: import("memory-card").MemoryCard | undefined; readonly memory: import("memory-card").MemoryCard; __options: WechatyOptions; start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan", listener: (...args: any[]) => any): any; addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any; once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any; prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any; prependOnceListener<E_21 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_21, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_21]): any; off<E_22 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_22, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_22]): any; removeAllListeners<E_23 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event?: E_23 | undefined): any; removeListener<E_24 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_24, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_24]): any; emit: (<E_7 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_7, ...args: import("typed-emitter").Arguments<import("../schemas/wechaty-events.js").WechatyEventListeners[E_7]>) => boolean) & ((event: any, ...args: any) => boolean); eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[]; listeners<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../schemas/wechaty-events.js").WechatyEventListeners; __puppet?: PUPPET.impls.PuppetInterface | undefined; readonly puppet: PUPPET.impls.PuppetInterface; readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface; __puppetMixinInited: boolean; ready(): Promise<void>; __setupPuppetEvents(puppet: PUPPET.impls.PuppetInterface): void; __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined; __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined; __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined; __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined; __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined; __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined; __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined; __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined; __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined; __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined; __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined; __wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined; __wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined; readonly Contact: import("../user-modules/contact.js").ContactConstructor; readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor; readonly Delay: import("../user-modules/delay.js").DelayConstructor; readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor; readonly Image: import("../user-modules/image.js").ImageConstructor; readonly Location: import("../user-modules/location.js").LocationConstructor; readonly Message: import("../user-modules/message.js").MessageConstructor; readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor; readonly Post: import("../user-modules/post.js").PostConstructor; readonly Room: import("../user-modules/room.js").RoomConstructor; readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor; readonly Tag: import("../user-modules/tag.js").TagConstructor; readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; emitError(e: any): void; __io?: import("../io.js").Io | undefined; readonly io: import("../io.js").Io; __ioToken?: string | undefined; }) & { readonly log: import("brolog/dist/esm/src/logger.js").Loggable; }) & ((abstract new (...args: any[]) => { __puppet?: PUPPET.impls.PuppetInterface | undefined; readonly puppet: PUPPET.impls.PuppetInterface; readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface; __puppetMixinInited: boolean; start(): Promise<void>; stop(): Promise<void>; ready(): Promise<void>; init(): Promise<void>; __setupPuppetEvents(puppet: PUPPET.impls.PuppetInterface): void; __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined; __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined; __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined; __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined; __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined; __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined; __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined; __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined; __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined; __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined; __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined; __wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined; __wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined; readonly Contact: import("../user-modules/contact.js").ContactConstructor; readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor; readonly Delay: import("../user-modules/delay.js").DelayConstructor; readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor; readonly Image: import("../user-modules/image.js").ImageConstructor; readonly Location: import("../user-modules/location.js").LocationConstructor; readonly Message: import("../user-modules/message.js").MessageConstructor; readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor; readonly Post: import("../user-modules/post.js").PostConstructor; readonly Room: import("../user-modules/room.js").RoomConstructor; readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor; readonly Tag: import("../user-modules/tag.js").TagConstructor; readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor; readonly log: import("brolog/dist/esm/src/logger.js").Loggable; readonly id: string; __memory?: import("memory-card").MemoryCard | undefined; readonly memory: import("memory-card").MemoryCard; __options: WechatyOptions; on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan", listener: (...args: any[]) => any): any; addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any; once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any; prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any; prependOnceListener<E_28 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_28, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_28]): any; off<E_29 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_29, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_29]): any; removeAllListeners<E_30 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event?: E_30 | undefined): any; removeListener<E_31 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_31, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_31]): any; emit: (<E_7 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_7, ...args: import("typed-emitter").Arguments<import("../schemas/wechaty-events.js").WechatyEventListeners[E_7]>) => boolean) & ((event: any, ...args: any) => boolean); eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[]; listeners<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../schemas/wechaty-events.js").WechatyEventListeners; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; emitError(e: any): void; __io?: import("../io.js").Io | undefined; readonly io: import("../io.js").Io; __ioToken?: string | undefined; }) & { readonly log: import("brolog/dist/esm/src/logger.js").Loggable; }) & ((abstract new (...args: any[]) => { __io?: import("../io.js").Io | undefined; readonly io: import("../io.js").Io; __ioToken?: string | undefined; start(): Promise<void>; stop(): Promise<void>; readonly log: import("brolog/dist/esm/src/logger.js").Loggable; readonly id: string; __memory?: import("memory-card").MemoryCard | undefined; readonly memory: import("memory-card").MemoryCard; __options: WechatyOptions; init(): Promise<void>; on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan", listener: (...args: any[]) => any): any; addListener<E_32 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_32, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_32]): any; once<E_33 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_33, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_33]): any; prependListener<E_34 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_34, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_34]): any; prependOnceListener<E_35 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_35, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_35]): any; off<E_36 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_36, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_36]): any; removeAllListeners<E_37 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event?: E_37 | undefined): any; removeListener<E_38 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_38, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_38]): any; emit: (<E_7 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_7, ...args: import("typed-emitter").Arguments<import("../schemas/wechaty-events.js").WechatyEventListeners[E_7]>) => boolean) & ((event: any, ...args: any) => boolean); eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[]; listeners<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../schemas/wechaty-events.js").WechatyEventListeners; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; emitError(e: any): void; }) & { readonly log: import("brolog/dist/esm/src/logger.js").Loggable; }) & ((abstract new (...args: any[]) => { __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined; __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined; __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined; __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined; __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined; __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined; __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined; __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined; __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined; __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined; __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined; __wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined; __wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined; readonly Contact: import("../user-modules/contact.js").ContactConstructor; readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor; readonly Delay: import("../user-modules/delay.js").DelayConstructor; readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor; readonly Image: import("../user-modules/image.js").ImageConstructor; readonly Location: import("../user-modules/location.js").LocationConstructor; readonly Message: import("../user-modules/message.js").MessageConstructor; readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor; readonly Post: import("../user-modules/post.js").PostConstructor; readonly Room: import("../user-modules/room.js").RoomConstructor; readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor; readonly Tag: import("../user-modules/tag.js").TagConstructor; readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor; init(): Promise<void>; readonly log: import("brolog/dist/esm/src/logger.js").Loggable; readonly id: string; __memory?: import("memory-card").MemoryCard | undefined; readonly memory: import("memory-card").MemoryCard; __options: WechatyOptions; start(): Promise<void>; stop(): Promise<void>; on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan", listener: (...args: any[]) => any): any; addListener<E_39 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_39, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_39]): any; once<E_40 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_40, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_40]): any; prependListener<E_41 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_41, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_41]): any; prependOnceListener<E_42 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_42, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_42]): any; off<E_43 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_43, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_43]): any; removeAllListeners<E_44 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event?: E_44 | undefined): any; removeListener<E_45 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_45, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_45]): any; emit<E_7 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_7, ...args: import("typed-emitter").Arguments<import("../schemas/wechaty-events.js").WechatyEventListeners[E_7]>): boolean; eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[]; listeners<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../schemas/wechaty-events.js").WechatyEventListeners; }) & { readonly log: import("brolog/dist/esm/src/logger.js").Loggable; }) & ((abstract new (...args: any[]) => { wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; emitError(e: any): void; emit(event: any, ...args: any): boolean; readonly log: import("brolog/dist/esm/src/logger.js").Loggable; readonly id: string; __memory?: import("memory-card").MemoryCard | undefined; readonly memory: import("memory-card").MemoryCard; __options: WechatyOptions; init(): Promise<void>; start(): Promise<void>; stop(): Promise<void>; on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan", listener: (...args: any[]) => any): any; addListener<E_46 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_46, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_46]): any; once<E_47 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_47, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_47]): any; prependListener<E_48 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_48, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_48]): any; prependOnceListener<E_49 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_49, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_49]): any; off<E_50 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_50, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_50]): any; removeAllListeners<E_51 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event?: E_51 | undefined): any; removeListener<E_52 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_52, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_52]): any; eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[]; listeners<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../schemas/wechaty-events.js").WechatyEventListeners; }) & { readonly log: import("brolog/dist/esm/src/logger.js").Loggable; }) & typeof WechatySkeleton; /** * Huan(2021211): Keep the below call back hell * because it's easy for testing * especially when there's some typing mismatch and we need to figure it out. */ /** * Main bot class. * * A `Bot` is a WeChat client depends on which puppet you use. * It may equals * - web-WeChat, when you use: [puppet-puppeteer](https://github.com/wechaty/wechaty-puppet-puppeteer)/[puppet-wechat4u](https://github.com/wechaty/wechaty-puppet-wechat4u) * - ipad-WeChat, when you use: [puppet-padchat](https://github.com/wechaty/wechaty-puppet-padchat) * - ios-WeChat, when you use: puppet-ioscat * * See more: * - [What is a Puppet in Wechaty](https://github.com/wechaty/getting-started/wiki/FAQ#31-what-is-a-puppet-in-wechaty) * * > If you want to know how to send message, see [Message](#Message) <br> * > If you want to know how to get contact, see [Contact](#Contact) * * @example <caption>The World's Shortest ChatBot Code: 6 lines of JavaScript</caption> * import { WechatyBuilder } from 'wechaty' * const bot = WechatyBuilder.build() * bot.on('scan', (qrCode, status) => console.log('https://wechaty.js.org/qrcode/' + encodeURIComponent(qrcode))) * bot.on('login', user => console.log(`User ${user} logged in`)) * bot.on('message', message => console.log(`Message: ${message}`)) * bot.start() */ declare class WechatyBase extends mixinBase implements SayableSayer { __options: WechatyOptions; static readonly VERSION: string; readonly wechaty: WechatyInterface; readonly _stopCallbackList: (() => void)[]; /** * The term [Puppet](https://wechaty.js.org/docs/specs/puppet) in Wechaty is an Abstract Class for implementing protocol plugins. * The plugins are the component that helps Wechaty to control the WeChat(that's the reason we call it puppet). * The plugins are named XXXPuppet, for example: * - [PuppetWeChat](https://github.com/wechaty/puppet-wechat): * - [PuppetWeChat](https://github.com/wechaty/puppet-service): * - [PuppetXP](https://github.com/wechaty/puppet-xp) * * @typedef PuppetModuleName * @property {string} PUPPET_DEFAULT * The default puppet. * @property {string} wechaty-puppet-wechat4u * The default puppet, using the [wechat4u](https://github.com/nodeWechat/wechat4u) to control the [WeChat Web API](https://wx.qq.com/) via a chrome browser. * @property {string} wechaty-puppet-service * - Using the gRPC protocol to connect with a Protocol Server for controlling the any protocol of any IM program. * @property {string} wechaty-puppet-wechat * - Using the [google puppeteer](https://github.com/GoogleChrome/puppeteer) to control the [WeChat Web API](https://wx.qq.com/) via a chrome browser. * @property {string} wechaty-puppet-mock * - Using the mock data to mock wechat operation, just for test. */ /** * The option parameter to create a wechaty instance * * @typedef WechatyOptions * @property {string} name -Wechaty Name. </br> * When you set this: </br> * `new Wechaty({name: 'wechaty-name'}) ` </br> * it will generate a file called `wechaty-name.memory-card.json`. </br> * This file stores the login information for bot. </br> * If the file is valid, the bot can auto login so you don't need to scan the qrCode to login again. </br> * Also, you can set the environment variable for `WECHATY_NAME` to set this value when you start. </br> * eg: `WECHATY_NAME="your-cute-bot-name" node bot.js` * @property {PuppetModuleName | Puppet} puppet -Puppet name or instance * @property {Partial<PuppetOptions>} puppetOptions -Puppet TOKEN * @property {string} ioToken -Io TOKEN */ /** * Creates an instance of Wechaty. * @param {WechatyOptions} [options={}] * */ constructor(__options?: WechatyOptions); start(): Promise<void>; onStart(): Promise<void>; onStop(): Promise<void>; /** * Send message to currentUser, in other words, bot send message to itself. * > Tips: * This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/wechaty/wechaty/wiki/Puppet#3-puppet-compatible-table) * * @param {(string | Contact | FileBox | UrlLink | MiniProgram | Location)} sayable * send text, Contact, or file to bot. </br> * You can use {@link https://www.npmjs.com/package/file-box|FileBox} to send file * * @returns {Promise<void>} * * @example * const bot = new Wechaty() * await bot.start() * // after logged in * * // 1. send text to bot itself * await bot.say('hello!') * * // 2. send Contact to bot itself * const contact = await bot.Contact.find() * await bot.say(contact) * * // 3. send Image to bot itself from remote url * import { FileBox } from 'wechaty' * const fileBox = FileBox.fromUrl('https://wechaty.github.io/wechaty/images/bot-qr-code.png') * await bot.say(fileBox) * * // 4. send Image to bot itself from local file * import { FileBox } from 'wechaty' * const fileBox = FileBox.fromFile('/tmp/text.jpg') * await bot.say(fileBox) * * // 5. send Link to bot itself * const linkPayload = new UrlLink ({ * description : 'WeChat Bot SDK for Individual Account, Powered by TypeScript, Docker, and Love', * thumbnailUrl: 'https://avatars0.githubusercontent.com/u/25162437?s=200&v=4', * title : 'Welcome to Wechaty', * url : 'https://github.com/wechaty/wechaty', * }) * await bot.say(linkPayload) * * // 6. send MiniProgram to bot itself * const miniPayload = new MiniProgram ({ * username : 'gh_xxxxxxx', //get from mp.weixin.qq.com * appid : '', //optional, get from mp.weixin.qq.com * title : '', //optional * pagepath : '', //optional * description : '', //optional * thumbnailurl : '', //optional * }) * await bot.say(miniPayload) */ say(sayable: Sayable): Promise<void>; publish(post: PostInterface): Promise<void | PostInterface>; } type WechatyBaseProtectedProperty = '__serviceCtlLogger' | '__serviceCtlResettingIndicator' | 'wechaty' | 'onStart' | 'onStop'; export type { WechatyBaseProtectedProperty, }; export { WechatyBase, }; //# sourceMappingURL=wechaty-base.d.ts.map