UNPKG

wechaty-redux

Version:

Wechaty Redux Plugin Powered By Ducks

43 lines 2.1 kB
/** * Wechaty Open Source Software - https://github.com/wechaty * * @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and * Wechaty Contributors <https://github.com/wechaty>. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ import type * as PUPPET from 'wechaty-puppet'; import type * as WECHATY from 'wechaty'; import { Observable } from 'rxjs'; import type { Store } from 'redux'; import type { PuppetRegistry } from './registry.js'; interface RegisterPuppetOptions { store?: Store; wechaty?: WECHATY.impls.WechatyInterface; } declare const puppetRef: Map<string, number>; declare const increasePuppetReferenceInRegistry: (registry: PuppetRegistry) => (puppet: PUPPET.impls.PuppetInterface) => number; declare const decreasePuppetReferenceInRegistry: (registry: PuppetRegistry) => (puppet: PUPPET.impls.PuppetInterface) => number; /** * Puppet will be automatic registered/deregistered inside the RxJS operator * * - Creating new operators from scratch * @see https://rxjs.dev/guide/operators * */ declare const registerPuppetInRegistry: (registry: PuppetRegistry) => <T>(puppet: PUPPET.impls.PuppetInterface, options?: RegisterPuppetOptions | undefined) => (observable: Observable<T>) => Observable<import("typesafe-actions").PayloadAction<"wechaty-redux/REGISTER_PUPPET_COMMAND", { puppetId: string; }> | T>; export { type RegisterPuppetOptions, registerPuppetInRegistry, increasePuppetReferenceInRegistry, decreasePuppetReferenceInRegistry, puppetRef, }; //# sourceMappingURL=register-puppet.d.ts.map