documentationjs / documentationjs/documentation
Flow union types
- Dominant language
- JavaScript
- Stars
- 5.8k
- Forks
- 481
- PR merge metrics
- No merged PRs in 30d
Description
It would be super awesome if documentation.js understood union types. Example:
```JS
type Ratio =
| number
| 'minorSecond'
| 'majorSecond'
| 'minorThird'
| 'majorThird'
| 'perfectFourth'
| 'augFourth'
| 'perfectFifth'
| 'minorSixth'
| 'goldenSection'
| 'majorSixth'
| 'minorSeventh'
| 'majorSeventh'
| 'octave'
| 'majorTenth'
| 'majorEleventh'
| 'majorTwelfth'
| 'doubleOctave'
const scale = (steps: number, ratio?: Ratio = 'perfectFourth'): string { /* ... */ }
```
In the documentation, this will show this signature:
```
scale(steps: number, ratio: [Ratio])
```
and these parameters:
```
steps (number)
ratio ([Ratio] (default 'perfectFourth') )
```
It would be awesome if documentation.js could get the values this union can have and put them in the parameter description!
Contributor guide
Assessment
This issue has not been assessed yet.