# mod.ts
interface AssignOpts {
  a: string;
}

export function foo([e,,f, ...g]: number[], { c, d: asdf, i = "asdf", ...rest}, ops: AssignOpts = {}): void {
    console.log("Hello world");
}

# diagnostics
error[private-type-ref]: public type 'foo' references private type 'AssignOpts'
 --> /mod.ts:5:1
  | 
5 | export function foo([e,,f, ...g]: number[], { c, d: asdf, i = "asdf", ...rest}, ops: AssignOpts = {}): void {
  | ^
  = hint: make the referenced type public or remove the reference
  | 
1 | interface AssignOpts {
  | - this is the referenced type
  | 

  info: to ensure documentation is complete all types that are exposed in the public API must be public


error[missing-jsdoc]: exported symbol is missing JSDoc documentation
 --> /mod.ts:5:1
  | 
5 | export function foo([e,,f, ...g]: number[], { c, d: asdf, i = "asdf", ...rest}, ops: AssignOpts = {}): void {
  | ^

# output.txt
Defined in file:///mod.ts:5:1

function foo([e, , f, ...g]: number[], {c, d, i, ...rest}, ops: AssignOpts): void

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

private interface AssignOpts

  a: string


# output.json
[
  {
    "name": "foo",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 5,
      "col": 0,
      "byteIndex": 39
    },
    "declarationKind": "export",
    "kind": "function",
    "functionDef": {
      "params": [
        {
          "kind": "array",
          "elements": [
            {
              "kind": "identifier",
              "name": "e",
              "optional": false,
              "tsType": null
            },
            null,
            {
              "kind": "identifier",
              "name": "f",
              "optional": false,
              "tsType": null
            },
            {
              "kind": "rest",
              "arg": {
                "kind": "identifier",
                "name": "g",
                "optional": false,
                "tsType": null
              },
              "tsType": null
            }
          ],
          "optional": false,
          "tsType": {
            "repr": "",
            "kind": "array",
            "array": {
              "repr": "number",
              "kind": "keyword",
              "keyword": "number"
            }
          }
        },
        {
          "kind": "object",
          "props": [
            {
              "kind": "assign",
              "key": "c",
              "value": null
            },
            {
              "kind": "keyValue",
              "key": "d",
              "value": {
                "kind": "identifier",
                "name": "asdf",
                "optional": false,
                "tsType": null
              }
            },
            {
              "kind": "assign",
              "key": "i",
              "value": "[UNSUPPORTED]"
            },
            {
              "kind": "rest",
              "arg": {
                "kind": "identifier",
                "name": "rest",
                "optional": false,
                "tsType": null
              }
            }
          ],
          "optional": false,
          "tsType": null
        },
        {
          "kind": "assign",
          "left": {
            "kind": "identifier",
            "name": "ops",
            "optional": false,
            "tsType": {
              "repr": "AssignOpts",
              "kind": "typeRef",
              "typeRef": {
                "typeParams": null,
                "typeName": "AssignOpts"
              }
            }
          },
          "right": "[UNSUPPORTED]",
          "tsType": null
        }
      ],
      "returnType": {
        "repr": "void",
        "kind": "keyword",
        "keyword": "void"
      },
      "hasBody": true,
      "isAsync": false,
      "isGenerator": false,
      "typeParams": []
    }
  },
  {
    "name": "AssignOpts",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 1,
      "col": 0,
      "byteIndex": 0
    },
    "declarationKind": "private",
    "kind": "interface",
    "interfaceDef": {
      "extends": [],
      "constructors": [],
      "methods": [],
      "properties": [
        {
          "name": "a",
          "location": {
            "filename": "file:///mod.ts",
            "line": 2,
            "col": 2,
            "byteIndex": 25
          },
          "params": [],
          "computed": false,
          "optional": false,
          "tsType": {
            "repr": "string",
            "kind": "keyword",
            "keyword": "string"
          },
          "typeParams": []
        }
      ],
      "callSignatures": [],
      "indexSignatures": [],
      "typeParams": []
    }
  }
]
