From eb736e9c1d892db113b971bab279160b465b3496 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Sun, 29 Oct 2017 23:49:18 +0800 Subject: [PATCH] jsdoc: clarify params --- jsdoc.md | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/jsdoc.md b/jsdoc.md index 3025eb778..6a94a36b0 100644 --- a/jsdoc.md +++ b/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: ### 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: @@ -83,6 +79,20 @@ function play (song) { See: +### Other keywodrs + +```js +/** + * @throws {FooException} + * @private + * @deprecated + * @see + * + * @function + * @class + */ +``` + ### Renaming ```js