documentationjs / documentationjs/documentation
Flow type imports syntax is not enough to have module documented
- Dominant language
- JavaScript
- Stars
- 5.8k
- Forks
- 481
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm trying to use `documentation.js` 4.0.0-beta.18 with `Flow` and it's working pretty well for infering types. However, my code is spread across several modules and I would like to use the [Flow type imports syntax](https://flowtype.org/docs/modules.html#type-imports--exports) like this:
```javascript
// index.js
// @flow
import type {MyNumber} from './types';
/**
* My number
*/
const myNumber: MyNumber = 1;
```
```javascript
// types.js
// @flow
/**
* My number type
*/
type MyNumber = number;
export type {
MyNumber
};
```
Here is the page generated by `documentation.js`:

But instead I would expect:

Where `MyNumber` type is added to the documentation.
If I change `index.js` like this:
```diff
// @flow
+import './types';
import type {MyNumber} from './types';
```
Then I'll have the result of the second image.
So to me, it seems like an `import type` statement is not enough to have `documentation.js` look up the content of the imported module.
Can we add support for this `import type` syntax into `documentation.js` ? If yes, do you have an idea of where should I start if I wanted to change the actual behaviour and submit a PR ?
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.