@juzi/wechaty
Version:
Wechaty is a RPA SDK for Chatbot Makers.
75 lines • 6.87 kB
TypeScript
import { Io } from '../io.js';
import type { WechatyOptions } from '../wechaty-builder.js';
import type { WechatySkeleton } from '../wechaty/mod.js';
/**
* Huan(202111): we should not include the IO logic internally
*
* TODO: remove all IO related logics from Wechaty internal
*/
declare const ioMixin: <MixinBase extends typeof WechatySkeleton & ((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" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "contact-corporation" | "room-owner" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url", 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;
eventNames(): (string | symbol)[];
rawListeners<E_7 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_7): Function[];
listeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[];
listenerCount<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): number;
getMaxListeners(): number;
setMaxListeners(maxListeners: number): any;
__events: import("../schemas/wechaty-events.js").WechatyEventListeners;
}) & {
readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
})>(mixinBase: MixinBase) => ((abstract new (...args: any[]) => {
__io?: Io | undefined;
readonly io: 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" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "contact-corporation" | "room-owner" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url", listener: (...args: any[]) => any): any;
addListener<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_10]): any;
once<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
prependListener<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
prependOnceListener<E_13 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_13, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_13]): any;
off<E_14 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_14, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_14]): any;
removeAllListeners<E_15 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event?: E_15 | undefined): any;
removeListener<E_16 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_16, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_16]): any;
emit: (<E_17 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_17, ...args: import("typed-emitter").Arguments<import("../schemas/wechaty-events.js").WechatyEventListeners[E_17]>) => boolean) & ((event: any, ...args: any) => boolean);
eventNames(): (string | symbol)[];
rawListeners<E_7 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_7): Function[];
listeners<E_8 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_8): Function[];
listenerCount<E_9 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_9): 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;
}) & MixinBase;
declare type IoMixin = ReturnType<typeof ioMixin>;
declare type ProtectedPropertyIoMixin = '__io' | '__ioToken' | 'io';
export type { IoMixin, ProtectedPropertyIoMixin, };
export { ioMixin, };
//# sourceMappingURL=io-mixin.d.ts.map