jsdoc valid param types
To answer the actual question
Is there a list somewhere of valid types for param tags for jsdoc?
The documentation of @param
states here that you can use built-in types and "namepaths" (a.k. paths to types you have created/documented earlier and your own types you declared with @type
.
If you look up built-in Javascript types
, you get the following, for example here, you get the list of primitive types:
- Boolean
- Null
- Undefined
- Number
- String
- Symbol (new in ECMAScript 2015)
- Object
And here are some examples of namepaths:
- exampleFunction
- exampleClass#someInstanceMember
- exampleClass.staticMember
- exampleClass~innerMember
E.g. @param {exampleClass} exampleParam Instance of your example class
The JS Documentation tooling I've used just tokenizes the comments into strings anyway, making it possible to put anything you want in the {type} section.
You could stick with JavaScript types if you wanted like {number} or {string}, or if you want to specify you could do {integer}... but I would probably recommend something like:
@param {number} myParam must be an integer
cheers