This PR just adds TypeScript typings based on the ones from mqtt.
The typings re-export everything from mqtt, except for the MqttClient class and connect.
Although they don't export the MqttClient class, they do export the MqttClientinterface as IMqttClient, to make it clearer that the package doesn't export the actual MqttClient class.
The AsyncMqttClient class declaration extends from MqttClient, and does some never-based trickery to overload the original methods with the promisified ones. I thought that this would be cleaner than re-writing the entire MqttClient interface, when all we really need are a few overloads.
Thanks for the work on promisifying
mqtt
!This PR just adds TypeScript typings based on the ones from
mqtt
.The typings re-export everything from
mqtt
, except for theMqttClient
class andconnect
.Although they don't export the
MqttClient
class, they do export theMqttClient
interface asIMqttClient
, to make it clearer that the package doesn't export the actualMqttClient
class.The
AsyncMqttClient
class declaration extends fromMqttClient
, and does somenever
-based trickery to overload the original methods with the promisified ones. I thought that this would be cleaner than re-writing the entireMqttClient
interface, when all we really need are a few overloads.