import { WrapAsync } from 'gerror'; import type { WechatySkeleton } from '../wechaty/mod.js'; declare const gErrorMixin: (mixinBase: MixinBase) => ((abstract new (...args: any[]) => { /** * Wrap promise in sync way (catch error by emitting it) * 1. convert a async callback function to be sync function * by catcing any errors and emit them to error event * 2. wrap a Promise by catcing any errors and emit them to error event */ wrapAsync: WrapAsync; /** * Wechaty internally can use `emit('error' whatever)` to emit any error * But the external call can only emit GError. * That's the reason why we need the below `emitError(e: any) */ emitError(e: any): void; /** * Convert any error to GError, * and emit `error` event with GError */ 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: import("../schemas/wechaty-options.js").WechatyOptions; init(): Promise; start(): Promise; stop(): Promise; 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(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any; once(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any; prependListener(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any; prependOnceListener(event: E_3, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_3]): any; off(event: E_4, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_4]): any; removeAllListeners(event?: E_5 | undefined): any; removeListener(event: E_6, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_6]): any; eventNames(): (string | symbol)[]; rawListeners(event: E_7): Function[]; listeners(event: E_8): Function[]; listenerCount(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; declare type GErrorMixin = ReturnType; declare type ProtectedPropertyGErrorMixin = never; export type { GErrorMixin, ProtectedPropertyGErrorMixin, }; export { gErrorMixin, }; //# sourceMappingURL=gerror-mixin.d.ts.map