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