documentation/test/fixture/memberedclass.output.json
Tom MacWright 3da1ff6dd0 Source-sorting by default (#410)
* Source-sorting by default

Many changes

* Uses a new version of module-deps that exposes a sort key
  we use to sort documentation.
* Adds inference for methods in objects
* Groups events into a separate comment property

* Add jsdoc property. Refs https://github.com/documentationjs/documentation/pull/388#issuecomment-215791547

* Namespaces and paths

* More powerful paths: paths now include name, kind, and scope
* comments now include a 'namespace' property with a formatted namespace

* Fix tests

* Re-ignore fonts

* Nix sourceKey from output

* Pin dependency versions

* Fix module-deps-sortable ref

* Update tests for right deps
2016-04-29 18:09:52 -04:00

524 lines
15 KiB
JSON

[
{
"description": {
"type": "root",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "This is my class, a demo thing.",
"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": [
{
"title": "class",
"description": null,
"lineNumber": 3,
"type": null,
"name": "MyClass"
},
{
"title": "memberof",
"description": "com.Test",
"lineNumber": 4
}
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 6,
"column": 3
}
},
"context": {
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 29,
"column": 2
}
},
"code": "/**\n * This is my class, a demo thing.\n *\n * @class MyClass\n * @memberof com.Test\n */\ncom.Test.MyClass = class {\n\n constructor() {\n this.howMany = 2;\n }\n\n /**\n * Get the number 42\n *\n * @param {boolean} getIt whether to get the number\n * @returns {number} forty-two\n */\n getFoo(getIt) {\n return getIt ? 42 : 0;\n }\n\n /**\n * Get undefined\n *\n * @returns {undefined} does not return anything.\n */\n static getUndefined() {}\n};\n"
},
"errors": [
{
"message": "@memberof reference to com.Test not found",
"commentLineNumber": 4
}
],
"kind": "class",
"name": "MyClass",
"memberof": "com.Test",
"members": {
"instance": [
{
"description": {
"type": "root",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Get the number 42",
"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": "param",
"description": "whether to get the number",
"lineNumber": 3,
"type": {
"type": "NameExpression",
"name": "boolean"
},
"name": "getIt"
},
{
"title": "returns",
"description": "forty-two",
"lineNumber": 4,
"type": {
"type": "NameExpression",
"name": "number"
}
}
],
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 18,
"column": 7
}
},
"context": {
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 21,
"column": 5
}
},
"code": "/**\n * This is my class, a demo thing.\n *\n * @class MyClass\n * @memberof com.Test\n */\ncom.Test.MyClass = class {\n\n constructor() {\n this.howMany = 2;\n }\n\n /**\n * Get the number 42\n *\n * @param {boolean} getIt whether to get the number\n * @returns {number} forty-two\n */\n getFoo(getIt) {\n return getIt ? 42 : 0;\n }\n\n /**\n * Get undefined\n *\n * @returns {undefined} does not return anything.\n */\n static getUndefined() {}\n};\n"
},
"errors": [],
"params": [
{
"name": "getIt",
"lineNumber": 3,
"description": {
"type": "root",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "whether to get the number",
"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
}
}
},
"type": {
"type": "NameExpression",
"name": "boolean"
}
}
],
"returns": [
{
"description": {
"type": "root",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "forty-two",
"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": "getFoo",
"kind": "function",
"memberof": "com.Test.MyClass",
"scope": "instance",
"members": {
"instance": [],
"static": []
},
"path": [
{
"name": "MyClass",
"kind": "class"
},
{
"name": "getFoo",
"kind": "function",
"scope": "instance"
}
],
"namespace": "MyClass#getFoo"
}
],
"static": [
{
"description": {
"type": "root",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Get undefined",
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 1,
"column": 14,
"offset": 13
},
"indent": []
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 1,
"column": 14,
"offset": 13
},
"indent": []
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 1,
"column": 14,
"offset": 13
}
}
},
"tags": [
{
"title": "returns",
"description": "does not return anything.",
"lineNumber": 3,
"type": {
"type": "UndefinedLiteral"
}
}
],
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 27,
"column": 7
}
},
"context": {
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 28,
"column": 28
}
},
"code": "/**\n * This is my class, a demo thing.\n *\n * @class MyClass\n * @memberof com.Test\n */\ncom.Test.MyClass = class {\n\n constructor() {\n this.howMany = 2;\n }\n\n /**\n * Get the number 42\n *\n * @param {boolean} getIt whether to get the number\n * @returns {number} forty-two\n */\n getFoo(getIt) {\n return getIt ? 42 : 0;\n }\n\n /**\n * Get undefined\n *\n * @returns {undefined} does not return anything.\n */\n static getUndefined() {}\n};\n"
},
"errors": [],
"returns": [
{
"description": {
"type": "root",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "does not return anything.",
"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
}
}
},
"type": {
"type": "UndefinedLiteral"
}
}
],
"name": "getUndefined",
"kind": "function",
"memberof": "com.Test.MyClass",
"scope": "static",
"members": {
"instance": [],
"static": []
},
"path": [
{
"name": "MyClass",
"kind": "class"
},
{
"name": "getUndefined",
"kind": "function",
"scope": "static"
}
],
"namespace": "MyClass.getUndefined"
}
],
"events": []
},
"path": [
{
"name": "MyClass",
"kind": "class"
}
],
"namespace": "MyClass"
}
]