UNPKG

1.3 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Logger } from '@nestjs/common/services/logger.service';
3import { Observable } from 'rxjs';
4import { MqttClient } from '../external/mqtt-client.interface';
5import { MqttOptions, ReadPacket, WritePacket } from '../interfaces';
6import { ClientProxy } from './client-proxy';
7export declare class ClientMqtt extends ClientProxy {
8 protected readonly options: MqttOptions['options'];
9 protected readonly logger: Logger;
10 protected readonly subscriptionsCount: Map<string, number>;
11 protected readonly url: string;
12 protected mqttClient: MqttClient;
13 protected connection: Promise<any>;
14 constructor(options: MqttOptions['options']);
15 getRequestPattern(pattern: string): string;
16 getResponsePattern(pattern: string): string;
17 close(): void;
18 connect(): Promise<any>;
19 mergeCloseEvent<T = any>(instance: MqttClient, source$: Observable<T>): Observable<T>;
20 createClient(): MqttClient;
21 handleError(client: MqttClient): void;
22 createResponseCallback(): (channel: string, buffer: Buffer) => any;
23 protected publish(partialPacket: ReadPacket, callback: (packet: WritePacket) => any): Function;
24 protected dispatchEvent(packet: ReadPacket): Promise<any>;
25 protected unsubscribeFromChannel(channel: string): void;
26}