import type { PuppetOptions, EventDirtyPayload } from '../schemas/mod.js'; import { DirtyType } from '../schemas/mod.js'; import { CacheAgent } from '../agents/mod.js'; import type { PuppetSkeleton } from '../puppet/mod.js'; /** * * Huan(202111) Issue #158 - Refactoring the 'dirty' event, dirtyPayload(), * and XXXPayloadDirty() methods logic & spec * * @see https://github.com/wechaty/puppet/issues/158 * */ declare const cacheMixin: { __currentUserId?: string | undefined; readonly currentUserId: string; readonly isLoggedIn: boolean; __authQrCode?: string | undefined; readonly authQrCode: string | undefined; start(): Promise; stop(): Promise; /** * Huan(202111): we return first before emit the `dirty` event? */ login(userId: string): void; logout(reason?: string): Promise; selfId(): string; logonoff(): boolean; readonly id: string; readonly options: PuppetOptions; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; /** * * @windmemory(202008): add dirty payload methods * * @see https://github.com/wechaty/grpc/pull/79 * * Call this method when you want to notify the server that the data cache need to be invalidated. */ emit(event: any, ...args: any): boolean; addListener(event: E, listener: import("../puppet/events.js").PuppetEventListener[E]): any; on(event: E_1, listener: import("../puppet/events.js").PuppetEventListener[E_1]): any; once(event: E_2, listener: import("../puppet/events.js").PuppetEventListener[E_2]): any; prependListener(event: E_3, listener: import("../puppet/events.js").PuppetEventListener[E_3]): any; prependOnceListener(event: E_4, listener: import("../puppet/events.js").PuppetEventListener[E_4]): any; off(event: E_5, listener: import("../puppet/events.js").PuppetEventListener[E_5]): any; removeAllListeners(event?: E_6 | undefined): any; removeListener(event: E_7, listener: import("../puppet/events.js").PuppetEventListener[E_7]): any; eventNames(): (string | symbol)[]; rawListeners(event: E_8): Function[]; listeners(event: E_9): Function[]; listenerCount(event: E_10): number; getMaxListeners(): number; setMaxListeners(maxListeners: number): any; __events: import("../puppet/events.js").PuppetEventListener; })>(mixinBase: MixinBase) => (abstract new (...args: any[]) => { cache: CacheAgent; __cacheMixinCleanCallbackList: (() => void)[]; start(): Promise; stop(): Promise; /** * * @windmemory(202008): add dirty payload methods * * @see https://github.com/wechaty/grpc/pull/79 * * Call this method when you want to notify the server that the data cache need to be invalidated. */ dirtyPayload(type: DirtyType, id: string): void; /** * OnDirty will be registered as a `dirty` event listener, * and it will invalidate the cache. */ onDirty({ payloadType, payloadId, }: EventDirtyPayload): void; /** * When we are using PuppetService, the `dirty` event will be emitted from the server, * and we need to wait for the `dirty` event so we can make sure the cache has been invalidated. */ __dirtyPayloadAwait(type: DirtyType, id: string): Promise; readonly id: string; readonly options: PuppetOptions; wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync; /** * * @windmemory(202008): add dirty payload methods * * @see https://github.com/wechaty/grpc/pull/79 * * Call this method when you want to notify the server that the data cache need to be invalidated. */ emit(event: any, ...args: any): boolean; addListener(event: E_11, listener: import("../puppet/events.js").PuppetEventListener[E_11]): any; on(event: E_12, listener: import("../puppet/events.js").PuppetEventListener[E_12]): any; once(event: E_13, listener: import("../puppet/events.js").PuppetEventListener[E_13]): any; prependListener(event: E_14, listener: import("../puppet/events.js").PuppetEventListener[E_14]): any; prependOnceListener(event: E_15, listener: import("../puppet/events.js").PuppetEventListener[E_15]): any; off(event: E_16, listener: import("../puppet/events.js").PuppetEventListener[E_16]): any; removeAllListeners(event?: E_17 | undefined): any; removeListener(event: E_18, listener: import("../puppet/events.js").PuppetEventListener[E_18]): any; eventNames(): (string | symbol)[]; rawListeners(event: E_8): Function[]; listeners(event: E_9): Function[]; listenerCount(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; selfId(): string; logonoff(): boolean; }) & MixinBase; declare type CacheMixin = ReturnType; declare type ProtectedPropertyCacheMixin = 'cache' | 'onDirty' | '__cacheMixinCleanCallbackList' | '__dirtyPayloadAwait'; export type { CacheMixin, ProtectedPropertyCacheMixin, }; export { cacheMixin }; //# sourceMappingURL=cache-mixin.d.ts.map