UNPKG

wechaty-puppet

Version:

Abstract Puppet for Wechaty

250 lines 21.3 kB
import type { PuppetSkeleton } from '../puppet/puppet-skeleton.js'; import { SayablePayload } from '../schemas/sayable.js'; declare const sayableMixin: <MixinBase extends typeof PuppetSkeleton & (abstract new (...args: any[]) => { conversationReadMark(conversationId: string, hasRead?: boolean | undefined): Promise<boolean | void>; messageContact(messageId: string): Promise<string>; messageFile(messageId: string): Promise<import("file-box/dist/esm/src/interface.js").FileBoxInterface>; messageImage(messageId: string, imageType: import("../schemas/image.js").ImageType): Promise<import("file-box/dist/esm/src/interface.js").FileBoxInterface>; messageMiniProgram(messageId: string): Promise<import("../schemas/mini-program.js").MiniProgramPayload>; messageUrl(messageId: string): Promise<import("../schemas/url-link.js").UrlLinkPayload>; messageLocation(messageId: string): Promise<import("../schemas/location.js").LocationPayload>; messageForward(conversationId: string, messageId: string): Promise<string | void>; messageSendContact(conversationId: string, contactId: string): Promise<string | void>; messageSendFile(conversationId: string, file: import("file-box/dist/esm/src/interface.js").FileBoxInterface): Promise<string | void>; messageSendLocation(conversationId: string, locationPayload: import("../schemas/location.js").LocationPayload): Promise<string | void>; messageSendMiniProgram(conversationId: string, miniProgramPayload: import("../schemas/mini-program.js").MiniProgramPayload): Promise<string | void>; messageSendPost(conversationId: string, postPayload: import("../schemas/post.js").PostPayload): Promise<string | void>; messageSendText(conversationId: string, text: string, mentionIdList?: string[] | undefined): Promise<string | void>; messageSendUrl(conversationId: string, urlLinkPayload: import("../schemas/url-link.js").UrlLinkPayload): Promise<string | void>; messageRecall(messageId: string): Promise<boolean>; messageRawPayload(messageId: string): Promise<any>; messageRawPayloadParser(rawPayload: any): Promise<import("../schemas/message.js").MessagePayload>; messagePayloadCache(messageId: string): import("../schemas/message.js").MessagePayload | undefined; messagePayload(messageId: string): Promise<import("../schemas/message.js").MessagePayload>; messageList(): string[]; messageSearch(query?: import("../schemas/message.js").MessageQueryFilter | undefined): Promise<string[]>; messageQueryFilterFactory(query: import("../schemas/message.js").MessageQueryFilter): import("../schemas/message.js").MessagePayloadFilterFunction; messagePayloadDirty(id: string): Promise<void>; messageSend(conversationId: string, sayable: SayablePayload): Promise<string | void>; readonly id: string; readonly options: import("../schemas/puppet.js").PuppetOptions; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); emit(event: any, ...args: any): boolean; addListener<E extends keyof import("../puppet/events.js").PuppetEventListener>(event: E, listener: import("../puppet/events.js").PuppetEventListener[E]): any; on<E_1 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_1, listener: import("../puppet/events.js").PuppetEventListener[E_1]): any; once<E_2 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_2, listener: import("../puppet/events.js").PuppetEventListener[E_2]): any; prependListener<E_3 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_3, listener: import("../puppet/events.js").PuppetEventListener[E_3]): any; prependOnceListener<E_4 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_4, listener: import("../puppet/events.js").PuppetEventListener[E_4]): any; off<E_5 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_5, listener: import("../puppet/events.js").PuppetEventListener[E_5]): any; removeAllListeners<E_6 extends keyof import("../puppet/events.js").PuppetEventListener>(event?: E_6 | undefined): any; removeListener<E_7 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_7, listener: import("../puppet/events.js").PuppetEventListener[E_7]): any; eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_8): Function[]; listeners<E_9 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../puppet/events.js").PuppetEventListener; cache: import("../agents/cache-agent.js").CacheAgent; __cacheMixinCleanCallbackList: (() => void)[]; dirtyPayload(type: import("../schemas/dirty.js").DirtyType, id: string): void; onDirty({ payloadType, payloadId, }: import("../schemas/event.js").EventDirtyPayload): void; __dirtyPayloadAwait(type: import("../schemas/dirty.js").DirtyType, id: string): Promise<void>; __currentUserId?: string | undefined; readonly currentUserId: string; readonly isLoggedIn: boolean; __authQrCode?: string | undefined; readonly authQrCode: string | undefined; login(userId: string): void; logout(reason?: string): Promise<void>; selfId(): string; logonoff(): boolean; }) & (abstract new (...args: any[]) => { cache: import("../agents/cache-agent.js").CacheAgent; __cacheMixinCleanCallbackList: (() => void)[]; start(): Promise<void>; stop(): Promise<void>; dirtyPayload(type: import("../schemas/dirty.js").DirtyType, id: string): void; onDirty({ payloadType, payloadId, }: import("../schemas/event.js").EventDirtyPayload): void; __dirtyPayloadAwait(type: import("../schemas/dirty.js").DirtyType, id: string): Promise<void>; readonly id: string; readonly options: import("../schemas/puppet.js").PuppetOptions; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; emit(event: any, ...args: any): boolean; addListener<E_11 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_11, listener: import("../puppet/events.js").PuppetEventListener[E_11]): any; on<E_12 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_12, listener: import("../puppet/events.js").PuppetEventListener[E_12]): any; once<E_13 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_13, listener: import("../puppet/events.js").PuppetEventListener[E_13]): any; prependListener<E_14 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_14, listener: import("../puppet/events.js").PuppetEventListener[E_14]): any; prependOnceListener<E_15 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_15, listener: import("../puppet/events.js").PuppetEventListener[E_15]): any; off<E_16 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_16, listener: import("../puppet/events.js").PuppetEventListener[E_16]): any; removeAllListeners<E_17 extends keyof import("../puppet/events.js").PuppetEventListener>(event?: E_17 | undefined): any; removeListener<E_18 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_18, listener: import("../puppet/events.js").PuppetEventListener[E_18]): any; eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_8): Function[]; listeners<E_9 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../puppet/events.js").PuppetEventListener; __currentUserId?: string | undefined; readonly currentUserId: string; readonly isLoggedIn: boolean; __authQrCode?: string | undefined; readonly authQrCode: string | undefined; login(userId: string): void; logout(reason?: string): Promise<void>; selfId(): string; logonoff(): boolean; }) & (abstract new (...args: any[]) => { __currentUserId?: string | undefined; readonly currentUserId: string; readonly isLoggedIn: boolean; __authQrCode?: string | undefined; readonly authQrCode: string | undefined; start(): Promise<void>; stop(): Promise<void>; login(userId: string): void; logout(reason?: string): Promise<void>; selfId(): string; logonoff(): boolean; readonly id: string; readonly options: import("../schemas/puppet.js").PuppetOptions; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; emit(event: any, ...args: any): boolean; addListener<E_19 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_19, listener: import("../puppet/events.js").PuppetEventListener[E_19]): any; on<E_20 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_20, listener: import("../puppet/events.js").PuppetEventListener[E_20]): any; once<E_21 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_21, listener: import("../puppet/events.js").PuppetEventListener[E_21]): any; prependListener<E_22 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_22, listener: import("../puppet/events.js").PuppetEventListener[E_22]): any; prependOnceListener<E_23 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_23, listener: import("../puppet/events.js").PuppetEventListener[E_23]): any; off<E_24 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_24, listener: import("../puppet/events.js").PuppetEventListener[E_24]): any; removeAllListeners<E_25 extends keyof import("../puppet/events.js").PuppetEventListener>(event?: E_25 | undefined): any; removeListener<E_26 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_26, listener: import("../puppet/events.js").PuppetEventListener[E_26]): any; eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_8): Function[]; listeners<E_9 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../puppet/events.js").PuppetEventListener; }) & (abstract new (...args: any[]) => { postRawPayload(postId: string): Promise<any>; postRawPayloadParser(rawPayload: any): Promise<import("../schemas/post.js").PostPayload>; postPayloadCache(postId: string): import("../schemas/post.js").PostPayload | undefined; postPayload(postId: string): Promise<import("../schemas/post.js").PostPayload>; postPublish(payload: import("../schemas/post.js").PostPayload): Promise<string | void>; postSearch(filter: import("../schemas/post.js").PostQueryFilter, pagination?: import("../schemas/pagination.js").PaginationRequest | undefined): Promise<import("../schemas/pagination.js").PaginationResponse<string[]>>; postList(): string[]; postPayloadDirty(id: string): Promise<void>; readonly id: string; readonly options: import("../schemas/puppet.js").PuppetOptions; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); emit(event: any, ...args: any): boolean; addListener<E_27 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_27, listener: import("../puppet/events.js").PuppetEventListener[E_27]): any; on<E_28 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_28, listener: import("../puppet/events.js").PuppetEventListener[E_28]): any; once<E_29 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_29, listener: import("../puppet/events.js").PuppetEventListener[E_29]): any; prependListener<E_30 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_30, listener: import("../puppet/events.js").PuppetEventListener[E_30]): any; prependOnceListener<E_31 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_31, listener: import("../puppet/events.js").PuppetEventListener[E_31]): any; off<E_32 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_32, listener: import("../puppet/events.js").PuppetEventListener[E_32]): any; removeAllListeners<E_33 extends keyof import("../puppet/events.js").PuppetEventListener>(event?: E_33 | undefined): any; removeListener<E_34 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_34, listener: import("../puppet/events.js").PuppetEventListener[E_34]): any; eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_8): Function[]; listeners<E_9 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../puppet/events.js").PuppetEventListener; cache: import("../agents/cache-agent.js").CacheAgent; __cacheMixinCleanCallbackList: (() => void)[]; dirtyPayload(type: import("../schemas/dirty.js").DirtyType, id: string): void; onDirty({ payloadType, payloadId, }: import("../schemas/event.js").EventDirtyPayload): void; __dirtyPayloadAwait(type: import("../schemas/dirty.js").DirtyType, id: string): Promise<void>; __currentUserId?: string | undefined; readonly currentUserId: string; readonly isLoggedIn: boolean; __authQrCode?: string | undefined; readonly authQrCode: string | undefined; login(userId: string): void; logout(reason?: string): Promise<void>; selfId(): string; logonoff(): boolean; })>(mixinBase: MixinBase) => (abstract new (...args: any[]) => { sayablePayload(sayableId: string): Promise<undefined | SayablePayload>; readonly id: string; readonly options: import("../schemas/puppet.js").PuppetOptions; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>); emit(event: any, ...args: any): boolean; addListener<E_35 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_35, listener: import("../puppet/events.js").PuppetEventListener[E_35]): any; on<E_36 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_36, listener: import("../puppet/events.js").PuppetEventListener[E_36]): any; once<E_37 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_37, listener: import("../puppet/events.js").PuppetEventListener[E_37]): any; prependListener<E_38 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_38, listener: import("../puppet/events.js").PuppetEventListener[E_38]): any; prependOnceListener<E_39 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_39, listener: import("../puppet/events.js").PuppetEventListener[E_39]): any; off<E_40 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_40, listener: import("../puppet/events.js").PuppetEventListener[E_40]): any; removeAllListeners<E_41 extends keyof import("../puppet/events.js").PuppetEventListener>(event?: E_41 | undefined): any; removeListener<E_42 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_42, listener: import("../puppet/events.js").PuppetEventListener[E_42]): any; eventNames(): (string | symbol)[]; rawListeners<E_8 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_8): Function[]; listeners<E_9 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_9): Function[]; listenerCount<E_10 extends keyof import("../puppet/events.js").PuppetEventListener>(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../puppet/events.js").PuppetEventListener; conversationReadMark(conversationId: string, hasRead?: boolean | undefined): Promise<boolean | void>; messageContact(messageId: string): Promise<string>; messageFile(messageId: string): Promise<import("file-box/dist/esm/src/interface.js").FileBoxInterface>; messageImage(messageId: string, imageType: import("../schemas/image.js").ImageType): Promise<import("file-box/dist/esm/src/interface.js").FileBoxInterface>; messageMiniProgram(messageId: string): Promise<import("../schemas/mini-program.js").MiniProgramPayload>; messageUrl(messageId: string): Promise<import("../schemas/url-link.js").UrlLinkPayload>; messageLocation(messageId: string): Promise<import("../schemas/location.js").LocationPayload>; messageForward(conversationId: string, messageId: string): Promise<string | void>; messageSendContact(conversationId: string, contactId: string): Promise<string | void>; messageSendFile(conversationId: string, file: import("file-box/dist/esm/src/interface.js").FileBoxInterface): Promise<string | void>; messageSendLocation(conversationId: string, locationPayload: import("../schemas/location.js").LocationPayload): Promise<string | void>; messageSendMiniProgram(conversationId: string, miniProgramPayload: import("../schemas/mini-program.js").MiniProgramPayload): Promise<string | void>; messageSendPost(conversationId: string, postPayload: import("../schemas/post.js").PostPayload): Promise<string | void>; messageSendText(conversationId: string, text: string, mentionIdList?: string[] | undefined): Promise<string | void>; messageSendUrl(conversationId: string, urlLinkPayload: import("../schemas/url-link.js").UrlLinkPayload): Promise<string | void>; messageRecall(messageId: string): Promise<boolean>; messageRawPayload(messageId: string): Promise<any>; messageRawPayloadParser(rawPayload: any): Promise<import("../schemas/message.js").MessagePayload>; messagePayloadCache(messageId: string): import("../schemas/message.js").MessagePayload | undefined; messagePayload(messageId: string): Promise<import("../schemas/message.js").MessagePayload>; messageList(): string[]; messageSearch(query?: import("../schemas/message.js").MessageQueryFilter | undefined): Promise<string[]>; messageQueryFilterFactory(query: import("../schemas/message.js").MessageQueryFilter): import("../schemas/message.js").MessagePayloadFilterFunction; messagePayloadDirty(id: string): Promise<void>; messageSend(conversationId: string, sayable: SayablePayload): Promise<string | void>; cache: import("../agents/cache-agent.js").CacheAgent; __cacheMixinCleanCallbackList: (() => void)[]; dirtyPayload(type: import("../schemas/dirty.js").DirtyType, id: string): void; onDirty({ payloadType, payloadId, }: import("../schemas/event.js").EventDirtyPayload): void; __dirtyPayloadAwait(type: import("../schemas/dirty.js").DirtyType, id: string): Promise<void>; __currentUserId?: string | undefined; readonly currentUserId: string; readonly isLoggedIn: boolean; __authQrCode?: string | undefined; readonly authQrCode: string | undefined; login(userId: string): void; logout(reason?: string): Promise<void>; selfId(): string; logonoff(): boolean; postRawPayload(postId: string): Promise<any>; postRawPayloadParser(rawPayload: any): Promise<import("../schemas/post.js").PostPayload>; postPayloadCache(postId: string): import("../schemas/post.js").PostPayload | undefined; postPayload(postId: string): Promise<import("../schemas/post.js").PostPayload>; postPublish(payload: import("../schemas/post.js").PostPayload): Promise<string | void>; postSearch(filter: import("../schemas/post.js").PostQueryFilter, pagination?: import("../schemas/pagination.js").PaginationRequest | undefined): Promise<import("../schemas/pagination.js").PaginationResponse<string[]>>; postList(): string[]; postPayloadDirty(id: string): Promise<void>; }) & MixinBase; declare type SayableMixin = ReturnType<typeof sayableMixin>; declare type ProtectedPropertySayableMixin = never; export type { SayableMixin, ProtectedPropertySayableMixin, }; export { sayableMixin }; //# sourceMappingURL=sayable-mixin.d.ts.map