3 ms·
Same here (along with some JSDoc type annotations). This works well.
by derekbaker783 5y ago
Same here (along with some JSDoc type annotations). This works well.
- fenomas 5y agoYes exactly - when tsc you really want code hints for an object, but tsc can't guess its type, you can do: /** @type {import('../index').Engine} */ this.engine = engine Most of my projects have a god object at the center, so if I explicitly type that one object then I get basically all the important code hints for free. A side benefit of this is that you can also use TypeDoc to generate docs. It's not really made for vanilla JS, but once I got over the initial road bumps I've been happy with the results.