///
import { TypedEmitter } from 'tiny-typed-emitter';
import { SlingDisplayMessageType, SlingMessage, SlingNonFlushDisplayMessage, SlingOptionalIdMessage } from './slingProtocol';
export interface SlingClientOptions {
/**
* The WebSocket endpoint URL to connect to.
*/
readonly websocketEndpoint: string;
/**
* The MQTT client ID for this client to use.
*/
readonly clientId: string;
/**
* The MQTT client ID of the device.
*/
readonly deviceId: string;
}
export declare type SlingClientDisplayValue = SlingNonFlushDisplayMessage['value'];
export interface SlingClientEvents {
connect: () => void;
error: (error: Error) => void;
message: (message: SlingMessage) => void;
statusChange: (isRunning: boolean) => void;
monitor: (data: string[]) => void;
prompt: (prompt: string) => void;
promptDismiss: () => void;
display: (message: SlingClientDisplayValue, type: Exclude) => void;
}
export declare class SlingClient extends TypedEmitter {
readonly options: SlingClientOptions;
private _mqttClient?;
private _deviceStatus?;
private _lastProcessedMessageId?;
private _queuedMessages;
private _seenHellos;
private readonly _displayBuffer;
private readonly _queuedFlushes;
private _monitorData;
constructor(options: SlingClientOptions);
connect(): void;
disconnect(): void;
sendRun(code: Buffer): void;
sendStop(): void;
sendPing(): void;
sendMessage(message: SlingOptionalIdMessage): void;
private _handleConnect;
private _handleMessage;
private _processMessage;
private _attemptFlush;
}