# mod.ts
/** Comment */
export namespace SameName {}
/** Comment */
export function SameName(): YesDiagnostic1 {
}

/** Comment */
export function test(): YesDiagnostic2;
export function test(): NoDiagnostic {

}

interface YesDiagnostic1 {}
interface YesDiagnostic2 {}

// should not have diagnostic for this because it's in the implementation signature
interface NoDiagnostic {}

# diagnostics
error[private-type-ref]: public type 'SameName' references private type 'YesDiagnostic1'
  --> /mod.ts:4:1
   | 
 4 | export function SameName(): YesDiagnostic1 {
   | ^
   = hint: make the referenced type public or remove the reference
   | 
13 | interface YesDiagnostic1 {}
   | - this is the referenced type
   | 

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


error[private-type-ref]: public type 'test' references private type 'YesDiagnostic2'
  --> /mod.ts:8:1
   | 
 8 | export function test(): YesDiagnostic2;
   | ^
   = hint: make the referenced type public or remove the reference
   | 
14 | interface YesDiagnostic2 {}
   | - this is the referenced type
   | 

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

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

namespace SameName
  Comment


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

function SameName(): YesDiagnostic1
  Comment

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

function test(): YesDiagnostic2
  Comment


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

private interface YesDiagnostic1


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

private interface YesDiagnostic2



# output.json
{
  "symbols": [
    {
      "name": "SameName",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 1,
            "col": 0,
            "byteIndex": 15
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "Comment"
          },
          "kind": "namespace",
          "def": {
            "elements": []
          }
        },
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 3,
            "col": 0,
            "byteIndex": 59
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "Comment"
          },
          "kind": "function",
          "def": {
            "params": [],
            "returnType": {
              "repr": "YesDiagnostic1",
              "kind": "typeRef",
              "value": {
                "typeName": "YesDiagnostic1",
                "resolution": {
                  "kind": "local"
                }
              }
            },
            "hasBody": true
          }
        }
      ]
    },
    {
      "name": "test",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 7,
            "col": 0,
            "byteIndex": 122
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "Comment"
          },
          "kind": "function",
          "def": {
            "params": [],
            "returnType": {
              "repr": "YesDiagnostic2",
              "kind": "typeRef",
              "value": {
                "typeName": "YesDiagnostic2",
                "resolution": {
                  "kind": "local"
                }
              }
            }
          }
        },
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 8,
            "col": 0,
            "byteIndex": 162
          },
          "declarationKind": "export",
          "kind": "function",
          "def": {
            "params": [],
            "returnType": {
              "repr": "NoDiagnostic",
              "kind": "typeRef",
              "value": {
                "typeName": "NoDiagnostic",
                "resolution": {
                  "kind": "local"
                }
              }
            },
            "hasBody": true
          }
        }
      ]
    },
    {
      "name": "YesDiagnostic1",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 12,
            "col": 0,
            "byteIndex": 205
          },
          "declarationKind": "private",
          "kind": "interface",
          "def": {}
        }
      ]
    },
    {
      "name": "YesDiagnostic2",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 13,
            "col": 0,
            "byteIndex": 233
          },
          "declarationKind": "private",
          "kind": "interface",
          "def": {}
        }
      ]
    }
  ]
}
