Closed alsoscotland closed 2 months ago
the return types are actually exported from a subdirectory. Try this
import {Address} from "shippo/models/components";
Usually, an IDE would autocomplete this information - can you share any details about your environment/IDE?
We don't explicitly state this in the docs anywhere, I'll speak with the team about making this more clear.
Interesting. I use VSCode. It may be more intuitive to be able to import them from the top level of the package.
In looking more at the package, the node_modules install has the types exported at both
shippo/models/components
and
shippo/src/models/components
the IDE may have trouble with resolving due to the redundancy
It may be more intuitive to be able to import them from the top level of the package.
that's a fair point. should have an update pushed later today, thanks for the feedback!
just published https://www.npmjs.com/package/shippo/v/2.2.0 which should address this, if not please re-open
I am currently in the process of upgrading from 1.71->2.1.2 and I really appreciate that you are moving to support typescript types. I have been rolling my own approximate types for some time now.
I am curious if you have any advice on importing and leveraging your types directly in node, or if making them more explicit exports would be something you would potentially consider doing in a future release.
As an example I see that
Since this type is not explicitly exported, I do not see a way to
import type { Address } from 'shippo'
in my node code. This would be very useful if it would be something you could offer in a future release.