# mod.ts
/**
* @module foo
*/

/**
* Hello there, this is a multiline JSdoc.
*
* It has many lines
*
* Or not that many?
*/
export function foo(a: string, b?: number, cb: (...cbArgs: unknown[]) => void, ...args: unknown[]): void {
    /**
     * @todo document all the things.
     */
    console.log("Hello world");
}
# output.txt
Defined in file:///mod.ts:1:1


  @module
      foo


Defined in file:///mod.ts:12:1

function foo(a: string, b?: number, cb: (...cbArgs: unknown[]) => void, ...args: unknown[]): void
  Hello there, this is a multiline JSdoc.
  
  It has many lines
  
  Or not that many?


# output.json
[
  {
    "name": "",
    "location": {
      "filename": "file:///mod.ts",
      "line": 1,
      "col": 0,
      "byteIndex": 0
    },
    "declarationKind": "export",
    "jsDoc": {
      "tags": [
        {
          "kind": "module",
          "name": "foo"
        }
      ]
    },
    "kind": "moduleDoc"
  },
  {
    "name": "foo",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 12,
      "col": 0,
      "byteIndex": 115
    },
    "declarationKind": "export",
    "jsDoc": {
      "doc": "Hello there, this is a multiline JSdoc.\n\nIt has many lines\n\nOr not that many?"
    },
    "kind": "function",
    "functionDef": {
      "params": [
        {
          "kind": "identifier",
          "name": "a",
          "optional": false,
          "tsType": {
            "repr": "string",
            "kind": "keyword",
            "keyword": "string"
          }
        },
        {
          "kind": "identifier",
          "name": "b",
          "optional": true,
          "tsType": {
            "repr": "number",
            "kind": "keyword",
            "keyword": "number"
          }
        },
        {
          "kind": "identifier",
          "name": "cb",
          "optional": false,
          "tsType": {
            "repr": "",
            "kind": "fnOrConstructor",
            "fnOrConstructor": {
              "constructor": false,
              "tsType": {
                "repr": "void",
                "kind": "keyword",
                "keyword": "void"
              },
              "params": [
                {
                  "kind": "rest",
                  "arg": {
                    "kind": "identifier",
                    "name": "cbArgs",
                    "optional": false,
                    "tsType": null
                  },
                  "tsType": {
                    "repr": "",
                    "kind": "array",
                    "array": {
                      "repr": "unknown",
                      "kind": "keyword",
                      "keyword": "unknown"
                    }
                  }
                }
              ],
              "typeParams": []
            }
          }
        },
        {
          "kind": "rest",
          "arg": {
            "kind": "identifier",
            "name": "args",
            "optional": false,
            "tsType": null
          },
          "tsType": {
            "repr": "",
            "kind": "array",
            "array": {
              "repr": "unknown",
              "kind": "keyword",
              "keyword": "unknown"
            }
          }
        }
      ],
      "returnType": {
        "repr": "void",
        "kind": "keyword",
        "keyword": "void"
      },
      "hasBody": true,
      "isAsync": false,
      "isGenerator": false,
      "typeParams": []
    }
  }
]
