From 4517423214bd5c3c8eb45f13eae5dc2e50dfe3d1 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 18 Nov 2016 10:40:02 -0500 Subject: [PATCH 1/3] Support system.import with nice handy babel plugin --- lib/input/dependency.js | 5 +- package.json | 1 + test/fixture/system-import.input.js | 5 + test/fixture/system-import.output.json | 2614 +++++++++++++++++++++ test/fixture/system-import.output.md | 140 ++ test/fixture/system-import.output.md.json | 2233 ++++++++++++++++++ 6 files changed, 4997 insertions(+), 1 deletion(-) create mode 100644 test/fixture/system-import.input.js create mode 100644 test/fixture/system-import.output.json create mode 100644 test/fixture/system-import.output.md create mode 100644 test/fixture/system-import.output.md.json diff --git a/lib/input/dependency.js b/lib/input/dependency.js index 464aba2c2..8d0b18f73 100644 --- a/lib/input/dependency.js +++ b/lib/input/dependency.js @@ -46,7 +46,10 @@ function dependencyStream(indexes, options, callback) { require('babel-preset-react') ], plugins: [ - require('babel-plugin-transform-decorators-legacy').default + require('babel-plugin-transform-decorators-legacy').default, + // Required to support webpack's System.import + // https://github.com/documentationjs/documentation/issues/578 + require('babel-plugin-system-import-transformer').default ] })], postFilter: moduleFilters.externals(indexes, options) diff --git a/package.json b/package.json index bf5132d7c..8da8b0053 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "dependencies": { "ansi-html": "0.0.5", "babel-core": "^6.17.0", + "babel-plugin-system-import-transformer": "2.4.0", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-es2015": "^6.16.0", "babel-preset-react": "^6.16.0", diff --git a/test/fixture/system-import.input.js b/test/fixture/system-import.input.js new file mode 100644 index 000000000..b8b9b2bdd --- /dev/null +++ b/test/fixture/system-import.input.js @@ -0,0 +1,5 @@ +/* + * System.import is a webpack convention + * https://github.com/documentationjs/documentation/issues/578 + */ +System.import("./es6.input.js").then(() => {}); diff --git a/test/fixture/system-import.output.json b/test/fixture/system-import.output.json new file mode 100644 index 000000000..4e899117d --- /dev/null +++ b/test/fixture/system-import.output.json @@ -0,0 +1,2614 @@ +[ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 33, + "offset": 88 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 33, + "offset": 88 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 33, + "offset": 88 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + } + }, + "errors": [], + "name": "destructure", + "kind": "function", + "params": [ + { + "title": "param", + "name": "$0", + "type": { + "type": "NameExpression", + "name": "Object" + }, + "default": "{}", + "properties": [ + { + "title": "param", + "name": "$0.phoneNumbers", + "default": "[]" + }, + { + "title": "param", + "name": "$0.emailAddresses", + "default": "[]" + }, + { + "title": "param", + "name": "$0.params", + "lineNumber": 5, + "type": { + "type": "RestType" + } + } + ] + } + ], + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "destructure", + "kind": "function" + } + ], + "namespace": "destructure" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Similar, but with an array", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 27, + "offset": 26 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 27, + "offset": 26 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 27, + "offset": 26 + } + } + }, + "tags": [ + { + "title": "example", + "description": "destructure([1, 2, 3])", + "lineNumber": 2 + } + ], + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + } + }, + "errors": [], + "examples": [ + { + "description": "destructure([1, 2, 3])" + } + ], + "name": "destructure", + "kind": "function", + "params": [ + { + "title": "param", + "name": "$0", + "type": { + "type": "NameExpression", + "name": "Array" + }, + "properties": [ + { + "title": "param", + "name": "$0.a", + "lineNumber": 13 + }, + { + "title": "param", + "name": "$0.b", + "lineNumber": 13 + }, + { + "title": "param", + "name": "$0.c", + "lineNumber": 13 + } + ] + } + ], + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "destructure", + "kind": "function" + } + ], + "namespace": "destructure" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function returns the number one.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + } + } + }, + "tags": [ + { + "title": "param", + "description": "an array of numbers", + "lineNumber": 2, + "type": { + "type": "TypeApplication", + "expression": { + "type": "NameExpression", + "name": "Array" + }, + "applications": [ + { + "type": "NameExpression", + "name": "Number" + } + ] + }, + "name": "a" + }, + { + "title": "returns", + "description": "numberone", + "lineNumber": 3, + "type": { + "type": "NameExpression", + "name": "Number" + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 31 + } + } + }, + "errors": [], + "params": [ + { + "name": "a", + "lineNumber": 2, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "an array of numbers", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + } + } + }, + "type": { + "type": "TypeApplication", + "expression": { + "type": "NameExpression", + "name": "Array" + }, + "applications": [ + { + "type": "NameExpression", + "name": "Number" + } + ] + } + }, + { + "title": "param", + "name": "b", + "lineNumber": 21 + } + ], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "numberone", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + } + } + }, + "type": { + "type": "NameExpression", + "name": "Number" + } + } + ], + "name": "multiply", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "multiply", + "kind": "function" + } + ], + "namespace": "multiply" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is a sink", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 25, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 62, + "column": 1 + } + } + }, + "errors": [], + "name": "Sink", + "kind": "class", + "members": { + "instance": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is a property of the sink.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 27, + "column": 2 + }, + "end": { + "line": 29, + "column": 5 + } + }, + "context": { + "loc": { + "start": { + "line": 30, + "column": 2 + }, + "end": { + "line": 30, + "column": 18 + } + } + }, + "errors": [], + "name": "staticProp", + "kind": "member", + "memberof": "Sink", + "scope": "instance", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "Sink", + "kind": "class" + }, + { + "name": "staticProp", + "kind": "member", + "scope": "instance" + } + ], + "namespace": "Sink#staticProp" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Is it empty", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 12, + "offset": 11 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 12, + "offset": 11 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 12, + "offset": 11 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 32, + "column": 2 + }, + "end": { + "line": 34, + "column": 5 + } + }, + "context": { + "loc": { + "start": { + "line": 35, + "column": 2 + }, + "end": { + "line": 37, + "column": 3 + } + } + }, + "errors": [], + "name": "empty", + "kind": "function", + "memberof": "Sink", + "scope": "instance", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "Sink", + "kind": "class" + }, + { + "name": "empty", + "kind": "function", + "scope": "instance" + } + ], + "namespace": "Sink#empty" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is a getter method: it should be documented\nas a property.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 15, + "offset": 63 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 15, + "offset": 63 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 15, + "offset": 63 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 46, + "column": 2 + }, + "end": { + "line": 49, + "column": 5 + } + }, + "context": { + "loc": { + "start": { + "line": 50, + "column": 2 + }, + "end": { + "line": 52, + "column": 3 + } + } + }, + "errors": [], + "name": "aGetter", + "kind": "member", + "memberof": "Sink", + "scope": "instance", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "Sink", + "kind": "class" + }, + { + "name": "aGetter", + "kind": "member", + "scope": "instance" + } + ], + "namespace": "Sink#aGetter" + }, + { + "description": "", + "tags": [ + { + "title": "param", + "description": "the height of the thing", + "lineNumber": 1, + "type": { + "type": "NameExpression", + "name": "number" + }, + "name": "height" + }, + { + "title": "param", + "description": "the width of the thing", + "lineNumber": 2, + "type": { + "type": "NameExpression", + "name": "number" + }, + "name": "width" + } + ], + "loc": { + "start": { + "line": 54, + "column": 2 + }, + "end": { + "line": 57, + "column": 5 + } + }, + "context": { + "loc": { + "start": { + "line": 58, + "column": 2 + }, + "end": { + "line": 61, + "column": 3 + } + } + }, + "errors": [], + "params": [ + { + "name": "height", + "lineNumber": 1, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "the height of the thing", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + } + } + }, + "type": { + "type": "NameExpression", + "name": "number" + } + }, + { + "name": "width", + "lineNumber": 2, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "the width of the thing", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + } + } + }, + "type": { + "type": "NameExpression", + "name": "number" + } + } + ], + "name": "constructor", + "kind": "function", + "memberof": "Sink", + "scope": "instance", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "Sink", + "kind": "class" + }, + { + "name": "constructor", + "kind": "function", + "scope": "instance" + } + ], + "namespace": "Sink#constructor" + } + ], + "static": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method says hello", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 39, + "column": 2 + }, + "end": { + "line": 41, + "column": 5 + } + }, + "context": { + "loc": { + "start": { + "line": 42, + "column": 2 + }, + "end": { + "line": 44, + "column": 3 + } + } + }, + "errors": [], + "name": "hello", + "kind": "function", + "memberof": "Sink", + "scope": "static", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "Sink", + "kind": "class" + }, + { + "name": "hello", + "kind": "function", + "scope": "static" + } + ], + "namespace": "Sink.hello" + } + ], + "events": [] + }, + "path": [ + { + "name": "Sink", + "kind": "class" + } + ], + "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 + } + } + }, + "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 + } + } + }, + "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", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function takes rest params", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 81, + "column": 0 + }, + "end": { + "line": 83, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 84, + "column": 0 + }, + "end": { + "line": 85, + "column": 1 + } + } + }, + "errors": [], + "name": "functionWithRest", + "kind": "function", + "params": [ + { + "title": "param", + "name": "someParams", + "lineNumber": 84, + "type": { + "type": "RestType" + } + } + ], + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "functionWithRest", + "kind": "function" + } + ], + "namespace": "functionWithRest" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "So does this one, with types", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 29, + "offset": 28 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 29, + "offset": 28 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 29, + "offset": 28 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 87, + "column": 0 + }, + "end": { + "line": 89, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 90, + "column": 0 + }, + "end": { + "line": 91, + "column": 1 + } + } + }, + "errors": [], + "name": "functionWithRestAndType", + "kind": "function", + "params": [ + { + "title": "param", + "name": "someParams", + "lineNumber": 90, + "type": { + "type": "RestType", + "expression": { + "type": "NameExpression", + "name": "number" + } + } + } + ], + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "functionWithRestAndType", + "kind": "function" + } + ], + "namespace": "functionWithRestAndType" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is an async method", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 95, + "column": 0 + }, + "end": { + "line": 97, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 98, + "column": 0 + }, + "end": { + "line": 98, + "column": 24 + } + } + }, + "errors": [], + "name": "foo", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "foo", + "kind": "function" + } + ], + "namespace": "foo" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function returns the number one.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + } + } + }, + "tags": [ + { + "title": "returns", + "description": "numberone", + "lineNumber": 2, + "type": { + "type": "NameExpression", + "name": "Number" + } + } + ], + "loc": { + "start": { + "line": 102, + "column": 0 + }, + "end": { + "line": 105, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 106, + "column": 0 + }, + "end": { + "line": 106, + "column": 38 + } + } + }, + "errors": [], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "numberone", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + } + } + }, + "type": { + "type": "NameExpression", + "name": "Number" + } + } + ], + "name": "es6.input", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "es6.input", + "kind": "function" + } + ], + "namespace": "es6.input" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This tests our support of optional parameters in ES6", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 53, + "offset": 52 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 53, + "offset": 52 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 53, + "offset": 52 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 108, + "column": 0 + }, + "end": { + "line": 110, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 111, + "column": 0 + }, + "end": { + "line": 113, + "column": 1 + } + } + }, + "errors": [], + "name": "veryImportantTransform", + "kind": "function", + "params": [ + { + "title": "param", + "name": "foo", + "default": "'bar'" + } + ], + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "veryImportantTransform", + "kind": "function" + } + ], + "namespace": "veryImportantTransform" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "A protected function", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 21, + "offset": 20 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 21, + "offset": 20 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 21, + "offset": 20 + } + } + }, + "tags": [ + { + "title": "protected", + "description": null, + "lineNumber": 2 + } + ], + "loc": { + "start": { + "line": 123, + "column": 0 + }, + "end": { + "line": 126, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 127, + "column": 0 + }, + "end": { + "line": 127, + "column": 27 + } + } + }, + "errors": [], + "access": "protected", + "name": "iAmProtected", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "iAmProtected", + "kind": "function" + } + ], + "namespace": "iAmProtected" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "A public function", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 18, + "offset": 17 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 18, + "offset": 17 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 18, + "offset": 17 + } + } + }, + "tags": [ + { + "title": "public", + "description": null, + "lineNumber": 2 + } + ], + "loc": { + "start": { + "line": 129, + "column": 0 + }, + "end": { + "line": 132, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 133, + "column": 0 + }, + "end": { + "line": 133, + "column": 24 + } + } + }, + "errors": [], + "access": "public", + "name": "iAmPublic", + "kind": "function", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "iAmPublic", + "kind": "function" + } + ], + "namespace": "iAmPublic" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is re-exported", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 141, + "column": 0 + }, + "end": { + "line": 143, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 144, + "column": 0 + }, + "end": { + "line": 144, + "column": 42 + } + } + }, + "errors": [], + "name": "execute", + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "execute" + } + ], + "namespace": "execute" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Regression check for #498", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 146, + "column": 0 + }, + "end": { + "line": 146, + "column": 32 + } + }, + "context": { + "loc": { + "start": { + "line": 147, + "column": 0 + }, + "end": { + "line": 153, + "column": 1 + } + } + }, + "errors": [], + "name": "isArrayEqualWith", + "kind": "function", + "params": [ + { + "title": "param", + "name": "array1", + "lineNumber": 148, + "type": { + "type": "TypeApplication", + "expression": { + "type": "NameExpression", + "name": "Array" + }, + "applications": [ + { + "type": "NameExpression", + "name": "T" + } + ] + } + }, + { + "title": "param", + "name": "array2", + "lineNumber": 149, + "type": { + "type": "TypeApplication", + "expression": { + "type": "NameExpression", + "name": "Array" + }, + "applications": [ + { + "type": "NameExpression", + "name": "T" + } + ] + } + }, + { + "title": "param", + "name": "compareFunction", + "default": "(a: T, b: T): boolean => a === b", + "type": { + "type": "OptionalType", + "expression": { + "type": "FunctionType", + "params": [ + { + "type": "ParameterType", + "name": "a", + "expression": { + "type": "NameExpression", + "name": "T" + } + }, + { + "type": "ParameterType", + "name": "b", + "expression": { + "type": "NameExpression", + "name": "T" + } + } + ], + "result": { + "type": "NameExpression", + "name": "boolean" + } + } + } + } + ], + "returns": [ + { + "type": { + "type": "NameExpression", + "name": "boolean" + } + } + ], + "members": { + "instance": [], + "static": [] + }, + "path": [ + { + "name": "isArrayEqualWith", + "kind": "function" + } + ], + "namespace": "isArrayEqualWith" + } +] \ No newline at end of file diff --git a/test/fixture/system-import.output.md b/test/fixture/system-import.output.md new file mode 100644 index 000000000..815570663 --- /dev/null +++ b/test/fixture/system-import.output.md @@ -0,0 +1,140 @@ + + +# destructure + +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` **...any** + +# destructure + +Similar, but with an array + +**Parameters** + +- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** + - `$0.a` + - `$0.b` + - `$0.c` + +**Examples** + +```javascript +destructure([1, 2, 3]) +``` + +# multiply + +This function returns the number one. + +**Parameters** + +- `a` **[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)>** an array of numbers +- `b` + +Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone + +# Sink + +This is a sink + +## staticProp + +This is a property of the sink. + +## empty + +Is it empty + +## aGetter + +This is a getter method: it should be documented +as a property. + +## constructor + +**Parameters** + +- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing +- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing + +## hello + +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` **...any** + +# functionWithRestAndType + +So does this one, with types + +**Parameters** + +- `someParams` **...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** + +# foo + +This is an async method + +# es6.input + +This function returns the number one. + +Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone + +# veryImportantTransform + +This tests our support of optional parameters in ES6 + +**Parameters** + +- `foo` (optional, default `'bar'`) + +# iAmProtected + +A protected function + +# iAmPublic + +A public function + +# execute + +This is re-exported + +# isArrayEqualWith + +Regression check for #498 + +**Parameters** + +- `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** +- `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** +- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a: T, b: T): boolean => a === b`) + +Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json new file mode 100644 index 000000000..512fd2610 --- /dev/null +++ b/test/fixture/system-import.output.md.json @@ -0,0 +1,2233 @@ +{ + "type": "root", + "children": [ + { + "type": "html", + "value": "" + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "destructure" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 33, + "offset": 88 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 33, + "offset": 88 + }, + "indent": [ + 1 + ] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "children": [ + { + "type": "text", + "value": "Object" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "{}" + }, + { + "type": "text", + "value": ")" + } + ] + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0.phoneNumbers" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "[]" + }, + { + "type": "text", + "value": ")" + } + ] + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0.emailAddresses" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "[]" + }, + { + "type": "text", + "value": ")" + } + ] + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0.params" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "..." + }, + { + "type": "text", + "value": "any" + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "destructure" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Similar, but with an array", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 27, + "offset": 26 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 27, + "offset": 26 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0.a" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0.b" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0.c" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Examples" + } + ] + }, + { + "lang": "javascript", + "type": "code", + "value": "destructure([1, 2, 3])" + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "multiply" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function returns the number one.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "a" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] + }, + { + "type": "text", + "value": "<" + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "Number" + } + ] + }, + { + "type": "text", + "value": ">" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "an array of numbers", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + }, + "indent": [] + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "b" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "Number" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "numberone", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "Sink" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is a sink", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "staticProp" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is a property of the sink.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "empty" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Is it empty", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 12, + "offset": 11 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 12, + "offset": 11 + }, + "indent": [] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "aGetter" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is a getter method: it should be documented\nas a property.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 15, + "offset": 63 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 15, + "offset": 63 + }, + "indent": [ + 1 + ] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "constructor" + } + ] + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "height" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "number" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "the height of the thing", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "width" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "number" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "the width of the thing", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ] + } + ] + } + ] + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "hello" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method says hello", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "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", + "children": [ + { + "type": "text", + "value": "functionWithRest" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function takes rest params", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "someParams" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "..." + }, + { + "type": "text", + "value": "any" + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "functionWithRestAndType" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "So does this one, with types", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 29, + "offset": 28 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 29, + "offset": 28 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "someParams" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "..." + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "number" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "foo" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is an async method", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "es6.input" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This function returns the number one.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 38, + "offset": 37 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "Number" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "numberone", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "veryImportantTransform" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This tests our support of optional parameters in ES6", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 53, + "offset": 52 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 53, + "offset": 52 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "foo" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "'bar'" + }, + { + "type": "text", + "value": ")" + } + ] + } + ] + } + ] + } + ] + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "iAmProtected" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "A protected function", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 21, + "offset": 20 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 21, + "offset": 20 + }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "iAmPublic" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "A public function", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 18, + "offset": 17 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 18, + "offset": 17 + }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "execute" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is re-exported", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 20, + "offset": 19 + }, + "indent": [] + } + }, + { + "depth": 1, + "type": "heading", + "children": [ + { + "type": "text", + "value": "isArrayEqualWith" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Regression check for #498", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "array1" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] + }, + { + "type": "text", + "value": "<" + }, + { + "type": "text", + "value": "T" + }, + { + "type": "text", + "value": ">" + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "array2" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] + }, + { + "type": "text", + "value": "<" + }, + { + "type": "text", + "value": "T" + }, + { + "type": "text", + "value": ">" + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "compareFunction" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "function (" + }, + { + "type": "text", + "value": "a: " + }, + { + "type": "text", + "value": "T" + }, + { + "type": "text", + "value": ", " + }, + { + "type": "text", + "value": "b: " + }, + { + "type": "text", + "value": "T" + }, + { + "type": "text", + "value": ")" + }, + { + "type": "text", + "value": ": " + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "children": [ + { + "type": "text", + "value": "boolean" + } + ] + }, + { + "type": "text", + "value": "?" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "(a: T, b: T): boolean => a === b" + }, + { + "type": "text", + "value": ")" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "children": [ + { + "type": "text", + "value": "boolean" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] +} \ No newline at end of file From 01111a840e4058152e09c6c20aff6b290c17c4e8 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 18 Nov 2016 10:43:29 -0500 Subject: [PATCH 2/3] Use a smaller import --- test/fixture/system-import.input.js | 2 +- test/fixture/system-import.output.json | 2473 +-------------------- test/fixture/system-import.output.md | 137 +- test/fixture/system-import.output.md.json | 2119 +----------------- 4 files changed, 16 insertions(+), 4715 deletions(-) diff --git a/test/fixture/system-import.input.js b/test/fixture/system-import.input.js index b8b9b2bdd..95fd643be 100644 --- a/test/fixture/system-import.input.js +++ b/test/fixture/system-import.input.js @@ -2,4 +2,4 @@ * System.import is a webpack convention * https://github.com/documentationjs/documentation/issues/578 */ -System.import("./es6.input.js").then(() => {}); +System.import("./simple.input.js").then(() => {}); diff --git a/test/fixture/system-import.output.json b/test/fixture/system-import.output.json index 4e899117d..ee6fd4cc9 100644 --- a/test/fixture/system-import.output.json +++ b/test/fixture/system-import.output.json @@ -1,259 +1,4 @@ [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - } - }, - "errors": [], - "name": "destructure", - "kind": "function", - "params": [ - { - "title": "param", - "name": "$0", - "type": { - "type": "NameExpression", - "name": "Object" - }, - "default": "{}", - "properties": [ - { - "title": "param", - "name": "$0.phoneNumbers", - "default": "[]" - }, - { - "title": "param", - "name": "$0.emailAddresses", - "default": "[]" - }, - { - "title": "param", - "name": "$0.params", - "lineNumber": 5, - "type": { - "type": "RestType" - } - } - ] - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "destructure", - "kind": "function" - } - ], - "namespace": "destructure" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Similar, but with an array", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "tags": [ - { - "title": "example", - "description": "destructure([1, 2, 3])", - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 14, - "column": 1 - } - } - }, - "errors": [], - "examples": [ - { - "description": "destructure([1, 2, 3])" - } - ], - "name": "destructure", - "kind": "function", - "params": [ - { - "title": "param", - "name": "$0", - "type": { - "type": "NameExpression", - "name": "Array" - }, - "properties": [ - { - "title": "param", - "name": "$0.a", - "lineNumber": 13 - }, - { - "title": "param", - "name": "$0.b", - "lineNumber": 13 - }, - { - "title": "param", - "name": "$0.c", - "lineNumber": 13 - } - ] - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "destructure", - "kind": "function" - } - ], - "namespace": "destructure" - }, { "description": { "type": "root", @@ -308,134 +53,39 @@ } }, "tags": [ - { - "title": "param", - "description": "an array of numbers", - "lineNumber": 2, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - }, - "name": "a" - }, { "title": "returns", "description": "numberone", - "lineNumber": 3, + "lineNumber": 2, "type": { "type": "NameExpression", - "name": "Number" + "name": "number" } } ], "loc": { "start": { - "line": 16, + "line": 1, "column": 0 }, "end": { - "line": 20, + "line": 4, "column": 3 } }, "context": { "loc": { "start": { - "line": 21, + "line": 5, "column": 0 }, "end": { - "line": 21, - "column": 31 + "line": 8, + "column": 2 } } }, "errors": [], - "params": [ - { - "name": "a", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an array of numbers", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - } - }, - { - "title": "param", - "name": "b", - "lineNumber": 21 - } - ], "returns": [ { "description": { @@ -492,11 +142,11 @@ }, "type": { "type": "NameExpression", - "name": "Number" + "name": "number" } } ], - "name": "multiply", + "name": "simple.input", "kind": "function", "members": { "instance": [], @@ -504,2111 +154,10 @@ }, "path": [ { - "name": "multiply", - "kind": "function" - } - ], - "namespace": "multiply" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 25, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 26, - "column": 0 - }, - "end": { - "line": 62, - "column": 1 - } - } - }, - "errors": [], - "name": "Sink", - "kind": "class", - "members": { - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 27, - "column": 2 - }, - "end": { - "line": 29, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 18 - } - } - }, - "errors": [], - "name": "staticProp", - "kind": "member", - "memberof": "Sink", - "scope": "instance", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "staticProp", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Sink#staticProp" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 32, - "column": 2 - }, - "end": { - "line": 34, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 35, - "column": 2 - }, - "end": { - "line": 37, - "column": 3 - } - } - }, - "errors": [], - "name": "empty", - "kind": "function", - "memberof": "Sink", - "scope": "instance", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "empty", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Sink#empty" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 49, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 50, - "column": 2 - }, - "end": { - "line": 52, - "column": 3 - } - } - }, - "errors": [], - "name": "aGetter", - "kind": "member", - "memberof": "Sink", - "scope": "instance", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "aGetter", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Sink#aGetter" - }, - { - "description": "", - "tags": [ - { - "title": "param", - "description": "the height of the thing", - "lineNumber": 1, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "height" - }, - { - "title": "param", - "description": "the width of the thing", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "width" - } - ], - "loc": { - "start": { - "line": 54, - "column": 2 - }, - "end": { - "line": 57, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 58, - "column": 2 - }, - "end": { - "line": 61, - "column": 3 - } - } - }, - "errors": [], - "params": [ - { - "name": "height", - "lineNumber": 1, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "name": "width", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "name": "constructor", - "kind": "function", - "memberof": "Sink", - "scope": "instance", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "constructor", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Sink#constructor" - } - ], - "static": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method says hello", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 39, - "column": 2 - }, - "end": { - "line": 41, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 42, - "column": 2 - }, - "end": { - "line": 44, - "column": 3 - } - } - }, - "errors": [], - "name": "hello", - "kind": "function", - "memberof": "Sink", - "scope": "static", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "hello", - "kind": "function", - "scope": "static" - } - ], - "namespace": "Sink.hello" - } - ], - "events": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - } - ], - "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 - } - } - }, - "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 - } - } - }, - "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", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function takes rest params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 81, - "column": 0 - }, - "end": { - "line": 83, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 84, - "column": 0 - }, - "end": { - "line": 85, - "column": 1 - } - } - }, - "errors": [], - "name": "functionWithRest", - "kind": "function", - "params": [ - { - "title": "param", - "name": "someParams", - "lineNumber": 84, - "type": { - "type": "RestType" - } - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "functionWithRest", - "kind": "function" - } - ], - "namespace": "functionWithRest" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "So does this one, with types", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 87, - "column": 0 - }, - "end": { - "line": 89, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 90, - "column": 0 - }, - "end": { - "line": 91, - "column": 1 - } - } - }, - "errors": [], - "name": "functionWithRestAndType", - "kind": "function", - "params": [ - { - "title": "param", - "name": "someParams", - "lineNumber": 90, - "type": { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "functionWithRestAndType", - "kind": "function" - } - ], - "namespace": "functionWithRestAndType" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 95, - "column": 0 - }, - "end": { - "line": 97, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 98, - "column": 0 - }, - "end": { - "line": 98, - "column": 24 - } - } - }, - "errors": [], - "name": "foo", - "kind": "function", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 102, - "column": 0 - }, - "end": { - "line": 105, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 106, - "column": 0 - }, - "end": { - "line": 106, - "column": 38 - } - } - }, - "errors": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "name": "es6.input", - "kind": "function", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "es6.input", - "kind": "function" - } - ], - "namespace": "es6.input" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters in ES6", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 108, - "column": 0 - }, - "end": { - "line": 110, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 111, - "column": 0 - }, - "end": { - "line": 113, - "column": 1 - } - } - }, - "errors": [], - "name": "veryImportantTransform", - "kind": "function", - "params": [ - { - "title": "param", - "name": "foo", - "default": "'bar'" - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "veryImportantTransform", - "kind": "function" - } - ], - "namespace": "veryImportantTransform" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A protected function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [ - { - "title": "protected", - "description": null, - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 123, - "column": 0 - }, - "end": { - "line": 126, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 127, - "column": 0 - }, - "end": { - "line": 127, - "column": 27 - } - } - }, - "errors": [], - "access": "protected", - "name": "iAmProtected", - "kind": "function", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "iAmProtected", - "kind": "function" - } - ], - "namespace": "iAmProtected" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A public function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [ - { - "title": "public", - "description": null, - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 129, - "column": 0 - }, - "end": { - "line": 132, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 133, - "column": 0 - }, - "end": { - "line": 133, - "column": 24 - } - } - }, - "errors": [], - "access": "public", - "name": "iAmPublic", - "kind": "function", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "iAmPublic", - "kind": "function" - } - ], - "namespace": "iAmPublic" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is re-exported", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 141, - "column": 0 - }, - "end": { - "line": 143, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 144, - "column": 0 - }, - "end": { - "line": 144, - "column": 42 - } - } - }, - "errors": [], - "name": "execute", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "execute" - } - ], - "namespace": "execute" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #498", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 146, - "column": 0 - }, - "end": { - "line": 146, - "column": 32 - } - }, - "context": { - "loc": { - "start": { - "line": 147, - "column": 0 - }, - "end": { - "line": 153, - "column": 1 - } - } - }, - "errors": [], - "name": "isArrayEqualWith", - "kind": "function", - "params": [ - { - "title": "param", - "name": "array1", - "lineNumber": 148, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "T" - } - ] - } - }, - { - "title": "param", - "name": "array2", - "lineNumber": 149, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "T" - } - ] - } - }, - { - "title": "param", - "name": "compareFunction", - "default": "(a: T, b: T): boolean => a === b", - "type": { - "type": "OptionalType", - "expression": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "T" - } - }, - { - "type": "ParameterType", - "name": "b", - "expression": { - "type": "NameExpression", - "name": "T" - } - } - ], - "result": { - "type": "NameExpression", - "name": "boolean" - } - } - } - } - ], - "returns": [ - { - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "isArrayEqualWith", + "name": "simple.input", "kind": "function" } ], - "namespace": "isArrayEqualWith" + "namespace": "simple.input" } ] \ No newline at end of file diff --git a/test/fixture/system-import.output.md b/test/fixture/system-import.output.md index 815570663..55ce13e20 100644 --- a/test/fixture/system-import.output.md +++ b/test/fixture/system-import.output.md @@ -1,140 +1,7 @@ -# destructure - -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` **...any** - -# destructure - -Similar, but with an array - -**Parameters** - -- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** - - `$0.a` - - `$0.b` - - `$0.c` - -**Examples** - -```javascript -destructure([1, 2, 3]) -``` - -# multiply - -This function returns the number one. - -**Parameters** - -- `a` **[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)>** an array of numbers -- `b` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -# Sink - -This is a sink - -## staticProp - -This is a property of the sink. - -## empty - -Is it empty - -## aGetter - -This is a getter method: it should be documented -as a property. - -## constructor - -**Parameters** - -- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing -- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing - -## hello - -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` **...any** - -# functionWithRestAndType - -So does this one, with types - -**Parameters** - -- `someParams` **...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -# foo - -This is an async method - -# es6.input +# simple.input This function returns the number one. -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -# veryImportantTransform - -This tests our support of optional parameters in ES6 - -**Parameters** - -- `foo` (optional, default `'bar'`) - -# iAmProtected - -A protected function - -# iAmPublic - -A public function - -# execute - -This is re-exported - -# isArrayEqualWith - -Regression check for #498 - -**Parameters** - -- `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a: T, b: T): boolean => a === b`) - -Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json index 512fd2610..6f30c7d2d 100644 --- a/test/fixture/system-import.output.md.json +++ b/test/fixture/system-import.output.md.json @@ -11,429 +11,7 @@ "children": [ { "type": "text", - "value": "destructure" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "{}" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.phoneNumbers" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.emailAddresses" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.params" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "destructure" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Similar, but with an array", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "destructure([1, 2, 3])" - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "multiply" + "value": "simple.input" } ] }, @@ -472,135 +50,6 @@ "indent": [] } }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an array of numbers", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, { "type": "paragraph", "children": [ @@ -618,7 +67,7 @@ "children": [ { "type": "text", - "value": "Number" + "value": "number" } ] } @@ -664,1570 +113,6 @@ } } ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Sink" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticProp" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "empty" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "aGetter" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "constructor" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "height" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "width" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "hello" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method says hello", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "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", - "children": [ - { - "type": "text", - "value": "functionWithRest" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function takes rest params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "someParams" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "functionWithRestAndType" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "So does this one, with types", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "someParams" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "es6.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "veryImportantTransform" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters in ES6", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "foo" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "'bar'" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "iAmProtected" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A protected function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "iAmPublic" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A public function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "execute" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is re-exported", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "isArrayEqualWith" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #498", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "array1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "array2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "compareFunction" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "a: " - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "b: " - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "(a: T, b: T): boolean => a === b" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] } ] } \ No newline at end of file From bfeab8fb5c8a691f9fcf8b413088a00f431b6657 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 18 Nov 2016 10:45:53 -0500 Subject: [PATCH 3/3] Use smaller imports here too --- test/fixture/es6-import.input.js | 2 +- test/fixture/es6-import.output.json | 2473 +----------------------- test/fixture/es6-import.output.md | 137 +- test/fixture/es6-import.output.md.json | 2119 +------------------- 4 files changed, 16 insertions(+), 4715 deletions(-) diff --git a/test/fixture/es6-import.input.js b/test/fixture/es6-import.input.js index 12d244dbc..19d21072c 100644 --- a/test/fixture/es6-import.input.js +++ b/test/fixture/es6-import.input.js @@ -1,5 +1,5 @@ import hasEx6 from './es6-ext'; -import multiply from "./es6.input.js"; +import multiply from "./simple.input.js"; import * as foo from "some-other-module"; /** diff --git a/test/fixture/es6-import.output.json b/test/fixture/es6-import.output.json index e83c88c9d..8388f25d0 100644 --- a/test/fixture/es6-import.output.json +++ b/test/fixture/es6-import.output.json @@ -256,261 +256,6 @@ ], "namespace": "es6-ext" }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - } - }, - "errors": [], - "name": "destructure", - "kind": "function", - "params": [ - { - "title": "param", - "name": "$0", - "type": { - "type": "NameExpression", - "name": "Object" - }, - "default": "{}", - "properties": [ - { - "title": "param", - "name": "$0.phoneNumbers", - "default": "[]" - }, - { - "title": "param", - "name": "$0.emailAddresses", - "default": "[]" - }, - { - "title": "param", - "name": "$0.params", - "lineNumber": 5, - "type": { - "type": "RestType" - } - } - ] - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "destructure", - "kind": "function" - } - ], - "namespace": "destructure" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Similar, but with an array", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "tags": [ - { - "title": "example", - "description": "destructure([1, 2, 3])", - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 14, - "column": 1 - } - } - }, - "errors": [], - "examples": [ - { - "description": "destructure([1, 2, 3])" - } - ], - "name": "destructure", - "kind": "function", - "params": [ - { - "title": "param", - "name": "$0", - "type": { - "type": "NameExpression", - "name": "Array" - }, - "properties": [ - { - "title": "param", - "name": "$0.a", - "lineNumber": 13 - }, - { - "title": "param", - "name": "$0.b", - "lineNumber": 13 - }, - { - "title": "param", - "name": "$0.c", - "lineNumber": 13 - } - ] - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "destructure", - "kind": "function" - } - ], - "namespace": "destructure" - }, { "description": { "type": "root", @@ -565,134 +310,39 @@ } }, "tags": [ - { - "title": "param", - "description": "an array of numbers", - "lineNumber": 2, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - }, - "name": "a" - }, { "title": "returns", "description": "numberone", - "lineNumber": 3, + "lineNumber": 2, "type": { "type": "NameExpression", - "name": "Number" + "name": "number" } } ], "loc": { "start": { - "line": 16, + "line": 1, "column": 0 }, "end": { - "line": 20, + "line": 4, "column": 3 } }, "context": { "loc": { "start": { - "line": 21, + "line": 5, "column": 0 }, "end": { - "line": 21, - "column": 31 + "line": 8, + "column": 2 } } }, "errors": [], - "params": [ - { - "name": "a", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an array of numbers", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - } - }, - { - "title": "param", - "name": "b", - "lineNumber": 21 - } - ], "returns": [ { "description": { @@ -749,11 +399,11 @@ }, "type": { "type": "NameExpression", - "name": "Number" + "name": "number" } } ], - "name": "multiply", + "name": "simple.input", "kind": "function", "members": { "instance": [], @@ -761,2111 +411,10 @@ }, "path": [ { - "name": "multiply", - "kind": "function" - } - ], - "namespace": "multiply" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 25, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 26, - "column": 0 - }, - "end": { - "line": 62, - "column": 1 - } - } - }, - "errors": [], - "name": "Sink", - "kind": "class", - "members": { - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 27, - "column": 2 - }, - "end": { - "line": 29, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 18 - } - } - }, - "errors": [], - "name": "staticProp", - "kind": "member", - "memberof": "Sink", - "scope": "instance", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "staticProp", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Sink#staticProp" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 32, - "column": 2 - }, - "end": { - "line": 34, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 35, - "column": 2 - }, - "end": { - "line": 37, - "column": 3 - } - } - }, - "errors": [], - "name": "empty", - "kind": "function", - "memberof": "Sink", - "scope": "instance", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "empty", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Sink#empty" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 49, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 50, - "column": 2 - }, - "end": { - "line": 52, - "column": 3 - } - } - }, - "errors": [], - "name": "aGetter", - "kind": "member", - "memberof": "Sink", - "scope": "instance", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "aGetter", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Sink#aGetter" - }, - { - "description": "", - "tags": [ - { - "title": "param", - "description": "the height of the thing", - "lineNumber": 1, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "height" - }, - { - "title": "param", - "description": "the width of the thing", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "width" - } - ], - "loc": { - "start": { - "line": 54, - "column": 2 - }, - "end": { - "line": 57, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 58, - "column": 2 - }, - "end": { - "line": 61, - "column": 3 - } - } - }, - "errors": [], - "params": [ - { - "name": "height", - "lineNumber": 1, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "name": "width", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "name": "constructor", - "kind": "function", - "memberof": "Sink", - "scope": "instance", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "constructor", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Sink#constructor" - } - ], - "static": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method says hello", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 39, - "column": 2 - }, - "end": { - "line": 41, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 42, - "column": 2 - }, - "end": { - "line": 44, - "column": 3 - } - } - }, - "errors": [], - "name": "hello", - "kind": "function", - "memberof": "Sink", - "scope": "static", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "hello", - "kind": "function", - "scope": "static" - } - ], - "namespace": "Sink.hello" - } - ], - "events": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - } - ], - "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 - } - } - }, - "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 - } - } - }, - "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", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function takes rest params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 81, - "column": 0 - }, - "end": { - "line": 83, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 84, - "column": 0 - }, - "end": { - "line": 85, - "column": 1 - } - } - }, - "errors": [], - "name": "functionWithRest", - "kind": "function", - "params": [ - { - "title": "param", - "name": "someParams", - "lineNumber": 84, - "type": { - "type": "RestType" - } - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "functionWithRest", - "kind": "function" - } - ], - "namespace": "functionWithRest" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "So does this one, with types", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 87, - "column": 0 - }, - "end": { - "line": 89, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 90, - "column": 0 - }, - "end": { - "line": 91, - "column": 1 - } - } - }, - "errors": [], - "name": "functionWithRestAndType", - "kind": "function", - "params": [ - { - "title": "param", - "name": "someParams", - "lineNumber": 90, - "type": { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "functionWithRestAndType", - "kind": "function" - } - ], - "namespace": "functionWithRestAndType" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 95, - "column": 0 - }, - "end": { - "line": 97, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 98, - "column": 0 - }, - "end": { - "line": 98, - "column": 24 - } - } - }, - "errors": [], - "name": "foo", - "kind": "function", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 102, - "column": 0 - }, - "end": { - "line": 105, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 106, - "column": 0 - }, - "end": { - "line": 106, - "column": 38 - } - } - }, - "errors": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "name": "es6.input", - "kind": "function", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "es6.input", - "kind": "function" - } - ], - "namespace": "es6.input" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters in ES6", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 108, - "column": 0 - }, - "end": { - "line": 110, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 111, - "column": 0 - }, - "end": { - "line": 113, - "column": 1 - } - } - }, - "errors": [], - "name": "veryImportantTransform", - "kind": "function", - "params": [ - { - "title": "param", - "name": "foo", - "default": "'bar'" - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "veryImportantTransform", - "kind": "function" - } - ], - "namespace": "veryImportantTransform" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A protected function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [ - { - "title": "protected", - "description": null, - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 123, - "column": 0 - }, - "end": { - "line": 126, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 127, - "column": 0 - }, - "end": { - "line": 127, - "column": 27 - } - } - }, - "errors": [], - "access": "protected", - "name": "iAmProtected", - "kind": "function", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "iAmProtected", - "kind": "function" - } - ], - "namespace": "iAmProtected" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A public function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [ - { - "title": "public", - "description": null, - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 129, - "column": 0 - }, - "end": { - "line": 132, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 133, - "column": 0 - }, - "end": { - "line": 133, - "column": 24 - } - } - }, - "errors": [], - "access": "public", - "name": "iAmPublic", - "kind": "function", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "iAmPublic", - "kind": "function" - } - ], - "namespace": "iAmPublic" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is re-exported", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 141, - "column": 0 - }, - "end": { - "line": 143, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 144, - "column": 0 - }, - "end": { - "line": 144, - "column": 42 - } - } - }, - "errors": [], - "name": "execute", - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "execute" - } - ], - "namespace": "execute" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #498", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 146, - "column": 0 - }, - "end": { - "line": 146, - "column": 32 - } - }, - "context": { - "loc": { - "start": { - "line": 147, - "column": 0 - }, - "end": { - "line": 153, - "column": 1 - } - } - }, - "errors": [], - "name": "isArrayEqualWith", - "kind": "function", - "params": [ - { - "title": "param", - "name": "array1", - "lineNumber": 148, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "T" - } - ] - } - }, - { - "title": "param", - "name": "array2", - "lineNumber": 149, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "T" - } - ] - } - }, - { - "title": "param", - "name": "compareFunction", - "default": "(a: T, b: T): boolean => a === b", - "type": { - "type": "OptionalType", - "expression": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "T" - } - }, - { - "type": "ParameterType", - "name": "b", - "expression": { - "type": "NameExpression", - "name": "T" - } - } - ], - "result": { - "type": "NameExpression", - "name": "boolean" - } - } - } - } - ], - "returns": [ - { - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "members": { - "instance": [], - "static": [] - }, - "path": [ - { - "name": "isArrayEqualWith", + "name": "simple.input", "kind": "function" } ], - "namespace": "isArrayEqualWith" + "namespace": "simple.input" } ] \ No newline at end of file diff --git a/test/fixture/es6-import.output.md b/test/fixture/es6-import.output.md index 197bd8048..bea585d89 100644 --- a/test/fixture/es6-import.output.md +++ b/test/fixture/es6-import.output.md @@ -14,141 +14,8 @@ Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer This is the default export frogs! -# destructure - -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` **...any** - -# destructure - -Similar, but with an array - -**Parameters** - -- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** - - `$0.a` - - `$0.b` - - `$0.c` - -**Examples** - -```javascript -destructure([1, 2, 3]) -``` - -# multiply - -This function returns the number one. - -**Parameters** - -- `a` **[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)>** an array of numbers -- `b` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -# Sink - -This is a sink - -## staticProp - -This is a property of the sink. - -## empty - -Is it empty - -## aGetter - -This is a getter method: it should be documented -as a property. - -## constructor - -**Parameters** - -- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing -- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing - -## hello - -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` **...any** - -# functionWithRestAndType - -So does this one, with types - -**Parameters** - -- `someParams` **...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -# foo - -This is an async method - -# es6.input +# simple.input This function returns the number one. -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -# veryImportantTransform - -This tests our support of optional parameters in ES6 - -**Parameters** - -- `foo` (optional, default `'bar'`) - -# iAmProtected - -A protected function - -# iAmPublic - -A public function - -# execute - -This is re-exported - -# isArrayEqualWith - -Regression check for #498 - -**Parameters** - -- `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a: T, b: T): boolean => a === b`) - -Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json index bfc9a4b09..eded2cef2 100644 --- a/test/fixture/es6-import.output.md.json +++ b/test/fixture/es6-import.output.md.json @@ -202,429 +202,7 @@ "children": [ { "type": "text", - "value": "destructure" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "{}" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.phoneNumbers" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.emailAddresses" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.params" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "destructure" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Similar, but with an array", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "destructure([1, 2, 3])" - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "multiply" + "value": "simple.input" } ] }, @@ -663,135 +241,6 @@ "indent": [] } }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an array of numbers", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, { "type": "paragraph", "children": [ @@ -809,7 +258,7 @@ "children": [ { "type": "text", - "value": "Number" + "value": "number" } ] } @@ -855,1570 +304,6 @@ } } ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Sink" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticProp" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "empty" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "aGetter" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "constructor" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "height" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "width" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "hello" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method says hello", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "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", - "children": [ - { - "type": "text", - "value": "functionWithRest" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function takes rest params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "someParams" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "functionWithRestAndType" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "So does this one, with types", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "someParams" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "es6.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "veryImportantTransform" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters in ES6", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "foo" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "'bar'" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "iAmProtected" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A protected function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "iAmPublic" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A public function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "execute" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is re-exported", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "isArrayEqualWith" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #498", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "array1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "array2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "compareFunction" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "a: " - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "b: " - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "(a: T, b: T): boolean => a === b" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] } ] } \ No newline at end of file