typedoc-better-json
Version:
Transforms typedoc's json output to a format that is better for creating custom documentation website
999 lines (998 loc) • 26.3 kB
JSON
{
"meta": {
"typedocBetterJsonVersion": "__REDACTED__"
},
"functions": [
{
"kind": "function",
"name": "sum",
"signatures": [
{
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "This is a description of the sum function."
}
]
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "This is a second paragraph in the description. Everything after this is markdown"
}
]
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "Heading 1"
}
]
},
{
"type": "heading",
"depth": 2,
"children": [
{
"type": "text",
"value": "Heading 2"
}
]
},
{
"type": "heading",
"depth": 3,
"children": [
{
"type": "text",
"value": "Heading 3"
}
]
},
{
"type": "heading",
"depth": 4,
"children": [
{
"type": "text",
"value": "Heading 4"
}
]
},
{
"type": "heading",
"depth": 5,
"children": [
{
"type": "text",
"value": "Heading 5"
}
]
},
{
"type": "heading",
"depth": 6,
"children": [
{
"type": "text",
"value": "Heading 6"
}
]
},
{
"type": "paragraph",
"children": [
{
"type": "emphasis",
"children": [
{
"type": "text",
"value": "This text will be italic"
}
]
},
{
"type": "text",
"value": "\n"
},
{
"type": "emphasis",
"children": [
{
"type": "text",
"value": "This will also be italic"
}
]
},
{
"type": "text",
"value": "\n"
},
{
"type": "strong",
"children": [
{
"type": "text",
"value": "This text will be bold"
}
]
},
{
"type": "text",
"value": "\n"
},
{
"type": "strong",
"children": [
{
"type": "text",
"value": "This will also be bold"
}
]
},
{
"type": "text",
"value": "\n"
},
{
"type": "emphasis",
"children": [
{
"type": "text",
"value": "You "
},
{
"type": "strong",
"children": [
{
"type": "text",
"value": "can"
}
]
},
{
"type": "text",
"value": " combine them"
}
]
}
]
},
{
"type": "list",
"ordered": false,
"start": null,
"spread": false,
"children": [
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Item 1"
}
]
}
]
},
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Item 2"
}
]
}
]
},
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Item 2a"
}
]
}
]
},
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Item 2b"
}
]
}
]
}
]
},
{
"type": "list",
"ordered": true,
"start": 1,
"spread": false,
"children": [
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "numbered item 1"
}
]
}
]
},
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "numbered item 2"
}
]
}
]
},
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "numbered item 3"
}
]
}
]
}
]
}
],
"parameters": [
{
"name": "a",
"type": {
"code": "number",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "First number"
}
]
}
]
},
{
"name": "b",
"type": {
"code": "number",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Second number"
}
]
}
]
},
{
"name": "rest",
"type": {
"code": "Array<number>",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Rest of the numbers"
}
]
}
],
"flags": {
"isRest": true
}
}
],
"returns": {
"type": {
"code": "number",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "The sum of all numbers"
}
]
}
]
},
"blockTags": [
{
"tag": "@example",
"summary": [
{
"type": "heading",
"depth": 2,
"children": [
{
"type": "text",
"value": "Example"
}
]
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Example can have markdown too and code blocks"
}
]
},
{
"type": "code",
"lang": "js",
"meta": null,
"value": "import { sum } from \"my-library\";"
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "You can multiple examples"
}
]
},
{
"type": "code",
"lang": "ts",
"meta": null,
"value": "sum(1, 2, 3, 4); // 10\nsum(1, 2); // 3"
}
]
},
{
"tag": "@remarks",
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "This is a remark"
}
]
}
]
},
{
"tag": "@see",
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "link",
"title": null,
"url": "https://en.wikipedia.org/wiki/Mathematics",
"children": [
{
"type": "text",
"value": "https://en.wikipedia.org/wiki/Mathematics"
}
]
}
]
}
]
},
{
"tag": "@twfeature",
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "XYZ"
}
]
}
]
},
{
"tag": "@foo",
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "FOO BAR"
}
]
}
]
},
{
"tag": "@deprecated",
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Use "
},
{
"type": "inlineCode",
"value": "fancySum"
},
{
"type": "text",
"value": " instead."
}
]
}
]
}
]
}
],
"source": "__REDACTED__"
}
],
"variables": [
{
"kind": "variable",
"name": "test",
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Variable test"
}
]
}
],
"source": "__REDACTED__",
"type": {
"code": "{ boo: { (a: number) : void ; bar: string }; foo: number; bar: () => { value: number } ; bazz: (a: number, b: number) => number }",
"tokens": []
},
"typeDeclaration": [
{
"kind": "function",
"name": "boo",
"signatures": [
{
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "method with rest arguments and extra property"
}
]
}
],
"parameters": [
{
"name": "a",
"type": {
"code": "number",
"tokens": []
}
}
],
"returns": {
"type": {
"code": "void",
"tokens": []
}
},
"blockTags": [
{
"tag": "@example",
"summary": [
{
"type": "code",
"lang": "ts",
"meta": null,
"value": "console.log('hello')"
}
]
}
]
}
],
"source": "__REDACTED__"
},
{
"kind": "subtype",
"name": "foo",
"type": {
"code": "number",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Normal property"
}
]
}
]
},
{
"kind": "function",
"name": "bar",
"signatures": [
{
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "method on variable"
}
]
}
],
"returns": {
"type": {
"code": "{ value: number }",
"tokens": []
}
}
}
],
"source": "__REDACTED__"
},
{
"kind": "function",
"name": "bazz",
"signatures": [
{
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "method with arguments"
}
]
}
],
"parameters": [
{
"name": "a",
"type": {
"code": "number",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "first number"
}
]
}
]
},
{
"name": "b",
"type": {
"code": "number",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "second number"
}
]
}
]
}
],
"returns": {
"type": {
"code": "number",
"tokens": []
}
},
"blockTags": [
{
"tag": "@example",
"summary": [
{
"type": "code",
"lang": "ts",
"meta": null,
"value": "test.bazz(1, 2); // 3"
}
]
}
]
}
],
"source": "__REDACTED__"
}
],
"flags": {
"isConst": true
}
}
],
"classes": [
{
"kind": "class",
"name": "Foo",
"source": "__REDACTED__",
"constructor": {
"kind": "function",
"name": "constructor",
"signatures": [
{
"returns": {
"type": {
"code": "Foo<T>",
"tokens": [
{
"name": "Foo",
"package": "typedoc-better-json"
},
{
"name": "T"
}
]
}
},
"typeParameters": [
{
"name": "T",
"extendsType": {
"code": "Record<string, unknown>",
"tokens": [
{
"name": "Record",
"package": "typescript"
}
]
},
"defaultType": {
"code": "{ a: number }",
"tokens": []
}
}
],
"inheritedFrom": {
"name": "Bar2.constructor"
}
}
],
"source": "__REDACTED__"
},
"methods": [
{
"kind": "function",
"name": "bazz",
"signatures": [
{
"summary": [],
"parameters": [
{
"name": "a",
"type": {
"code": "number",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "first number"
}
]
}
]
},
{
"name": "b",
"type": {
"code": "number",
"tokens": []
},
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "second number"
}
]
}
]
}
],
"returns": {
"type": {
"code": "number",
"tokens": []
}
},
"blockTags": [
{
"tag": "@example",
"summary": [
{
"type": "code",
"lang": "ts",
"meta": null,
"value": "Foo.bazz(1, 2); // 3"
}
]
}
]
}
],
"source": "__REDACTED__"
},
{
"kind": "function",
"name": "get",
"signatures": [
{
"parameters": [
{
"name": "foo",
"type": {
"code": "T",
"tokens": [
{
"name": "T"
}
]
}
}
],
"returns": {
"type": {
"code": "void",
"tokens": []
}
}
}
],
"source": "__REDACTED__"
},
{
"kind": "function",
"name": "getBar",
"signatures": [
{
"returns": {
"type": {
"code": "number",
"tokens": []
}
}
}
],
"source": "__REDACTED__"
},
{
"kind": "function",
"name": "getFoo",
"signatures": [
{
"returns": {
"type": {
"code": "number",
"tokens": []
}
}
}
],
"source": "__REDACTED__",
"flags": {
"isPrivate": true
}
}
],
"properties": [
{
"kind": "variable",
"name": "boo",
"source": "__REDACTED__",
"type": {
"code": "{ (a: number) : void ; bar: string }",
"tokens": []
},
"typeDeclaration": [
{
"kind": "function",
"name": "boo",
"signatures": [
{
"summary": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Foo.boo description"
}
]
}
],
"parameters": [
{
"name": "a",
"type": {
"code": "number",
"tokens": []
}
}
],
"returns": {
"type": {
"code": "void",
"tokens": []
}
},
"blockTags": [
{
"tag": "@example",
"summary": [
{
"type": "code",
"lang": "ts",
"meta": null,
"value": "console.log('Foo.boo example')"
}
]
}
]
}
],
"source": "__REDACTED__"
},
{
"kind": "subtype",
"name": "bar",
"type": {
"code": "string",
"tokens": []
}
}
]
}
],
"typeParameters": [
{
"name": "T",
"extendsType": {
"code": "Record<string, unknown>",
"tokens": [
{
"name": "Record",
"package": "typescript"
}
]
},
"defaultType": {
"code": "{ a: number }",
"tokens": []
}
}
],
"implements": [
{
"code": "Bar",
"tokens": [
{
"name": "Bar",
"package": "typedoc-better-json"
}
]
}
],
"extends": [
{
"code": "Bar2",
"tokens": [
{
"name": "Bar2",
"package": "typedoc-better-json"
}
]
}
]
}
]
}