flowgen icon indicating copy to clipboard operation
flowgen copied to clipboard

TypeScript definition that relies on importing sub-definition doesn't work at all.

Open peat-psuwit opened this issue 7 years ago • 1 comments

For example, this is the index.d.ts of firebase: https://github.com/firebase/firebase-js-sdk/blob/master/packages/firebase/index.d.ts

And here's what flowgen outputs:

declare module.exports: typeof firebase

Which is obviously unusable.

From the readme, it's stated that "imported types from other libraries dont usually have a one-to-one mapping." However, in this case, it's importing its own sub-definition, albeit from other packages, which is in TS. So, flowgen can't ignore import statement completely.

peat-psuwit avatar Jan 04 '18 13:01 peat-psuwit

I wrote a package called flowgen-package that handles everything for the generation of a FlowTyped compatible file. Using my package we can automatically generate types for all the @types/* packages.

https://github.com/aminya/flowgen-package

I have not still registered it because this can be part of flowgen itself. @joarwilk Should I make a PR?

aminya avatar May 05 '21 11:05 aminya