Documentation and API fixes (part of !2529)
I've forked off the documentation changes from !2529 (merged) to make it easier to work on the meat of that MR, and to make these easier to merge.
This MR names a bunch of previously unnamed types (e. g. see !2649 (comment 1254521161)). There are three reasons for them:
- luadoc's
@list
and@map
only work in type declarations, and aren't types themselves. So they can't be used as a type annotation. (correction: there are#list
and#map
but luadocumentor didn't handle them well, see 2 MRs in the comments) - For #table arguments with specific fields, this allows to use Teal for catching typos in the table fields. That's particularly useful because many of the table fields are optional and don't show warnings or errors when misused.
- For types implemented as numbers, it's convenient to be able to check if they come from the correct enum. This is particularly true for numeric types such as camera
#MODE
and#ControlSwitch
, where performing any arithmetic on them is not a good idea.
Edited by uramer