Skip to content

Commit

Permalink
fix(types): connect function proper overloads for its parameters (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
erichardson-lee committed Feb 10, 2022
1 parent 9eb4c79 commit 28c4040
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions types/lib/connect/index.d.ts
Original file line number Diff line number Diff line change
@@ -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 };

0 comments on commit 28c4040

Please sign in to comment.