UNPKG

@gdyfe/rop-client

Version:
38 lines (37 loc) 1.2 kB
import { IROP, Qos } from './types'; import EventEmitter from './event'; declare class ROP extends EventEmitter { ROP_FLASH_SITE: string; ICS_ADDR: string; PORT: number; SSL_PORT: number; private _topicList; private _pubKey; private _subKey; private _mqttClient; private _useSSL; private _state; private _reenterDf; private _reEnterTimeout; private _enterTimes; private _clientId; private _timer; static STATE_INIT: number; static STATE_ENTERING: number; static STATE_ENTERED: number; static STATE_ENTER_FAILED: number; static STATE_REENTERING: number; constructor({ ICS_ADDR, ROP_FLASH_SITE, PORT, SSL_PORT, }: IROP); private getUuid; private ReEnter; private InternalSubscribe; private InternalUnSubscribe; private InternalEnter; Enter(pubKey: string, subKey: string, clientId: string, useSSL: boolean): void; Leave(): void; On(evt: string, func: any): void; Publish(body: string, topic: string, qos?: Qos, retain?: boolean): void; Subscribe(topic: string, qos?: number): void; UnSubscribe(topic: string): void; } export default ROP;