/** * Wechaty Open Source Software - https://github.com/wechaty * * @copyright 2016 Huan LI (李卓桓) , and * Wechaty Contributors . * * 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 { puppet as grpcPuppet, grpc } from '@juzi/wechaty-grpc'; import * as PUPPET from '@juzi/wechaty-puppet'; declare class EventStreamManager { puppet: PUPPET.impls.PuppetInterface; protected eventStream: undefined | grpc.ServerWritableStream; private puppetListening; private offCallbackList; constructor(puppet: PUPPET.impls.PuppetInterface); busy(): boolean; start(stream: grpc.ServerWritableStream): void; stop(): void; grpcEmit(type: grpcPuppet.EventTypeMap[keyof grpcPuppet.EventTypeMap], // https://stackoverflow.com/a/49286056/1123955 obj: object): void; connectPuppetEventToStreamingCall(): void; /** * Detect if the streaming call was gone (GRPC disconnects) * https://github.com/grpc/grpc/issues/8117#issuecomment-362198092 */ private onStreamingCallEnd; removePuppetListeners(): void; } export { EventStreamManager }; //# sourceMappingURL=event-stream-manager.d.ts.map