UNPKG

wechaty-puppet-service

Version:
40 lines 1.78 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 { puppet as grpcPuppet, grpc } from 'wechaty-grpc'; import * as PUPPET from 'wechaty-puppet'; declare class EventStreamManager { puppet: PUPPET.impls.PuppetInterface; protected eventStream: undefined | grpc.ServerWritableStream<grpcPuppet.EventRequest, grpcPuppet.EventResponse>; private puppetListening; constructor(puppet: PUPPET.impls.PuppetInterface); busy(): boolean; start(stream: grpc.ServerWritableStream<grpcPuppet.EventRequest, grpcPuppet.EventResponse>): 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; } export { EventStreamManager }; //# sourceMappingURL=event-stream-manager.d.ts.map