///
import { EventEmitter } from "events";
import { IMConnectionData } from "./MConnectionInterface";
export declare const ALL_CLOSE = "ALL";
export declare const ALL_MESSAGES: {
READY: string;
SCAN_START: string;
SCAN_STOP: string;
SCAN_DATA: string;
DEVICE_CONNECTED: string;
DEVICE_DISCONNECTED: string;
GET_DEVICE_SERVICE_LIST: string;
GET_DEVICE_CHARACTERISTIC_LIST: string;
SET_DEVICE_NOTIFY: string;
WRITE_DATA: string;
RECEIVE_DATA: string;
LIST_SERIAL_PORT_DEVICE: string;
DTR_STATE: string;
SET_BAUD_RATE: string;
};
export declare const DEVICE_TYPE_SERIAL_PORT = "serialport";
export declare const DEVICE_TYPE_BLE = "ble";
export declare type IDeviceType = "serialport" | "ble";
export declare class MConnectionBase extends EventEmitter {
protected connection: WebSocket;
private ready;
private readonly deviceType;
constructor(deviceType: IDeviceType);
protected processMessage(data: string, cmdType: string): Promise;
protected timerSendMessage(message: any, handle: (e: MessageEvent) => Promise, timeout?: number): Promise;
protected sendMessage(data: any): void;
private processError;
private processInfoMessage;
private processDataMessage;
openConnection(): Promise;
closeConnection(): void;
isReady(): boolean;
}