timotejroiko / sweph

The definitive Swiss Ephemeris bindings for Node.js
Other
93 stars 15 forks source link

Fix types declarations in package.json #20

Closed martynasj closed 5 months ago

martynasj commented 5 months ago

Hey! I noticed that when imported from "sweph" I'm getting type issue for not being able to find types. This should fix it

import * as swe from "sweph";

// error below
Could not find a declaration file for module 'sweph'. '/Users/...../node_modules/sweph/index.mjs' implicitly has an 'any' type.
  There are types at '/Users/...../node_modules/sweph/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'sweph' library may need to update its package.json or typings.ts (7016)
timotejroiko commented 5 months ago

i've never seen that error before, apparently it only happens when you specify the new moduleResolution options node16 and nodenext.

Thanks!