jsdoc: clarify params
This commit is contained in:
parent
78701ecb78
commit
eb736e9c1d
46
jsdoc.md
46
jsdoc.md
|
@ -9,17 +9,15 @@ weight: -1
|
|||
### Functions
|
||||
|
||||
```js
|
||||
/*
|
||||
/**
|
||||
* This is a function.
|
||||
*
|
||||
* @param {string} n - A string param
|
||||
* @return {string} A good string
|
||||
*
|
||||
* @throws {FooException}
|
||||
* @private
|
||||
* @deprecated
|
||||
* @see
|
||||
* @example
|
||||
*
|
||||
* @function
|
||||
* @class
|
||||
* foo('hello')
|
||||
*/
|
||||
|
||||
function foo(n) { return n }
|
||||
|
@ -29,17 +27,15 @@ See: <http://usejsdoc.org/index.html>
|
|||
|
||||
### Types
|
||||
|
||||
```
|
||||
/**
|
||||
* @param {string=} n - Optional param
|
||||
* @param {string} [n] - Optional param
|
||||
* @param {(string|number)} n - Multiple types
|
||||
* @param {*} n - Any type
|
||||
* @param {...string} n - Repeatable arguments
|
||||
* @param {string} [n="hi"] - Optional param with default
|
||||
* @param {string[]} n - An array of strings
|
||||
*/
|
||||
```
|
||||
| Type | Description |
|
||||
| --- | --- |
|
||||
| `@param {string=} n` | Optional |
|
||||
| `@param {string} [n]` | Optional |
|
||||
| `@param {(string|number)} n` | Multiple types |
|
||||
| `@param {*} n` | Any type |
|
||||
| `@param {...string} n` | Repeatable arguments |
|
||||
| `@param {string} [n="hi"]` | Optional with default |
|
||||
| `@param {string[]} n` | Array of strings |
|
||||
|
||||
See: <http://usejsdoc.org/tags-type.html>
|
||||
|
||||
|
@ -83,6 +79,20 @@ function play (song) {
|
|||
|
||||
See: <http://usejsdoc.org/tags-typedef.html>
|
||||
|
||||
### Other keywodrs
|
||||
|
||||
```js
|
||||
/**
|
||||
* @throws {FooException}
|
||||
* @private
|
||||
* @deprecated
|
||||
* @see
|
||||
*
|
||||
* @function
|
||||
* @class
|
||||
*/
|
||||
```
|
||||
|
||||
### Renaming
|
||||
|
||||
```js
|
||||
|
|
Loading…
Reference in New Issue