diff --git a/types/lib/connect/index.d.ts b/types/lib/connect/index.d.ts index d058373f2..1c85b9ca8 100644 --- a/types/lib/connect/index.d.ts +++ b/types/lib/connect/index.d.ts @@ -1,10 +1,25 @@ -import { IClientOptions, MqttClient } from '../client' +import { IClientOptions, MqttClient } from "../client"; /** * connect - connect to an MQTT broker. * - * @param {String} [brokerUrl] - url of the broker, optional + * @param {String} brokerUrl - url of the broker + */ +declare function connect(brokerUrl: string): MqttClient; + +/** + * connect - connect to an MQTT broker. + * + * @param {Object} opts - see MqttClient#constructor + */ +declare function connect(opts: IClientOptions): MqttClient; + +/** + * connect - connect to an MQTT broker. + * + * @param {String} brokerUrl - url of the broker * @param {Object} opts - see MqttClient#constructor */ -declare function connect (brokerUrl?: string | any, opts?: IClientOptions): MqttClient -export { connect } -export { MqttClient } +declare function connect(brokerUrl: string, opts: IClientOptions): MqttClient; + +export { connect }; +export { MqttClient };