flowgen
flowgen copied to clipboard
TypeScript definition that relies on importing sub-definition doesn't work at all.
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.
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?