# mod.ts
/** A function expression */
export const foo = function (a: string): void {};

/** A named function expression */
export const bar = function myFunc(a: string, b: number): string {
  return a;
};

/** An arrow function */
export const baz = (a: string): void => {};

/** An async arrow function */
export const qux = async (a: string): Promise<string> => {
  return a;
};

# output.txt
Defined in file:///mod.ts:4:14

function bar(a: string, b: number): string
  A named function expression

Defined in file:///mod.ts:9:14

function baz(a: string): void
  An arrow function

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

function foo(a: string): void
  A function expression

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

async function qux(a: string): Promise<string>
  An async arrow function


# output.json
{
  "symbols": [
    {
      "name": "foo",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 1,
            "col": 13,
            "byteIndex": 42
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "A function expression"
          },
          "kind": "function",
          "def": {
            "params": [
              {
                "kind": "identifier",
                "name": "a",
                "optional": false,
                "tsType": {
                  "repr": "string",
                  "kind": "keyword",
                  "value": "string"
                }
              }
            ],
            "returnType": {
              "repr": "void",
              "kind": "keyword",
              "value": "void"
            },
            "hasBody": true
          }
        }
      ]
    },
    {
      "name": "bar",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 4,
            "col": 13,
            "byteIndex": 128
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "A named function expression"
          },
          "kind": "function",
          "def": {
            "defName": "myFunc",
            "params": [
              {
                "kind": "identifier",
                "name": "a",
                "optional": false,
                "tsType": {
                  "repr": "string",
                  "kind": "keyword",
                  "value": "string"
                }
              },
              {
                "kind": "identifier",
                "name": "b",
                "optional": false,
                "tsType": {
                  "repr": "number",
                  "kind": "keyword",
                  "value": "number"
                }
              }
            ],
            "returnType": {
              "repr": "string",
              "kind": "keyword",
              "value": "string"
            },
            "hasBody": true
          }
        }
      ]
    },
    {
      "name": "baz",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 9,
            "col": 13,
            "byteIndex": 236
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "An arrow function"
          },
          "kind": "function",
          "def": {
            "params": [
              {
                "kind": "identifier",
                "name": "a",
                "optional": false,
                "tsType": {
                  "repr": "string",
                  "kind": "keyword",
                  "value": "string"
                }
              }
            ],
            "returnType": {
              "repr": "void",
              "kind": "keyword",
              "value": "void"
            },
            "hasBody": true
          }
        }
      ]
    },
    {
      "name": "qux",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 12,
            "col": 13,
            "byteIndex": 312
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "An async arrow function"
          },
          "kind": "function",
          "def": {
            "params": [
              {
                "kind": "identifier",
                "name": "a",
                "optional": false,
                "tsType": {
                  "repr": "string",
                  "kind": "keyword",
                  "value": "string"
                }
              }
            ],
            "returnType": {
              "repr": "Promise",
              "kind": "typeRef",
              "value": {
                "typeParams": [
                  {
                    "repr": "string",
                    "kind": "keyword",
                    "value": "string"
                  }
                ],
                "typeName": "Promise"
              }
            },
            "hasBody": true,
            "isAsync": true
          }
        }
      ]
    }
  ]
}
