import * as mqtt from 'mqtt'; import { ChannelType } from "../support/ChannelType"; import { IRenderer, ISpecification, IListener, IBehaviour } from '../api'; export declare class MqttConnection { private readonly callbacks; private readonly subscriptions; private readonly behaviourBind; private readonly listener; private readonly renderer; private readonly clientId; private readonly identityId; private readonly userId; private readonly mqttClient; private readonly removeFromEventStream; constructor(url: string, identityId: string, renderer: IRenderer, listener: IListener, username?: string | null, password?: string | null); /** * Disconnects from the mqtt connection. */ disconnect: () => mqtt.MqttClient; /** * Subscribes to the given destination. * * @param type the channel type * @param callback the callback function */ subscribe(type: ChannelType, callback: (message: object) => void): void; /** * Unsubscribes from the given destination * * @param destination the destination to unsubscribe from */ unsubscribe: (destination: string) => mqtt.MqttClient; /** * Sends the given message to the given destination. * * @param channelType the channel type * @param msg the message */ publish(channelType: ChannelType, msg: ISpecification): void; /** * Initial request to make the system aware that the user is listening. */ reception(attributes?: object): void; /** * Executes the registered channel type callback. * * @param type the channel type * @param msg the message */ private callback; private onMessage; /** * Binds the given IBehaviour to the MqttConnection. * * @param behaviour */ bind(behaviour: IBehaviour): void; private outgoing; private incoming; private mqttCallback; private header; }