OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

Types in openzwave-shared.d.ts don't match the test files #368

Open rschristian opened 4 years ago

rschristian commented 4 years ago

For example, in test2.js there is the following code:

nodes[nodeid] = {
    manufacturer: '',
    manufacturerid: '',
    product: '',
    producttype: '',
    productid: '',
    type: '',
    name: '',
    loc: '',
    classes: {},
    ready: false,
  };

Only, the type definitions for the library state that these are the correct types:

export interface NodeInfo {
    manufacturer: string;
    manufacturerid: string;
    product: string;
    producttype: string;
    productid: string;
    type: string;
    name: string;
    loc: string;
}

Are classes and ready actually part of the object, or are they unused? Without a solid definition of the types, this library is incredibly difficult to use.

robertsLando commented 4 years ago

@RyanChristian4427 could you send a PR for that?

rschristian commented 4 years ago

I could certainly try, but are the types wrong, or is that JS object wrong? I couldn't say myself, which is why I created this issue.

robertsLando commented 4 years ago

@RyanChristian4427 classes and ready are parameters usually added to the node object by the user, NodeInfo is the interface of the object coming from node_ready and node_available events