Open karthik2804 opened 4 months ago
Explicitly declaring the imports sounds like a sensible approach. The current types are primiarly for jco transpile
, where the imports don't matter to the end user as they are encapsulated, so they only matter so far as they are reexported.
In this guest generation case, it definitely makes sense to generate a declare module
output for all imports. It would be nice to add a new flag for this which outputs this new form. --declare-imports
or similar perhaps.
I just ran into this myself. I would be happy to look into contributing the change, if you're looking for help.
@cdata no one is currently working on this, a PR would be great if you're interested in contributing.
@cdata just wanted to check in if you were working on this issue. I would be happy to look into it otherwise
I am using
jco types
to create the typings to build an SDK based on the generated code, the generated types contain namespaces instead of modules which means IDE does not provide intellisense and alsotsc
fails to compile without//@ts-ignore
the wit imports .I have the following
wit
Using the following command to generate the types
jco types -o types <path to wit>
provides the following directory structureAnd the contents of the files are
And the following is the guest code
I could get around this by manually editing the generated types to be the following
Please let me know if I am missing something here. Thanks!