Closed fwcd closed 5 years ago
I think that #128 should be the correct way to declare this, could you try and see that it works for you?
btw, the correct way to import this module should be import Speaker = require('speaker')
unless you are using synthetic es module imports...
import Speaker from "speaker";
seems to work fine, thanks!
The TypeScript declaration file declares
Speaker
as adefault
export:https://github.com/TooTallNate/node-speaker/blob/f365fc8b84c0a856c1bdc71255da01d7aee6ac02/index.d.ts#L20-L27
If that was the case,
Speaker
could be imported with the following syntax:This does not work, however, since the actual file does not assign
exports.default
, but ratherexports
:https://github.com/TooTallNate/node-speaker/blob/f365fc8b84c0a856c1bdc71255da01d7aee6ac02/index.js#L353-L357
The correct way to import
Speaker
would be to use...which yields the following (incorrect) error by the compiler though: