/// import mqtt from 'mqtt'; import { IClientPublishOptions, ISubscriptionGrant } from 'mqtt/src/lib/client'; import { Packet } from 'mqtt-packet'; /** * MQTT Provider. */ export declare class MqttProvider { /** * MQTT Client. * * @protected */ protected client: mqtt.MqttClient | undefined; /** * Get MQTT Client. * * @returns mqtt.MqttClient | undefined */ getClient(): mqtt.MqttClient | undefined; /** * Get MQTT Client. * Async method with reconnect possibility. * * @returns Promise */ getClientAsync(): Promise; /** * By default, client connects when constructor is called. * To prevent this you can set "manualConnect" option to "true" and call "client.connect()" manually. * * @returns Promise * @see https://github.com/mqttjs/MQTT.js?tab=readme-ov-file#connect-async */ connect(): Promise; /** * Subscribe to a topic or topics. * * @param eventMessageCallback * @returns Promise * @see https://github.com/mqttjs/MQTT.js?tab=readme-ov-file#mqttclientsubscribeasynctopictopic-arraytopic-object-options */ subscribe(eventMessageCallback: Function): Promise; /** * Publish a message to a topic. * * @param topic * @param message * @param opts * @returns Promise * @see https://github.com/mqttjs/MQTT.js?tab=readme-ov-file#mqttclientpublishasynctopic-message-options */ publish(topic: string, message: string | Buffer, opts?: IClientPublishOptions): Promise; /** * Close the client. * * @returns Promise * @see https://github.com/mqttjs/MQTT.js?tab=readme-ov-file#mqttclientendasyncforce-options */ end(): Promise; /** * Listen Topic. * * @param topic * @param oldMessage * @param newMessage * @returns void */ listenTopic(topic: string, oldMessage: string | undefined, newMessage: string): void; } declare const _default: MqttProvider; export default _default;