# 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:4:1

function SameName(): YesDiagnostic1
  Comment

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

function test(): YesDiagnostic2
  Comment


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

private interface YesDiagnostic1


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

private interface YesDiagnostic2


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

namespace SameName
  Comment



# output.json
[
  {
    "name": "SameName",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 2,
      "col": 0,
      "byteIndex": 15
    },
    "declarationKind": "export",
    "jsDoc": {
      "doc": "Comment"
    },
    "kind": "namespace",
    "namespaceDef": {
      "elements": []
    }
  },
  {
    "name": "SameName",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 4,
      "col": 0,
      "byteIndex": 59
    },
    "declarationKind": "export",
    "jsDoc": {
      "doc": "Comment"
    },
    "kind": "function",
    "functionDef": {
      "params": [],
      "returnType": {
        "repr": "YesDiagnostic1",
        "kind": "typeRef",
        "typeRef": {
          "typeParams": null,
          "typeName": "YesDiagnostic1"
        }
      },
      "hasBody": true,
      "isAsync": false,
      "isGenerator": false,
      "typeParams": []
    }
  },
  {
    "name": "test",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 8,
      "col": 0,
      "byteIndex": 122
    },
    "declarationKind": "export",
    "jsDoc": {
      "doc": "Comment"
    },
    "kind": "function",
    "functionDef": {
      "params": [],
      "returnType": {
        "repr": "YesDiagnostic2",
        "kind": "typeRef",
        "typeRef": {
          "typeParams": null,
          "typeName": "YesDiagnostic2"
        }
      },
      "isAsync": false,
      "isGenerator": false,
      "typeParams": []
    }
  },
  {
    "name": "test",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 9,
      "col": 0,
      "byteIndex": 162
    },
    "declarationKind": "export",
    "kind": "function",
    "functionDef": {
      "params": [],
      "returnType": {
        "repr": "NoDiagnostic",
        "kind": "typeRef",
        "typeRef": {
          "typeParams": null,
          "typeName": "NoDiagnostic"
        }
      },
      "hasBody": true,
      "isAsync": false,
      "isGenerator": false,
      "typeParams": []
    }
  },
  {
    "name": "YesDiagnostic1",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 13,
      "col": 0,
      "byteIndex": 205
    },
    "declarationKind": "private",
    "kind": "interface",
    "interfaceDef": {
      "extends": [],
      "constructors": [],
      "methods": [],
      "properties": [],
      "callSignatures": [],
      "indexSignatures": [],
      "typeParams": []
    }
  },
  {
    "name": "YesDiagnostic2",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 14,
      "col": 0,
      "byteIndex": 233
    },
    "declarationKind": "private",
    "kind": "interface",
    "interfaceDef": {
      "extends": [],
      "constructors": [],
      "methods": [],
      "properties": [],
      "callSignatures": [],
      "indexSignatures": [],
      "typeParams": []
    }
  }
]
