-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): connect function proper overloads for its parameters (#1416)
- Loading branch information
1 parent
9eb4c79
commit 28c4040
Showing
1 changed file
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |