jimmywarting / wemo-client

JavaScript client library for controlling and subscribing to Wemo Devices
MIT License
132 stars 40 forks source link

Add typescript declarations #58

Open pascalmartin opened 6 years ago

pascalmartin commented 6 years ago

Hi

I use typescript in my project and i made the typescript declarations file for wemo-client module, The declaration file is not 100% complete but it a good base for other contributor.

http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

Exemple of use:

import Wemo = require('wemo-client');

const wemo: Wemo.Wemo = new Wemo();

wemo.discover((err: Error, device: Wemo.IDevice): void => {
    if (err) {
        Logger.log('error', err);
        return;
    }

    const client: Wemo.IClient = wemo.client(device);

    // ...
});
codecov-io commented 6 years ago

Codecov Report

Merging #58 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #58   +/-   ##
=======================================
  Coverage   86.41%   86.41%           
=======================================
  Files           2        2           
  Lines         287      287           
  Branches       47       47           
=======================================
  Hits          248      248           
  Misses         39       39

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 718cb99...9f73be3. Read the comment docs.

timonreinhard commented 6 years ago

I'm not so much into Typescript but I'd say either make the declarations complete or leave them out altogether, right?