UNPKG

@ecobee/nodejs-gcloud-pubsub-module

Version:
15 lines (14 loc) 754 B
import { PubSub, Subscription, Message } from '@google-cloud/pubsub'; import { Server, CustomTransportStrategy } from '@nestjs/microservices'; import { GCloudPubSubServerOptions } from '../interfaces/gcloud-pub-sub.interface'; export declare class GCloudPubSubServer extends Server implements CustomTransportStrategy { readonly options: GCloudPubSubServerOptions; client: PubSub; subscriptions: Subscription[]; isShuttingDown: boolean; constructor(options: GCloudPubSubServerOptions); listen(callback: () => void): void; handleErrorFactory(subscription: Subscription, subcriptionName: string): (error: any) => void; close(): void; handleMessageFactory(subscriptionName: string): (message: Message) => Promise<void>; }