From 3f08c19533f65fdeebf5bdaff6368ed2a7022e6b Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 3 Jun 2016 17:50:16 -0400 Subject: [PATCH] Move documentation-theme-utils into core Also: * Fixes many issues in the default theme * Moves the default theme from default-theme to default_theme * Creates a new, robust linker infrastructure that will support bare links * Replaces slugg with github-slugger * Outputs unknown types as Any. Fixes #451 --- default-theme/index.js | 101 --- default-theme/lib/format_markdown.js | 63 -- default-theme/lib/format_parameters.js | 39 -- default-theme/lib/highlight.js | 14 - default-theme/section_list._ | 20 - {default-theme => default_theme}/README.md | 0 .../assets/anchor.js | 0 .../assets/bass-addons.css | 0 .../assets/bass.css | 0 .../assets/fonts/EOT/SourceCodePro-Bold.eot | Bin .../fonts/EOT/SourceCodePro-Regular.eot | Bin .../assets/fonts/LICENSE.txt | 0 .../assets/fonts/OTF/SourceCodePro-Bold.otf | Bin .../fonts/OTF/SourceCodePro-Regular.otf | Bin .../assets/fonts/TTF/SourceCodePro-Bold.ttf | Bin .../fonts/TTF/SourceCodePro-Regular.ttf | Bin .../WOFF/OTF/SourceCodePro-Bold.otf.woff | Bin .../WOFF/OTF/SourceCodePro-Regular.otf.woff | Bin .../WOFF/TTF/SourceCodePro-Bold.ttf.woff | Bin .../WOFF/TTF/SourceCodePro-Regular.ttf.woff | Bin .../WOFF2/OTF/SourceCodePro-Bold.otf.woff2 | Bin .../WOFF2/OTF/SourceCodePro-Regular.otf.woff2 | Bin .../WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 | Bin .../WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 | Bin .../assets/fonts/source-code-pro.css | 0 .../assets/github.css | 0 .../assets/site.js | 0 .../assets/style.css | 35 +- {default-theme => default_theme}/index._ | 26 +- default_theme/index.js | 101 +++ {default-theme => default_theme}/note._ | 0 {default-theme => default_theme}/section._ | 26 +- default_theme/section_list._ | 19 + .../test/format_markdown.js | 0 .../test/format_parameters.js | 0 .../test/index.js | 0 index.js | 20 +- lib/commands/build.js | 2 +- lib/commands/readme.js | 2 +- lib/inline_tokenizer.js | 6 +- lib/output/html.js | 4 +- lib/output/markdown.js | 6 +- lib/output/markdown_ast.js | 31 +- lib/output/util/format_type.js | 178 +++++ lib/output/util/formatters.js | 101 +++ lib/output/util/linker_stack.js | 77 +++ lib/output/util/reroute_links.js | 17 + lib/parse.js | 1 - package.json | 4 +- test/fixture/es6-import.output.json | 647 +++++++++++++++--- test/fixture/es6-import.output.md | 26 +- test/fixture/es6-import.output.md.json | 343 +++++++++- test/fixture/es6.input.js | 22 +- test/fixture/es6.output.json | 647 +++++++++++++++--- test/fixture/es6.output.md | 26 +- test/fixture/es6.output.md.json | 343 +++++++++- test/fixture/factory.output.md | 2 +- test/fixture/factory.output.md.json | 11 +- test/fixture/html/nested.input.js | 14 + test/fixture/html/nested.output.files | 341 +++++---- test/fixture/inline-link.output.md | 2 +- test/fixture/inline-link.output.md.json | 2 +- test/fixture/sync/flow-types.output.md | 2 +- test/fixture/sync/flow-types.output.md.json | 11 +- test/format_type.js | 67 ++ test/linker.js | 21 + test/test.js | 17 +- 67 files changed, 2754 insertions(+), 683 deletions(-) delete mode 100644 default-theme/index.js delete mode 100644 default-theme/lib/format_markdown.js delete mode 100644 default-theme/lib/format_parameters.js delete mode 100644 default-theme/lib/highlight.js delete mode 100644 default-theme/section_list._ rename {default-theme => default_theme}/README.md (100%) rename {default-theme => default_theme}/assets/anchor.js (100%) rename {default-theme => default_theme}/assets/bass-addons.css (100%) rename {default-theme => default_theme}/assets/bass.css (100%) rename {default-theme => default_theme}/assets/fonts/EOT/SourceCodePro-Bold.eot (100%) rename {default-theme => default_theme}/assets/fonts/EOT/SourceCodePro-Regular.eot (100%) rename {default-theme => default_theme}/assets/fonts/LICENSE.txt (100%) rename {default-theme => default_theme}/assets/fonts/OTF/SourceCodePro-Bold.otf (100%) rename {default-theme => default_theme}/assets/fonts/OTF/SourceCodePro-Regular.otf (100%) rename {default-theme => default_theme}/assets/fonts/TTF/SourceCodePro-Bold.ttf (100%) rename {default-theme => default_theme}/assets/fonts/TTF/SourceCodePro-Regular.ttf (100%) rename {default-theme => default_theme}/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff (100%) rename {default-theme => default_theme}/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff (100%) rename {default-theme => default_theme}/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff (100%) rename {default-theme => default_theme}/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff (100%) rename {default-theme => default_theme}/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 (100%) rename {default-theme => default_theme}/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 (100%) rename {default-theme => default_theme}/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 (100%) rename {default-theme => default_theme}/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 (100%) rename {default-theme => default_theme}/assets/fonts/source-code-pro.css (100%) rename {default-theme => default_theme}/assets/github.css (100%) rename {default-theme => default_theme}/assets/site.js (100%) rename {default-theme => default_theme}/assets/style.css (80%) rename {default-theme => default_theme}/index._ (87%) create mode 100644 default_theme/index.js rename {default-theme => default_theme}/note._ (100%) rename {default-theme => default_theme}/section._ (88%) create mode 100644 default_theme/section_list._ rename {default-theme => default_theme}/test/format_markdown.js (100%) rename {default-theme => default_theme}/test/format_parameters.js (100%) rename {default-theme => default_theme}/test/index.js (100%) create mode 100644 lib/output/util/format_type.js create mode 100644 lib/output/util/formatters.js create mode 100644 lib/output/util/linker_stack.js create mode 100644 lib/output/util/reroute_links.js create mode 100644 test/format_type.js create mode 100644 test/linker.js diff --git a/default-theme/index.js b/default-theme/index.js deleted file mode 100644 index 45363b1ca..000000000 --- a/default-theme/index.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -var fs = require('fs'), - path = require('path'), - File = require('vinyl'), - vfs = require('vinyl-fs'), - _ = require('lodash'), - concat = require('concat-stream'), - formatMarkdown = require('./lib/format_markdown'), - formatParameters = require('./lib/format_parameters'); - -module.exports = function (comments, options, callback) { - - var highlight = require('./lib/highlight')(options.hljs || {}); - - var namespaces = comments.map(function (comment) { - return comment.namespace; - }); - - var imports = { - shortSignature: function (section, hasSectionName) { - var prefix = ''; - if (section.kind === 'class') { - prefix = 'new '; - } - if (section.kind !== 'function' && !hasSectionName) { - return ''; - } - if (hasSectionName) { - return prefix + section.name + formatParameters(section, true); - } else if (!hasSectionName && formatParameters(section)) { - return formatParameters(section, true); - } - return '()'; - }, - signature: function (section, hasSectionName) { - var returns = ''; - var prefix = ''; - if (section.kind === 'class') { - prefix = 'new '; - } else if (section.kind !== 'function') { - return section.name; - } - if (section.returns) { - returns = ': ' + - formatMarkdown.type(section.returns[0].type, namespaces); - } - if (hasSectionName) { - return prefix + section.name + - formatParameters(section) + returns; - } else if (!hasSectionName && formatParameters(section)) { - return section.name + formatParameters(section) + returns; - } - return section.name + '()' + returns; - }, - md: function (ast, inline) { - if (inline && ast && ast.children.length && ast.children[0].type === 'paragraph') { - ast = { - type: 'root', - children: ast.children[0].children.concat(ast.children.slice(1)) - }; - } - return formatMarkdown(ast, namespaces); - }, - formatType: function (section) { - return formatMarkdown.type(section.type, namespaces); - }, - autolink: function (text) { - return formatMarkdown.link(namespaces, text); - }, - highlight: function (str) { - return highlight(str); - } - }; - - var pageTemplate = _.template(fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), { - imports: { - renderSection: _.template(fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'), { - imports: imports - }), - renderNote: _.template(fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'), { - imports: imports - }), - renderSectionList: _.template(fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'), { - imports: imports - }) - } - }); - - // push assets into the pipeline as well. - vfs.src([__dirname + '/assets/**'], { base: __dirname }) - .pipe(concat(function (files) { - callback(null, files.concat(new File({ - path: 'index.html', - contents: new Buffer(pageTemplate({ - docs: comments, - options: options - }), 'utf8') - }))); - })); -}; diff --git a/default-theme/lib/format_markdown.js b/default-theme/lib/format_markdown.js deleted file mode 100644 index f87210b5a..000000000 --- a/default-theme/lib/format_markdown.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -var remark = require('remark'), - html = require('remark-html'), - visit = require('unist-util-visit'), - utils = require('documentation-theme-utils'); - -function getHref(paths) { - return function (text) { - if (paths && paths.indexOf(text) >= 0) { - return '#' + text; - } - }; -} - -function rerouteLinks(ast) { - visit(ast, 'link', function (node) { - if (node.jsdoc && !node.url.match(/^(http|https|\.)/)) { - node.url = '#' + node.url; - } - }); - return ast; -} - -/** - * This helper is exposed in templates as `md` and is useful for showing - * Markdown-formatted text as proper HTML. - * - * @name formatMarkdown - * @param {Object} ast - mdast tree - * @returns {string} HTML - * @example - * var x = remark.parse('## foo'); - * // in template - * // {{ md x }} - * // generates

foo

- */ -module.exports = function (ast) { - if (ast) { - return remark().use(html).stringify(rerouteLinks(ast)); - } -}; - -module.exports.type = function (type, paths) { - return module.exports({ - type: 'root', - children: utils.formatType(type, getHref(paths)) - }).replace(/\n/g, ''); -}; - -/** - * Link text to this page or to a central resource. - * @param {Array} paths list of valid namespace paths that are linkable - * @param {string} text inner text of the link - * @param {string} description link text override - * @returns {string} potentially linked HTML - */ -module.exports.link = function (paths, text, description) { - return module.exports({ - type: 'root', - children: [utils.link(text, getHref(paths), description)] - }).replace(/\n/g, ''); -}; diff --git a/default-theme/lib/format_parameters.js b/default-theme/lib/format_parameters.js deleted file mode 100644 index bad0b565a..000000000 --- a/default-theme/lib/format_parameters.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -var formatMarkdown = require('./format_markdown'); -var Syntax = require('doctrine').Syntax; - -/** - * Format a parameter name. This is used in formatParameters - * and just needs to be careful about differentiating optional - * parameters - * - * @param {Object} param a param as a type spec - * @returns {string} formatted parameter representation. - */ -function formatParameter(param, short) { - if (short) { - return param.type.type == Syntax.OptionalType ? '[' + param.name + ']' : param.name; - } else { - return param.name + ': ' + formatMarkdown.type(param.type).replace(/\n/g, ''); - } -} - -/** - * Format the parameters of a function into a quickly-readable - * summary that resembles how you would call the function - * initially. - * - * @param {Object} section comment node from documentation - * @returns {string} formatted parameters - */ -module.exports = function formatParams(section, short) { - if (section.params) { - return '(' + section.params.map(function (param) { - return formatParameter(param, short); - }).join(', ') + ')'; - } else if (!section.params && (section.kind === 'function' || section.kind === 'class')) { - return '()'; - } - return ''; -}; diff --git a/default-theme/lib/highlight.js b/default-theme/lib/highlight.js deleted file mode 100644 index c58a7ba2a..000000000 --- a/default-theme/lib/highlight.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var hljs = require('highlight.js'); - -module.exports = function (hljsOptions) { - hljs.configure(hljsOptions); - - return function (example) { - if (hljsOptions.highlightAuto) { - return hljs.highlightAuto(example).value; - } - return hljs.highlight('js', example).value; - }; -}; diff --git a/default-theme/section_list._ b/default-theme/section_list._ deleted file mode 100644 index 6ffacccd1..000000000 --- a/default-theme/section_list._ +++ /dev/null @@ -1,20 +0,0 @@ -
- <% members.forEach(function(member) { %> -
-
-
- - <%= member.name%> - <%= shortSignature(member, false) %> -
-
- -
- <% }) %> -
diff --git a/default-theme/README.md b/default_theme/README.md similarity index 100% rename from default-theme/README.md rename to default_theme/README.md diff --git a/default-theme/assets/anchor.js b/default_theme/assets/anchor.js similarity index 100% rename from default-theme/assets/anchor.js rename to default_theme/assets/anchor.js diff --git a/default-theme/assets/bass-addons.css b/default_theme/assets/bass-addons.css similarity index 100% rename from default-theme/assets/bass-addons.css rename to default_theme/assets/bass-addons.css diff --git a/default-theme/assets/bass.css b/default_theme/assets/bass.css similarity index 100% rename from default-theme/assets/bass.css rename to default_theme/assets/bass.css diff --git a/default-theme/assets/fonts/EOT/SourceCodePro-Bold.eot b/default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot similarity index 100% rename from default-theme/assets/fonts/EOT/SourceCodePro-Bold.eot rename to default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot diff --git a/default-theme/assets/fonts/EOT/SourceCodePro-Regular.eot b/default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot similarity index 100% rename from default-theme/assets/fonts/EOT/SourceCodePro-Regular.eot rename to default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot diff --git a/default-theme/assets/fonts/LICENSE.txt b/default_theme/assets/fonts/LICENSE.txt similarity index 100% rename from default-theme/assets/fonts/LICENSE.txt rename to default_theme/assets/fonts/LICENSE.txt diff --git a/default-theme/assets/fonts/OTF/SourceCodePro-Bold.otf b/default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf similarity index 100% rename from default-theme/assets/fonts/OTF/SourceCodePro-Bold.otf rename to default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf diff --git a/default-theme/assets/fonts/OTF/SourceCodePro-Regular.otf b/default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf similarity index 100% rename from default-theme/assets/fonts/OTF/SourceCodePro-Regular.otf rename to default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf diff --git a/default-theme/assets/fonts/TTF/SourceCodePro-Bold.ttf b/default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf similarity index 100% rename from default-theme/assets/fonts/TTF/SourceCodePro-Bold.ttf rename to default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf diff --git a/default-theme/assets/fonts/TTF/SourceCodePro-Regular.ttf b/default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf similarity index 100% rename from default-theme/assets/fonts/TTF/SourceCodePro-Regular.ttf rename to default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf diff --git a/default-theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff b/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff similarity index 100% rename from default-theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff rename to default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff diff --git a/default-theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff b/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff similarity index 100% rename from default-theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff rename to default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff diff --git a/default-theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff b/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff similarity index 100% rename from default-theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff rename to default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff diff --git a/default-theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff b/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff similarity index 100% rename from default-theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff rename to default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff diff --git a/default-theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 b/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 similarity index 100% rename from default-theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 rename to default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 diff --git a/default-theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 b/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 similarity index 100% rename from default-theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 rename to default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 diff --git a/default-theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 b/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 similarity index 100% rename from default-theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 rename to default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 diff --git a/default-theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 b/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 similarity index 100% rename from default-theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 rename to default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 diff --git a/default-theme/assets/fonts/source-code-pro.css b/default_theme/assets/fonts/source-code-pro.css similarity index 100% rename from default-theme/assets/fonts/source-code-pro.css rename to default_theme/assets/fonts/source-code-pro.css diff --git a/default-theme/assets/github.css b/default_theme/assets/github.css similarity index 100% rename from default-theme/assets/github.css rename to default_theme/assets/github.css diff --git a/default-theme/assets/site.js b/default_theme/assets/site.js similarity index 100% rename from default-theme/assets/site.js rename to default_theme/assets/site.js diff --git a/default-theme/assets/style.css b/default_theme/assets/style.css similarity index 80% rename from default-theme/assets/style.css rename to default_theme/assets/style.css index 579131f70..3e8146261 100644 --- a/default-theme/assets/style.css +++ b/default_theme/assets/style.css @@ -1,13 +1,18 @@ .documentation { - font-family: Helvetica, sans-serif; - color: #666; - line-height: 1.5; + font-family: Helvetica, sans-serif; + color: #666; + line-height: 1.5; + background: #f5f5f5; } .black { color: #666; } +.bg-white { + background-color: #fff; +} + h4 { margin: 20px 0 10px 0; } @@ -16,20 +21,8 @@ h4 { color: #000; } -.keyline-top { - border-top: 1px solid #ccc; -} - -.keyline-top-not { - border-top: 1px solid #ccc; -} - -.keyline-top-not:first-child { - border-top: none; -} - -.keyline-right { - border-right: 1px solid #ccc; +.border-bottom { + border-color: #ddd; } a { @@ -125,10 +118,14 @@ table { .prose table th, .prose table td { + text-align: left; padding:8px; border:1px solid #ddd; } +.prose table th:nth-child(1) { border-right: none; } +.prose table th:nth-child(2) { border-left: none; } + .prose table { border:1px solid #ddd; } @@ -141,3 +138,7 @@ table { .quiet { opacity: 0.7; } + +.minishadow { + box-shadow: 2px 2px 10px #f3f3f3; +} diff --git a/default-theme/index._ b/default_theme/index._ similarity index 87% rename from default-theme/index._ rename to default_theme/index._ index 837eea02a..68ba25890 100644 --- a/default-theme/index._ +++ b/default_theme/index._ @@ -25,7 +25,7 @@ <% docs.forEach(function(doc) { %> <% var hasMembers = doc.members.static.length || doc.members.instance.length %>
  • <%- doc.name %> <% if (hasMembers) { %><% } %> @@ -80,19 +80,17 @@
    -
    - <% docs.forEach(function(s) { %> - <% if (s.kind !== 'note') { %> - <%= renderSection({ - section: s, - renderSection: renderSection, - renderSectionList: renderSectionList - }) %> - <% } else { %> -
    <%=renderNote({ note: s })%>
    - <% } %> - <% }) %> -
    + <% docs.forEach(function(s) { %> + <% if (s.kind !== 'note') { %> + <%= renderSection({ + section: s, + renderSection: renderSection, + renderSectionList: renderSectionList + }) %> + <% } else { %> +
    <%=renderNote({ note: s })%>
    + <% } %> + <% }) %>
    diff --git a/default_theme/index.js b/default_theme/index.js new file mode 100644 index 000000000..870545ef2 --- /dev/null +++ b/default_theme/index.js @@ -0,0 +1,101 @@ +'use strict'; + +var fs = require('fs'), + path = require('path'), + File = require('vinyl'), + vfs = require('vinyl-fs'), + _ = require('lodash'), + concat = require('concat-stream'), + GithubSlugger = require('github-slugger'), + createFormatters = require('../').util.createFormatters, + createLinkerStack = require('../').util.createLinkerStack, + hljs = require('highlight.js'); + +module.exports = function (comments, options, callback) { + + var linkerStack = createLinkerStack(options) + .namespaceResolver(comments, function (namespace) { + var slugger = new GithubSlugger(); + return '#' + slugger.slug(namespace); + }); + + var formatters = createFormatters(linkerStack.link); + + hljs.configure(options.hljs || {}); + + var sharedImports = { + imports: { + slug: function (str) { + var slugger = new GithubSlugger(); + return slugger.slug(str); + }, + shortSignature: function (section) { + var prefix = ''; + if (section.kind === 'class') { + prefix = 'new '; + } else if (section.kind !== 'function') { + return section.name; + } + return prefix + section.name + formatters.parameters(section, true); + }, + signature: function (section) { + var returns = ''; + var prefix = ''; + if (section.kind === 'class') { + prefix = 'new '; + } else if (section.kind !== 'function') { + return section.name; + } + if (section.returns) { + returns = ': ' + + formatters.type(section.returns[0].type); + } + return prefix + section.name + formatters.parameters(section) + returns; + }, + md: function (ast, inline) { + if (inline && ast && ast.children.length && ast.children[0].type === 'paragraph') { + ast = { + type: 'root', + children: ast.children[0].children.concat(ast.children.slice(1)) + }; + } + return formatters.markdown(ast); + }, + formatType: formatters.type, + autolink: formatters.autolink, + highlight: function (example) { + if (options.hljs && options.hljs.highlightAuto) { + return hljs.highlightAuto(example).value; + } + return hljs.highlight('js', example).value; + } + } + }; + + var pageTemplate = _.template( + fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), { + imports: _.assign({}, sharedImports.imports, { + renderSection: _.template( + fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'), + sharedImports), + renderNote: _.template( + fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'), + sharedImports), + renderSectionList: _.template( + fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'), + sharedImports) + }) + }); + + // push assets into the pipeline as well. + vfs.src([__dirname + '/assets/**'], { base: __dirname }) + .pipe(concat(function (files) { + callback(null, files.concat(new File({ + path: 'index.html', + contents: new Buffer(pageTemplate({ + docs: comments, + options: options + }), 'utf8') + }))); + })); +}; diff --git a/default-theme/note._ b/default_theme/note._ similarity index 100% rename from default-theme/note._ rename to default_theme/note._ diff --git a/default-theme/section._ b/default_theme/section._ similarity index 88% rename from default-theme/section._ rename to default_theme/section._ index db1f53892..e4988869a 100644 --- a/default-theme/section._ +++ b/default_theme/section._ @@ -1,10 +1,10 @@ -
    +
    <% if (typeof nested === 'undefined') { %>
    -

    +

    <%- section.name %> -

    + <% if (section.context && section.context.github) { %>
    <%= section.context.path %> @@ -15,7 +15,7 @@ <%= md(section.description) %> -
    <%= signature(section) %>
    +
    <%= signature(section) %>
    <% if (section.augments) { %>

    @@ -40,26 +40,26 @@ <% section.params.forEach(function(param) { %>

    - <%- param.name%> (<%= formatType(param) %><% if (param.default) { %> + <%- param.name%> (<%= formatType(param.type) %><% if (param.default) { %> (default <%- param.default %>) <% } %>) <%= md(param.description, true) %>
    <% if (param.properties) { %> - +
    - - + + <% param.properties.forEach(function(property) { %> - @@ -79,7 +79,7 @@
    <% section.properties.forEach(function(property) { %>
    - <%- property.name%> (<%= formatType(property) %>) + <%- property.name%> (<%= formatType(property.type) %>) <% if (property.default) { %> (default <%- property.default %>) <% } %><% if (property.description) { @@ -88,7 +88,7 @@ <% if (property.properties) { %>
      <% property.properties.forEach(function(property) { %> -
    • <%- name%> <%= formatType(property) %> +
    • <%- name%> <%= formatType(property.type) %> <% if (property.default) { %> (default <%- property.default %>) <% } %> @@ -104,7 +104,7 @@ <% if (section.returns) { %> <% section.returns.forEach(function(ret) { %>
      Returns
      - <%= formatType(ret) %><% if (ret.description) { %>: + <%= formatType(ret.type) %><% if (ret.description) { %>: <%= md(ret.description, true) %> <% }%> <% }) %> @@ -114,7 +114,7 @@
      Throws
        <% section.throws.forEach(function(throws) { %> -
      • <%= formatType(throws) %>: <%= md(throws.description, true) %>
      • +
      • <%= formatType(throws.type) %>: <%= md(throws.description, true) %>
      • <% }); %>
      <% } %> diff --git a/default_theme/section_list._ b/default_theme/section_list._ new file mode 100644 index 000000000..62d5075e2 --- /dev/null +++ b/default_theme/section_list._ @@ -0,0 +1,19 @@ +
      + <% members.forEach(function(member) { %> +
      +
      +
      + + <%= shortSignature(member) %> +
      +
      +
      + <%= renderSection({ + section: member, + renderSection: renderSection, + nested: true + }) %> +
      +
      + <% }) %> +
      diff --git a/default-theme/test/format_markdown.js b/default_theme/test/format_markdown.js similarity index 100% rename from default-theme/test/format_markdown.js rename to default_theme/test/format_markdown.js diff --git a/default-theme/test/format_parameters.js b/default_theme/test/format_parameters.js similarity index 100% rename from default-theme/test/format_parameters.js rename to default_theme/test/format_parameters.js diff --git a/default-theme/test/index.js b/default_theme/test/index.js similarity index 100% rename from default-theme/test/index.js rename to default_theme/test/index.js diff --git a/index.js b/index.js index a908eb033..ac3e226f7 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,8 @@ var fs = require('fs'), inferReturn = require('./lib/infer/return'), inferAccess = require('./lib/infer/access'), formatLint = require('./lib/lint').formatLint, - lintComments = require('./lib/lint').lintComments; + lintComments = require('./lib/lint').lintComments, + markdownAST = require('./lib/output/markdown_ast'); /** * Build a pipeline of comment handlers. @@ -222,9 +223,24 @@ module.exports.lint = function lint(indexes, options, callback) { module.exports.expandInputs = expandInputs; module.exports.buildSync = buildSync; +/** + * Documentation's formats are modular methods that take comments + * and options as input and call a callback with writable objects, + * like stringified JSON, markdown strings, or Vinyl objects for HTML + * output. + */ module.exports.formats = { html: require('./lib/output/html'), md: require('./lib/output/markdown'), - remark: require('./lib/output/markdown_ast'), + remark: function (comments, options, callback) { + markdownAST(comments, options, function (err, res) { + callback(err, JSON.stringify(res, null, 2)); + }); + }, json: require('./lib/output/json') }; + +module.exports.util = { + createFormatters: require('./lib/output/util/formatters'), + createLinkerStack: require('./lib/output/util/linker_stack') +}; diff --git a/lib/commands/build.js b/lib/commands/build.js index e4916884e..84e26b48a 100644 --- a/lib/commands/build.js +++ b/lib/commands/build.js @@ -22,7 +22,7 @@ module.exports.parseArgs = function (yargs) { .option('format', { alias: 'f', default: 'json', - choices: ['json', 'md', 'html'] + choices: ['json', 'md', 'remark', 'html'] }) .option('output', { describe: 'output location. omit for stdout, otherwise is a filename ' + diff --git a/lib/commands/readme.js b/lib/commands/readme.js index 726e0fbce..0898a5ae1 100644 --- a/lib/commands/readme.js +++ b/lib/commands/readme.js @@ -66,7 +66,7 @@ function readme(documentation, parsedArgs) { var readmeContent = fs.readFileSync(readmeFile, 'utf8'); remark.use(plugin, { section: readmeOptions.section, - toInject: docsAst + toInject: JSON.parse(docsAst) }).process(readmeContent, onInjected.bind(null, readmeContent)); } diff --git a/lib/inline_tokenizer.js b/lib/inline_tokenizer.js index 84a9bca06..b41102f32 100644 --- a/lib/inline_tokenizer.js +++ b/lib/inline_tokenizer.js @@ -11,17 +11,13 @@ * @returns {Function} tokenizer */ function makeTokenizer(type, regex) { - var tokenizer = function (eat, value, silent) { + var tokenizer = function (eat, value) { var match = regex.exec(value); if (!match) { return; } - if (silent) { - return true; - } - return eat(match[0])({ type: type, url: match[1], diff --git a/lib/output/html.js b/lib/output/html.js index ff7ece47b..e06e10d7a 100644 --- a/lib/output/html.js +++ b/lib/output/html.js @@ -7,7 +7,7 @@ var path = require('path'); * * @param {Array} comments Parsed comments. * @param {Object} options Options that can customize the output - * @param {string} [options.theme='default-theme'] Name of a module used for an HTML theme. + * @param {string} [options.theme='default_theme'] Name of a module used for an HTML theme. * @param {Function} callback Called with array of results as vinyl-fs objects. * @returns {undefined} Calls callback. * @name html @@ -18,7 +18,7 @@ module.exports = function makeHTML(comments, options, callback) { if (options.theme) { theme = require(path.resolve(process.cwd(), options.theme)); } else { - theme = require('../../default-theme/'); + theme = require('../../default_theme/'); } theme(comments, options, callback); }; diff --git a/lib/output/markdown.js b/lib/output/markdown.js index 315b59e86..161fbb1f7 100644 --- a/lib/output/markdown.js +++ b/lib/output/markdown.js @@ -9,14 +9,14 @@ var remark = require('remark'), * [Markdown](http://daringfireball.net/projects/markdown/). * * @param {Array} comments parsed comments - * @param {Object} opts Options that can customize the output + * @param {Object} options Options that can customize the output * @param {Function} callback called with null, string * @name markdown * @return {undefined} calls callback */ -module.exports = function (comments, opts, callback) { +module.exports = function (comments, options, callback) { var processor = remark().use(toc); - markdownAST(comments, opts, function (err, ast) { + markdownAST(comments, options, function (err, ast) { var processedAST = processor.run(ast); return callback(null, processor.stringify(processedAST)); }); diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index c40132703..7774558a6 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -1,22 +1,34 @@ var u = require('unist-builder'), - formatType = require('documentation-theme-utils').formatType, - hljs = require('highlight.js'); + hljs = require('highlight.js'), + GithubSlugger = require('github-slugger'), + createLinkerStack = require('./util/linker_stack'), + rerouteLinks = require('./util/reroute_links'), + _formatType = require('./util/format_type'); /** * Given a hierarchy-nested set of comments, generate an remark-compatible * Abstract Syntax Tree usable for generating Markdown output * * @param {Array} comments nested comment - * @param {Object} opts currently none accepted + * @param {Object} options currently none accepted * @param {Function} callback called with AST * @returns {undefined} calls callback */ -function commentsToAST(comments, opts, callback) { - var hljsOptions = (opts || {}).hljs || {}, - language = !hljsOptions.highlightAuto ? 'javascript' : undefined; +function commentsToAST(comments, options, callback) { + // Configure code highlighting + var hljsOptions = (options || {}).hljs || {}, + language = !hljsOptions.highlightAuto ? 'javascript' : undefined; hljs.configure(hljsOptions); + var linkerStack = createLinkerStack(options) + .namespaceResolver(comments, function (namespace) { + var slugger = new GithubSlugger(); + return '#' + slugger.slug(namespace); + }); + + var formatType = _formatType.bind(undefined, linkerStack.link); + /** * Generate an AST chunk for a comment at a given depth: this is * split from the main function to handle hierarchially nested comments @@ -177,9 +189,10 @@ function commentsToAST(comments, opts, callback) { .filter(Boolean); } - return callback(null, u('root', comments.reduce(function (memo, comment) { - return memo.concat(generate(1, comment)); - }, []))); + return callback(null, rerouteLinks(linkerStack.link, + u('root', comments.reduce(function (memo, comment) { + return memo.concat(generate(1, comment)); + }, [])))); } module.exports = commentsToAST; diff --git a/lib/output/util/format_type.js b/lib/output/util/format_type.js new file mode 100644 index 000000000..15abfe3f6 --- /dev/null +++ b/lib/output/util/format_type.js @@ -0,0 +1,178 @@ +var Syntax = require('doctrine').Syntax, + u = require('unist-builder'); + +/** + * Shortcut to create a new text node + * + * @param {string} text contents + * @returns {Object} remark AST node + */ +function t(text) { + return u('text', text); +} + +/** + * Helper used to automatically link items to global JS documentation or to internal + * documentation. + * + * @param {String} text - text to potentially link + * @param {function} [getHref] - a function that tries + * to find a URL to point a named link to + * @param {string} description text that will be shown to the user, if this + * is a two-part link with both target and text + * @returns {Object} [mdast](https://www.npmjs.com/package/mdast) node + * @example + * link('string').url // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String' + */ +function link(text, getHref, description) { + var href = getHref(text); + if (href) { + // TODO: this is a temporary fix until we drop remark 3.x support, + // and then we should remove the 'href' property and only + // have the url property of links + return u('link', { + href: href, + url: href + }, [u('text', description || text)]); + } + return u('text', text); +} + +/** + * Given a list of types, a method to get a link location, and start, + * end, and separator strings, format a list of potential types. This is + * used for optional arrays, like where either a string or number is + * accepted as an input. + * + * @param {Function} getHref a method that resolves a namepath to a path + * @param {Array} items a list of doctrine-formatted type objects + * @param {string} start string to prefix the output + * @param {string} end string to suffix the output + * @param {string} sep string between items + * @returns {Array} formatted remark AST + */ +function commaList(getHref, items, start, end, sep) { + var res = []; + if (start) { + res.push(t(start)); + } + for (var i = 0, iz = items.length; i < iz; ++i) { + res = res.concat(formatType(getHref, items[i])); + if (i + 1 !== iz) { + res.push(t(sep || ', ')); + } + } + if (end) { + res.push(t(end)); + } + return res; +} + +/** + * Add a string after and potentially before a formatted type definition + * + * @param {Array} formatted remark AST of a type definition + * @param {string} str postfix + * @param {string} prefix string to put after the type comment + * @returns {Array} suffixed and potentially prefixed type + */ +function decorate(formatted, str, prefix) { + if (prefix) { + return [t(str)].concat(formatted); + } + return formatted.concat(t(str)); +} + +/** + * Helper used to format JSDoc-style type definitions into HTML or Markdown. + * + * @name formatType + * @param {function} getHref - a function that tries + * to find a URL to point a named link to + * @param {Object} node - type object in doctrine style + * @returns {Object[]} array of [mdast](https://www.npmjs.com/package/mdast) syntax trees + * @example + * formatType({ type: 'NameExpression', name: 'String' })[0].url + * // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String' + */ +function formatType(getHref, node) { + var result = []; + + if (!node) { + return [t('Any')]; + } + + switch (node.type) { + case Syntax.NullableLiteral: + return [t('?')]; + case Syntax.AllLiteral: + return [t('Any')]; + case Syntax.NullLiteral: + return [t('null')]; + case Syntax.VoidLiteral: + return [t('void')]; + case Syntax.UndefinedLiteral: + return [link('undefined', getHref)]; + case Syntax.NameExpression: + return [link(node.name, getHref)]; + case Syntax.ParameterType: + return [t(node.name + ': ')].concat(formatType(getHref, node.expression)); + + case Syntax.TypeApplication: + return formatType(getHref, node.expression) + .concat(commaList(getHref, node.applications, '<', '>')); + case Syntax.UnionType: + return commaList(getHref, node.elements, '(', ')', ' | '); + case Syntax.ArrayType: + return commaList(getHref, node.elements, '[', ']'); + case Syntax.RecordType: + return commaList(getHref, node.fields, '{', '}'); + + case Syntax.FieldType: + if (node.value) { + return [t(node.key + ': ')].concat(formatType(getHref, node.value)); + } + return [t(node.key)]; + + case Syntax.FunctionType: + result = [t('function (')]; + + if (node['this']) { + if (node['new']) { + result.push(t('new: ')); + } else { + result.push(t('this: ')); + } + + result = result.concat(formatType(getHref, node['this'])); + + if (node.params.length !== 0) { + result.push(t(', ')); + } + } + + result = result.concat(commaList(getHref, node.params, '', ')')); + + if (node.result) { + result = result.concat([t(': ')].concat(formatType(getHref, node.result))); + } + return result; + + case Syntax.RestType: + // note that here we diverge from doctrine itself, which + // lets the expression be omitted. + return decorate(formatType(getHref, node.expression), '...', true); + case Syntax.OptionalType: + return decorate(decorate(formatType(getHref, node.expression), '[', true), ']').concat( + node.default ? t('(default ' + node.default + ')') : []); + case Syntax.NonNullableType: + return decorate(formatType(getHref, node.expression), '!', node.prefix); + case Syntax.NullableType: + return decorate(formatType(getHref, node.expression), '?', node.prefix); + + default: + throw new Error('Unknown type ' + node.type); + } +} + +module.exports = formatType; diff --git a/lib/output/util/formatters.js b/lib/output/util/formatters.js new file mode 100644 index 000000000..7d66b2cb8 --- /dev/null +++ b/lib/output/util/formatters.js @@ -0,0 +1,101 @@ +var remark = require('remark'), + html = require('remark-html'), + Syntax = require('doctrine').Syntax, + u = require('unist-builder'), + _rerouteLinks = require('./reroute_links'), + formatType = require('./format_type'); + +/** + * Create a formatter group, given a linker method that resolves + * namespaces to URLs + * + * @param {Function} getHref linker method + * @returns {formatters} formatter object + */ +module.exports = function (getHref) { + var rerouteLinks = _rerouteLinks.bind(undefined, getHref); + + /** + * Formatters are helpers for templates: they handle tricky logic + * parts like outputting types and parameters. + */ + var formatters = {}; + + /** + * Format a parameter name. This is used in formatParameters + * and just needs to be careful about differentiating optional + * parameters + * + * @param {Object} param a param as a type spec + * @param {boolean} short whether to cut the details and make it skimmable + * @returns {string} formatted parameter representation. + */ + function formatParameter(param, short) { + if (short) { + return param.type.type == Syntax.OptionalType ? + '[' + param.name + ']' : param.name; + } + return param.name + ': ' + formatters.type(param.type).replace(/\n/g, ''); + } + + /** + * Convert a remark AST to a string of HTML, rerouting links as necessary + * @param {Object} ast remark-compatible AST + * @returns {string} HTML + */ + formatters.markdown = function (ast) { + if (ast) { + return remark().use(html).stringify(rerouteLinks(ast)); + } + }; + + /** + * Format a type and convert it to HTML + * + * @param {Object} type doctrine-format type + * @returns {string} HTML + */ + formatters.type = function (type) { + return formatters.markdown(u('root', formatType(getHref, type))).replace(/\n/g, ''); + }; + + /** + * Link text to this page or to a central resource. + * @param {string} text inner text of the link + * @param {string} description link text override + * @returns {string} potentially linked HTML + */ + formatters.autolink = function (text) { + var href = getHref(text); + if (href) { + // TODO: this is a temporary fix until we drop remark 3.x support, + // and then we should remove the 'href' property and only + // have the url property of links + return formatters.markdown(u('link', { + href: href, + url: href + }, [u('text', text)])).replace(/\n/g, ''); + } + return formatters.markdown(u('text', text)).replace(/\n/g, ''); + }; + + /** + * Format the parameters of a function into a quickly-readable + * summary that resembles how you would call the function + * initially. + * + * @param {Object} section comment node from documentation + * @param {boolean} short whether to cut the details and make it skimmable + * @returns {string} formatted parameters + */ + formatters.parameters = function (section, short) { + if (section.params) { + return '(' + section.params.map(function (param) { + return formatParameter(param, short); + }).join(', ') + ')'; + } + return '()'; + }; + + return formatters; +}; diff --git a/lib/output/util/linker_stack.js b/lib/output/util/linker_stack.js new file mode 100644 index 000000000..1363d6fd1 --- /dev/null +++ b/lib/output/util/linker_stack.js @@ -0,0 +1,77 @@ +var globalsDocs = require('globals-docs'); +var walk = require('../../walk'); + +/** + * Generate a linker method that links given hardcoded namepaths to URLs + * + * @param {Object} paths an object specified in documentation.yml of hard paths + * @returns {Function} linker + */ +function pathsLinker(paths) { + return function (namespace) { + if (paths[namespace]) { + return paths[namespace]; + } + }; +} + +/** + * Given an array of functions, call each of them with `input` + * and return the output of the first one that returns a truthy value. + * + * @param {Array} fns array of methods + * @param {*} input any input + * @returns {*} any output + */ +function firstPass(fns, input) { + for (var i = 0; i < fns.length; i++) { + var output = fns[i](input); + if (output) { + return output; + } + } +} + +/** + * Create a linking method that takes a namepath and returns a URI + * or a falsy value + * + * @param {Object} config - configuration value + * @returns {Function} linker method + */ +function LinkerStack(config) { + this.stack = []; + + if (config.defaultGlobals !== false) { + this.stack.push(function (namespace) { + return globalsDocs.getDoc(namespace, config.defaultGlobalsEnvs); + }); + } + + if (config.paths) { + this.stack.push(pathsLinker(config.paths)); + } + + this.link = this.link.bind(this); +} + +LinkerStack.prototype.namespaceResolver = function (comments, resolver) { + var namespaces = {}; + walk(comments, function (comment) { + namespaces[comment.namespace] = true; + }); + this.stack.push(function (namespace) { + if (namespaces[namespace] === true) { + return resolver(namespace); + } + }); + return this; +}; + +LinkerStack.prototype.link = function (namepath) { + return firstPass(this.stack, namepath); +}; + +module.exports = function (opts) { + return new LinkerStack(opts); +}; diff --git a/lib/output/util/reroute_links.js b/lib/output/util/reroute_links.js new file mode 100644 index 000000000..1c3f740a0 --- /dev/null +++ b/lib/output/util/reroute_links.js @@ -0,0 +1,17 @@ +var visit = require('unist-util-visit'); + +/** + * Reroute inline jsdoc links in documentation + * @param {Function} getHref a method that resolves namespaces + * @param {Object} ast remark AST + * @returns {Object} that ast with rerouted links + * @private + */ +module.exports = function rerouteLinks(getHref, ast) { + visit(ast, 'link', function (node) { + if (node.jsdoc && !node.url.match(/^(http|https|\.)/)) { + node.url = getHref(node.url); + } + }); + return ast; +}; diff --git a/lib/parse.js b/lib/parse.js index e95a51e3b..ab9e008b0 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1,7 +1,6 @@ 'use strict'; var doctrine = require('doctrine'); - var parseMarkdown = require('./parse_markdown'); /** diff --git a/package.json b/package.json index c8e6acb11..1e77ae34b 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,12 @@ "debounce": "^1.0.0", "disparity": "^2.0.0", "doctrine": "^1.1.0", - "documentation-theme-utils": "^3.0.0", "events": "^1.1.0", "extend": "^3.0.0", "get-comments": "^1.0.1", "git-url-parse": "^6.0.1", + "github-slugger": "1.1.1", + "globals-docs": "2.2.0", "highlight.js": "^9.1.0", "js-yaml": "^3.3.1", "lodash": "^4.11.1", @@ -41,7 +42,6 @@ "remark-toc": "^3.0.0", "remote-origin-url": "0.4.0", "resolve": "^1.1.6", - "slugg": "^1.0.0", "stream-array": "^1.1.0", "strip-json-comments": "^2.0.0", "tiny-lr": "^0.2.1", diff --git a/test/fixture/es6-import.output.json b/test/fixture/es6-import.output.json index 42ee67944..2901b7bd5 100644 --- a/test/fixture/es6-import.output.json +++ b/test/fixture/es6-import.output.json @@ -267,7 +267,7 @@ "children": [ { "type": "text", - "value": "This function destructures with defaults.", + "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", "position": { "start": { "line": 1, @@ -275,11 +275,13 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 }, - "indent": [] + "indent": [ + 1 + ] } } ], @@ -290,11 +292,13 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 }, - "indent": [] + "indent": [ + 1 + ] } } ], @@ -305,9 +309,9 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 } } }, @@ -318,22 +322,22 @@ "column": 0 }, "end": { - "line": 3, + "line": 4, "column": 3 } }, "context": { "loc": { "start": { - "line": 4, + "line": 5, "column": 0 }, "end": { - "line": 5, + "line": 6, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "destructure", @@ -361,7 +365,7 @@ { "title": "param", "name": "$0.params", - "lineNumber": 4, + "lineNumber": 5, "type": { "type": "RestType" } @@ -434,31 +438,42 @@ } } }, - "tags": [], + "tags": [ + { + "title": "example", + "description": "destructure([1, 2, 3])", + "lineNumber": 2 + } + ], "loc": { "start": { - "line": 7, + "line": 8, "column": 0 }, "end": { - "line": 9, + "line": 12, "column": 3 } }, "context": { "loc": { "start": { - "line": 10, + "line": 13, "column": 0 }, "end": { - "line": 11, + "line": 14, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], + "examples": [ + { + "description": "destructure([1, 2, 3])" + } + ], "name": "destructure", "kind": "function", "params": [ @@ -473,17 +488,17 @@ { "title": "param", "name": "$0.a", - "lineNumber": 10 + "lineNumber": 13 }, { "title": "param", "name": "$0.b", - "lineNumber": 10 + "lineNumber": 13 }, { "title": "param", "name": "$0.c", - "lineNumber": 10 + "lineNumber": 13 } ] } @@ -585,26 +600,26 @@ ], "loc": { "start": { - "line": 13, + "line": 16, "column": 0 }, "end": { - "line": 17, + "line": 20, "column": 3 } }, "context": { "loc": { "start": { - "line": 18, + "line": 21, "column": 0 }, "end": { - "line": 18, + "line": 21, "column": 31 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "params": [ @@ -680,7 +695,7 @@ { "title": "param", "name": "b", - "lineNumber": 18 + "lineNumber": 21 } ], "returns": [ @@ -813,26 +828,26 @@ "tags": [], "loc": { "start": { - "line": 20, + "line": 23, "column": 0 }, "end": { - "line": 22, + "line": 25, "column": 3 } }, "context": { "loc": { "start": { - "line": 23, + "line": 26, "column": 0 }, "end": { - "line": 59, + "line": 62, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "Sink", @@ -895,26 +910,26 @@ "tags": [], "loc": { "start": { - "line": 24, + "line": 27, "column": 2 }, "end": { - "line": 26, + "line": 29, "column": 5 } }, "context": { "loc": { "start": { - "line": 27, + "line": 30, "column": 2 }, "end": { - "line": 27, + "line": 30, "column": 18 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "staticProp", @@ -994,26 +1009,26 @@ "tags": [], "loc": { "start": { - "line": 29, + "line": 32, "column": 2 }, "end": { - "line": 31, + "line": 34, "column": 5 } }, "context": { "loc": { "start": { - "line": 32, + "line": 35, "column": 2 }, "end": { - "line": 34, + "line": 37, "column": 3 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "empty", @@ -1097,26 +1112,26 @@ "tags": [], "loc": { "start": { - "line": 43, + "line": 46, "column": 2 }, "end": { - "line": 46, + "line": 49, "column": 5 } }, "context": { "loc": { "start": { - "line": 47, + "line": 50, "column": 2 }, "end": { - "line": 49, + "line": 52, "column": 3 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "aGetter", @@ -1166,26 +1181,26 @@ ], "loc": { "start": { - "line": 51, + "line": 54, "column": 2 }, "end": { - "line": 54, + "line": 57, "column": 5 } }, "context": { "loc": { "start": { - "line": 55, + "line": 58, "column": 2 }, "end": { - "line": 58, + "line": 61, "column": 3 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "params": [ @@ -1389,26 +1404,26 @@ "tags": [], "loc": { "start": { - "line": 36, + "line": 39, "column": 2 }, "end": { - "line": 38, + "line": 41, "column": 5 } }, "context": { "loc": { "start": { - "line": 39, + "line": 42, "column": 2 }, "end": { - "line": 41, + "line": 44, "column": 3 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "hello", @@ -1443,6 +1458,418 @@ ], "namespace": "Sink" }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method returns a basket. The type should not be linked.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + } + } + }, + "tags": [ + { + "title": "returns", + "description": "a basket", + "lineNumber": 3, + "type": { + "type": "NameExpression", + "name": "Basket" + } + } + ], + "loc": { + "start": { + "line": 64, + "column": 0 + }, + "end": { + "line": 68, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 69, + "column": 0 + }, + "end": { + "line": 70, + "column": 1 + } + }, + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + }, + "errors": [], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "a basket", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + } + } + }, + "type": { + "type": "NameExpression", + "name": "Basket" + } + } + ], + "name": "makeABasket", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "makeABasket", + "kind": "function" + } + ], + "namespace": "makeABasket" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method returns a ", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + }, + { + "type": "link", + "url": "Sink", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "sink" + } + ], + "position": { + "start": { + "line": 1, + "column": 23, + "offset": 22 + }, + "end": { + "line": 1, + "column": 40, + "offset": 39 + }, + "indent": [] + } + }, + { + "type": "text", + "value": ". The type should be linked.\nIt takes a ", + "position": { + "start": { + "line": 1, + "column": 40, + "offset": 39 + }, + "end": { + "line": 2, + "column": 12, + "offset": 79 + }, + "indent": [ + 1 + ] + } + }, + { + "type": "link", + "url": "number", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "number" + } + ], + "position": { + "start": { + "line": 2, + "column": 12, + "offset": 79 + }, + "end": { + "line": 2, + "column": 26, + "offset": 93 + }, + "indent": [] + } + }, + { + "type": "text", + "value": " which should also be linked.", + "position": { + "start": { + "line": 2, + "column": 26, + "offset": 93 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + } + } + }, + "tags": [ + { + "title": "returns", + "description": "a sink", + "lineNumber": 4, + "type": { + "type": "NameExpression", + "name": "Sink" + } + } + ], + "loc": { + "start": { + "line": 72, + "column": 0 + }, + "end": { + "line": 77, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 78, + "column": 0 + }, + "end": { + "line": 79, + "column": 1 + } + }, + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + }, + "errors": [], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "a sink", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + } + } + }, + "type": { + "type": "NameExpression", + "name": "Sink" + } + } + ], + "name": "makeASink", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "makeASink", + "kind": "function" + } + ], + "namespace": "makeASink" + }, { "description": { "type": "root", @@ -1499,26 +1926,26 @@ "tags": [], "loc": { "start": { - "line": 61, + "line": 81, "column": 0 }, "end": { - "line": 63, + "line": 83, "column": 3 } }, "context": { "loc": { "start": { - "line": 64, + "line": 84, "column": 0 }, "end": { - "line": 65, + "line": 85, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "functionWithRest", @@ -1527,7 +1954,7 @@ { "title": "param", "name": "someParams", - "lineNumber": 64, + "lineNumber": 84, "type": { "type": "RestType" } @@ -1601,26 +2028,26 @@ "tags": [], "loc": { "start": { - "line": 67, + "line": 87, "column": 0 }, "end": { - "line": 69, + "line": 89, "column": 3 } }, "context": { "loc": { "start": { - "line": 70, + "line": 90, "column": 0 }, "end": { - "line": 71, + "line": 91, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "functionWithRestAndType", @@ -1629,7 +2056,7 @@ { "title": "param", "name": "someParams", - "lineNumber": 70, + "lineNumber": 90, "type": { "type": "RestType", "expression": { @@ -1707,26 +2134,26 @@ "tags": [], "loc": { "start": { - "line": 75, + "line": 95, "column": 0 }, "end": { - "line": 77, + "line": 97, "column": 3 } }, "context": { "loc": { "start": { - "line": 78, + "line": 98, "column": 0 }, "end": { - "line": 78, + "line": 98, "column": 24 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "foo", @@ -1754,26 +2181,26 @@ ], "loc": { "start": { - "line": 82, + "line": 102, "column": 0 }, "end": { - "line": 84, + "line": 104, "column": 3 } }, "context": { "loc": { "start": { - "line": 85, + "line": 105, "column": 0 }, "end": { - "line": 85, + "line": 105, "column": 41 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "access": "public", @@ -1782,7 +2209,7 @@ { "title": "param", "name": "thisIsTheArgument", - "lineNumber": 85 + "lineNumber": 105 } ], "members": { @@ -1862,26 +2289,26 @@ ], "loc": { "start": { - "line": 87, + "line": 107, "column": 0 }, "end": { - "line": 90, + "line": 110, "column": 3 } }, "context": { "loc": { "start": { - "line": 91, + "line": 111, "column": 0 }, "end": { - "line": 91, + "line": 111, "column": 38 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "returns": [ @@ -2014,26 +2441,26 @@ "tags": [], "loc": { "start": { - "line": 93, + "line": 113, "column": 0 }, "end": { - "line": 95, + "line": 115, "column": 3 } }, "context": { "loc": { "start": { - "line": 96, + "line": 116, "column": 0 }, "end": { - "line": 98, + "line": 118, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "veryImportantTransform", @@ -2119,26 +2546,26 @@ ], "loc": { "start": { - "line": 108, + "line": 128, "column": 0 }, "end": { - "line": 111, + "line": 131, "column": 3 } }, "context": { "loc": { "start": { - "line": 112, + "line": 132, "column": 0 }, "end": { - "line": 112, + "line": 132, "column": 27 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "access": "protected", @@ -2218,26 +2645,26 @@ ], "loc": { "start": { - "line": 114, + "line": 134, "column": 0 }, "end": { - "line": 117, + "line": 137, "column": 3 } }, "context": { "loc": { "start": { - "line": 118, + "line": 138, "column": 0 }, "end": { - "line": 118, + "line": 138, "column": 24 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "access": "public", @@ -2311,26 +2738,26 @@ "tags": [], "loc": { "start": { - "line": 126, + "line": 146, "column": 0 }, "end": { - "line": 128, + "line": 148, "column": 3 } }, "context": { "loc": { "start": { - "line": 129, + "line": 149, "column": 0 }, "end": { - "line": 129, + "line": 149, "column": 42 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "execute", diff --git a/test/fixture/es6-import.output.md b/test/fixture/es6-import.output.md index 60e9d1456..2080a69f3 100644 --- a/test/fixture/es6-import.output.md +++ b/test/fixture/es6-import.output.md @@ -14,14 +14,15 @@ This is the default export frogs! # destructure -This function destructures with defaults. +This function destructures with defaults. It should not +have any parameter descriptions. **Parameters** - `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`) - `$0.phoneNumbers` (optional, default `[]`) - `$0.emailAddresses` (optional, default `[]`) - - `$0.params` **...** + - `$0.params` **...Any** # destructure @@ -34,6 +35,12 @@ Similar, but with an array - `$0.b` - `$0.c` +**Examples** + +```javascript +destructure([1, 2, 3]) +``` + # multiply This function returns the number one. @@ -73,13 +80,26 @@ as a property. This method says hello +# makeABasket + +This method returns a basket. The type should not be linked. + +Returns **Basket** a basket + +# makeASink + +This method returns a [sink](#sink). The type should be linked. +It takes a [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) which should also be linked. + +Returns **[Sink](#sink)** a sink + # functionWithRest This function takes rest params **Parameters** -- `someParams` **...** +- `someParams` **...Any** # functionWithRestAndType diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json index cb03bcb73..de9217097 100644 --- a/test/fixture/es6-import.output.md.json +++ b/test/fixture/es6-import.output.md.json @@ -207,7 +207,7 @@ "children": [ { "type": "text", - "value": "This function destructures with defaults.", + "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", "position": { "start": { "line": 1, @@ -215,11 +215,13 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 }, - "indent": [] + "indent": [ + 1 + ] } } ], @@ -230,11 +232,13 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 }, - "indent": [] + "indent": [ + 1 + ] } }, { @@ -405,6 +409,10 @@ { "type": "text", "value": "..." + }, + { + "type": "text", + "value": "Any" } ] }, @@ -592,6 +600,20 @@ } ] }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Examples" + } + ] + }, + { + "lang": "javascript", + "type": "code", + "value": "destructure([1, 2, 3])" + }, { "depth": 1, "type": "heading", @@ -1230,6 +1252,305 @@ "indent": [] } }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "makeABasket" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method returns a basket. The type should not be linked.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Basket" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "a basket", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "makeASink" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method returns a ", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + }, + { + "type": "link", + "url": "#sink", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "sink" + } + ], + "position": { + "start": { + "line": 1, + "column": 23, + "offset": 22 + }, + "end": { + "line": 1, + "column": 40, + "offset": 39 + }, + "indent": [] + } + }, + { + "type": "text", + "value": ". The type should be linked.\nIt takes a ", + "position": { + "start": { + "line": 1, + "column": 40, + "offset": 39 + }, + "end": { + "line": 2, + "column": 12, + "offset": 79 + }, + "indent": [ + 1 + ] + } + }, + { + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "number" + } + ], + "position": { + "start": { + "line": 2, + "column": 12, + "offset": 79 + }, + "end": { + "line": 2, + "column": 26, + "offset": 93 + }, + "indent": [] + } + }, + { + "type": "text", + "value": " which should also be linked.", + "position": { + "start": { + "line": 2, + "column": 26, + "offset": 93 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + }, + "indent": [ + 1 + ] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "#sink", + "url": "#sink", + "type": "link", + "children": [ + { + "type": "text", + "value": "Sink" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "a sink", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + }, + "indent": [] + } + } + ] + }, { "depth": 1, "type": "heading", @@ -1308,6 +1629,10 @@ { "type": "text", "value": "..." + }, + { + "type": "text", + "value": "Any" } ] }, diff --git a/test/fixture/es6.input.js b/test/fixture/es6.input.js index 8d67cf1d5..4826ca912 100644 --- a/test/fixture/es6.input.js +++ b/test/fixture/es6.input.js @@ -1,11 +1,14 @@ /** - * This function destructures with defaults. + * This function destructures with defaults. It should not + * have any parameter descriptions. */ function destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) { } /** * Similar, but with an array + * @example + * destructure([1, 2, 3]) */ function destructure([a, b, c]) { } @@ -58,6 +61,23 @@ class Sink { } } +/** + * This method returns a basket. The type should not be linked. + * + * @returns {Basket} a basket + */ +function makeABasket() { +} + +/** + * This method returns a {@link Sink sink}. The type should be linked. + * It takes a {@link number} which should also be linked. + * + * @returns {Sink} a sink + */ +function makeASink() { +} + /** * This function takes rest params */ diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json index 244d609bb..243795cec 100644 --- a/test/fixture/es6.output.json +++ b/test/fixture/es6.output.json @@ -8,7 +8,7 @@ "children": [ { "type": "text", - "value": "This function destructures with defaults.", + "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", "position": { "start": { "line": 1, @@ -16,11 +16,13 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 }, - "indent": [] + "indent": [ + 1 + ] } } ], @@ -31,11 +33,13 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 }, - "indent": [] + "indent": [ + 1 + ] } } ], @@ -46,9 +50,9 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 } } }, @@ -59,22 +63,22 @@ "column": 0 }, "end": { - "line": 3, + "line": 4, "column": 3 } }, "context": { "loc": { "start": { - "line": 4, + "line": 5, "column": 0 }, "end": { - "line": 5, + "line": 6, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "destructure", @@ -102,7 +106,7 @@ { "title": "param", "name": "$0.params", - "lineNumber": 4, + "lineNumber": 5, "type": { "type": "RestType" } @@ -175,31 +179,42 @@ } } }, - "tags": [], + "tags": [ + { + "title": "example", + "description": "destructure([1, 2, 3])", + "lineNumber": 2 + } + ], "loc": { "start": { - "line": 7, + "line": 8, "column": 0 }, "end": { - "line": 9, + "line": 12, "column": 3 } }, "context": { "loc": { "start": { - "line": 10, + "line": 13, "column": 0 }, "end": { - "line": 11, + "line": 14, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], + "examples": [ + { + "description": "destructure([1, 2, 3])" + } + ], "name": "destructure", "kind": "function", "params": [ @@ -214,17 +229,17 @@ { "title": "param", "name": "$0.a", - "lineNumber": 10 + "lineNumber": 13 }, { "title": "param", "name": "$0.b", - "lineNumber": 10 + "lineNumber": 13 }, { "title": "param", "name": "$0.c", - "lineNumber": 10 + "lineNumber": 13 } ] } @@ -326,26 +341,26 @@ ], "loc": { "start": { - "line": 13, + "line": 16, "column": 0 }, "end": { - "line": 17, + "line": 20, "column": 3 } }, "context": { "loc": { "start": { - "line": 18, + "line": 21, "column": 0 }, "end": { - "line": 18, + "line": 21, "column": 31 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "params": [ @@ -421,7 +436,7 @@ { "title": "param", "name": "b", - "lineNumber": 18 + "lineNumber": 21 } ], "returns": [ @@ -554,26 +569,26 @@ "tags": [], "loc": { "start": { - "line": 20, + "line": 23, "column": 0 }, "end": { - "line": 22, + "line": 25, "column": 3 } }, "context": { "loc": { "start": { - "line": 23, + "line": 26, "column": 0 }, "end": { - "line": 59, + "line": 62, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "Sink", @@ -636,26 +651,26 @@ "tags": [], "loc": { "start": { - "line": 24, + "line": 27, "column": 2 }, "end": { - "line": 26, + "line": 29, "column": 5 } }, "context": { "loc": { "start": { - "line": 27, + "line": 30, "column": 2 }, "end": { - "line": 27, + "line": 30, "column": 18 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "staticProp", @@ -735,26 +750,26 @@ "tags": [], "loc": { "start": { - "line": 29, + "line": 32, "column": 2 }, "end": { - "line": 31, + "line": 34, "column": 5 } }, "context": { "loc": { "start": { - "line": 32, + "line": 35, "column": 2 }, "end": { - "line": 34, + "line": 37, "column": 3 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "empty", @@ -838,26 +853,26 @@ "tags": [], "loc": { "start": { - "line": 43, + "line": 46, "column": 2 }, "end": { - "line": 46, + "line": 49, "column": 5 } }, "context": { "loc": { "start": { - "line": 47, + "line": 50, "column": 2 }, "end": { - "line": 49, + "line": 52, "column": 3 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "aGetter", @@ -907,26 +922,26 @@ ], "loc": { "start": { - "line": 51, + "line": 54, "column": 2 }, "end": { - "line": 54, + "line": 57, "column": 5 } }, "context": { "loc": { "start": { - "line": 55, + "line": 58, "column": 2 }, "end": { - "line": 58, + "line": 61, "column": 3 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "params": [ @@ -1130,26 +1145,26 @@ "tags": [], "loc": { "start": { - "line": 36, + "line": 39, "column": 2 }, "end": { - "line": 38, + "line": 41, "column": 5 } }, "context": { "loc": { "start": { - "line": 39, + "line": 42, "column": 2 }, "end": { - "line": 41, + "line": 44, "column": 3 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "hello", @@ -1184,6 +1199,418 @@ ], "namespace": "Sink" }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method returns a basket. The type should not be linked.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + } + } + }, + "tags": [ + { + "title": "returns", + "description": "a basket", + "lineNumber": 3, + "type": { + "type": "NameExpression", + "name": "Basket" + } + } + ], + "loc": { + "start": { + "line": 64, + "column": 0 + }, + "end": { + "line": 68, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 69, + "column": 0 + }, + "end": { + "line": 70, + "column": 1 + } + }, + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + }, + "errors": [], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "a basket", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + } + } + }, + "type": { + "type": "NameExpression", + "name": "Basket" + } + } + ], + "name": "makeABasket", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "makeABasket", + "kind": "function" + } + ], + "namespace": "makeABasket" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method returns a ", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + }, + { + "type": "link", + "url": "Sink", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "sink" + } + ], + "position": { + "start": { + "line": 1, + "column": 23, + "offset": 22 + }, + "end": { + "line": 1, + "column": 40, + "offset": 39 + }, + "indent": [] + } + }, + { + "type": "text", + "value": ". The type should be linked.\nIt takes a ", + "position": { + "start": { + "line": 1, + "column": 40, + "offset": 39 + }, + "end": { + "line": 2, + "column": 12, + "offset": 79 + }, + "indent": [ + 1 + ] + } + }, + { + "type": "link", + "url": "number", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "number" + } + ], + "position": { + "start": { + "line": 2, + "column": 12, + "offset": 79 + }, + "end": { + "line": 2, + "column": 26, + "offset": 93 + }, + "indent": [] + } + }, + { + "type": "text", + "value": " which should also be linked.", + "position": { + "start": { + "line": 2, + "column": 26, + "offset": 93 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + } + } + }, + "tags": [ + { + "title": "returns", + "description": "a sink", + "lineNumber": 4, + "type": { + "type": "NameExpression", + "name": "Sink" + } + } + ], + "loc": { + "start": { + "line": 72, + "column": 0 + }, + "end": { + "line": 77, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 78, + "column": 0 + }, + "end": { + "line": 79, + "column": 1 + } + }, + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + }, + "errors": [], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "a sink", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + } + } + }, + "type": { + "type": "NameExpression", + "name": "Sink" + } + } + ], + "name": "makeASink", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "makeASink", + "kind": "function" + } + ], + "namespace": "makeASink" + }, { "description": { "type": "root", @@ -1240,26 +1667,26 @@ "tags": [], "loc": { "start": { - "line": 61, + "line": 81, "column": 0 }, "end": { - "line": 63, + "line": 83, "column": 3 } }, "context": { "loc": { "start": { - "line": 64, + "line": 84, "column": 0 }, "end": { - "line": 65, + "line": 85, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "functionWithRest", @@ -1268,7 +1695,7 @@ { "title": "param", "name": "someParams", - "lineNumber": 64, + "lineNumber": 84, "type": { "type": "RestType" } @@ -1342,26 +1769,26 @@ "tags": [], "loc": { "start": { - "line": 67, + "line": 87, "column": 0 }, "end": { - "line": 69, + "line": 89, "column": 3 } }, "context": { "loc": { "start": { - "line": 70, + "line": 90, "column": 0 }, "end": { - "line": 71, + "line": 91, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "functionWithRestAndType", @@ -1370,7 +1797,7 @@ { "title": "param", "name": "someParams", - "lineNumber": 70, + "lineNumber": 90, "type": { "type": "RestType", "expression": { @@ -1448,26 +1875,26 @@ "tags": [], "loc": { "start": { - "line": 75, + "line": 95, "column": 0 }, "end": { - "line": 77, + "line": 97, "column": 3 } }, "context": { "loc": { "start": { - "line": 78, + "line": 98, "column": 0 }, "end": { - "line": 78, + "line": 98, "column": 24 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "foo", @@ -1495,26 +1922,26 @@ ], "loc": { "start": { - "line": 82, + "line": 102, "column": 0 }, "end": { - "line": 84, + "line": 104, "column": 3 } }, "context": { "loc": { "start": { - "line": 85, + "line": 105, "column": 0 }, "end": { - "line": 85, + "line": 105, "column": 41 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "access": "public", @@ -1523,7 +1950,7 @@ { "title": "param", "name": "thisIsTheArgument", - "lineNumber": 85 + "lineNumber": 105 } ], "members": { @@ -1603,26 +2030,26 @@ ], "loc": { "start": { - "line": 87, + "line": 107, "column": 0 }, "end": { - "line": 90, + "line": 110, "column": 3 } }, "context": { "loc": { "start": { - "line": 91, + "line": 111, "column": 0 }, "end": { - "line": 91, + "line": 111, "column": 38 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "returns": [ @@ -1755,26 +2182,26 @@ "tags": [], "loc": { "start": { - "line": 93, + "line": 113, "column": 0 }, "end": { - "line": 95, + "line": 115, "column": 3 } }, "context": { "loc": { "start": { - "line": 96, + "line": 116, "column": 0 }, "end": { - "line": 98, + "line": 118, "column": 1 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "veryImportantTransform", @@ -1860,26 +2287,26 @@ ], "loc": { "start": { - "line": 108, + "line": 128, "column": 0 }, "end": { - "line": 111, + "line": 131, "column": 3 } }, "context": { "loc": { "start": { - "line": 112, + "line": 132, "column": 0 }, "end": { - "line": 112, + "line": 132, "column": 27 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "access": "protected", @@ -1959,26 +2386,26 @@ ], "loc": { "start": { - "line": 114, + "line": 134, "column": 0 }, "end": { - "line": 117, + "line": 137, "column": 3 } }, "context": { "loc": { "start": { - "line": 118, + "line": 138, "column": 0 }, "end": { - "line": 118, + "line": 138, "column": 24 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "access": "public", @@ -2052,26 +2479,26 @@ "tags": [], "loc": { "start": { - "line": 126, + "line": 146, "column": 0 }, "end": { - "line": 128, + "line": 148, "column": 3 } }, "context": { "loc": { "start": { - "line": 129, + "line": 149, "column": 0 }, "end": { - "line": 129, + "line": 149, "column": 42 } }, - "code": "/**\n * This function destructures with defaults.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" + "code": "/**\n * This function destructures with defaults. It should not\n * have any parameter descriptions.\n */\nfunction destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) {\n}\n\n/**\n * Similar, but with an array\n * @example\n * destructure([1, 2, 3])\n */\nfunction destructure([a, b, c]) {\n}\n\n/**\n * This function returns the number one.\n * @param {Array} a an array of numbers\n * @returns {Number} numberone\n */\nvar multiply = (a, b) => a * b;\n\n/**\n * This is a sink\n */\nclass Sink {\n /**\n * This is a property of the sink.\n */\n staticProp = 42;\n\n /**\n * Is it empty\n */\n empty() {\n return 1;\n }\n\n /**\n * This method says hello\n */\n static hello() {\n return 'hello';\n }\n\n /**\n * This is a getter method: it should be documented\n * as a property.\n */\n get aGetter() {\n return 42;\n }\n\n /**\n * @param {number} height the height of the thing\n * @param {number} width the width of the thing\n */\n constructor(height, width) {\n this.height = height;\n this.width = width;\n }\n}\n\n/**\n * This method returns a basket. The type should not be linked.\n *\n * @returns {Basket} a basket\n */\nfunction makeABasket() {\n}\n\n/**\n * This method returns a {@link Sink sink}. The type should be linked.\n * It takes a {@link number} which should also be linked.\n *\n * @returns {Sink} a sink\n */\nfunction makeASink() {\n}\n\n/**\n * This function takes rest params\n */\nfunction functionWithRest(...someParams) {\n}\n\n/**\n * So does this one, with types\n */\nfunction functionWithRestAndType(...someParams: number) {\n}\n\n// FUNCTION TYPES\n\n/**\n * This is an async method\n */\nasync function foo() { }\n\nexport default multiply;\n\n/**\n * @public\n */\nexport default (thisIsTheArgument) => {};\n\n/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = () => (

      hello

      );\n\n/**\n * This tests our support of optional parameters in ES6\n */\nfunction veryImportantTransform(foo = 'bar') {\n return \"42\";\n}\n\n// ACCESS LEVELS\n\n/**\n * A private function\n * @private\n */\nfunction iAmPrivate() { }\n\n/**\n * A protected function\n * @protected\n */\nfunction iAmProtected() { }\n\n/**\n * A public function\n * @public\n */\nfunction iAmPublic() { }\n\n/**\n * A private function using the access tag\n * @access private\n */\nfunction iAmAccessPrivate() { }\n\n/**\n * This is re-exported\n */\nexport { execute } from 'external-module';\n" }, "errors": [], "name": "execute", diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md index 567a8fd77..dba434da5 100644 --- a/test/fixture/es6.output.md +++ b/test/fixture/es6.output.md @@ -1,13 +1,14 @@ # destructure -This function destructures with defaults. +This function destructures with defaults. It should not +have any parameter descriptions. **Parameters** - `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`) - `$0.phoneNumbers` (optional, default `[]`) - `$0.emailAddresses` (optional, default `[]`) - - `$0.params` **...** + - `$0.params` **...Any** # destructure @@ -20,6 +21,12 @@ Similar, but with an array - `$0.b` - `$0.c` +**Examples** + +```javascript +destructure([1, 2, 3]) +``` + # multiply This function returns the number one. @@ -59,13 +66,26 @@ as a property. This method says hello +# makeABasket + +This method returns a basket. The type should not be linked. + +Returns **Basket** a basket + +# makeASink + +This method returns a [sink](#sink). The type should be linked. +It takes a [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) which should also be linked. + +Returns **[Sink](#sink)** a sink + # functionWithRest This function takes rest params **Parameters** -- `someParams` **...** +- `someParams` **...Any** # functionWithRestAndType diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json index 329f12376..efdd1b1df 100644 --- a/test/fixture/es6.output.md.json +++ b/test/fixture/es6.output.md.json @@ -16,7 +16,7 @@ "children": [ { "type": "text", - "value": "This function destructures with defaults.", + "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", "position": { "start": { "line": 1, @@ -24,11 +24,13 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 }, - "indent": [] + "indent": [ + 1 + ] } } ], @@ -39,11 +41,13 @@ "offset": 0 }, "end": { - "line": 1, - "column": 42, - "offset": 41 + "line": 2, + "column": 33, + "offset": 88 }, - "indent": [] + "indent": [ + 1 + ] } }, { @@ -214,6 +218,10 @@ { "type": "text", "value": "..." + }, + { + "type": "text", + "value": "Any" } ] }, @@ -401,6 +409,20 @@ } ] }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Examples" + } + ] + }, + { + "lang": "javascript", + "type": "code", + "value": "destructure([1, 2, 3])" + }, { "depth": 1, "type": "heading", @@ -1039,6 +1061,305 @@ "indent": [] } }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "makeABasket" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method returns a basket. The type should not be linked.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 61, + "offset": 60 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Basket" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "a basket", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "makeASink" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method returns a ", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + }, + { + "type": "link", + "url": "#sink", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "sink" + } + ], + "position": { + "start": { + "line": 1, + "column": 23, + "offset": 22 + }, + "end": { + "line": 1, + "column": 40, + "offset": 39 + }, + "indent": [] + } + }, + { + "type": "text", + "value": ". The type should be linked.\nIt takes a ", + "position": { + "start": { + "line": 1, + "column": 40, + "offset": 39 + }, + "end": { + "line": 2, + "column": 12, + "offset": 79 + }, + "indent": [ + 1 + ] + } + }, + { + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "number" + } + ], + "position": { + "start": { + "line": 2, + "column": 12, + "offset": 79 + }, + "end": { + "line": 2, + "column": 26, + "offset": 93 + }, + "indent": [] + } + }, + { + "type": "text", + "value": " which should also be linked.", + "position": { + "start": { + "line": 2, + "column": 26, + "offset": 93 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 55, + "offset": 122 + }, + "indent": [ + 1 + ] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "#sink", + "url": "#sink", + "type": "link", + "children": [ + { + "type": "text", + "value": "Sink" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "a sink", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 7, + "offset": 6 + }, + "indent": [] + } + } + ] + }, { "depth": 1, "type": "heading", @@ -1117,6 +1438,10 @@ { "type": "text", "value": "..." + }, + { + "type": "text", + "value": "Any" } ] }, diff --git a/test/fixture/factory.output.md b/test/fixture/factory.output.md index 8992a84dd..86858616f 100644 --- a/test/fixture/factory.output.md +++ b/test/fixture/factory.output.md @@ -2,7 +2,7 @@ an area chart generator -Returns **area** chart +Returns **[area](#area)** chart # area diff --git a/test/fixture/factory.output.md.json b/test/fixture/factory.output.md.json index bcd9b6a55..3fcbcc331 100644 --- a/test/fixture/factory.output.md.json +++ b/test/fixture/factory.output.md.json @@ -57,8 +57,15 @@ "type": "strong", "children": [ { - "type": "text", - "value": "area" + "href": "#area", + "url": "#area", + "type": "link", + "children": [ + { + "type": "text", + "value": "area" + } + ] } ] }, diff --git a/test/fixture/html/nested.input.js b/test/fixture/html/nested.input.js index f12f67aff..f4f717328 100644 --- a/test/fixture/html/nested.input.js +++ b/test/fixture/html/nested.input.js @@ -129,3 +129,17 @@ class Foo { */ get bar() { } } + +/** + * I am the container of stream types + */ +var customStreams = { }; + +/** + * I am a passthrough stream that belongs to customStreams + * + * @kind class + */ +customStreams.passthrough = function () { + this.custom = true; +}; diff --git a/test/fixture/html/nested.output.files b/test/fixture/html/nested.output.files index c930f9bf9..f5e666fad 100644 --- a/test/fixture/html/nested.output.files +++ b/test/fixture/html/nested.output.files @@ -25,7 +25,7 @@
    • Klass @@ -129,7 +129,7 @@
    • Foo @@ -154,6 +154,33 @@
    • + +
    • + customStreams + + + + + +
    • +
      @@ -162,16 +189,15 @@
      -
      + - -
      +
      -

      +

      Klass -

      +
      @@ -179,7 +205,7 @@

      Creates a new Klass

      -
      Klass(foo: )
      +
      new Klass(foo: Any)

      @@ -202,7 +228,7 @@

      - foo () + foo (Any)
      @@ -222,25 +248,24 @@
      Static Members
      -
      +
      -
      - - isClass - (other, also) +
      + + isClass(other, also)
      - -
      +
      -
      - - isWeird - (other) +
      + + isWeird(other)
      - -
      +
      -
      - - isBuffer - (buf, [size]) +
      + + isBuffer(buf, [size])
      - -
      +
      -
      - - isArrayOfBuffers - (buffers) +
      + + isArrayOfBuffers(buffers)
      - -
      +
      -
      - +
      + MAGIC_NUMBER -
      - -
      +
      -
      - +
      + event -
      -
    NameDescriptionNameDescription
    <%- property.name %> <%= formatType(property) %> + <%- property.name %> <%= formatType(property.type) %> <% if (property.default) { %> (default <%- property.default %>) <% } %>
    +
    - - + + @@ -775,26 +793,26 @@ k.isArrayOfBuffers(); - - -
    + + +
    -

    +

    bar -

    +
    -

    Get an instance of Klass. Will make -a klass instance multiword, -like a klass

    +

    Get an instance of Klass. Will make +a klass instance multiword, +like a klass

    -
    bar(): Klass
    +
    bar(): Klass
    @@ -811,7 +829,7 @@ like a klass

    Returns
    - Klass: + Klass: that class @@ -829,16 +847,16 @@ like a klass

    - - -
    + + +
    -

    +

    bar -

    +
    @@ -846,7 +864,7 @@ like a klass

    Rest property function

    -
    bar(toys: ...Number): undefined
    +
    bar(toys: ...Number): undefined
    @@ -893,26 +911,26 @@ like a klass

    - - -
    + + +
    -

    +

    bar -

    +
    -

    Get an instance of Klass. Will make -a klass instance multiword, -like a klass. This needs a number input.

    +

    Get an instance of Klass. Will make +a klass instance multiword, +like a klass. This needs a number input.

    -
    bar(): undefined
    +
    bar(): undefined
    @@ -947,16 +965,16 @@ like a klass. This needs a number inp
    - - -
    + + +
    -

    +

    Foo -

    +
    @@ -964,7 +982,7 @@ like a klass. This needs a number inp

    This is Foo

    -
    Foo()
    +
    new Foo()
    @@ -990,23 +1008,22 @@ like a klass. This needs a number inp
    Instance Members
    -
    +
    -
    - +
    + bar -
    -
    diff --git a/test/fixture/inline-link.output.md b/test/fixture/inline-link.output.md index e1ebae7b0..0bad7b20a 100644 --- a/test/fixture/inline-link.output.md +++ b/test/fixture/inline-link.output.md @@ -11,7 +11,7 @@ Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer # inline-link.input This function returns the number one. Internally, this uses -[addOne](addOne) to do the math. This demonstrates +[addOne](#addone) to do the math. This demonstrates [Addition](https://en.wikipedia.org/wiki/Addition) and diff --git a/test/fixture/inline-link.output.md.json b/test/fixture/inline-link.output.md.json index 594ac1c21..890b76f4c 100644 --- a/test/fixture/inline-link.output.md.json +++ b/test/fixture/inline-link.output.md.json @@ -232,7 +232,7 @@ }, { "type": "link", - "url": "addOne", + "url": "#addone", "title": null, "jsdoc": true, "children": [ diff --git a/test/fixture/sync/flow-types.output.md b/test/fixture/sync/flow-types.output.md index 0317ffe51..547bb8129 100644 --- a/test/fixture/sync/flow-types.output.md +++ b/test/fixture/sync/flow-types.output.md @@ -4,7 +4,7 @@ This function returns the number one. **Parameters** -- `a` **Point** +- `a` **[Point](#point)** - `b` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** - `c` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** - `d` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** diff --git a/test/fixture/sync/flow-types.output.md.json b/test/fixture/sync/flow-types.output.md.json index 39fcb6a84..effa01aca 100644 --- a/test/fixture/sync/flow-types.output.md.json +++ b/test/fixture/sync/flow-types.output.md.json @@ -77,8 +77,15 @@ "type": "strong", "children": [ { - "type": "text", - "value": "Point" + "href": "#point", + "url": "#point", + "type": "link", + "children": [ + { + "type": "text", + "value": "Point" + } + ] } ] }, diff --git a/test/format_type.js b/test/format_type.js new file mode 100644 index 000000000..cc40a03c1 --- /dev/null +++ b/test/format_type.js @@ -0,0 +1,67 @@ +/*eslint max-len: 0 */ +'use strict'; + +var _formatType = require('../lib/output/util/format_type'), + createLinkerStack = require('../lib/output/util/linker_stack'), + remark = require('remark'), + parse = require('doctrine').parse, + test = require('tap').test; + +function stringify(children) { + return remark().stringify({ + type: 'paragraph', + children: children + }); +} + +test('formatType', function (t) { + var linkerStack = createLinkerStack({}); + var formatType = _formatType.bind(undefined, linkerStack.link); + [ + ['Foo', 'Foo'], + ['null', 'null'], + ['null', 'null'], + ['*', 'Any'], + ['Array|undefined', '([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \\| [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined))'], + ['Array', '[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>'], + ['number!', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)!'], + ['function(string, boolean)', 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))'], + ['function(string, boolean): number', 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)): [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'], + ['function()', 'function ()'], + ['function(this:something, string)', 'function (this: something, [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))'], + ['function(new:something)', 'function (new: something)'], + ['{myNum: number, myObject}', '{myNum: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), myObject}'], + ['[string,]', '\\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]'], + ['number?', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?'], + ['?number', '?[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'], + ['?', '?'], + ['void', 'void'], + ['function(a:b)', 'function (a: b)'], + ['function(a):void', 'function (a): void'], + ['number=', '\\[[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]'], + ['...number', '...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'], + ['undefined', '[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)'] + ].forEach(function (example) { + t.deepEqual(stringify(formatType( + parse('@param {' + example[0] + '} a', { sloppy: true }).tags[0].type) + ), example[1], example[0]); + }); + + t.deepEqual(stringify(formatType( + parse('@param {number} [a=1]', { sloppy: true }).tags[0].type) + ), '\\[[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]', 'default'); + + t.deepEqual(stringify(_formatType(function (str) { + return str.toUpperCase(); + }, parse('@param {Foo} a', { + sloppy: true + }).tags[0].type)), '[Foo](FOO)', 'with custom linker'); + + t.deepEqual(stringify(formatType()), 'Any', 'empty case'); + + t.throws(function () { + formatType({}); + }); + + t.end(); +}); diff --git a/test/linker.js b/test/linker.js new file mode 100644 index 000000000..501fc76db --- /dev/null +++ b/test/linker.js @@ -0,0 +1,21 @@ +var createLinkerStack = require('../lib/output/util/linker_stack'), + test = require('tap').test; + +test('linkerStack', function (t) { + + var linkerStack = createLinkerStack({}); + + t.equal(linkerStack.link('string'), + 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String', + 'Default global resolution of string'); + + t.equal(createLinkerStack({ + paths: { + Point: 'http://geojson.org/geojson-spec.html#point' + } + }).link('Point'), + 'http://geojson.org/geojson-spec.html#point', + 'Custom hardcoded path for a GeoJSON type'); + + t.end(); +}); diff --git a/test/test.js b/test/test.js index f1142df1f..9009c1ed0 100644 --- a/test/test.js +++ b/test/test.js @@ -11,6 +11,7 @@ var test = require('tap').test, glob = require('glob'), path = require('path'), fs = require('fs'), + _ = require('lodash'), chdir = require('chdir'); var UPDATE = !!process.env.UPDATE; @@ -32,7 +33,7 @@ if (fs.existsSync(path.join(__dirname, '../.git'))) { var expect = require(outputfile); t.deepEqual(result, expect, 'produces correct JSON'); - outputMarkdown(result, null, function (err, result) { + outputMarkdown(result, {}, function (err, result) { t.ifError(err); var outputfile = file.replace('.input.js', '.output.github.md'); if (UPDATE) { @@ -67,7 +68,7 @@ test('external modules option', function (t) { test('bad input', function (tt) { glob.sync(path.join(__dirname, 'fixture/bad', '*.input.js')).forEach(function (file) { tt.test(path.basename(file), function (t) { - documentation.build([file], null, function (error, res) { + documentation.build([file], {}, function (error, res) { t.equal(res, undefined); // make error a serializable object error = JSON.parse(JSON.stringify(error)); @@ -90,7 +91,7 @@ test('bad input', function (tt) { test('html', function (tt) { glob.sync(path.join(__dirname, 'fixture/html', '*.input.js')).forEach(function (file) { tt.test(path.basename(file), function (t) { - documentation.build([file], null, function (err, result) { + documentation.build([file], {}, function (err, result) { t.ifError(err); outputHtml(result, null, function (err, result) { t.ifError(err); @@ -118,11 +119,11 @@ test('html', function (tt) { test('outputs', function (ttt) { glob.sync(path.join(__dirname, 'fixture', '*.input.js')).forEach(function (file) { ttt.test(path.basename(file), function (tt) { - documentation.build([file], null, function (err, result) { + documentation.build([file], {}, function (err, result) { tt.ifError(err); tt.test('markdown', function (t) { - outputMarkdown(result, null, function (err, result) { + outputMarkdown(_.cloneDeep(result), {}, function (err, result) { t.ifError(err); var outputfile = file.replace('.input.js', '.output.md'); if (UPDATE) { @@ -135,7 +136,7 @@ test('outputs', function (ttt) { }); tt.test('markdown AST', function (t) { - outputMarkdownAST(result, null, function (err, result) { + outputMarkdownAST(_.cloneDeep(result), {}, function (err, result) { t.ifError(err); var outputfile = file.replace('.input.js', '.output.md.json'); if (UPDATE) { @@ -176,7 +177,7 @@ test('outputs - sync', function (ttt) { var result = documentation.buildSync([file]); tt.test('markdown', function (t) { - outputMarkdown(result, null, function (err, result) { + outputMarkdown(result, {}, function (err, result) { t.ifError(err); var outputfile = file.replace('.input.js', '.output.md'); if (UPDATE) { @@ -189,7 +190,7 @@ test('outputs - sync', function (ttt) { }); tt.test('markdown AST', function (t) { - outputMarkdownAST(result, null, function (err, result) { + outputMarkdownAST(result, {}, function (err, result) { t.ifError(err); var outputfile = file.replace('.input.js', '.output.md.json'); if (UPDATE) { pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy

    NameDescriptionNameDescription