documentationjs / documentationjs/documentation

Support for flowtype Decalartions

Open
#587 6 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

Here is an example of using a flowtype declaration to give a type annotation to a function:
```
/**
* test function returns true
*/
declare var test : () => boolean;
function test(){
return true;
}
```

The documentation produced does not capture the type annotation:
![image](https://cloud.githubusercontent.com/assets/810921/20118824/aee678de-a5cb-11e6-9a86-9cad0f48cbd7.png)

While if you use the syntax:
```
/**
* test function returns true
*/
function test() : boolean {
return true;
}
```

It produces the documentation which does capture the type annotation:
![image](https://cloud.githubusercontent.com/assets/810921/20118857/d431fb04-a5cb-11e6-89b3-89c042751b85.png)

Unclear to me how realistic it is to support flowtype's various syntaxes for type annotation without using flow directly to parse the file however.

Let me know if this fits into the scope for this project/repo.

flowtype declaration doc:
https://flowtype.org/docs/declarations.html

```
$ documentation --version
4.0.0-beta12
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.