# mod.ts
interface DumperStateOptions {
}

/** Options for the dumper. */
export type DumpOptions = DumperStateOptions;

interface Wrapped<T> {
  value: T;
}

/** A pure alias only re-exposes the type when it takes no type arguments. */
export type WrappedOptions = Wrapped<string>;

/** A union is not a pure alias, so it still leaks the private type. */
export type MaybeOptions = DumperStateOptions | undefined;

/** A non-alias declaration still leaks the private type it references. */
export interface Consumer {
  options: DumperStateOptions;
}

# diagnostics
error[private-type-ref]: public type 'WrappedOptions' references private type 'Wrapped'
  --> /mod.ts:12:1
   | 
12 | export type WrappedOptions = Wrapped<string>;
   | ^
   = hint: make the referenced type public or remove the reference
   | 
 7 | interface Wrapped<T> {
   | - 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 'MaybeOptions' references private type 'DumperStateOptions'
  --> /mod.ts:15:1
   | 
15 | export type MaybeOptions = DumperStateOptions | undefined;
   | ^
   = hint: make the referenced type public or remove the reference
   | 
 1 | interface DumperStateOptions {
   | - 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 'Consumer["options"]' references private type 'DumperStateOptions'
  --> /mod.ts:19:3
   | 
19 |   options: DumperStateOptions;
   |   ^
   = hint: make the referenced type public or remove the reference
   | 
 1 | interface DumperStateOptions {
   | - 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:19:3
   | 
19 |   options: DumperStateOptions;
   |   ^

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

interface Consumer
  A non-alias declaration still leaks the private type it references.

  options: DumperStateOptions

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

private interface DumperStateOptions


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

private interface Wrapped<T>

  value: T

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

type DumpOptions = DumperStateOptions
  Options for the dumper.

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

type MaybeOptions = DumperStateOptions | undefined
  A union is not a pure alias, so it still leaks the private type.

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

type WrappedOptions = Wrapped<string>
  A pure alias only re-exposes the type when it takes no type arguments.


# output.json
{
  "symbols": [
    {
      "name": "DumpOptions",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 4,
            "col": 0,
            "byteIndex": 65
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "Options for the dumper."
          },
          "kind": "typeAlias",
          "def": {
            "tsType": {
              "repr": "DumperStateOptions",
              "kind": "typeRef",
              "value": {
                "typeName": "DumperStateOptions",
                "resolution": {
                  "kind": "local"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "WrappedOptions",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 11,
            "col": 0,
            "byteIndex": 228
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "A pure alias only re-exposes the type when it takes no type arguments."
          },
          "kind": "typeAlias",
          "def": {
            "tsType": {
              "repr": "Wrapped",
              "kind": "typeRef",
              "value": {
                "typeParams": [
                  {
                    "repr": "string",
                    "kind": "keyword",
                    "value": "string"
                  }
                ],
                "typeName": "Wrapped",
                "resolution": {
                  "kind": "local"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "MaybeOptions",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 14,
            "col": 0,
            "byteIndex": 347
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "A union is not a pure alias, so it still leaks the private type."
          },
          "kind": "typeAlias",
          "def": {
            "tsType": {
              "kind": "union",
              "value": [
                {
                  "repr": "DumperStateOptions",
                  "kind": "typeRef",
                  "value": {
                    "typeName": "DumperStateOptions",
                    "resolution": {
                      "kind": "local"
                    }
                  }
                },
                {
                  "repr": "undefined",
                  "kind": "keyword",
                  "value": "undefined"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Consumer",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 17,
            "col": 0,
            "byteIndex": 482
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "A non-alias declaration still leaks the private type it references."
          },
          "kind": "interface",
          "def": {
            "properties": [
              {
                "name": "options",
                "location": {
                  "filename": "file:///mod.ts",
                  "line": 18,
                  "col": 2,
                  "byteIndex": 512
                },
                "tsType": {
                  "repr": "DumperStateOptions",
                  "kind": "typeRef",
                  "value": {
                    "typeName": "DumperStateOptions",
                    "resolution": {
                      "kind": "local"
                    }
                  }
                }
              }
            ]
          }
        }
      ]
    },
    {
      "name": "DumperStateOptions",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 0,
            "col": 0,
            "byteIndex": 0
          },
          "declarationKind": "private",
          "kind": "interface",
          "def": {}
        }
      ]
    },
    {
      "name": "Wrapped",
      "declarations": [
        {
          "location": {
            "filename": "file:///mod.ts",
            "line": 6,
            "col": 0,
            "byteIndex": 112
          },
          "declarationKind": "private",
          "kind": "interface",
          "def": {
            "properties": [
              {
                "name": "value",
                "location": {
                  "filename": "file:///mod.ts",
                  "line": 7,
                  "col": 2,
                  "byteIndex": 137
                },
                "tsType": {
                  "repr": "T",
                  "kind": "typeRef",
                  "value": {
                    "typeName": "T",
                    "resolution": {
                      "kind": "typeParam",
                      "declaringName": "Wrapped",
                      "declaringKind": "interface"
                    }
                  }
                }
              }
            ],
            "typeParams": [
              {
                "name": "T"
              }
            ]
          }
        }
      ]
    }
  ]
}
