marijnh / getdocs

Getdocs is not JSDoc
MIT License
145 stars 11 forks source link

What if an argument accepts multiple types? #7

Closed ericandrewlewis closed 8 years ago

ericandrewlewis commented 8 years ago

I'm looking to document this function.

The third parameter accepts string, array, or DOM element. How would one document this?

marijnh commented 8 years ago

I'm using union<string, [...], DOMNode> for situations like that. Though in this case, since the type is recursive (the ... should refer to the union itself) you can't really do that accurately.