UNPKG

1.55 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 { MqttRecordOptions } from '../record-builders/mqtt.record-builder';
7import { ClientProxy } from './client-proxy';
8export declare class ClientMqtt extends ClientProxy {
9 protected readonly options: MqttOptions['options'];
10 protected readonly logger: Logger;
11 protected readonly subscriptionsCount: Map<string, number>;
12 protected readonly url: string;
13 protected mqttClient: MqttClient;
14 protected connection: Promise<any>;
15 constructor(options: MqttOptions['options']);
16 getRequestPattern(pattern: string): string;
17 getResponsePattern(pattern: string): string;
18 close(): void;
19 connect(): Promise<any>;
20 mergeCloseEvent<T = any>(instance: MqttClient, source$: Observable<T>): Observable<T>;
21 createClient(): MqttClient;
22 handleError(client: MqttClient): void;
23 createResponseCallback(): (channel: string, buffer: Buffer) => any;
24 protected publish(partialPacket: ReadPacket, callback: (packet: WritePacket) => any): () => void;
25 protected dispatchEvent(packet: ReadPacket): Promise<any>;
26 protected unsubscribeFromChannel(channel: string): void;
27 protected initializeSerializer(options: MqttOptions['options']): void;
28 protected mergePacketOptions(requestOptions?: MqttRecordOptions): MqttRecordOptions | undefined;
29}