/** * MHub client library for Node.JS, using einaros/ws for WebSockets. */ /// import * as tls from "tls"; import { BaseClient, BaseClientOptions } from "./baseclient"; /** * Options to be passed to MClient constructor. */ export interface MClientOptions extends BaseClientOptions, tls.TlsOptions { /** * When true, will not automatically connect in the * constructor. Connect explicitly using `#connect()`. */ noImplicitConnect?: boolean; } export declare const defaultClientOptions: MClientOptions; /** * MHub client using server-side WebSocket. * * Allows subscribing and publishing to MHub server nodes. * * @event open() Emitted when connection was established. * @event close() Emitted when connection was closed. * @event error(e: Error) Emitted when there was a connection, server or protocol error. * @event message(m: Message) Emitted when message was received (due to subscription). */ export declare class MClient extends BaseClient { private _url; /** * Create new connection to MServer. * @param url Websocket URL of MServer, e.g. ws://localhost:13900 * @param options Optional TLS settings and other options (see * https://nodejs.org/dist/latest-v6.x/docs/api/tls.html#tls_tls_connect_port_host_options_callback * for the TLS settings, and `MClientOptions` for other options) */ constructor(url: string, options?: MClientOptions); /** * Full URL of MHub connection. */ get url(): string; } export default MClient;